发表于:2007/6/8 16:35:00
#0楼
.在2000H~2004H单元中,存有5个压缩BCD码。试变成将他们转换成ASCⅡ码,并存入2005H开始的连续单元中
ORG 0000H
MOV R0,#50H
MOV R1,#05H
MOV DPTR,#2000H
CLR A
LOOP:MOVX A,@DPTR
MOV @R0,A
INC @R0
INC DPTR
DJNZ R1,LOOP
CLR A
MOV R0,#50H
MOV DPTR,#2005H
MOV R1,#05H
LOOP1:MOV A,@R0
ADD A,#30H
MOVX @DPTR,A
INC R0
INC DPTR
DJNZ R1,LOOP1
CLR A
END
ORG 0000H
MOV R0,#50H
MOV R1,#05H
MOV DPTR,#2000H
CLR A
LOOP:MOVX A,@DPTR
MOV @R0,A
INC @R0
INC DPTR
DJNZ R1,LOOP
CLR A
MOV R0,#50H
MOV DPTR,#2005H
MOV R1,#05H
LOOP1:MOV A,@R0
ADD A,#30H
MOVX @DPTR,A
INC R0
INC DPTR
DJNZ R1,LOOP1
CLR A
END