1、SETB EASETB ET0SETB TR0MOV R4,#19START1:CALL DISPJNB AA,SETMM1JMP START1SETMM1:CALL SETMMSETMM:JB AA,SETMM0SETMM2:JNB AA,SETMM3CLR ET0CLR TR0MOV TIMES,#01HMOV R0,#MINUTESETMM4:NOPINC22:CALL OFFLCALL INC11JB AA,INC22MOV A,TIMESRL AMOV TIMES,AJNB TIMES. 5, SETMM4SETMM12:JNB AA , SETMM11SETMM0:RETSETMM
2、11:JMP SETMM12SETMM3:JMP SETMM2INC11:MOV R3,#40INC111:MOV A,R0JB BB,INC17ADD A,#1DA ACALL INC000INC13:JNB BB , INC14INC17:MOV R0,ADJNZ R3,INC111INC14:JMP INC13OFFL:MOV 22H,R0MOV R6,#10OFF1:MOV R7,#10OFF2:MOV R0, # 0AAHDJNZ R7 , OFF2DJNZ R6 , OFF1MOV R0 , 22HINC000:JB TIMES. 0, INC001JB TIMES. 1, INC
3、002JB TIMES. 2, INC003JB TIMES. 3, INC004JB TIMES. 4, INC005JMP INCOUTINC005:CJNE A, #99H, INCOUTMOV A,#00HINC004:CJNE A, # 13H, INCOUTMOV A,#01HINC003:CJNE A,# 32H ,INCOUTINC002:CJNE A,#24H,INCOUTINC001:CJNE A,# 60H , INCOUTINCOUT:INTT0:PUSH ACCPUSH PSWORL TL0,#0C0HDJNZ R4 , CLKE111JMP LOOP11CLKE11
4、1:JMP CLKELOOP11:MOV R4,#19HMOV A,SECMOV SEC,ACJNE A, #60H , CLKE99MOV A,MINUTEMOV MINUTE,ACLK0:CJNE A, # 60H, CLKEMOV MINUTE,#0MOV A,HOURMOV HOUR,ACJNE A, # 24H, CLKEMOV HOUR,#0MOV A,DAYMOV DAY,AMOV A,MONTHINC AMOVC A, A + PCSJMP CLK1DB 31H,28H,31HDB 30H,31H,30HDB 31H,31H,30HDB 00H,00H,00HDB 31H,30
5、H,31HCLK1:CLR CSUBB A,DAYJNC CLKECJNE A,#2,CLK3MOV A,YEARANL A,#13HJNB ACC.4,CLK2ADD A,#2CLK2:ANL A,#3JNZ CLK3XRL A,#29HJZ CLKECLK3:MOV DAY,#1MOV MONTH,ACJNE A,#13H,CLKEMOV MONTH,#1MOV YEAR,ACLKE99:CALL CONVERTCLKE:POP PSWPOP ACCDISP:MOV 23H,R0DISP99:MOV R1,#40HMOV R2,#9DISP1:ANL A,#0FHMOV R1,ASWAP
6、AINC R1DJNZ R2,DISP2CALL DISPLAYMOV R0,23HDISP2:JMP DISP1DISPLAY:MOV R5,#19SETB AAAPLAY:SETB BBBCLR BBBCLR AAAMOV A,R1MOV DPTR,#TABMOVC A,A+DPTRMOV COM,ACALL DL1MSMOV COM,#0FFHDJNZ R5,PLAY1PLAY1:JMP PLAYTAB:DB 0C0H,0F9H,0A4H, 0B0H,99H,92H,82H,0F8H,80H,90H,0FFH,0A3H,8EH,0ABHDL1MS:MOV 25H,R7MOV 24H,R6
7、MOV R7,#20DS1:DJNZ R6,$DJNZ R7,DS1MOV R7,25HMOV R6,24HSTART_YEAR EQU 01CONVERT_YEAR DATA 5CHCONVERT_MONTH DATA 38HCONVERT_DATE DATA 37HTEMP_BYTE1 DATA 57HTEMP_BYTE2 DATA 58HTEMP_BYTE3 DATA 59HTEMP_BYTE4 DATA 5AHTEMP_BYTE5 DATA 5BHCONVERT:MOV A, YEARMOV TIME_YEAR,AMOV TIME_MONTH,AMOV TIME_DATA,AMOV A
8、,TIME_YEARMOV B,#16DIV ABMOV CONVERT_YEAR,BMOV B,#10MUL ABADD A,CONVERT_YEARMOV CONVERT_YEAR,AMOV A,TIME_MONTHJNB ACC.4,CON_02CLR ACC.4ADD A,#10CON_02:MOV CONVERT_MONTH,AMOV A,TIME_DATAMOV CONVERT_DATE,BADD A,CONVERT_DATEMOV CONVERT_DATE,AMOV DPTR,#MONTH_DATAMOV A,CONVERT_YEARCON_06:SUBB A,#START_YE
9、ARMOV B,#3ADD A,DPLMOV DPL,AMOV A,BADDC A,DPHMOV DPH,AMOV A, #2MOVC A, A+DPTRCLR ACC.7MOV B, #32MOV TEMP_BYTE1,AMOV TEMP_BYTE2,BMOV TEMP_BYTE3,#0MOV A,CONVERT_MONTHCJNE A,#10,CON_08CON_08:JC CON_09MOV TEMP_BYTE3,#1CON_09:ANL A,#03HJNZ CON_10LCALL GET_RUN_DAYS_LOWSJMP CON_12CON_10:LCALL GET_DAYS_LOWC
10、ON_12:MOV B,CONVERT_DATEDEC BADD A,BMOV TEMP_BYTE4,AJNC CON_14INC TEMP_BYTE3CON_14:MOV A,TEMP_BYTE1DEC AADD A,TEMP_BYTE2MOV TEMP_BYTE5,ACJNE A,TEMP_BYTE1,CON_20MOV A,CONVERT_DATECJNE A,TEMP_BYTE2,CON_20CON_20:JC CON_22LJMP CON_60CON_22:JNZ CON_24MOV A,#100CON_24:MOV A,DPLSUBB A,#3JNC CON_26DEC DPHCO
11、N_26:MOV A,TEMP_BYTE5SUBB A,TEMP_BYTE4MOV TEMP_BYTE3,AMOV CONVERT_MONTH,#12CLR F0CLR AANL A,#0F0HSWAP A;JZ CON_30MOVC A , A+DPTRMOV C, ACC.7MOV A, #1RLC ASJMP CON_34CON_30:CON_34:MOV TEMP_BYTE5, ACON_40:MOV A, TEMP_BYTE5RRC AJC CON_42MOV B, #29SJMP CON_44CON_42:MOV B, #30CON_44:MOV A, TEMP_BYTE3SUBB
12、 A, BJZ CON_46JNC CON_50CPL ACON_46: INC AMOV B, #10ORL A, BMOV CONVERT_DATE, AMOV A, CONVERT_MONTHMOV CONVERT_MONTH, AMOV A, CONVERT_YEARMOV CONVERT_YEAR, ACALL WEEKCON_50:MOV TEMP_BYTE3, AJB F0, CON_52DEC CONVERT_MONTHCON_52:CJNE A, TEMP_BYTE4, CON_54CPL F0CON_54:SJMP CON_40CON_60:MOV A, TEMP_BYTE
13、4SUBB A, TEMP_BYTE5MOV TEMP_BYTE4, AJNC CON_62DEC TEMP_BYTE3CON_62:MOV CONVERT_MONTH, #1ANL A, #0F0HXCH A, TEMP_BYTE5ANL A, #0FHMOV TEMP_BYTE1, AMOV TEMP_BYTE2, AORL A, TEMP_BYTE1MOV A, TEMP_BYTE2ANL A, # 0FHMOV ACC. 3, CCON_70:MOV A, TEMP_BYTE1JC CON_72SJMP CON_74CON_72:CON_74:SUBB A,BJNC CON_78MOV
14、 B, AJZ CON_76MOV TEMP_BYTE4, BSJMP CON_80CON_76:LJMP CON_46 CON_78:MOV TEMP_BYTE4, A CON_80:CJNE A, TEMP_BYTE5, CON_82JNB F0, CON_82SJMP CON_70CON_82:INC CONVERT_MONTHGET_DAYS_LOW:MOVC A, A+PCDB 0,31,59,90,120,151,181,212,243,17,48,78GET_RUN_DAYS_LOW:DB 0,31,60,91,121,152,182,213,244,18,49,79MONTH_
15、DATA:DB 04DH,04AH,0B8H;2001DB 00DH,04AH,04CH;2002DB 00DH,0A5H,041H;2003DB 025H,0AAH,0B6H;2004DB 005H,06AH,049H;2005DB 07AH,0ADH,0BDH;2006DB 002H,05DH,052H;2007DB 009H,02DH,047H;2008DB 05CH,095H,0BAH;2009DB 00AH,095H,04EH;2010DB 00BH,04AH,043H;2011DB 04BH,055H,037H;2012DB 00AH,0D5H,04AH;2013DB 095H,0
16、5AH,0BFH;2014DB 004H,0BAH,053H;2015DB 00AH,05BH,048H;2016DB 065H,02BH,0BCH;2017DB 005H,02BH,050H;2018DB 00AH,093H,045H;2019DB 047H,04AH,0B9H;2020DB 006H,0AAH,04CH;2021DB 00AH,0D5H,041H;2022DB 024H,0DAH,0B6H;2023DB 004H,0B6H,04AH;2024DB 069H,057H,03DH;2025DB 00AH,04EH,051H;2026DB 00DH,026H,046H;2027D
17、B 05EH,093H,03AH;2028DB 00DH,053H,04DH;2029DB 005H,0AAH,043H;2030DB 036H,0B5H,037H;2031DB 009H,06DH,04BH;2032DB 0B4H,0AEH,0BFH;2033DB 004H,0ADH,053H;2034DB 00AH,04DH,048H;2035DB 06DH,025H,0BCH;2036DB 00DH,025H,04FH;2037DB 00DH,052H,044H;2038DB 05DH,0AAH,038H;2039DB 00BH,05AH,04CH;2040DB 005H,06DH,04
18、1H;2041DB 024H,0ADH,0B6H;2042DB 004H,09BH,04AH;2043DB 07AH,04BH,0BEH;2044DB 00AH,04BH,051H;2045DB 00AH,0A5H,046H;2046DB 05BH,052H,0BAH;2047DB 006H,0D2H,04EH;2048DB 00AH,0DAH,042H;2049DB 035H,05BH,037H;2050DB 009H,037H,04BH;2051DB 084H,097H,0C1H;2052DB 004H,097H,053H;2053DB 006H,04BH,048H;2054DB 066H
19、,0A5H,03CH;2055DB 00EH,0A5H,04FH;2056DB 006H,0B2H,044H;2057DB 04AH,0B6H,038H;2058DB 00AH,0AEH,04CH;2059DB 009H,02EH,042H;2060DB 03CH,097H,035H;2061DB 00CH,096H,049H;2062DB 07DH,04AH,0BDH;2063DB 00DH,04AH,051H;2064DB 00DH,0A5H,045H;2065DB 055H,0AAH,0BAH;2066DB 005H,06AH,04EH;2067DB 00AH,06DH,043H;206
20、8DB 045H,02EH,0B7H;2069DB 005H ,02DH, 04BH; 2070DB 08AH, 095H, 0BFH; 2071DB 00AH, 095H, 053H; 2072DB 00BH, 04AH, 047H; 2073DB 06BH, 055H, 03BH; 2074DB 00AH, 0D5H, 04FH; 2075DB 005H, 05AH, 045H; 2076DB 04AH, 05DH, 038H; 2077DB 00AH, 05BH, 04CH; 2078DB 005H, 02BH, 042H; 2079DB 03AH, 093H, 0B6H; 2080DB
21、 006H, 093H, 049H; 2081DB 077H, 029H, 0BDH; 2082DB 006H, 0AAH, 051H; 2083DB 00AH, 0D5H, 046H; 2084DB 054H, 0DAH, 0BAH; 2085DB 004H, 0B6H, 04EH; 2086DB 00AH, 057H, 043H; 2087DB 045H, 027H, 038H; 2088DB 00DH, 026H, 04AH; 2089DB 08EH, 093H, 03EH; 2090DB 00DH, 052H, 052H; 2091DB 00DH, 0AAH, 047H; 2092DB
22、 066H, 0B5H, 03BH; 2093DB 005H, 06DH, 04FH; 2094DB 004H, 0AEH, 045H; 2095DB 04AH, 04EH, 0B9H; 2096DB 00AH, 04DH, 04CH; 2097DB 00DH, 015H, 041H; 2098DB 02DH, 092H, 0B5H;DB 00DH, 053H, 049H; 2100TIME_WEEK1 DATA 52HWEEK:MOV A, TIME_YEARMOV B, #16MOV TEMP_BYTE1, BADD A, TEMP_BYTE1MOV A, TIME_MONTHJB ACC.7, GETW02MOV A, #100ADD A,
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1