BCD碼到ASCII碼轉(zhuǎn)換實(shí)例
BCD碼到ASCII碼轉(zhuǎn)換實(shí)例
BCDTOASC
MOV R0,#20H
MOV R1,#10H
MOV R2,#05H
ACALLBCDASC
LOOP0:
SJMPLOOP0
BCDASC:
MOV R1,#10H
MOV R6,#0AH
LOOP1:
MOV @R1,#00H
INCR1
DJNZR6,LOOP1
LOOP2:
MOV A,@R0
MOV R2,A
SWAPA
ANLA,#0FH
ADDA,#30H-
MOV @R1,A
INCR1
MOV A,R2
ANLA,#0FH
ADDA,#30H
MOV @R1,A
INCR0
INCR1
DJNZR7,LOOP2
RET