📄 dpjjx17.htm
字号:
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">18H</font></CODE></TD>
</TR>
<TR><TD WIDTH="11%" VALIGN="TOP" height="25">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">22H</font></CODE></TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">17H</font></CODE></TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">10H</font></CODE></TD>
</TR>
<TR><TD WIDTH="11%" VALIGN="TOP" height="25">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">21H</font></CODE></TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">0FH</font></CODE></TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </TD>
<TD WIDTH="11%" VALIGN="TOP" height="25">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">08H</font></CODE></TD>
</TR>
<TR><TD WIDTH="11%" VALIGN="TOP" height="1">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">20H</font></CODE></TD>
<TD WIDTH="11%" VALIGN="TOP" height="1">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">07H</font></CODE></TD>
<TD WIDTH="11%" VALIGN="TOP" height="1">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">06H</font></CODE></TD>
<TD WIDTH="11%" VALIGN="TOP" height="1">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">05H</font></CODE></TD>
<TD WIDTH="11%" VALIGN="TOP" height="1">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">04H</font></CODE></TD>
<TD WIDTH="11%" VALIGN="TOP" height="1">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">03H</font></CODE></TD>
<TD WIDTH="11%" VALIGN="TOP" height="1">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">02H</font></CODE></TD>
<TD WIDTH="11%" VALIGN="TOP" height="1">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">01H</font></CODE></TD>
<TD WIDTH="11%" VALIGN="TOP" height="1">
<CODE><P style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2">00H</font></CODE></TD>
</TR>
</TABLE>
<FONT FACE="宋体" LANG="ZH-CN" size="2">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">图1</P>
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="宋体" LANG="ZH-CN">内部</font><font size="2"><FONT FACE="System" LANG="ZH-CN">RAM</FONT><FONT FACE="宋体" LANG="ZH-CN">的</FONT><FONT FACE="System" LANG="ZH-CN">20H-2FH</FONT><FONT FACE="宋体" LANG="ZH-CN">这</FONT><FONT FACE="System" LANG="ZH-CN">16</FONT><FONT FACE="宋体" LANG="ZH-CN">个字节,就是</FONT><FONT FACE="System" LANG="ZH-CN">8031</FONT><FONT FACE="宋体" LANG="ZH-CN">的位寻址区。看图</FONT><FONT FACE="System" LANG="ZH-CN">1</FONT><FONT FACE="宋体" LANG="ZH-CN">。可见这里面的每一个</FONT><FONT FACE="System" LANG="ZH-CN">RAM</FONT></font><font size="2" FACE="宋体" LANG="ZH-CN">中的每个位我们都可能直接用位地址来找到它们,而不必用字节地址,然后再用逻辑指令的方式。</font></P><FONT FACE="宋体" LANG="ZH-CN">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><LI>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font size="2">可以位寻址的特殊功能寄存器</LI></font></p>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"></P>
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System" LANG="ZH-CN">8031</font><font size="2"><FONT FACE="宋体" LANG="ZH-CN">中有一些</FONT><FONT FACE="System" LANG="ZH-CN">SFR</FONT><FONT FACE="宋体" LANG="ZH-CN">是可以进行位寻址的,这些</FONT><FONT FACE="System" LANG="ZH-CN">SFR</FONT><FONT FACE="宋体" LANG="ZH-CN">的特点是其字节地址均可被</FONT><FONT FACE="System" LANG="ZH-CN">8</FONT><FONT FACE="宋体" LANG="ZH-CN">整除,如</FONT><FONT FACE="System" LANG="ZH-CN">A</FONT><FONT FACE="宋体" LANG="ZH-CN">累加器,</FONT><FONT FACE="System" LANG="ZH-CN">B</FONT><FONT FACE="宋体" LANG="ZH-CN">寄存器、</FONT><FONT FACE="System" LANG="ZH-CN">PSW</FONT><FONT FACE="宋体" LANG="ZH-CN">、</FONT><FONT FACE="System" LANG="ZH-CN">IP</FONT><FONT FACE="宋体" LANG="ZH-CN">(中断优先级控制寄存器)、</FONT><FONT FACE="System" LANG="ZH-CN">IE</FONT><FONT FACE="宋体" LANG="ZH-CN">(中断允许控制寄存器)、</FONT><FONT FACE="System" LANG="ZH-CN">SCON</FONT><FONT FACE="宋体" LANG="ZH-CN">(串行口控制寄存器)、</FONT><FONT FACE="System" LANG="ZH-CN">TCON</FONT><FONT FACE="宋体" LANG="ZH-CN">(定时器</FONT><FONT FACE="System" LANG="ZH-CN">/</FONT><FONT FACE="宋体" LANG="ZH-CN">计数器控制寄存器)、</FONT><FONT FACE="System" LANG="ZH-CN">P0-P3</FONT><FONT FACE="宋体" LANG="ZH-CN">(</FONT><FONT FACE="System" LANG="ZH-CN">I/O</FONT><FONT FACE="宋体" LANG="ZH-CN">端口锁存器)。以上的一些</FONT><FONT FACE="System" LANG="ZH-CN">SFR</FONT></font><font size="2" FACE="宋体" LANG="ZH-CN">我们还不熟,等我们讲解相关内容时再作详细解释。</font></P><FONT FACE="宋体" LANG="ZH-CN">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><LI>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font size="2">位操作指令</LI></font></p>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"></P></font></OL><DIR>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System" LANG="ZH-CN">MCS-51</font><font size="2"><FONT FACE="宋体" LANG="ZH-CN">单片机的硬件结构中,有一个位处理器(又称布尔处理器),它有一套位变量处理的指令集。在进行位处理时,</FONT><FONT FACE="System" LANG="ZH-CN">CY</FONT><FONT FACE="宋体" LANG="ZH-CN">(就是我们前面讲的进位位)称“<B>位累加器”。</B>有自已的位</FONT><FONT FACE="System" LANG="ZH-CN">RAM</FONT><FONT FACE="宋体" LANG="ZH-CN">,也就是我们刚讲的内部</FONT><FONT FACE="System" LANG="ZH-CN">RAM</FONT><FONT FACE="宋体" LANG="ZH-CN">的</FONT><FONT FACE="System" LANG="ZH-CN">20H-2FH</FONT><FONT FACE="宋体" LANG="ZH-CN">这</FONT><FONT FACE="System" LANG="ZH-CN">16</FONT><FONT FACE="宋体" LANG="ZH-CN">个字节单元即</FONT><FONT FACE="System" LANG="ZH-CN">128</FONT><FONT FACE="宋体" LANG="ZH-CN">个位单元,还有自已的位</FONT><FONT FACE="System" LANG="ZH-CN">I/O</FONT><FONT FACE="宋体" LANG="ZH-CN">空间(即</FONT><FONT FACE="System" LANG="ZH-CN">P0.0…..P0.7,P1.0…….P1.7,P2.0……..P2.7,P3.0……..P3.7</FONT><FONT FACE="宋体" LANG="ZH-CN">)。当然在物理实体上它们与原来的以字节寻址用的</FONT><FONT FACE="System" LANG="ZH-CN">RAM</FONT><FONT FACE="宋体" LANG="ZH-CN">,及端口是完全相同的,或者说这些</FONT><FONT FACE="System" LANG="ZH-CN">RAM</FONT></font><font size="2" FACE="宋体" LANG="ZH-CN">及端口都可以有两种用法。</font></P></DIR><OL>
<FONT FACE="宋体" LANG="ZH-CN">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><LI>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font size="2">位传送指令</LI></font></p>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"></P>
</font>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System" LANG="ZH-CN">MOV	C</font><FONT FACE="宋体" LANG="ZH-CN" size="2">,</FONT><font size="2" FACE="System" LANG="ZH-CN">BIT</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System" LANG="ZH-CN">MOV	BIT</font><FONT FACE="宋体" LANG="ZH-CN" size="2">,</FONT><font size="2" FACE="System" LANG="ZH-CN">C</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="宋体" LANG="ZH-CN">这组指令的功能是实现位累加器(</font><FONT FACE="System" LANG="ZH-CN" size="2">CY</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="宋体" LANG="ZH-CN">例:</font><font size="2"><FONT FACE="System" LANG="ZH-CN">MOV	P1.0,CY</FONT><FONT FACE="宋体" LANG="ZH-CN">		</FONT><FONT FACE="System" LANG="ZH-CN">;</FONT><FONT FACE="宋体" LANG="ZH-CN">将</FONT><FONT FACE="System" LANG="ZH-CN">CY</FONT><FONT FACE="宋体" LANG="ZH-CN">中的状态送到</FONT><FONT FACE="System" LANG="ZH-CN">P1.0</FONT><FONT FACE="宋体" LANG="ZH-CN">引脚上去(如果是做算术运算,我们就可以通过观察知道现在</FONT><FONT FACE="System" LANG="ZH-CN">CY</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	P1.0,CY</font><font size="2"><FONT FACE="宋体" LANG="ZH-CN">		</FONT><FONT FACE="System" LANG="ZH-CN">;</FONT><FONT FACE="宋体" LANG="ZH-CN">将</FONT><FONT FACE="System" LANG="ZH-CN">P1.0</FONT><FONT FACE="宋体" LANG="ZH-CN">的状态送给</FONT><FONT FACE="System" LANG="ZH-CN">CY</FONT></font><font size="2" FACE="宋体" LANG="ZH-CN">。</font></P><FONT FACE="宋体" LANG="ZH-CN">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><LI>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font size="2">位修正指令</LI></font></p>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"></P></font></OL><OL>
<FONT FACE="宋体" LANG="ZH-CN">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></font><LI>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="宋体" LANG="ZH-CN">位清</font><font size="2"><FONT FACE="System" LANG="ZH-CN">0</FONT><FONT FACE="宋体" LANG="ZH-CN">指令</font></LI></font><FONT FACE="宋体" LANG="ZH-CN"></p>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"></P>
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System" LANG="ZH-CN">CLR		C</font><font size="2"><FONT FACE="宋体" LANG="ZH-CN">	</FONT><FONT FACE="System" LANG="ZH-CN">;</FONT><FONT FACE="宋体" LANG="ZH-CN">使</FONT></font><font size="2" FACE="System" LANG="ZH-CN">CY=0</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System" LANG="ZH-CN">CLR		bit ;</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 FACE="System" LANG="ZH-CN">CLR P1.0 ;</FONT><FONT FACE="宋体" LANG="ZH-CN">即使</FONT><FONT FACE="System" LANG="ZH-CN">P1.0</FONT><FONT FACE="宋体" LANG="ZH-CN">变为</FONT></font><font size="2" FACE="System" LANG="ZH-CN">0</font></P>
<FONT FACE="宋体" LANG="ZH-CN">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></FONT><LI>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="宋体" LANG="ZH-CN">位置</font><font size="2"><FONT FACE="System" LANG="ZH-CN">1</FONT><FONT FACE="宋体" LANG="ZH-CN">指令	</font></LI>
</font><FONT FACE="宋体" LANG="ZH-CN"></p>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"></P>
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System" LANG="ZH-CN">SETB	C ;</font><FONT FACE="宋体" LANG="ZH-CN" size="2">使</FONT><font size="2" FACE="System" LANG="ZH-CN">CY=1</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<font size="2" FACE="System" LANG="ZH-CN">SETB	bit ;</font><font size="2"><FONT FACE="宋体" LANG="ZH-CN">使指定的位地址等于</FONT><FONT FACE="System" LANG="ZH-CN">1</FONT><FONT FACE="宋体" LANG="ZH-CN">。例:</FONT><FONT FACE="System" LANG="ZH-CN">SETB P1.0 ;</FONT><FONT FACE="宋体" LANG="ZH-CN">使</FONT><FONT FACE="System" LANG="ZH-CN">P.0</FONT><FONT FACE="宋体" LANG="ZH-CN">变为</FONT></font><font size="2" FACE="System" LANG="ZH-CN">1</font></P>
<FONT FACE="宋体" LANG="ZH-CN">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><LI>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -