Microcontroller › 8051 › Give me Hex to decimal & decimal to ascii conversion › if u want in asm programming
December 22, 2016 at 7:21 pm
#14291
Ashutosh Bhatt
Participant
if u want in asm programming then its very easy
1) saparate upper and lower nibble of HEX data using masking
2) shift upper nibble to right by 4 position
3) multiply uppper nibble data by 16
4) add the result with lower nibble
here is HEX to decimal conversion is complete
5) now again saparate upper and lower nibbles
6) add 30h (or 48d) in both nibbles to get ASCII values