Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/06/01 07:40
Read: times


 
#15479 - RE: HEX TO ASCII CODE
For single digit (ie. lower nibble of Acc) you can use the following code:

THE_NAME_U_WANT:
ANL A,#0FH
ADD A,#144
DA A
ADDC A,#64
DA A
RET

It returns the ASCII code of the hex digit in lower 4 bits of Acc in Acc.
If you need more than single hex digit, you can push Acc, convert, send to LCD, pop Acc, swap nibbles, convert and send to LCD. Since it is single digit, you have control of the display order you need on the LCD. It can also be used on serial communications.
Have fun.

List of 13 messages in thread
TopicAuthorDate
HEX TO ASCII CODE            01/01/70 00:00      
   RE: HEX TO ASCII CODE            01/01/70 00:00      
RE: HEX TO ASCII CODE            01/01/70 00:00      
RE: HEX TO ASCII CODE            01/01/70 00:00      
RE: HEX TO ASCII CODE            01/01/70 00:00      
RE: HEX TO ASCII CODE            01/01/70 00:00      
RE: HEX TO ASCII CODE            01/01/70 00:00      
RE: HEX TO ASCII CODE            01/01/70 00:00      
RE: HEX TO ASCII CODE            01/01/70 00:00      
RE: HEX TO ASCII CODE - Peter            01/01/70 00:00      
RE: HEX TO ASCII CODE - Peter            01/01/70 00:00      
RE: HEX TO ASCII CODE - Peter            01/01/70 00:00      
RE: HEX TO ASCII CODE            01/01/70 00:00      

Back to Subject List