需要编程。
MAIN:
MOV DPTR, #TAB
MOV R2, #0
LOOP:
MOV A, R2
MOVC A, @A + DPTR
MOV P2, A
CALL DELAY
JNB P1.0, KEY
NEXT:
JNB F0, LOOP
INC R2
CJNE R2, #10, LOOP
JMP MAIN
;--------------------------
KEY:
CPL F0
JNB P1.0, $
JMP NEXT
;--------------------------
DELAY:
MOV R5, #2
DJNZ R7, $
DJNZ R6, $ - 2
DJNZ R5, $ - 4
RET
;--------------------------
TAB: ;共阳段码
DB 0C0H,0F9H,0A4H,0B0H, 99H, 92H, 82H,0F8H
DB 080H, 90H, 88H, 83H,0C6H,0A1H, 86H, 8EH
;--------------------------
END