wenbin02015130 发表于 2005-6-10 12:11

紧急:几道期末考试复习题不会,请指教

<P ><FONT size=3>紧急<FONT face="Times New Roman">:</FONT>小弟有几道简单的汇编程序向各位请教<FONT face="Times New Roman">,</FONT>帮帮忙吧<FONT face="Times New Roman"> </FONT></FONT></P>
<P ><FONT size=3>一<FONT face="Times New Roman"> </FONT>已知,从内部<FONT face="Times New Roman">RAM BLOCK</FONT>单元开始存放有一组带符号数,数的个数存放在<FONT face="Times New Roman">LEN</FONT>单元。请编写可以统计其中正数和负数个数并分别存入<FONT face="Times New Roman">NUM</FONT>和<FONT face="Times New Roman">NUM+1</FONT>单元的程序</FONT></P>
<P ><FONT size=3>二设一自变量<FONT face="Times New Roman">X</FONT>为一无符号数,存放在内部<FONT face="Times New Roman">RAM</FONT>的<FONT face="Times New Roman">VAX</FONT>单元,函数<FONT face="Times New Roman">Y</FONT>存放在<FONT face="Times New Roman">FUNC</FONT>单元,请编写满足如下关系的程序</FONT></P>
<P ><FONT face="Times New Roman" size=3>  </FONT></P>
<P ><FONT size=3><FONT face="Times New Roman">            X      X&gt;=50</FONT></FONT></P>
<P ><FONT face="Times New Roman">Y=</FONT>{<FONT face="Times New Roman">    5X   <FONT size=3> 50&gt;X&gt;=20</FONT></FONT></P>
<P ><FONT face="Times New Roman" size=3>2X     X&lt;20</FONT><FONT face="Times New Roman">     </FONT><v:shapetype><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path connecttype="rect" gradientshapeok="t" extrusionok="f"></v:path><lock aspectratio="t" v:ext="edit"></lock></v:shapetype><v:shape><v:imagedata><FONT face="Times New Roman"></FONT></v:imagedata></v:shape><p></p></P>
<P ><FONT size=3>三<FONT face="Times New Roman"> </FONT>从外部<FONT face="Times New Roman">RAM</FONT>的<FONT face="Times New Roman">SOUCE(</FONT>二进制八位<FONT face="Times New Roman">)</FONT>开始有一数据块,该数据块以$结尾<FONT face="Times New Roman">. </FONT>请编写程序<FONT face="Times New Roman">.</FONT>把它们传送到以内部<FONT face="Times New Roman">RAM</FONT>的<FONT face="Times New Roman">DIST</FONT>为起始地址的区域<FONT face="Times New Roman">(</FONT>$字符也要传送<FONT face="Times New Roman">)</FONT></FONT></P>
<P ><FONT size=3>四<FONT face="Times New Roman"> </FONT>外部<FONT face="Times New Roman">RAM</FONT>从<FONT face="Times New Roman">2000H</FONT>到<FONT face="Times New Roman">2100H</FONT>有一数据块<FONT face="Times New Roman">. </FONT>请编写将它们传送到从<FONT face="Times New Roman">3000H</FONT>到<FONT face="Times New Roman">3100H</FONT>区域的程序</FONT></P>
<P ><FONT size=3>五<FONT face="Times New Roman"> </FONT>设晶振频率为<FONT face="Times New Roman">6MHZ, </FONT>请编写能延时<FONT face="Times New Roman">20ms</FONT>的子程序</FONT></P>

wufengcxp 发表于 2008-1-28 14:03

mov ax,offset ramblock
      mov cx, len
      dec,ax
again:inc,ax
      cmp[ax],0
      jg,next1
      jl,next2
next1: inc,di
      jmp,why
next2:inc,si
why:loop,again
     mov num,di
     mov num+1,si

页: [1]

编程论坛