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] I needed a 16bit binary to decimal routine but I'm just about out of registers. So I came up with a routine that pulls off one digit at a time and gets rid of each digit by calling an io subroutine. My best (so far) is 76 words and about 100 best to 500 worst case instructions executed. Compare that to John Paysons marvel at 48 instructions, about 200 executed and 2 input, 5 output/temp registers. Mine needs its input in 2 registers, returns the output in another and uses only one temp register during the computation. Hint: It's ugly. Think successive approximation. Its posted already at http://techref.massmind.org/microchip/math/radix/b2a-16b5alzs but gents and ladies will not cheat and look at it until they have beat it on their own. Its in Parallax mnemonics, so use http://www.geocities.com/SiliconValley/Network/9276/parallax.zip or http://www.picnpoke.com/parapic.zip to convert to MicroChip mnemonics --- 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 Scott Dattalo Sent: Thursday, March 09, 2000 07:27 To: PICLIST@MITVMA.MIT.EDU Subject: Re: How to write code that no one will laugh at [OT] Importance: Low On Thu, 9 Mar 2000, James Newton wrote: > I'm still recovering from the blow to my ego from having my first > code challenge ignored. At the risk of striking another blow, what challenge was that? Scott