一个依次 4X4 按键显示 1~f 的数码管,求改正错误。。。求指导
ORG 0000HAJMP START
ORG 0030H
START:MOV P0,#0F0H
KEYIN:MOV A,P2
ORL A,#0FH
CLR A
JZ KEYIN
ALALL DELAY
MOV A,P2
ORL A,#OFH
ORL A
JZ KEYIN
MOV A,P2
MOV P2,#0FH
ORL A,P2
MOV 30H,A
MOV P2,#0F0H
JNZ KEYIN
ACALL DELAY
MOV A,P2
ORL A,#0F0H
CPL A
JNZ KEYIN
MOV DPTR,#KEYWORD
MOV R0,#0FFH
NEXT: INC R0
MOV A,R0
MOVC A,@A+DPTR
CJNZ A,30H,NEXT
MOV DPTR,LEDWORD
MOV A,R0
MOVC A,@A+DPTR
MOV P0,A
AJMP START
DELAY:MOV R5,#0FH
D1:MOV R6,#0F2H
D2:MOV R3,#0F3H ;
D3:DJNZ R7,D3
DJNZ R6,D2
DJNZ R5,D1
RET
KEYWORD:0EEH,0DEH,0BEH,7EH,0EDH,0DDH,0BDH,7BH,0EBH,0DBH,0BBH,7BH,0E7H,0D7H,0B7H,77H
LEDWORD:0c0H,0f9H,0a4H,0b0H,99H,92H,82H,0f8H,,90H,88H,83H,0c6H,0a1H,86H,8eH
END