求程序数字钟。要求1显示小时和分钟2整点报时3四按键 选择 加1 减1 确认4秒由一个LED闪烁表示使用52单片机
发布网友
发布时间:2022-04-28 23:10
我来回答
共1个回答
热心网友
时间:2023-10-05 06:17
EF0DATA 19H
EF1DATA 20H
EF2DATA 21H
EF3DATA 22H
EF4DATA 23H
EF5DATA 24H
EF6DATA 25H
EF7DATA 26H
EF8DATA 27H
EF9DATA 28H
EF10DATA 29H
EF11DATA 30H
EF12DATA 31H
ORG0000H
LJMPMAIN
ORG0003H
AJMPSS
ORG0013H
AJMPSSS
ORG0032H
MAIN:MOVDPTR,#TAB
MOVIE,#85H
SETBPX1
MOVR6,#24
MOVSP,#50H
MOVEF12,#01H
LOOP:MOVR5,#03FH
MOVR4,#03FH
MOVR3,#03FH
MOVR2,#03FH
MOVR1,#03FH
MOVR0,#03FH
ACALLD
LOOP6:MOVEF5,#00H
LOOP5:MOVEF4,#00H
LOOP4:MOVEF3,#00H
LOOP3:MOVEF2,#00H
LOOP2:MOVEF1,#00H
LOOP1:MOVEF0,#00H
DJNZEF12,D0
ZO:MOVEF5,#01H
MOVEF4,#01H
MOVEF3,#01H
MOVEF2,#01H
MOVEF1,#01H
MOVEF0,#01H
D0:MOVEF12,#02H
MOVA,EF0
MOVCA,@A+DPTR
MOVR0,A
ACALLD
INCEF0
ACALLDEL
CJNER0,#067H,D0
AJMPD1
D1:MOVA,EF1
CJNER1,#06DH,D10
MOVR1,#3FH
AJMPD2
D10:MOVCA,@A+DPTR
MOVR1,A
ACALLD
INCEF1
AJMPLOOP1
D2:MOVA,EF2
CJNER2,#07FH,D20
MOVR2,#3FH
AJMPD3
D20:MOVCA,@A+DPTR
MOVR2,A
ACALLD
INCEF2
CJNER2,#067H,LOOP2
D3:MOVA,EF3
CJNER3,#06DH,D30
MOVR3,#03FH
AJMPD4
D30:MOVCA,@A+DPTR
MOVR3,A
ACALLD
INCEF3
CJNER3,#07DH,LOOP3
D4:MOVA,EF4
MOVCA,@A+DPTR
MOVR4,A
ACALLD
INCEF4
DJNZR6,LOOP6
CJNER4,#067H,LOOP4
D5:MOVA,EF5
MOVCA,@A+DPTR
MOVEF7,A
ACALLD
INCEF5
AJMPLOOP5
;************************************
D:PUSHACC ;显示子程序
MOVA,#0FEH
MOVP0,R0
MOVP2,A
RLA
ACALLDE
MOVP0,R1
MOVP2,A
RLA
ACALLDE
MOVP0,R2
SETBP0.7
MOVP2,A
RLA
ACALLDE
MOVP0,R3
MOVP2,A
RLA
ACALLDE
MOVP0,R4
SETBP0.7
MOVP2,A
RLA
ACALLDE
MOVP0,EF7
MOVP2,A
ACALLDE
POPACC
RET
DEL:MOVEF8,#5BH
DEL2:ACALLD
DJNZEF8,DEL2
RET
DE: PUSHPSW
MOV EF9,#01H
DL2:MOV EF10,#8EH
DL:MOV EF11,#02H
DJNZ EF11,$
DJNZ EF10,DL
DJNZ EF9,DL2
POPPSW
RET
DELOO: ;误差 0us
MOV EF9,#0C7H
DL1:
MOV EF10,#78H
DL0:
MOV EF11,#01H
DJNZ EF11,$
DJNZ EF10,DL0
DJNZ EF9,DL1
RET
TAB:DB03FH,006H,05BH,04FH,066H
DB06DH,07DH,007H,07FH,067H
RET
;****************************************
SS:ACALLDELOO;中断
MAI:MOVR7,#00H
LOOP01:MOVP1,#0FH
MOVA,P1
CJNEA,#0FH,F
ACALLD
AJMPLOOP01
F:ACALLDELOO;按键
CJNEA,#0FH,FO
AJMPLOOP01
FO:MOVP1,#0BFH
JNBP1.0,L0
JNBP1.1,L1
JNBP1.2,L2
JNBP1.3,L3
F1:MOVP1,#0DFH
JNBP1.0,L4
JNBP1.1,L5
JNBP1.2,L6
JNBP1.3,L7
F2:MOVP1,#0EFH
JNBP1.0,L8
JNBP1.1,L9
JNBP1.2,O0
JNBP1.3,MAI
W6:AJMPLOOP01
L0:MOVA,#00H
MOVR6,A
AJMPLOOP9
L1:MOVA,#01H
MOVR6,A
AJMPLOOP9
L2:MOVA,#02H
MOVR6,A
AJMPLOOP9
L3:MOVA,#03H
MOVR6,A
AJMPLOOP9
L4:MOVA,#04H
MOVR6,A
AJMPLOOP9
L5:MOVA,#05H
MOVR6,A
AJMPLOOP9
L6:MOVA,#06H
MOVR6,A
AJMPLOOP9
L7:MOVA,#07H
MOVR6,A
AJMPLOOP9
L8:MOVA,#08H
MOVR6,A
AJMPLOOP9
L9:MOVA,#09H
MOVR6,A
LOOP9:INCR7
MOVCA,@A+DPTR
CJNER7,#01,W1
MOVEF5,R6
MOVEF7,A
W1:CJNER7,#02,W2
MOVEF4,R6
MOVR4,A
W2:CJNER7,#03,W3
MOVEF3,R6
MOVR3,A
W3:CJNER7,#04,W4
MOVEF2,R6
MOVR2,A
W4:CJNER7,#05,W5
MOVEF1,R6
MOVR1,A
W5:CJNER7,#06,W6
MOVEF0,R6
MOVR0,A
O0:RETI
;**********************************
SSS:ACALLDELOO
MOVR5,#03FH
MOVR4,#03FH
MOVR3,#03FH
MOVR2,#03FH
MOVR1,#03FH
MOVR0,#03FH
ACALLD
MOVEF5,#00H
MOVEF4,#00H
MOVEF3,#00H
MOVEF2,#00H
MOVEF1,#00H
MOVEF0,#00H
RETI
END