?? dpjjx26.htm
字號:
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑體" LANG="ZH-CN">SETB	SECOND		;</font><font size="2" FACE="宋體" LANG="ZH-CN">關顯示</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑體" LANG="ZH-CN">MOV	A,#DISPBUFF	;</font><font size="2" FACE="宋體" LANG="ZH-CN">顯示緩沖區首地址</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="System,黑體" LANG="ZH-CN" size="2">ADD	A,Counter	</font></P>
<FONT FACE="System,黑體" LANG="ZH-CN" size="2">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	MOV	R0,A</P>
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑體" LANG="ZH-CN">MOV	A,@R0		;</font><font size="2" FACE="宋體" LANG="ZH-CN">根據計數器的值取相應的顯示緩沖區的值</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑體" LANG="ZH-CN">MOV	DPTR,#DISPTAB	;</font><font size="2" FACE="宋體" LANG="ZH-CN">字形表首地址</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑體" LANG="ZH-CN">MOVC	A,@A+DPTR	;</font><font size="2" FACE="宋體" LANG="ZH-CN">取字形碼</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑體" LANG="ZH-CN">MOV	P0,A		;</font><font size="2"><FONT FACE="宋體" LANG="ZH-CN">將字形碼送</FONT><FONT FACE="System,黑體" LANG="ZH-CN">P0</FONT></font><font size="2" FACE="宋體" LANG="ZH-CN">位(段口)</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑體" LANG="ZH-CN">MOV	A,Counter	;</font><font size="2" FACE="宋體" LANG="ZH-CN">取計數器的值</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑體" LANG="ZH-CN">JZ	DISPFIRST	;</font><font size="2"><FONT FACE="宋體" LANG="ZH-CN">如果是</FONT><FONT FACE="System,黑體" LANG="ZH-CN">0</FONT></font><font size="2" FACE="宋體" LANG="ZH-CN">則顯示第一位</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑體" LANG="ZH-CN">CLR	SECOND		;</font><font size="2" FACE="宋體" LANG="ZH-CN">否則顯示第二位</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="System,黑體" LANG="ZH-CN" size="2">AJMP	DISPNEXT</font></P>
<FONT FACE="System,黑體" LANG="ZH-CN" size="2">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">DISPFIRST:</P>
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑體" LANG="ZH-CN">CLR	FIRST		;</font><font size="2" FACE="宋體" LANG="ZH-CN">顯示第一位		
</font></P>
<FONT FACE="System,黑體" LANG="ZH-CN" size="2">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">DISPNEXT:</P>
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑體" LANG="ZH-CN">INC	Counter		;</font><FONT FACE="宋體" LANG="ZH-CN" size="2">計數器加</FONT><font size="2" FACE="System,黑體" LANG="ZH-CN">1</font></P>
<FONT FACE="System,黑體" LANG="ZH-CN" size="2">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	MOV	A,Counter	</P>
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑體" LANG="ZH-CN">DEC	A		;</font><font size="2"><FONT FACE="宋體" LANG="ZH-CN">如果計數器計到</FONT><FONT FACE="System,黑體" LANG="ZH-CN">2</FONT><FONT FACE="宋體" LANG="ZH-CN">,則讓它回</FONT></font><font size="2" FACE="System,黑體" LANG="ZH-CN">0</font></P><FONT FACE="System,黑體" LANG="ZH-CN">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">DEC	A		</font>		</P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">JZ	RSTCOUNT	</font>	</P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">AJMP	DISPEXIT</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">RSTCOUNT:</font></P>
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑體" LANG="ZH-CN">MOV	Counter,#0	;</font><font size="2"><FONT FACE="宋體" LANG="ZH-CN">計數器的值只能是</FONT><FONT FACE="System,黑體" LANG="ZH-CN">0</FONT><FONT FACE="宋體" LANG="ZH-CN">或</FONT></font><font size="2" FACE="System,黑體" LANG="ZH-CN">1</font></P><FONT FACE="System,黑體" LANG="ZH-CN">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">DISPEXIT:</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">POP	PSW</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">POP	ACC</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">RETI</font></P>
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑體" LANG="ZH-CN">DELAY:			;</font><font size="2"><FONT FACE="宋體" LANG="ZH-CN">延時</FONT><FONT FACE="System,黑體" LANG="ZH-CN">130</FONT></font><font size="2" FACE="宋體" LANG="ZH-CN">毫秒</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="System,黑體" LANG="ZH-CN" size="2">PUSH	PSW</font></P><FONT FACE="System,黑體" LANG="ZH-CN">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">SETB	RS0</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">MOV	R7,#255</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">D1:	MOV	R6,#255</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">D2:	NOP</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">NOP</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">NOP</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">NOP</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">DJNZ	R6,D2</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">DJNZ	R7,D1</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">POP	PSW</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">RET</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">DISPTAB:DB 28H,7EH,0a4H,64H,72H,61H,21H,7CH,20H,60H </font>	</P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">	
<font size="2">END</font></P>
</FONT><FONT FACE="宋體" LANG="ZH-CN" size="2">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">從上面的程序可以看出,和靜態顯示相比,動態掃描的程序稍有點復雜,不過,這是值得的。這個程序有一定的通用性,只要改變端口的值及計數器的值就可以顯示更多位數了。下面給出顯示程序的流程圖。</P>
</FONT><FONT FACE="System,黑體" LANG="ZH-CN">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2"> <IMG SRC="dpj261.gif" width="398" height="409"><IMG SRC="dpj262.gif" width="410" height="273"></font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><a href="down/exec81.asm">
<font size="2">程序一</font></a><font size="2"> <a href="down/exec81.hex">程序一之代碼</a>
<a href="down/exec82.asm">程序二 </a></font><a href="down/exec82.hex">
<font size="2">程序二之代碼</font></a></P>
</FONT></BODY>
</HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -