📄 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 + -