On Sat, 15 Jun 2002, Dmitriy A. Kiryashov wrote: >Hi Peter. > >2nd look... > >Base_4 inc/dec is obvious and not interesting. ;-) >;Base_3 inc / File 1.0 used, other bits are preserved >;inc(0)=1 Cy=0, inc(1)=2 Cy=0, inc(2)=0 Cy=1, ... > >movlw 1 >btfsc File,1 ; ==2? 2+1=3 -> 0 >movlw -2 >addwf File,F > >;Base_3 dec / File 1.0 used, other bits are preserved >;dec(2)=1 Cy=1, dec(1)=0 Cy=1, dec(0)=2 Cy=0, ... > >movlw 2 >btfss File,1 <---- >btfsc File,0 <---- >movlw -1 >addwf File,F This is a neat trick that I need to practice. Thank you very much Dmitry. >WBR Dmitry. PS: Which one is the right spelling of your name in English ? The one you sign with or the one your email program puts up ? -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads