📄 电子时钟的设计.htm
字号:
lang=EN-US style="FONT-SIZE: 14pt"><o:p></o:p></SPAN></P>
<DIV
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 0cm; PADDING-BOTTOM: 12pt; BORDER-LEFT: medium none; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-bottom-alt: solid windowtext .5pt">
<P class=MsoNormal
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; MARGIN: 0cm 0cm 0pt; BORDER-LEFT: medium none; TEXT-INDENT: 35.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none; mso-char-indent-count: 1.96; mso-border-bottom-alt: solid windowtext .5pt; mso-padding-alt: 0cm 0cm 12.0pt 0cm"><B
style="mso-bidi-font-weight: normal"><U
style="text-underline: double"><SPAN lang=EN-US
style="FONT-SIZE: 18pt"><o:p><SPAN style="TEXT-DECORATION: none"><FONT
face="Times New Roman"> </FONT></SPAN></o:p></SPAN></U></B></P></DIV>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 35.4pt; mso-char-indent-count: 1.96"><B
style="mso-bidi-font-weight: normal"><U
style="text-underline: double"><SPAN lang=EN-US
style="FONT-SIZE: 18pt"><FONT face="Times New Roman"><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN></FONT></SPAN></U></B><B
style="mso-bidi-font-weight: normal"><U
style="text-underline: double"><SPAN
style="FONT-SIZE: 18pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">西安工业大学课程设计用纸</SPAN></U></B><B
style="mso-bidi-font-weight: normal"><U
style="text-underline: double"><SPAN lang=EN-US
style="FONT-SIZE: 18pt"><FONT face="Times New Roman"><SPAN
style="mso-spacerun: yes">
</SPAN><o:p></o:p></FONT></SPAN></U></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 14pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">出来。并调用屏幕</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt"><FONT
face="Times New Roman">I/O</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中断,定位光标的开始位置,结合着将时间显</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-SIZE: 14pt"><o:p><FONT
face="Times New Roman"> </FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 14pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">示在我们预先定义好的位置上。由于获取了的系统时间不会自动刷</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-SIZE: 14pt"><o:p><FONT
face="Times New Roman"> </FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 14pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">新,所以我们要设计成刷新的方式来不断获取系统的时间,这样就形成了会跳动的电子钟了。<SPAN
style="COLOR: #333333">调用延时</SPAN></SPAN><SPAN lang=EN-US
style="FONT-SIZE: 14pt; COLOR: #333333"><FONT
face="Times New Roman">TIME</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">延时中断服务程序,累加到存放秒值的寄存器</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt; COLOR: #333333"><FONT
face="Times New Roman">DL</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中,并进行十进制调整。在累加的过程中,不断地对时、分、秒值进行比较,秒不能等于</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt; COLOR: #333333"><FONT
face="Times New Roman">60</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,分不能等于</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt; COLOR: #333333"><FONT
face="Times New Roman">60</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,时不能等于</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt; COLOR: #333333"><FONT
face="Times New Roman">24</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。秒等于限制值时,则使秒值为</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt; COLOR: #333333"><FONT
face="Times New Roman">0</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分值加</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt; COLOR: #333333"><FONT
face="Times New Roman">1</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">;分等于限制值时,则使分值为</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt; COLOR: #333333"><FONT
face="Times New Roman">0</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">时值加</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt; COLOR: #333333"><FONT
face="Times New Roman">1</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">;时等于限制值时,则使时值为</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt; COLOR: #333333"><FONT
face="Times New Roman">0</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">;时、分、秒值都不超过限制值时,就转显示屏输出。</SPAN><SPAN
style="FONT-SIZE: 14pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">时间显示的刷新要配合延时程序进行,为了得到良好的显示效果,延时程序要尽量接近</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt"><FONT
face="Times New Roman">1</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">秒,但又不能超过一秒,所以本程序调用了一段较精确的时间延迟程序。</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt"><FONT
face="Times New Roman">
</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">利用</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt"><FONT
face="Times New Roman">BIOSS</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设计窗口,选择适当的背景和前景等,使屏幕显示更加完美。<SPAN
style="COLOR: #333333">程序一旦进入运行,就将不间断地在显示屏显示时间,要想程序停止运行,可同时在键盘按下</SPAN></SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt; COLOR: #333333"><FONT
face="Times New Roman">ESC</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">键返回</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt; COLOR: #333333"><FONT
face="Times New Roman">DOS</FONT></SPAN><SPAN
style="FONT-SIZE: 14pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">系统。</SPAN><SPAN
lang=EN-US style="FONT-SIZE: 14pt; COLOR: #333333"><o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 8.5pt; mso-char-indent-count: .47"><B
style="mso-bidi-font-weight: normal"><U
style="text-underline: double"><SPAN
style="FONT-SIZE: 18pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">四.程序流程图如下:</SPAN></U></B><B
style="mso-bidi-font-weight: normal"><U
style="text-underline: double"><SPAN lang=EN-US
style="FONT-SIZE: 18pt"><o:p></o:p></SPAN></U></B></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 35.4pt; mso-char-indent-count: 1.96"><B
style="mso-bidi-font-weight: normal"><U
style="text-underline: double"><SPAN lang=EN-US
style="FONT-SIZE: 18pt"><o:p><SPAN style="TEXT-DECORATION: none"><FONT
face="Times New Roman"> </FONT></SPAN></o:p></SPAN></U></B></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 35.4pt; mso-char-indent-count: 1.96"><SPAN
lang=EN-US style="FONT-SIZE: 18pt"><o:p><SPAN
style="TEXT-DECORATION: none"><FONT face="Times New Roman"><FONT
size=2>DATA
SEGMENT
;设置数据段<BR> BUF1 DB 'THE TIME IS NOW:
$'<BR> BUF5 DB ' @@@@@
^^^^^^^ @@@@@@ $'<BR>
BUF6 DB
' &&&&&&
#######
&&&&&& $'<BR> BUF7
DB ' 00 >o o < 00 $'<BR> BUF8 DB
' 00 (::) 00 $'<BR> BUF9 DB ' 00 ~~ 00
$'<BR> BUF10 DB ' 00 !! 00
$'<BR> BUF3 DB 'CLASS:040402206
$'<BR> BUF4 DB 'NAME:hu ling
wei $'<BR> BUF2 DB
10<BR> DB 10
DUP(?)<BR>
DATA ENDS<BR> STACK SEGMENT
STACK
;设置堆栈段<BR> DB
100 DUP(?)<BR>
STACK ENDS<BR> CODE
SEGMENT
;设置代码段<BR>
ASSUME
CS:CODE,DS:DATA,SS:STACK<BR> CURSOR MACRO
ROW,CLM
;设置光标位置<BR>
MOV AH,2 <BR>
MOV BH,0 <BR>
MOV DH,ROW
<BR> MOV
DL,CLM <BR> INT
10H <BR>
ENDM<BR> WIN MACRO
ROWL,CLML,ROWR,CLMR,COLOR
;设置窗口,位置,颜色<BR>
MOV AH,6 <BR>
MOV AL,0 <BR>
MOV
CH,ROWL<BR> MOV
CL,CLML<BR>
MOV
DH,ROWR<BR>
MOV
DL,CLMR<BR> MOV
BH,COLOR<BR>
INT
10H<BR> ENDM<BR>
ASCBCD MACRO
REG<BR> INC
BX<BR> INC
BX<BR> MOV
REG,[BX]<BR>
MOV CL,4<BR>
SHL REG,CL<BR>
INC BX<BR> MOV
AL,[BX]<BR>
AND AL,0FH<BR>
OR REG,AL<BR>
ENDM<BR>
BCDASC MACRO
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -