请大侠指教!有问题请教.
下面是个从在P0接共阴极的数码显示从1到9的汇编程序:START:
MOV DPTR,#TAB
MOV R0,#0AH
PLAY:
[color=Red]MOV A,#00H
MOVC A,@A+DPTR
MOV P0,A
ACALL DELAY
INC DPTR
DJNZ R0,PLAY
SJMP STRAT
DELAY:
MOV R5,#125
D2:
MOV R6,#0FFH
D3: DJNZ R6,D3
DJNZ R5,D2
RET
TAB:DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH
END[/color]
可是,以下这个汇编程序为什么不能达到预期郊果呢?
注:红色部分不同
STRAT:
MOV DPTR,#TAB
MOV R0,#0AH
PLAY:
MOVX A,@DPTR
MOV P0,A
ACALL DELAY
INC DPTR
DJNZ R0,PLAY
SJMP STRAT
DELAY:
MOV R5,#125
D2:MOV R6,#0FFH
D3:DJNZ R6,D3
DJNZ R5,D2
RET
TAB:DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH
END
哪位帮帮忙,谢谢~~