Yes. Input: 2 registers Temp: 1 register Output: 1 register ------------------- total: 4 registers Required at compile time: 1 subroutine to do something nice with the Output value and it can then munch it. For example, you can shift the output register out a port pin, leaving behind a zero. The only thing that the main routine has to do is call the subroutine for each digit of output with a valid number between 0 and 9 (or '0' and '9') in the output register. Possible improvements for extra credit (not in my code): It would be nice if it had an option to output a "." after some number of digits passed as a third input. It would be nice to optionally skip leading digits that are zero. Code that cannot be written for the PIC: A general purpose routine that is given a pointer (FSR) to a register holding the radix and followed by a count of the number of following bytes that contain the binary number to be converted. Output each digit as it is developed. --- James Newton mailto:jamesnewton@geocities.com 1-619-652-0593 http://techref.massmind.org NEW! FINALLY A REAL NAME! Members can add private/public comments/pages ($0 TANSTAAFL web hosting) -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Rich Leggitt Sent: Thursday, March 09, 2000 14:39 To: PICLIST@MITVMA.MIT.EDU Subject: Re: How to write code that no one will laugh at [OT] > Ok, I have a (probably little and fairly lame) code challenge! [ed: which > will probably be ignored 'cause its in Parallax mnemonics and its lame] Do we get to destroy the original 16 bit number?