Eric Smith wrote: > > I've finally gotten back to PIC programming, Welcome back! Rather than spoiling the fun for everyone, I shaved one cycle off of the 'toascii' routine. There are no comments, so the 'hint' is only partially revealed. > toascii - convert the low four bits of W into the ASCII representation of > a hexadecimal digit > Entry: W contains a value in the range 00h..0fh > Exit: W contains a the character, '0'..'9', 'A'..'F' > if the input was out of range, the output is unspecified > > 6 instruction words, 7 instruction cycles (including return) ; 5 instructions words, 6 cycles: toascii ADDLW -0x0a SKPNC ADDLW 'A'-'9' - 1 ADDLW '0' + 0x0a RETURN Scott -- "The problem with television is not the resolution." Hugh. F. Frohbach