硬件课程设计日历Word格式文档下载.docx
《硬件课程设计日历Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《硬件课程设计日历Word格式文档下载.docx(38页珍藏版)》请在冰豆网上搜索。
HZ_YEAR02DW0A3B0H
HZ_YEAR01DW0A3B0H
HZ_MON02DW0A3B1H
HZ_MON01DW0A3B0H
HZ_DAY02DW0A3B1H
HZ_DAY01DW0A3B0H
HZ_DATEDW0A3AFH
HZ_WEEKDW0A3B6H
HZ_WEEK01DW0D0C7H;
字体"
星"
HZ_WEEK02DW0C6DAH;
期"
HZ_XDW0A1EFH;
★"
HZ_WDW0CDF2H;
万"
HZ_NDW0C4EAH;
年"
HZ_RDW0C8D5H;
日"
HZ_LDW0C0FAH;
历"
HZ_ADRDB?
DATAENDS
STACK1SEGMENTSTACK
DW50DUP(0)
TOP_STACLABELWORD
STACK1ENDS
CODESEGMENT
ASSUMECS:
CODE,DS:
DATA
START:
MOVAX,STACK1
MOVSS,AX
LEASP,TOP_STAC
MOVAX,DATA
MOVDS,AX
MOVDX,PORT_8255;
8255初始化
MOVAL,80H
OUTDX,AL
CALLCLEAR;
LCD清除
CALLFUCTION_A;
日期显示
;
8253的编程
MOVDX,PORT_8253
MOVAL,00110101B;
写入控制字,0通道,方式2
MOVDX,PORT_0
MOVAL,00H
MOVAL,10H
MOVAL,01110111B;
1通道,方式3
MOVDX,PORT_1
OUTDX,AL
MAIN:
LP:
MOVDX,PORT_C
TESTDX,10H;
检测B口是否有1秒脉冲
JNZLP
TESTDX,00H
JNZLP
INCHZ_SEC02;
秒的个位加一
;
判断是否有键按下
MOVDX,PORT_8255
MOVAL,10001010B;
A口输出B口输入C口低四位输出,高四位输入
MOVDX,PORT_A;
A口为行,向所有的行输出0
MOVDX,PORT_B
RET_TO_1:
MOVAL,0FEH
MOVCL,AL
NEXT_ROW_1:
MOVDX,PORT_A
OUTDX,AL
MOVDX,PORT_B
INAL,DX
ANDAL,0FH
CMPAL,0FH;
JNEJP_1
CMPCL,0EFH
JEFUC
ROLCL,01
MOVAL,CL
JMPNEXT_ROW_1
JP_1:
CALLJP
FUC:
CALLFUCTION_00;
时间的进位
CALLFUCTION_01;
日期的进位
CALLFUCTION_02;
星期的进位
JMPMAIN
FUCTION_00PROC
CMPHZ_SEC02,0A3BAH;
判断是否为十,是跳转到秒进位子程序JETIM_NEXT_01
RET
TIM_NEXT_01:
INCHZ_SEC01;
秒的十位加一
MOVHZ_SEC02,0A3B0H;
个位置零
CMPHZ_SEC01,0A3B6H;
判断是否为六,是跳转
JETIM_NEXT_02
TIM_NEXT_02:
INCHZ_MIN02;
分的个位加一
MOVHZ_SEC01,0A3B0H
CMPHZ_MIN02,0A3BAH;
判断是否为十,是跳转
JETIM_NEXT_03
TIM_NEXT_03:
INCHZ_MIN01;
分的十位加一
MOVHZ_MIN02,0A3B0H
CMPHZ_MIN01,0A3B6H;
判断是否大于六,是跳转
JETIM_NEXT_04
RET
TIM_NEXT_04:
INCHZ_HOU02;
时的十位加一
MOVHZ_MIN01,0A3B0H
CMPHZ_HOU01,0A3B2H;
判断是否为二,是跳转
JETIM_NEXT_05
JMPTIM_NEXT_07
TIM_NEXT_05:
CMPHZ_HOU02,0A3B4H;
判断时的个位是否为四,是跳转JETIM_NEXT_06
TIM_NEXT_06:
MOVHZ_HOU01,0A3B0H
MOVHZ_HOU02,0A3B0H
INCHZ_DAY02;
日期加一
INCHZ_WEEK;
星期加一
TIM_NEXT_07:
CMPHZ_HOU02,0A3BAH;
判断时的个位是否为十,是跳转JETIM_NEXT_08
TIM_NEXT_08:
INCHZ_HOU01;
(个位为十)十位加一,个位置零
FUCTION_00ENDP
FUCTION_01PROC
CALLCMP_MON
CALLMON_COUNT
CALLYEAR_WALK
FUCTION_01ENDP
CMP_MONPROC
CMPHZ_MON01,0A3B0H;
判断是否是个位的月份
JEMON01_EQU_0
JMPMON01_EQU_1
MON01_EQU_0:
CMPHZ_MON02,0A3B1H;
一月
JEGO_TO_31
CMPHZ_MON02,0A3B2H;
二月
JEGO_TO_2MON
CMPHZ_MON02,0A3B3H;
三月
JEGO_TO_31
CMPHZ_MON02,0A3B4H;
四月
JEGO_TO_30
CMPHZ_MON02,0A3B5H;
五月
JEGO_TO_31
CMPHZ_MON02,0A3B6H;
六月
JEGO_TO_30
CMPHZ_MON02,0A3B7H;
七月
CMPHZ_MON02,0A3B8H;
八月
CMPHZ_MON02,0A3B9H;
九月
MON01_EQU_1:
CMPHZ_MON02,0A3B0H;
十月
十一月
十二月
GO_TO_31:
CALLCOUNT_31;
31天的子程序
JMPTO_END
GO_TO_30:
CALLCOUNT_30;
30天的子程序
GO_TO_2MON:
CALLMON_2_COUNT;
二月的子程序
TO_END:
CMP_MONENDP
COUNT_28PROC
CMPHZ_DAY01,0A3B2H;
判断天十位是否为2,是跳转
JENEXT_28_01
JMPNEXT_28_03
NEXT_28_01:
CMPHZ_DAY02,0A3B9H;
判断天个位是否为9,是跳转JENEXT_28_02
JMPNEXT_28_03
NEXT_28_02:
MOVHZ_DAY01,0A3B0H
MOVHZ_DAY02,0A3B1H
INCHZ_MON02;
月加一
NEXT_28_03:
CMPHZ_DAY02,0A3BAH
JENEXT_28_04
NEXT_28_04:
MOVHZ_DAY02,0A3B0H
INCHZ_DAY01
COUNT_28ENDP
COUNT_29PROC
CMPHZ_DAY01,0A3B2H;
判断天十位是否为2,是跳转JENEXT_29_01
JMPNEXT_29_03
NEXT_29_01:
CMPHZ_DAY02,0A3BAH;
判断天个位是否为A,是跳转JENEXT_29_02
NEXT_29_02:
MOVHZ_DAY01,0A3B0H
月加一
NEXT_29_03:
JENEXT_29_04
NEXT_29_04:
MOVHZ_DAY02,0A3B0H
COUNT_29ENDP
COUNT_30PROC
CMPHZ_DAY01,0A3B3H;
判断天十位是否为3,是跳转JENEXT_30_01
JMPNEXT_30_03
NEXT_30_01:
CMPHZ_DAY02,0A3B1H;
判断天个位是否为1,是跳转
JENEXT_30_02
JMPNEXT_30_03
NEXT_30_02:
NEXT_30_03:
JENEXT_30_04
NEXT_30_04:
COUNT_30ENDP
COUNT_31PROC
CMPHZ_DAY01,0A3B3H;
判断天十位是否为3,是跳转
JENEXT_31_01
JMPNEXT_31_03
NEXT_31_01:
CMPHZ_DAY02,0A3B2H;
判断天个位是否为2,是跳转
JENEXT_31_02
NEXT_31_02:
MOVHZ_DAY01,0A3B0H;
置天数为01
月份加一RET
NEXT_31_03:
CMPHZ_DAY02,0A3BAH;
个位是否为十,是跳转
JENEXT_31_04
NEXT_31_04:
MOVHZ_DAY02,0A3B0H;
个位置零,十位加一
COUNT_31ENDP
MON_2_COUNTPROC
MOVAX,HZ_YEAR01;
判断是否是闰年
ANDAX,01H
MOVCX,0AH
MULCX
MOVBX,HZ_YEAR02
ANDBX,01H
ADDAX,BX
MOVDX,00H
MOVBX,04H
DIVBX
CMPDX,0
JEGO_TO_29
JMPGO_TO_28
GO_TO_29:
CALLCOUNT_29;
29天的子程序
GO_TO_28:
CALLCOUNT_28
MON_2_COUNTENDP
YEAR_PANDUANPROC
MOVAX,HZ_YEAR01
MOVCX,0AH
MULCX
ADDAX,HZ_YEAR02
CMPDX,0
YEAR_PANDUANENDP
MON_COUNTPROC
CMPHZ_MON01,0A3B1H;
判断月的十位是否为一
JEMON_NEXT_01
JMPMON_NEXT_03
MON_NEXT_01:
CMPHZ_MON02,0A3B3H
JEMON_NEXT_02
MON_NEXT_02:
MOVHZ_MON01,0A3B0H
MOVHZ_MON02,0A3B1H
INCHZ_YEAR02
MON_NEXT_03:
CMPHZ_MON02,0A3BAH
JEMON_NEXT_04
RET
MON_NEXT_04:
MOVHZ_MON02,0A3B0H
INCHZ_MON01
MON_COUNTENDP
YEAR_WALKPROC
CMPHZ_YEAR02,0A3BAH
JEYEAR_NEXT_01
YEAR_NEXT_01:
MOVHZ_YEAR02,0A3B0H
INCHZ_YEAR01
YEAR_WALKENDP
FUCTION_02PROC
CMPHZ_WEEK,0A3B8H;
是否大于7,大于跳转
JEWEEK_NEXT01
JMPWEEK_END
WEEK_NEXT01:
MOVHZ_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PROC
PUSHCX
MOVAL,HZ_ADR
MOVAX,[BX]
PUSHAX
MOVAL,AH
CALLDATA_SETUP
CALLDELAY
POPAX
CALLDELAY
POPCX
LCD_DISPENDP
CMD_SETUPPROC
NOP
MOVAL,00000000B;
PC6置0,pc4置0(LCDI端=0,W端=0)
MOVAL,01000000B;
PC6置1(LCDE端=1)
OUTDX,AL
CALLDELAY
PC6置0,(LCDE端置0)
CMD_SETUPENDP
DATA_SETUPPROC
MOVDX,PORT_C;
PORT_A?
MOVAL,00010000B;
PC5置0,PC4=1(LCDI端=1)
MOVAL,01010000B;
PC6置0,(LCDE端=0)
DATA_SETUPENDP
DELAYPROC
PUSHDX
MOVCX,0FFFFH
X1:
LOOPX1
POPDX
POPCX
DELAYENDP
DELAY_SECPROCNEAR;
软延时
MOVBX,250
L1:
MOVCX,0
L2:
LOOPL2
DECBX
JNEL1
ANDAL,80H
CMPAL,00H判断是否为低电平,不是则循环;
JEL2
JMPL1;
DELAY_SECENDP
JPPROC
JP_START:
MOVDX,PORT_8255
A口输出B口输入C口低四位输出,高四位输入
万年历显示80H~87H
LEABX,HZ_X
MOVBY