piclist 2001\04\17\182556a >
Thread: Increment
www.piclist.com/techref/index.htm?key=increment
flavicon
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
inc24:
       movlw   1
       addwf   count0,F
       skpnc
       addwf   count1,F
       skpnc
       addwf   count1,F
       ;... {ed: repeat the last two lines for as wide a counter as is needed}
       return

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

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

--
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


<86256A31.007B251D.00@Brunswickoutdoor.com>

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...