GWAIT4:
LCALL DISPLAY JNB P0.1,GWAIT4 SETG5:
LCALL DISPLAY JNB P0.1,SETG6 JNB P0.2,GADDDAY JNB P0.3,JIANDAY AJMP SETG5
GADDDAY:
MOV R7,63H ;日加一 LCALL ADD1
MOV 63H,A
CJNE A,#32H,GADDDAY1 MOV 63H,#01H JIANDAY:
MOV R7,63H ;日减一 LCALL JIAN1 MOV 63H,A
CJNE A,#00H,GADDDAY1 MOV 63H,#31H
GADDDAY1:
MOV 32H,#86H ;日值送人1302 MOV 31H,63H LCALL WRITE
MOV R0,63H
LCALL DIVIDE ;日分离,送显示缓存 MOV 76H,R1 MOV 46H,R1 MOV 77H,R2
MOV 47H,R2
WAITT3: ;~~~~~~~~~~~~~~~~~ LCALL DISPLAY JNB P0.2,WAITT3 JNB P0.3,WAITT3 AJMP SETG5
SETG6:
SETB 0CH ;调星期时闪标志 GWAIT6:
LCALL DISPLAY JNB P0.1,GWAIT6 SETG7:
LCALL DISPLAY JNB P0.1,SETG8
JNB P0.2,GADDWEEK JNB P0.3,JIANWEEK AJMP SETG7 GADDWEEK:
MOV R7,64H ;星期加一 LCALL ADD1 MOV 64H,A
CJNE A,#07H,GADDWEEK1 MOV 64H,#00H AJMP GADDWEEK1
JIANWEEK:
MOV R7,64H ;星期减一 LCALL JIAN1 MOV 64H,A
CJNE A,#00H,GADDWEEK1 MOV 64H,#06H
GADDWEEK1: MOV 32H,#8AH
MOV 31H,64H ;星期值送人1302 LCALL WRITE
MOV R0,64H
LCALL DIVIDE ;星期值分离送显示缓存 MOV 48H,R1 MOV 78H,R1
WAITT4: ;~~~~~~~~~~~~~~~ ~~~~~ LCALL DISPLAY JNB P0.2,WAITT4
JNB P0.3,WAITT4 AJMP SETG7 SETG8:
SETB 0DH ;调小时时闪标志 GWAIT8:
LCALL DISPLAY JNB P0.1,GWAIT8 SETG9:
LCALL DISPLAY JNB P0.1,SETG10 JNB P0.2,GADDHOUR JNB P0.3,JIANHOUR AJMP SETG9
GADDHOUR:
MOV R7,62H ;小时加一 LCALL ADD1 MOV 62H,A
CJNE A,#24H,GADDHOUR1 MOV 62H,#00H
AJMP GADDHOUR1 JIANHOUR:
MOV R7,62H ;小时减一 LCALL JIAN1 MOV 62H,A
CJNE A,#00H,GADDHOUR1 MOV 62H,#23H
GADDHOUR1:
MOV 32H,#84H ;小时值送人1302 MOV 31H,62H
LCALL WRITE MOV R0,62H
LCALL DIVIDE ;小时值分离送显示缓存 MOV 74H,R1 MOV 44H,R1 MOV 75H,R2 MOV 45H,R2
WAITT5: ;~~~~~~~~~~~~~~~~~~~~~~~~~ LCALL DISPLAY
JNB P0.2,WAITT5 JNB P0.3,WAITT5 AJMP SETG9 SETG10:
SETB 0EH ;调分时候闪标志 GWAIT10:
LCALL DISPLAY JNB P0.1,GWAIT10 SETG11:
LCALL DISPLAY JNB P0.1,SETGOUT JNB P0.2,GADDMINTUE JNB P0.3,JIANMINTUE AJMP SETG11 GADDMINTUE:
MOV R7,61H ;分钟加一 LCALL ADD1 MOV 61H,A
CJNE A,#60H,GADDMINTUE1 MOV 61H,#00H
AJMP GADDMINTUE1 JIANMINTUE:
MOV R7,61H ;分钟减一
LCALL JIAN1
MOV 61H,A
CJNE A,#00H,GADDMINTUE1 MOV 61H,#59H GADDMINTUE1:
MOV 32H,#82H ;分钟值送人1302 MOV 31H,61H
LCALL WRITE MOV R0,61H
LCALL DIVIDE ;分钟值分离送显示缓存 MOV 72H,R1 MOV 42H,R1 MOV 73H,R2 MOV 43H,R2 WAITT6:
LCALL DISPLAY JNB P0.2,WAITT6 JNB P0.3,WAITT6 AJMP SETG11 SETGOUT: LCALL DISPLAY
JNB P0.1,SETGOUT LCALL GENGXIAN MOV 32H,#80H
MOV 31H,#00H ;1302晶振开始振荡 LCALL WRITE MOV 32H,#8EH
MOV 31H,#80H ;禁止写入1302 LCALL WRITE CLR 08H CLR 09H CLR 0AH CLR 0BH CLR 0CH CLR 0DH CLR 0EH
CLR 0FH
CLR ET1 ;关闪中断 CLR TR1 LJMP MAIN1
;;闪动调时程序~~~~~~~~~~~~~~~~ INTT1:
PUSH ACC
PUSH PSW
GFLASH: CPL 0FH
JB 0FH,GFLASH1
MOV 7CH,4CH ;全部显示 MOV 7BH,4BH MOV 7AH,4AH MOV 79H,49H MOV 78H,48H MOV 77H,47H MOV 76H,46H MOV 75H,45H MOV 74H,44H MOV 73H,43H MOV 72H,42H MOV 71H,41H MOV 70H,40H GFLASHOUT: POP PSW POP ACC RETI
GFLASH1:
JB 0AH,GFLASH2 ;调年闪 MOV 7CH,#0FH MOV 7BH,#0FH
AJMP GFLASHOUT GFLASH2:
JB 0BH,GFLASH3 ;调月闪 MOV 7AH,#0FH MOV 79H,#0FH
AJMP GFLASHOUT GFLASH3:
JB 0CH,GFLASH4 ;调日闪 MOV 77H,#0FH MOV 76H,#0FH AJMP GFLASHOUT GFLASH4:
JB 0DH,GFLASH5 ;调星期闪 MOV 78H,#0FH AJMP GFLASHOUT GFLASH5:
JB 0EH,GFLASH6 ;调小时闪 MOV 75H,#0FH MOV 74H,#0FH