On Sat, 15 Jun 2002, Peter L. Peres wrote: > Hi, > > I need to make a modulo 3 counter in a file. I've come up with this code: > > movlw 0x03 > andwf File,w ; > > xorlw 0x03 ; 11 -> 00 > btfss STATUS,Z > xorlw 0x03 ; undo xorlw above > > movwf File > > I actually need the movwf at the end to be like this because I have to add > in some flags. Surely there is a MUCH shorter way to do this ... > > Peter > > PS: The code has to be constant run time how 'bout rrf File,w andwf File,w andlw 1 addwf File,f Scott -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu