📄 dpjjx15.htm
字号:
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US style='font-family:System'><font size="2">ORL<span style='mso-tab-count:2'> </span>direct,#data
;direct</font></span><font size="2">中的值和立即数</font><span lang=EN-US
style='font-family:System'><font size="2">data</font></span><font size="2">按位</font><span lang=EN-US style='font-family:System'><font size="2">'</font></span><font size="2">或</font><span lang=EN-US style='font-family:System'><font size="2">'</font></span><font size="2">,结果送入</font><span
lang=EN-US style='font-family:System'><font size="2">direct</font></span><font size="2">中。</font><span lang=EN-US><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<font size="2">异或指令:</font><span
lang=EN-US><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US style='font-family:System'><font size="2">XRL<span style='mso-tab-count:2'> </span>A,Rn</font></span><span style='mso-tab-count:2' lang="EN-US"><font size="2">
</font> </span><span
lang=EN-US style='font-family:System'><font size="2">;A</font></span><font size="2">和</font><span lang=EN-US style='font-family:System'><font size="2">Rn</font></span><font size="2">中的值按位</font><span
lang=EN-US style='font-family:System'><font size="2">'</font></span><font size="2">异或</font><span lang=EN-US style='font-family:System'><font size="2">'</font></span><font size="2">,结果送入</font><span
lang=EN-US style='font-family:System'><font size="2">A</font></span><font size="2">中</font><span lang=EN-US><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US style='font-family:System'><font size="2">XRL<span style='mso-tab-count:2'> </span>A,direct
;A</font></span><font size="2">和</font><span lang=EN-US
style='font-family:System'><font size="2">direct</font></span><font size="2">中的值按位</font><span lang=EN-US style='font-family:System'><font size="2">'</font></span><font size="2">异或</font><span
lang=EN-US style='font-family:System'><font size="2">'</font></span><font size="2">,结果送入</font><span lang=EN-US style='font-family:System'><font size="2">A</font></span><font size="2">中</font><span lang=EN-US><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US style='font-family:System'><font size="2">XRL<span style='mso-tab-count:2'> </span>A,@Ri
;A</font></span><font size="2">和间址寻址单元</font><span lang=EN-US
style='font-family:System'><font size="2">@Ri</font></span><font size="2">中的值按位</font><span lang=EN-US style='font-family:System'><font size="2">'</font></span><font size="2">异或</font><span lang=EN-US style='font-family:System'><font size="2">'</font></span><font size="2">,结果送入</font><span
lang=EN-US style='font-family:System'><font size="2">A</font></span><font size="2">中</font><span lang=EN-US><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US style='font-family:System'><font size="2">XRL<span style='mso-tab-count:2'> </span>A,#data
;A</font></span><font size="2">和立即数</font><span lang=EN-US
style='font-family:System'><font size="2">data</font></span><font size="2">按位</font><span lang=EN-US style='font-family:System'><font size="2">'</font></span><font size="2">异或</font><span lang=EN-US style='font-family:System'><font size="2">'</font></span><font size="2">,结果送入</font><span
lang=EN-US style='font-family:System'><font size="2">A</font></span><font size="2">中</font><span lang=EN-US><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US style='font-family:System'><font size="2">XRL<span style='mso-tab-count:1'> </span>direct,A
;direct</font></span><font size="2">中值和</font><span lang=EN-US
style='font-family:System'><font size="2">A</font></span><font size="2">中的值按位</font><span lang=EN-US style='font-family:System'><font size="2">'</font></span><font size="2">异或</font><span lang=EN-US style='font-family:System'><font size="2">'</font></span><font size="2">,结果送入</font><span
lang=EN-US style='font-family:System'><font size="2">direct</font></span><font size="2">中</font><span lang=EN-US><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US style='font-family:System'><font size="2">XRL<span style='mso-tab-count:2'> </span>direct,#data
;direct</font></span><font size="2">中的值和立即数</font><span lang=EN-US
style='font-family:System'><font size="2">data</font></span><font size="2">按位</font><span lang=EN-US style='font-family:System'><font size="2">'</font></span><font size="2">异或</font><span lang=EN-US style='font-family:System'><font size="2">'</font></span><font size="2">,结果送入</font><span
lang=EN-US style='font-family:System'><font size="2">direct</font></span><font size="2">中。</font><span lang=EN-US><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<font size="2">练习:</font><span
lang=EN-US><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US style='font-family:System'><font size="2">MOV<span style='mso-tab-count:2'> </span>A</font></span><font size="2">,</font><span lang=EN-US style='font-family:System'><font size="2">#24H</font></span><span lang=EN-US style='font-size:10.5pt'><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US style='font-family:System'><font size="2">MOV<span style='mso-tab-count:2'> </span>R0</font></span><font size="2">,</font><span lang=EN-US style='font-family:System'><font size="2">#37H</font></span><span lang=EN-US style='font-size:10.5pt'><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US style='font-family:System'><font size="2">ORL<span style='mso-tab-count:3'> </span>A</font></span><font size="2">,</font><span lang=EN-US style='font-family:System'><font size="2">R0</font></span><span lang=EN-US style='font-size:10.5pt'><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US style='font-family:System'><font size="2">XRL<span style='mso-tab-count:3'> </span>A</font></span><font size="2">,</font><span lang=EN-US style='font-family:System'><font size="2">#29H</font></span><span lang=EN-US style='font-size:10.5pt'><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US style='font-family:System'><font size="2">MOV<span style='mso-tab-count:2'> </span>35H</font></span><font size="2">,</font><span lang=EN-US style='font-family:System'><font size="2">#10H</font></span><span lang=EN-US style='font-size:10.5pt'><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US style='font-family:System'><font size="2">ORL<span style='mso-tab-count:3'> </span>35H</font></span><font size="2">,</font><span lang=EN-US style='font-family:System'><font size="2">#29H</font></span><span lang=EN-US style='font-size:10.5pt'><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US style='font-family:System'><font size="2">MOV<span style='mso-tab-count:2'> </span>R0</font></span><font size="2">,</font><span lang=EN-US style='font-family:System'><font size="2">#35H</font></span><span lang=EN-US style='font-size:10.5pt'><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US style='font-family:System'><font size="2">ANL<span style='mso-tab-count:2'> </span>A</font></span><font size="2">,</font><span lang=EN-US style='font-family:System'><font size="2">@R0</font></span><span lang=EN-US style='font-size:10.5pt'><o:p></o:p></span></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<font size="2">四、控制转移类指令</font><span
lang=EN-US><o:p></o:p></span></p>
<ol start=1 type=1>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-line-height-alt:0pt;mso-list:l0 level1 lfo1;tab-stops:list 36.0pt'>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font size="2">无条件转移类指令</font><span lang=EN-US><o:p></o:p></span></li>
</ol>
<ol start=1 type=1>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-line-height-alt:0pt;mso-list:l1 level1 lfo2;tab-stops:list 36.0pt'>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font size="2">短转移类指令</font><span lang=EN-US><o:p></o:p></span></li>
</ol>
<p style='margin-left:36.0pt;mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US
style='font-family:System'><font size="2">AJMP<span style='mso-tab-count:
1'> </span>addr11</font></span><o:p></o:p></p>
<ol start=2 type=1>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-line-height-alt:0pt;mso-list:l1 level1 lfo2;tab-stops:list 36.0pt'>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font size="2">长转移类指令</font><span lang=EN-US><o:p></o:p></span></li>
</ol>
<p style='margin-left:36.0pt;mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US
style='font-family:System'><font size="2">LJMP<span style='mso-tab-count:
1'> </span>addr16</font></span><o:p></o:p></p>
<ol start=3 type=1>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-line-height-alt:0pt;mso-list:l1 level1 lfo2;tab-stops:list 36.0pt'>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font size="2">相对转移指令</font><span lang=EN-US><o:p></o:p></span></li>
</ol>
<p style='margin-left:36.0pt;mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US
style='font-family:System'><font size="2">SJMP<span style='mso-tab-count:
1'> </span>rel</font></span><o:p></o:p></p>
<p style='margin-left:36.0pt;mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<font size="2">上面的三条指令,如果要仔细分析的话,区别较大,但初学时,可不理会这么多,统统理解成:</font><span lang=EN-US
style='font-family:System'><font size="2">JMP</font><span style='mso-tab-count:2'><font size="2">
</font> </span></span><font size="2">标号,也就是跳转到一个标号处。事实上,</font><span lang=EN-US
style='font-family:System'><font size="2">LJMP</font><span style='mso-tab-count:
2'><font size="2">
</font> </span></span><font size="2">标号,在前面的例程中我们已接触过,并且也知道如何来使用了。而</font><span lang=EN-US
style='font-family:System'><font size="2">AJMP</font></span><font size="2">和</font><span lang=EN-US style='font-family:System'><font size="2">SJMP</font></span><font size="2">也是一样。那么他们的区别何在呢?在于跳转的范围不一样。好比跳远,</font><span
lang=EN-US style='font-family:System'><font size="2">LJMP</font></span><font size="2">一下就能跳</font><span lang=EN-US style='font-family:System'><font size="2">64K</font></span><font size="2">这么远(当然近了更没关系了)。而</font><span
lang=EN-US style='font-family:System'><font size="2">AJMP</font><span
style='mso-tab-count:1'><font size="2">
</font> </span></span><font size="2">最多只能跳</font><span lang=EN-US style='font-family:System'><font size="2">2K</font></span><font size="2">距离,而</font><span
lang=EN-US style='font-family:System'><font size="2">SJMP</font></span><font size="2">则最多只能跳</font><span lang=EN-US style='font-family:System'><font size="2">256</font></span><font size="2">这么远。原则上,所有用</font><span
lang=EN-US style='font-family:System'><font size="2">SJMP</font></span><font size="2">或</font><span lang=EN-US style='font-family:System'><font size="2">AJMP</font></span><font size="2">的地方都可以用</font><span
lang=EN-US style='font-family:System'><font size="2">LJMP</font></span><font size="2">来替代。因此在初学时,需要跳转时可以全用</font><span lang=EN-US
style='font-family:System'><font size="2">LJMP</font></span><font size="2">,除了一个场合。什么场合呢?先了解一下</font><span lang=EN-US style='font-family:System'><font size="2">AJMP</font></span><font size="2">,</font><span
lang=EN-US style='font-family:System'><font size="2">AJMP</font></span><font size="2">是一条双字节指令,也就说这条指令本身占用存储器(</font><span lang=EN-US
style='font-family:System'><font size="2">ROM</font></span><font size="2">)的两个单元。而</font><span lang=EN-US style='font-family:
System'><font size="2">LJMP</font></span><font size="2">则是三字节指令,即这条指令占用存储器(</font><span
lang=EN-US style='font-family:System'><font size="2">ROM</font></span><font size="2">)的三个单元。下面是第四条跳转指令。</font><span lang=EN-US><o:p></o:p></span></p>
<ol start=4 type=1>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-line-height-alt:0pt;mso-list:l1 level1 lfo2;tab-stops:list 36.0pt'>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font size="2">间接转移指令</font><span lang=EN-US><o:p></o:p></span></li>
</ol>
<p style='margin-left:36.0pt;mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US
style='font-family:System'><font size="2">JMP<span style='mso-tab-count:2'> </span>@A+DPTR</font></span><o:p></o:p></p>
<p style='mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<font size="2">这条指令的用途也是跳转,转到什么地方去呢?这可不能由标号简单地决定了。让我们从一个实际的例子入手吧。</font><span
lang=EN-US><o:p></o:p></span></p>
<p style='margin-left:72.0pt;mso-line-height-alt:0pt; line-height:150%; margin-top:0; margin-bottom:0'>
<span lang=EN-US
style='font-family:System'><font size="2">MOV<span style='mso-tab-count:1'> </span>DPTR</font></span><font size="2">,</font><span lang=EN-US style='font-family:System'><font size="2">#TAB</font></span><span
style='mso-tab-count:2' lang="EN-US"><font size="2">
</font> </span><span
lang=EN-US style='font-family:System'><font size="2">;</font></span><font size="2">将</font><span lang=EN-US style='font-family:System'><font size="2">TAB</font></span><font size="2">所代表的地址送入</font><span
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -