> a working & tested procedure for the 18Fxxx series chips Variables needed - kzero, cnt1, temp (which I already have defined for other routines and use them here as scratch), and 5 consecutive bytes in RAM starting with dg1, which is the MSD Enter with 16 bit number in hi:lo, ASCII returned in dg1 to dg5 ;================================================ ; Convert 16-bit data to ASCII for LCD ;================================================ ascii16 nop radix dec movf fsr0l,w ;save fsr movwf cnt1 clrf kzero clrf temp movlw dg1 ;set store address movwf fsr0l goto skpinc1 sub10k incf temp,f skpinc1 movlw 10000 & 255 subwf lo,f IFNDEF kzero movlw 10000 >> 8 btfss carry movlw (10000>>8)+1 subwf hi,f ELSE rlcf kzero,W sublw (10000>>8)+1 subwf hi,F ENDIF bc sub10k call out_temp movlw 10 movwf temp add1K decf temp,f movlw 1000 & 255 addwf lo,f IFNDEF kzero movlw 1000 >> 8 btfsc carry movlw (1000>>8)+1 addwf hi,f ELSE rlcf kzero,w addlw 1000 >> 8 addwf hi,f ENDIF bnc add1k call out_temp clrf temp movlw 100 goto skpinc2 sub100 incf temp,f skpinc2 subwf lo,f btfsc carry goto sub100 decf hi,f btfss hi,7 goto sub100 call out_temp movlw 10 movwf temp add10 decf temp,f addwf lo,f bnc add10 call out_temp ;convert and store call out_lo ;convert and store movf cnt1,w ;restore fsr movwf fsr0l radix hex return ;convert to ASCII and store out_temp movf temp,w addlw 0x30 ;add 0x30 to convert to ASCII movwf indf0 incf fsr0l,f ;store in RAM at dg1+fsr0l return out_lo movf lo,w addlw 0x30 movwf indf0 return -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.