MOV 32H,#8EH
MOV 31H,#00H ;允许写1302 LCALL WRITE MOV 32H,#80H
MOV 31H,#80H ;1302停止振荡 LCALL WRITE
GWAIT: ;~~~~~~~~~~~~~~~~~~ LCALL DISPLAY JNB P0.1,GWAIT SETG1:
LCALL DISPLAY JNB P0.1,SETG2 JNB P0.2,GADDYEAR JNB P0.3,JIANYEAR AJMP SETG1 GADDYEAR:
MOV R7,66H ;年加一 LCALL ADD1 MOV 66H,A
CJNE A,#51H,GADDYEAR1 MOV 66H,#00H AJMP GADDYEAR1 JIANYEAR:
MOV R7,66H ;年减一 LCALL JIAN1
MOV 66H,A
CJNE A,#00H,GADDYEAR1 MOV 66H,#51H GADDYEAR1:
MOV 32H,#8CH ;年值送人1302 MOV 31H,66H LCALL WRITE MOV R0,66H
LCALL DIVIDE ;年分离送显示缓存 MOV 4BH,R1 MOV 7BH,R1 MOV 4CH,R2 MOV 7CH,R2
WAITT1: ;~~~~~~~~~~~~~~~~ LCALL DISPLAY JNB P0.2,WAITT1 JNB P0.3,WAITT1 AJMP SETG1 SETG2:
SETB 0AH ;调月时闪标志 GWAIT2: LCALL DISPLAY JNB P0.1,GWAIT2 SETG3:
LCALL DISPLAY
JNB P0.1,SETG4 JNB P0.2,GADDMONTH JNB P0.3,JIANMONTH AJMP SETG3 GADDMONTH:
MOV R7,65H ;月加一 LCALL ADD1 MOV 65H,A
CJNE A,#13H,GADDMONTH1 MOV 65H,#01H AJMP GADDMONTH1 JIANMONTH:
MOV R7,65H ;月减一 LCALL JIAN1 MOV 65H,A
CJNE A,#00H,GADDMONTH1 MOV 65H,#12H GADDMONTH1:
MOV 32H,#88H ;月值送人1302 MOV 31H,65H LCALL WRITE MOV R0,65H
LCALL DIVIDE ;月分离,送显示缓存 MOV 79H,R1 MOV 49H,R1
MOV 7AH,R2 MOV 4AH,R2
WAITT2: ;~~~~~~~~~~~~~~~~~~~~ LCALL DISPLAY JNB P0.2,WAITT2 JNB P0.3,WAITT2 AJMP SETG3 SETG4:
SETB 0BH ;调日时闪标志 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: