>here is an alternative >nib2hex: > andlw 0x0F ;; you do not need to do it twice > addlw 246 ;; overflow if 10 or higher > sknc ;; skip if not carry > addlw 7 ;; difference between '9'+1 and 'A' > addlw 58 ;; convert to ASCII > return >;; 6 instructions instead of 17 > >Regards, >Imre I suspect this can be reduced even further. There used to be a nifty trick for doing this on 8080 and Z80 micros, which used the half carry flag. The PIC also has this flag available, so if anyone has an 8080 Cookbook or Z80 Cookbook handy they may like to look it up. From memory it totally does away with the skip instruction because you do not need to distinguish if it <=9 or >=A. actually on reflection looking over what I have written, I believe the technique was involved in converting a HEX nibble to ASCII, so may not be applicable here. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.