ORG 00H
MOV SP,#70H
CALL INIT_8279
GET_KEY:
MOV DPTR,#8061H
MOVX A,@DPTR
ANL A,#0FH
JZ GET_KEY
MOV DPTR,#8060H
MOVX A,@DPTR
PUSH ACC
ANL A,#00111000B
RR A
MOV R2,A
POP ACC
ANL A,#00000111B
ADD A,R2
MOV DPTR,#CODE_TABLE
MOVC A,@A+DPTR
MOV R3,#8
MOV DPTR,#8060H
LOOP:
MOVX @DPTR,A
DJNZ R3,LOOP
JMP GET_KEY
INIT_8279:
MOV A,#0
MOV DPTR,#8061H
MOVX @DPTR,A
MOV A,#34H
MOVX @DPTR,A
MOV ACC,#0DFH
MOVX @DPTR,A
NOT_CLEAR_OK:
MOVX A,@DPTR
JNB ACC.7,NOT_CLEAR_OK
MOV A,#40H
MOVX @DPTR,A
MOV A,#90H
MOVX @DPTR,A
RET
CODE_TABLE:
DB 0C0H,0F9H,0A4H,0B0H
DB 99H,92H,82H,0F8H
DB 80H,90H,88H,83H
DB 0C6H,0A1H,86H,8EH
END
留言列表