Searching \ for 'add32 / sub32' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=add32+sub32
Search entire site for: 'add32 / sub32'.

Truncated match.
PICList Thread
'add32 / sub32'
1998\04\18@122723 by Michael Hagberg

flavicon
face
ok, let's see if i learned my lesson well. will the sub32 routine work
correctly? i also modified the add routine so the answer for both functions
is returned in the 'A'.

michael


;Given   A3,A2,A1,A0
;        B3,B2,B1,B0
;Returns A = A + B

ADD32   movf    B0,w    ;Low byte
       addwf   A0,f

       movf    B1,w    ;Middle low byte
       btfsc   STATUS,C
       incfsz  B1,w
       addwf   A1,f

       movf    B2,w    ;Middle high byte
       btfsc   STATUS,C
       incfsz  B2,w
       addwf   A2,f

       movf    B3,w    ;High byte
       btfsc   STATUS,C
       incfsz  B3,w
       addwf   A3,f
       return

;Given   A3,A2,A1,A0
;        B3,B2,B1,B0
;Returns A = A - B

SUB32   movf    B0,w    ;Low byte
       subwf   A0,f

       movf    B1,w    ;Middle low byte
       btfsc   STATUS,C
       incfsz  B1,w
       subwf   A1,f

       movf    B2,w    ;Middle high byte
       btfsc   STATUS,C
       incfsz  B2,w
       subwf   A2,f

       movf    B3,w    ;High byte
       btfsc   STATUS,C
       incfsz  B3,w
       subwf   A3,f
       return

end

1998\04\19@235425 by Andrew Warren

face
flavicon
face
Michael Hagberg <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

{Quote hidden}

   Michael:

   No, it won't work... You need to replace all those BTFSC's with
   BTFSS's.

   -Andy

=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...