编程论坛's Archiver

fastgod 发表于 2005-5-31 02:52

[原创]有空的大侠帮我做做作业吧

有空的大侠帮我做做作业吧

<P ><FONT size=3><FONT face="Times New Roman">一、</FONT>设<FONT face="Times New Roman">X</FONT>、<FONT face="Times New Roman">Y</FONT>、<FONT face="Times New Roman">Z</FONT>、<FONT face="Times New Roman">V</FONT>均为<FONT face="Times New Roman">16</FONT>位有符号数,分别装在<FONT face="Times New Roman">X</FONT>、<FONT face="Times New Roman">Y</FONT>、<FONT face="Times New Roman">Z</FONT>、<FONT face="Times New Roman">V</FONT>存储单元中,阅读如下程序段,得出它的运算公式,并说明运算结果存于何处。</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>MOV AX, X                 </FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>IMUL  Y              </FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>MOV  CX ,AX            </FONT></FONT></P>
<P ><FONT face="Times New Roman" size=3>MOV  BX,DX</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>MOV AX ,Z                 </FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>CWD                    </FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>ADD  CX,AX              </FONT></FONT></P>
<P ><FONT face="Times New Roman" size=3>ADC  BX,DX</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>SUB CX,540                </FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>SBB BX,0              </FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>MOV  AX,V                </FONT></FONT></P>
<P ><FONT face="Times New Roman" size=3>CWD</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>SUB AX,CX                 </FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>SBB DX,BX           </FONT></FONT></P>
<P ><FONT face="Times New Roman" size=3>IDIV X</FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">二、</FONT>请指出下列指令的错误所在,并说明原因。</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(1)</FONT>       <FONT size=3>MOV CX,DL</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(2)</FONT>       <FONT size=3>XCHG [SI],3</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(3)</FONT>       <FONT size=3>POP CS</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(4)</FONT>       <FONT size=3>MOV IP,AX</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(5)</FONT>       <FONT size=3>SUB  [SI],[DI]</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(6)</FONT>       <FONT size=3>PUSH  DH</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(7)</FONT>       <FONT size=3>OR BL,DX</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(8)</FONT>       <FONT size=3>AND AX,DS</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(9)</FONT>       <FONT size=3>MUL 16</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(10)</FONT>   <FONT size=3>AND 7EEEH,AX</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(11)</FONT>   <FONT size=3>DIV 256</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(12)</FONT>   <FONT size=3>MOV ES,1243H</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(13)</FONT>   <FONT size=3>MOV CS,AX</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(14)</FONT>   <FONT size=3>SUB DL,CF</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(15)</FONT>   <FONT size=3>ADC AX,<st1:State w:st="on"><st1:place w:st="on">AL</st1:place></st1:State></FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(16)</FONT>   <FONT size=3>MOV <st1:State w:st="on"><st1:place w:st="on">AL</st1:place></st1:State>,300</FONT></FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">三、</FONT>假设<FONT face="Times New Roman">AX </FONT>和<FONT face="Times New Roman">SI</FONT>存入的是有符号数,<FONT face="Times New Roman">DX,DI</FONT>存放的是无符号数,请用比较指令和条件转移指令实现以下判断:</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(1)</FONT>       </FONT><FONT size=3>若(<FONT face="Times New Roman">DX</FONT>)<FONT face="Times New Roman">&gt;(DI) </FONT>,转到<FONT face="Times New Roman">ABOVE </FONT>执行</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(2)</FONT>       </FONT><FONT size=3>若(<FONT face="Times New Roman">AX</FONT>)<FONT face="Times New Roman">&gt;(SI),   </FONT>转到<FONT face="Times New Roman">GREATER</FONT>执行</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(3)</FONT>       </FONT><FONT size=3>若(<FONT face="Times New Roman">CX</FONT>)<FONT face="Times New Roman">=0</FONT>,转到<FONT face="Times New Roman">ZERO</FONT>执行</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(4)</FONT>       </FONT><FONT size=3>若(<FONT face="Times New Roman">AX</FONT>)<FONT face="Times New Roman">-(SI) </FONT>,产生溢出,转到<FONT face="Times New Roman">OVERFLOW</FONT>执行</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(5)</FONT>       </FONT><FONT size=3>若(<FONT face="Times New Roman">SI</FONT>)<FONT face="Times New Roman">&lt;=(AX)</FONT>,转到<FONT face="Times New Roman">LESS_EQ</FONT>执行</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(6)</FONT>       </FONT><FONT size=3>若(<FONT face="Times New Roman">DI</FONT>)<FONT face="Times New Roman">&lt;=(DX)</FONT>,转到<FONT face="Times New Roman">BELOW_EQ</FONT>执行</FONT></P>

<P ><FONT size=3>一、已知(<FONT face="Times New Roman">AX</FONT>)<FONT face="Times New Roman">=<st1:chmetcnv w:st="on" TCSC="0" NumberType="1" Negative="False" HasSpace="False" SourceValue="75" UnitName="a">75A</st1:chmetcnv>4H,CF=1 ,</FONT>分别写出下列指令执行后的结果。</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(1)</FONT>       <FONT size=3>ADD AX,08FFH</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(2)</FONT>       <FONT size=3>INC AX</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(3)</FONT>       <FONT size=3>SUB AX,4455H</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(4)</FONT>       <FONT size=3>AND AX,0FFFH</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(5)</FONT>       <FONT size=3>OR AX,0101H</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(6)</FONT>       <FONT size=3>SAR AX, 1</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(7)</FONT>       <FONT size=3>ROR AX , 1</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(8)</FONT>       <FONT size=3>ADC AX, 5</FONT></FONT></P>
<P ><FONT size=3>二、已知(<FONT face="Times New Roman">AX</FONT>)<FONT face="Times New Roman">=2040h,(DX)=380h,</FONT>端口(<FONT face="Times New Roman">PORT</FONT>)=(<FONT face="Times New Roman">80H</FONT>)=<FONT face="Times New Roman">1FH</FONT>,(<FONT face="Times New Roman">PORT+1</FONT>)<FONT face="Times New Roman">=45H,</FONT>指出执行下列指令后,结果是什么?</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(1)</FONT>       <FONT size=3>OUT  <st1:place w:st="on"><st1:City w:st="on">DX</st1:City>,<st1:State w:st="on">AL</st1:State></st1:place></FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(2)</FONT>       <FONT size=3>OUT DX,AX</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(3)</FONT>       <FONT size=3>IN <st1:State w:st="on"><st1:place w:st="on">AL</st1:place></st1:State>,PORT</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(4)</FONT>       <FONT size=3>IN AL,80H</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(5)</FONT>       <FONT size=3>OUT PORT+1,<st1:State w:st="on"><st1:place w:st="on">AL</st1:place></st1:State></FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>(6)</FONT>       <FONT size=3>IN AL,PORT+1</FONT></FONT></P>
<P ><FONT size=3>三、改正下列程序的错误:</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>1、</FONT>  </FONT><FONT size=3>下面是将内存一字节数据高<FONT face="Times New Roman">4</FONT>位和低<FONT face="Times New Roman">4</FONT>位互换并放回原位置的程序<FONT face="Times New Roman"> </FONT>,找出错误并改正。</FONT></P>
<P ><FONT face="Times New Roman" size=3>DATA  SEGMENT</FONT></P>
<P ><FONT face="Times New Roman" size=3>DD1 DB 23H</FONT></P>
<P ><FONT face="Times New Roman" size=3>DATA   ENDS</FONT></P>
<P ><FONT face="Times New Roman" size=3>CODE  SEGMENT</FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">        ASSUME CS:CODE ,DS:DATA</FONT></FONT></P>
<P ><FONT face="Times New Roman" size=3>START:</FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">        MOV AX,DATA</FONT></FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">        MOV DS,AX</FONT></FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">        LEA SI ,OFFSET DD1</FONT></FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">        MOV AL,[SI]</FONT></FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">                MOV CL,4</FONT></FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">                RCR AL,CL</FONT></FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">                MOV [SI],AL</FONT></FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">                MOV AH,4CH</FONT></FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">                INT 21H</FONT></FONT></P>
<P ><FONT face="Times New Roman" size=3>CODE ENDS</FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">      END START</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>2、</FONT>  </FONT><FONT size=3>下列的程序是将内存单元一字节数据乘以<FONT face="Times New Roman">10</FONT>放回单元的程序,找出错误并改正。</FONT></P>
<P ><FONT face="Times New Roman" size=3>DATA      SEGMENT</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>             DA    DW   34</FONT></FONT></P>
<P ><FONT face="Times New Roman" size=3>DATA      ENDS</FONT></P>
<P ><FONT face="Times New Roman" size=3>CODE     SEGMENT</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>           ASSUME CS:CODE,DS:DATA</FONT></FONT></P>
<P ><FONT face="Times New Roman" size=3>START:    MOV AX,DATA</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>              MOV SI,OFFSET DA</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>               MOV AL,[SI]</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>               MUL 10</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>               MOV [SI],AX</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>               MOV AH,4CH</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>               INT 21H</FONT></FONT></P>
<P ><FONT face="Times New Roman" size=3>CODE     ENDS</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>               END START</FONT></FONT></P>
<P ><FONT size=3>四、程序分析:</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>1、</FONT>  </FONT><FONT size=3>执行完程序后,回答指定的问题</FONT></P>
<P ><FONT face="Times New Roman" size=3>MOV AX,0</FONT></P>
<P ><FONT face="Times New Roman" size=3>MOV BX,2</FONT></P>
<P ><FONT face="Times New Roman" size=3>MOV CX,50</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>   LP: ADD AX,BX</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>              ADD BX,2</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3><st1:place w:st="on">LOOP</st1:place> LP</FONT></FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">   </FONT>问:(<FONT face="Times New Roman">1</FONT>)该程序的功能是:</FONT></P>
<P ><FONT size=3>(<FONT face="Times New Roman">2</FONT>)程序执行完成后,(<FONT face="Times New Roman">AX</FONT>)<FONT face="Times New Roman">=</FONT>?</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>2、</FONT>  </FONT><FONT size=3>执行完程序后,回答指定的问题。</FONT></P>
<P ><FONT face="Times New Roman" size=3>BLOCK DB 20H,1FH,08H,81H,0FFH……</FONT></P>
<P ><FONT face="Times New Roman" size=3>RESULT DB ?</FONT></P>
<P ><FONT face="Times New Roman" size=3>START:  LEA SI ,BLOCK</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>              MOV CH,0</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>               MOV CL,[SI]</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>               DEC CX</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>               INC SI</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>               MOV SL,[SI]</FONT></FONT></P>
<P ><FONT face="Times New Roman" size=3>LOP1:      CMP AL,[SI+1]</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>               JLE NEXT</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>               MOV AL,[SI+1]</FONT></FONT></P>
<P ><FONT face="Times New Roman" size=3>NEXT :    INC SI</FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>               <st1:place w:st="on">LOOP</st1:place>  LOP1</FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>               MOV RESULT ,<st1:State w:st="on"><st1:place w:st="on">AL</st1:place></st1:State></FONT></FONT></P>
<P ><FONT face="Times New Roman"><FONT size=3>               HLT</FONT></FONT></P>
<P ><FONT size=3>问:(<FONT face="Times New Roman">1</FONT>)该程序的功能是:</FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">                     </FONT>(<FONT face="Times New Roman">2</FONT>)该程序的循环次数是:</FONT></P>
<P ><p><FONT face="Times New Roman" size=3> </FONT></p></P>
<P ><FONT size=3>五、已知从<FONT face="Times New Roman">DS:2200H,ES:3200H</FONT>单元起分别存放<FONT face="Times New Roman">20</FONT>个<FONT face="Times New Roman">ASCII</FONT>的字符,找出两个字符串中第一个不同字符位置(段内偏地址),并放入<FONT face="Times New Roman">DS:<st1:chmetcnv w:st="on" TCSC="0" NumberType="1" Negative="False" HasSpace="False" SourceValue="22" UnitName="a">22A</st1:chmetcnv>0H</FONT>开始的连续两个单元中。请设计完成此任务的程序段。</FONT></P>
<P ><FONT size=3>六、试编程实现将键盘输入的小写字母用大写字母显示出来</FONT></P>

wufengcxp 发表于 2008-1-28 12:20

1.X*Y+Z-540-V

ccddh 发表于 2008-3-19 10:42

[V-(X*Y+Z-540)]/X

zkkpkk 发表于 2008-3-26 09:11

我不喜欢全大写的指令

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.