Skip to main content

ALP to convert Hex to ASCII


ALP to convert Hex to ASCII
org 00h
mov r0,#30h
mov a,@r0   ;operation: put hexa in 30h , u'll get result in next bytes
anl a,#0f0h
swap a
acall ascii
inc r0
mov @r0,a
dec r0
mov a,@r0
anl a,#0fh
acall ascii
inc r0
inc r0
mov @r0,a
sjmp $
ascii: cjne a,#0ah,nx
   nx: jc skp
       add a,#07h
skp:   add a,#30h
ret
end

Comments