1个回答
展开全部
ORG 0000H
LJMP MAIN
ORG 0003H
LJMP KEYINT
ORG 0030H
MAIN:
MOV R7,#0
LOOP:
MOV A,R7
JNZ ,LOOP1
MOV DPTR,#TAB1
SJMP START
LOOP1:
DEC A
JNZ LOOP2
MOV DPTR,#TAB2
SJMP START
LOOP2:
DEC A
JNZ LOOP3
MOV DPTR,#TAB3
SJMP START
LOOP3:
MOV DPTR,#TAB4
START:
MOV A,R6
INC R6
CJNE R6,#16,STA1
MOV R6,#0
STA1:
MOVC A,@A+DPTR
MOV P1,A
LCALL DELAY
LJMP LOOP
DELAY:
MOV R2,#100
DLY:
MOV R3,#250
DJNZ R3,$
DJNZ R2,DLY
RET
KEYINT:
INC R7
CJNE R7,#4,KINTR
MOV R7,#0
KINTR:
RETI
TAB1:
DB 0FEH,0FDH,0FBH,0F7H,0EFH,0DFH,0BFH,07FH
DB 0FEH,0FDH,0FBH,0F7H,0EFH,0DFH,0BFH,07FH
TAB2:
DB 0F0H,0FH,0F0H,0FH,0F0H,0FH,0F0H,0FH
DB 0F0H,0FH,0F0H,0FH,0F0H,0FH,0F0H,0FH
TAB3:
DB 0E7H,0DBH,0BDH,07EH,0E7H,0DBH,0BDH,07EH
DB 0E7H,0DBH,0BDH,07EH,0E7H,0DBH,0BDH,07EH
TAB4:
DB 0FEH,0FDH,0FBH,0F7H,0EFH,0DFH,0BFH,07FH
DB 07FH,0BFH,0DFH,0EFH,0F7H,0FBH,0FDH,0FEH
END
LJMP MAIN
ORG 0003H
LJMP KEYINT
ORG 0030H
MAIN:
MOV R7,#0
LOOP:
MOV A,R7
JNZ ,LOOP1
MOV DPTR,#TAB1
SJMP START
LOOP1:
DEC A
JNZ LOOP2
MOV DPTR,#TAB2
SJMP START
LOOP2:
DEC A
JNZ LOOP3
MOV DPTR,#TAB3
SJMP START
LOOP3:
MOV DPTR,#TAB4
START:
MOV A,R6
INC R6
CJNE R6,#16,STA1
MOV R6,#0
STA1:
MOVC A,@A+DPTR
MOV P1,A
LCALL DELAY
LJMP LOOP
DELAY:
MOV R2,#100
DLY:
MOV R3,#250
DJNZ R3,$
DJNZ R2,DLY
RET
KEYINT:
INC R7
CJNE R7,#4,KINTR
MOV R7,#0
KINTR:
RETI
TAB1:
DB 0FEH,0FDH,0FBH,0F7H,0EFH,0DFH,0BFH,07FH
DB 0FEH,0FDH,0FBH,0F7H,0EFH,0DFH,0BFH,07FH
TAB2:
DB 0F0H,0FH,0F0H,0FH,0F0H,0FH,0F0H,0FH
DB 0F0H,0FH,0F0H,0FH,0F0H,0FH,0F0H,0FH
TAB3:
DB 0E7H,0DBH,0BDH,07EH,0E7H,0DBH,0BDH,07EH
DB 0E7H,0DBH,0BDH,07EH,0E7H,0DBH,0BDH,07EH
TAB4:
DB 0FEH,0FDH,0FBH,0F7H,0EFH,0DFH,0BFH,07FH
DB 07FH,0BFH,0DFH,0EFH,0F7H,0FBH,0FDH,0FEH
END
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询