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

📄 masm4.htm

📁 本单片机教程是平凡老师花了大量时间
💻 HTM
📖 第 1 页 / 共 4 页
字号:
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> IF C1</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> INC R3</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV R4,A</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> ENDIF</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> IF C2</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV R5,P2</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> ADDC A,P3</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> ELSE</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV R1,P2</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> XRL A,R3</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> ENDIF</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> MOV @R1,A</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> ENDM</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0000 E4 CLR A</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0001 7B2A MOV R3,#2AH</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0003 CON 0,0,#23H,#65H,R6</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">+0003 7423 MOV A,#23H</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">+ IF 0</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">+ INC R3</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">+ MOV R4,A</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">+ ENDIF</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">+ IF 0</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">+ MOV R5,#65H</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">+ ADDC A,R6</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">+ ELSE</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">+0005 7965 MOV R1,#65H</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">+0007 6B XRL A,R3</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">+ ENDIF</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">+0008 F7 MOV @R1,A</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 0000 END</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">The Cybernetic Micro Systems 8051 Family Assembler, Version 
      3.03 Page 2</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 08-27-96</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> ;%T Symbol Name Type Value</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> CON . . . . . . . . . . . . . . M 0000</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> ;%Z</p>
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> 00 Errors (0000)</p>
    </font></i> 
    <p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>程序中宏指令带有条件结构,并可以通过形参C1确定判别条件。</font></p>
    <b><font face="Arial" size=5> 
    <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"><a name="_Toc416236575"></a><font face="黑体" lang="ZH-CN" size=4>第七节</font><font size=4> 
      </font><font face="黑体" lang="ZH-CN" size=4>汇编程序的出错信息</font></li> 
    <font face="黑体" lang="ZH-CN" size=4> 
    <p></p>
    <p style="line-height: 150%; margin-top: 0; margin-bottom: 0"></p>
    </font></b> 
  </ol>
</ol>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>一个汇编程序往往不可能一次编写就完全正确,总会有一些错误存在,MASM51在汇编时可以对源程序中存在的一些语法错误判别,并给出出错信息,出错信息将出现在屏幕上,并被写入到列表文件中去,我们可以根据出错信息对照源程序进行修改。</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>一般出错信息的格式为:</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>描述性信息(</font><font face="Arial" size=3>aaaa)</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <font face="宋体" lang="ZH-CN" size=3>描述性信息向用户提供错误的类型,以提供用户分析与纠正错误。</font><font face="Arial" size=3>aaaa</font><font face="宋体" lang="ZH-CN" size=3>是四位十六进制数字,它指出的是上一个错误出现的地址,以便</font><font size=3> 
  </font><font face="宋体" lang="ZH-CN" size=3>用户在较长的列表文件中找到上一个错误的所在。</font></p> 
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>错误数量的报告记录在列表文件的最后,其格式为:</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>XX</font><font size=3> 
  </font><font face="宋体" lang="ZH-CN" size=3>Errors(0000)</font></p> 
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>其中XX为十六进制数表示的错误数量。</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>宏汇编能提供的错误信息有:</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>(1)</font><font face="Arial" size=3>Undefined  
  symbol</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <font face="宋体" lang="ZH-CN" size=3>表示在源程序的语句中使用的符号未被定义,实际上可能是符号名拼错或在源程序中缺少一个该符号的等价指令。</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>(2)</font><font face="Arial" size=3>Missing  
  Argumentin Expression</font></p> 
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <font face="宋体" lang="ZH-CN" size=3>表示表达式中算术运算符后面没有操作数。</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>(3)</font><font face="Arial" size=3>Unblaanced  
  Parentheses</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <font face="宋体" lang="ZH-CN" size=3>每一个左括号必须与一个右括号配套,如果表达式中多余或缺少括号,将出现上述提示信息。</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>(4)</font><font face="Arial" size=3>ILLEGAL  
  EQUATE</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <font face="宋体" lang="ZH-CN" size=3>表示把两个不同类型的量用等价伪指令连在一起,例如保留字的值1寄存器名等,它们不允许用等值伪指令来改变。</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>(5)</font><font face="Arial" size=3>BADLY  
  ROFMED ARGUMENT</font></p> 
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <font face="宋体" lang="ZH-CN" size=3>表示一个数字参数使用了非法的数字。例如二进制中出现除0与1以外的其他数字。</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>(6)</font><font face="Arial" size=3>MISSING  
  END STATEMENT</font></p> 
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <font face="宋体" lang="ZH-CN" size=3>源文件结束处没有</font><font face="Arial" size=3>END</font><font face="宋体" lang="ZH-CN" size=3>语句。源文件的结束处必须有一个</font><font face="Arial" size=3>END</font><font face="宋体" lang="ZH-CN" size=3>语句。</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>(7)</font><font face="Arial" size=3>LABEL  
  NAME CONFLICTS WITH SYMBOL NAME</font></p> 
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <font face="宋体" lang="ZH-CN" size=3>标号名与符号名相同。</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>(8)</font><font face="Arial" size=3>MULTIPLY  
  DEFINED LABEL</font></p> 
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <font face="宋体" lang="ZH-CN" size=3>相同标号多次出现。</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>(9)</font><font face="Arial" size=3>LABEL  
  ADDRESS CHANGED ON PASS 2</font></p> 
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <font face="宋体" lang="ZH-CN" size=3>标号的值在两次扫描中改变。这个错误往往是在源程序的不同处用了同一个标号名,只要用字处理软件查找这个标号,就可以改正。</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>(10)</font><font face="Arial" size=3>UNRECOGNIZED  
  STATEMENT OR UNDEFINED ARGUMENT</font></p> 
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <font face="宋体" lang="ZH-CN" size=3>表示有未定义的指令、或源代码。出现一个语法类型的错误。该类错误可能由拼错命令名产生或由于记错命令的用法产生,改正起来较为简单。</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>(11)</font><font face="Arial" size=3>ADDRESS  
  OUT OF RANGE</font></p> 
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <font face="宋体" lang="ZH-CN" size=3>转移地址超出该语句的范围,例如SJMP转移地址超过+127~-128的范围,另外JB、JNB、JZ、JNZ等指令也容易发生类错误。如果是SJMP、AJMP、ACALL等指令发生错误,则改正较为容易,只要将指令改为范围较在的即可,如将SJMP改为AJMP,将AJMP改为LJMP,将ACLL改为LCALL等,如果是JZ、JB、JNZ、JNB等指令发生此类错误,则要使用一些技工技巧,如下面程序1所示,NEXT标号已超出了JZ指令作用的范围,则可以改成程序2,使用一个中间标号NEXT1,然后从NEXT1跳转到NEXT处。</font></p>
<font face="宋体" lang="ZH-CN" size=3> 
<p align="JUSTIFY" 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"><i><font face="宋体" lang="ZH-CN" size=3>.</font></i></p>
<i> 
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>.</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>JB</font><font size=3> 
  </font><font face="宋体" lang="ZH-CN" size=3>NEXT1</font></p> 
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>.</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>.</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>.</font></p>
<font face="宋体" lang="ZH-CN" size=3> 
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">NEXT1:</p>
</font>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>AJMP</font><font size=3> 
  </font><font face="宋体" lang="ZH-CN" size=3>NEXT</font></p> 
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>.</font></p>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font face="宋体" lang="ZH-CN" size=3>.</font></p>
</i>
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <font face="宋体" lang="ZH-CN" size=3>(12)</font><font face="Arial" size=3>VALUE  
  OUT OF RANGE</font></p> 
<p align="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> <font face="宋体" lang="ZH-CN" size=3>用一个非法的值来说明一个语句。</font></p>
<p align="center" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><a href="dpjjx.htm">
<font size=3> 
<img src="back1.gif" border="0" width="43" height="55">
</font></a></p>
<p align="center" style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </p>
<p align="center" style="line-height: 150%; margin-top: 0; margin-bottom: 0"><font size="2" face="宋体">杭州电子计算机工作室 
  COPYRIGHT; <a href="http://www.hificat.com" target="_blank">http://www.hificat.com</a><br>
  &nbsp; e-mail:<a href="mailto:xu169@sina.com">xu169@sina.com</a></font> qq:12739176 
  <font size="2">电话</font>:<font size="2">0571-85956028 13185018567</font></p>
<p align="center"> </p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -