October 7th, 2006, 02:32 AM
Converting hex to decimal in 8051 assembly code
It would be great if someone could explain to me how to convert hex to decimal (0-99). I know i need to use the mnemonic "DA A", but hiw dun really know how it works. Can some please help thanx.
September 25th, 2008, 01:21 AM
DA A instruction is only for conversion to BCD. For decimal number you take first character (MSD) convert to value 0 - 15 (char 0-F), multiply by 16 and then add second character (LSD) value 0 - 15 (char 0-F).
Originally Posted by kashyap