Searching \ for '[PIC]: Increment' 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/microchip/devices.htm?key=pic
Search entire site for: 'Increment'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Increment'
2001\04\18@191350 by David Cary

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


2001\04\19@084809 by Drew Vassallo

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

Trying to reduce *Dmitry's* code??? That's blasphemy!

>Would this work just as well ? Or is there some ``gotcha'' I'm missing ?
>
>; from David Cary
>inc24:
>      incf count0,f
>      skpnz

I'm not sure, but I thought that "incf" didn't exist on 12-bit cores.  Maybe
I'm wrong, though; it just seems that Dmitry wouldn't miss so simple a
reduction.

--Andrew

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


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