piclist 2001\04\18\191350a >
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: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


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