In SX Microcontrollers, SX/B Compiler and SX-Key Tool, James Newton wrote: Ok, just to be clear, that is NOT my code. The author is specified in the comments... ...and I've been staring at it for about an hour and I'll be damned if I can see how that could possibly work. I've read the page it came from and it was supposed to be a possible improvement on another routine, which was for 12 bits to 4 digits, but I've been staring at that for another hour and I don't see how that could work either. It's either bloody brilliant or its been garbled somehow. The CMCON line is a hold over from the PIC, you can whack that. But the missing label has me confused, as does the original 12 bit code. It appears to be a variation on Paysons code at: http://www.sxlist.com/techref/ubicom/lib/math/radix/b2bu-16b5d_sx.htm for a 16bit to 5 digit conversion which DOES work and IS bloody brilliant (read: impossible to understand). If I had the time, I would convert that 12 bit program to SASM and just run it.... to see if it worked at all... Then I would try to understand HOW it worked and THEN... I would try to understand how the idea (which I mistakenly posted above) is supposed to improve on it. But I have to get back to work.... ...the proof is left as an excercise for the student. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=84028#m84067 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)