SKPNC is a synonym for BTFSC STATUS,C MPASM recognizes a bunch of such special mnemonics in an attempt to make code clearer. Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) ----- Original Message ----- From: Sam Linder To: Sent: Monday, September 18, 2000 6:11 PM Subject: Re: [PIC]: usec delay routine > Where does "skpnc" come from? It's not part of the Mid-Range Instruction > Set. > > > > -----Original Message----- > From: Scott Dattalo [mailto:scott@DATTALO.COM] > Sent: Friday, September 15, 2000 12:24 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]: usec delay routine > > > On Fri, 15 Sep 2000, Sam Linder wrote: > > > unsigned char delayU, delayL; // C code > > #asm > > Delay10bit // delay is 10 bit value + 7 cycles ( + call + > > return, if any) > > incf _delayU,f // correct for dec & test instead of test & dec > > Dly10bLoop: > > comf _delayL,w // invert LSBs > > decfsz _delayU,f > > goto Dly10bLoop // coarse delay to closest 4 cycles > > andlw 3 > > > > // this additional code checks for the > > // page boundary and sets pclath correctly > > // **** > > movwf _delayL > > movlw low offset > > addwf _delayL > > movlw high offset > > btfsc status,C > > addlw 1 > > movwf pclath > > movf _delayL,w > > // **** > > > > addwf pcl,f > > offset: > > nop > > nop > > nop > > return > > #endasm > > > It's little more efficient to do this: > > > > > > unsigned char delayU, delayL; // C code > > #asm > > Delay10bit // delay is 10 bit value + 7 cycles ( + call + > > return, if any) > > incf _delayU,f // correct for dec & test instead of test & dec > > Dly10bLoop: > > comf _delayL,w // invert LSBs > > decfsz _delayU,f > > goto Dly10bLoop // coarse delay to closest 4 cycles > > andlw 3 > > addlw offset > skpnc > incf pclath,f > > movwf pcl > offset: > > > nop > > nop > > nop > > return > > #endasm > > > Looks like 3 more cycles than the original > > Scott > > -- > 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 > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu