三年一闰,五年两闰,十九年七闰,每逢闰年所加的一个月叫做闰月。ifmo
th2year0x040day_
umber1day_
umber
ifmo
th2year0x040day_
umber1
编辑版word
f判断阳历日在春节正月初一之前还是之后ifday_
umbertemp3阳历在春节之后或者春节当日
day_
umbertemp3mo
th1mo
th_poi
t1mo
th_poi
t为月份指向,阳历日在春季前就是春季flag_mo
thget_moo
_daymo
th_poi
tcale
dar_address检查该阴历月的大小大月返回1小月返回0flag_year0ifflag_mo
th
temp130大月30天else
temp129小月29天ifflag_mo
th0temp129elsetemp130
闰月所在的月分temp2year_codecale
dar_address0xf0temp24提取高四位假如是0表示没有闰月
whileday_
umbertemp1
day_
umbertemp1
编辑版word
fmo
th_poi
tifmo
thtemp2
flag_yearflag_yearifflag_year0
mo
th1else
mo
thflag_mo
thget_moo
_daymo
th_poi
tcale
dar_addressifflag_mo
th
temp130else
temp129dayday_
umber1else阳历在春节之前使用以下代码进行运算temp3day_
umberifyear0
year0xe3c_flag1
编辑版word
felseyear1
cale
dar_address3mo
th0xctemp2year_codecale
dar_address0xf0temp24提取高4位flag_year0iftemp20
mo
th_poi
t12else
mo
th_poi
t13flag_year0flag_mo
thget_moo
_daymo
th_poi
tcale
dar_addressifflag_mo
th
temp130else
temp129whiletemp3temp1
temp3temp1mo
th_poi
tifflag_year0
编辑版word
fmo
th1ifmo
thtemp2flag_yearflag_yearflag_mo
thget_moo
_daymo
th_poi
tcale
dar_addressifflag_mo
th
temp10x1eelse
temp10x1d
daytemp1temp31HEXBCD运算结束后把数据转换为BCD数据temp1year10temp14clock_moo
2temp1year10
temp1mo
th10temp14clock_moo
1temp1mo
th10
temp1day10temp14clock_moo
0temp1day10
编辑版word
fLcd_Lu
ar_Cale
darclock_moo
算法(日期年份所过闰年月校正7的余数就是星期如果是闰年又不到3月份上述之和要减一天再voidWeek_Co
vertbitcucharclock_time
ucharyearmo
thday定义年月天uchartemp
clock_time3指向日dayclock_time410clock_time0x0fBCD转换十进制clock_time指向月mo
thclock_time410clock_time0x0fclock_time指向年yearclock_time410clock_time0x0f
ifc0如果为21世纪r