32 bit addition


Closed Thread
Results 1 to 1 of 1

Thread: 32 bit addition

  1. #1
    ice's Avatar
    ice Guest

    Default Incrementing a 32 bit number

    Hello..
    i would like to increment a 32 bit variable with ticks from a quadrature encoder.

    I understand that PBP whorks with 8 bit variables..

    Following is a code snip for incrementing a 16bit variable
    Code:
    ;Increments _enc_counter (16 bit value), sets Z on exit.
    
    incfsz  _enc_counter,W      ; Add one to low byte
    decf    _enc_counter+1,F    ; No carry (negates next step)
    incf    _enc_counter+1,F    ; Add one to high byte
    movwf   _enc_counter        ; Store updated low byte back.
    iorwf   _enc_counter+1,W    ; Set Z flag
    how would it be implemented for 32 bits?..
    i also need to display the 32 bit values on an LCD..

    Thank you
    Last edited by ice; - 16th May 2005 at 12:23.

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 00:55
  3. 32 bit data displaying on LCD
    By selahattin in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 15th September 2006, 13:33
  4. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07
  5. 32 bit Addition - How to ?
    By capitano in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th December 2004, 11:14

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts