piclist 2001\04\17\182556a >
Thread: Increment
face BY : David Cary email (remove spam text)

Dear PIC assembly language programmers,

I can't help myself. I see someone else's code, and I think -- I could make that
at least 1 instruction shorter.

I saw this code:

; from Dmitry Kiryashov
; piclist.org/techref/microchip/math/incdec/gp.htm
       movlw   1
       addwf   count0,F
       addwf   count1,F
       addwf   count1,F
       ;... {ed: repeat the last two lines for as wide a counter as is needed}

Would this work just as well ? Or is there some ``gotcha'' I'm missing ?

; from David Cary
    incf count0,f
    incf count1,f
    incf count2,f
    ;... {repeat the last two lines for as wide a counter as is needed}

David Cary

http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


See also: www.piclist.com/techref/index.htm?key=increment
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Increment

month overview.

new search...