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 WBR Dmitry. > movf File,w > andlw 0x03 > xorlw 0x03 > movlw 0xFC > btfsc STATUS,Z > andwf File,f > > On the second look it is not that long ... thanks anyway. > > Peter -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu