⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dpjjx26.htm

📁 本单片机教程是平凡老师花了大量时间
💻 HTM
📖 第 1 页 / 共 3 页
字号:
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑体" LANG="ZH-CN">SETB&#9;SECOND&#9;&#9;;</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&#9;A,#DISPBUFF&#9;;</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&#9;A,Counter&#9;</font></P>
<FONT FACE="System,黑体" LANG="ZH-CN" size="2">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">&#9;MOV&#9;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&#9;A,@R0&#9;&#9;;</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&#9;DPTR,#DISPTAB&#9;;</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&#9;A,@A+DPTR&#9;;</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&#9;P0,A&#9;&#9;;</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&#9;A,Counter&#9;;</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&#9;DISPFIRST&#9;;</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&#9;SECOND&#9;&#9;;</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&#9;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&#9;FIRST&#9;&#9;;</font><font size="2" FACE="宋体" LANG="ZH-CN">显示第一位&#9;&#9; 
</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&#9;Counter&#9;&#9;;</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">&#9;MOV&#9;A,Counter&#9;</P>
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System,黑体" LANG="ZH-CN">DEC&#9;A&#9;&#9;;</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">&#9;
<font size="2">DEC&#9;A&#9;&#9;</font>&#9;&#9;</P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">&#9;
<font size="2">JZ&#9;RSTCOUNT&#9;</font>&#9;</P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">&#9;
<font size="2">AJMP&#9;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&#9;Counter,#0&#9;;</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">&#9;
<font size="2">POP&#9;PSW</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">&#9;
<font size="2">POP&#9;ACC</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">&#9;
<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:&#9;&#9;&#9;;</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&#9;PSW</font></P><FONT FACE="System,黑体" LANG="ZH-CN">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">&#9;
<font size="2">SETB&#9;RS0</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">&#9;
<font size="2">MOV&#9;R7,#255</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">D1:&#9;MOV&#9;R6,#255</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">D2:&#9;NOP</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">&#9;
<font size="2">NOP</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">&#9;
<font size="2">NOP</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">&#9;
<font size="2">NOP</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">&#9;
<font size="2">DJNZ&#9;R6,D2</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">&#9;
<font size="2">DJNZ&#9;R7,D1</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">&#9;
<font size="2">POP&#9;PSW</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">&#9;
<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>&#9;</P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">&#9;
<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 + -