Hi, Does anyone know how to convert a BINARY 8 bit to a 2 digit packed BCD. Example if I have value 0x0C (wich is 12 decimal) the result will be 12 or a char value of 0x12. thank you, Adi,
And now the add-on question for extra points: how many assembly instructions is the minimum this functionality can be achieved in? You may assume all inputs are already in the correct registers, and it doesn't matter where the output is, as long as it's somewhere.
But what is the more interesting value - the number of assembly instructions or code efficiency? A DIV and MODULO takes very long, so it might be better to use some add-and-compare loops Jochen
A DIV and MODULO takes very long, Indeed. And it's too many instructions, anyway ;-) So sorry, but no cigar yet.