piclist 2001\04\18\191350a >
Thread: Increment
www.piclist.com/techref/microchip/devices.htm?key=pic
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: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


<86256A32.007F80B7.00@Brunswickoutdoor.com>

See also: www.piclist.com/techref/microchip/devices.htm?key=pic
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...