判断下列程序是否有错误,如有,请修改: integer i; always @ (inp or cnt) begin result[7:4]=0; result[3:0]=inp; if(cnt==1) begin for(i=4;i<=7;i++) begin result [i] = result [i-4]; end result[3:0]=0; end end

判断下列程序是否有错误,如有,请修改: integer i; always @ (inp or cnt) begin result[7:4]=0; result[3:0]=inp; if(cnt==1) begin for(i=4;i<=7;i++) begin result [i] = result [i-4]; end result[3:0]=0; end end


参考答案和解析
12. MOV DPTP , 1050H 不能将直接地址 1050H 送入DPTR ,DPTR 只能接收立即数。 13. MOV R1 , C 位寻址方式中的源操作数和目的操作数均应为位地址, R1 是字节寄存器,这样书写是不对的。 14. JMP @RO 十 DPTR 变址寻址中的变址寄存器只可使用 A 与 DPTR 相加的形式完成。 15. 寄存器 RO 与相对转移地址写反了。 16. 交换指令只能在寄存器、寄存器与直接地址、间接地址之间进行数据交换,不能与立即数进行数据交换。

相关考题:

设有以下程度段: begin a:=0; for i:=7 downto 2 do case I of 1,2:a:=a1; 3,4:a:=a2; 5,6:; 7,8:a:=a3 end; writeln(‘a=‘,a:1) end. 若变量均已说明,则程序运行后的输出是( )。 Aa=8B12Ca=6D0

有程序段 for i:=1 to 10 do begin j:=i mod 4; case j of 0:x:‘a‘; 1:x:=‘b‘; 2:x:=‘c‘; 3:x:=‘d‘ end; end; for i:=1 to 10 do write(x:1); writeln; 输出应为( )。 AbcdabcdabcBabcdabcdabCcdabcdabcdDdabcdabcda

关于JAVA初级的代码计算问题 下面的方法,当输入为2的时候返回值是多少?()publicintgetValue(inti){intresult=0;switch(i){case1:result=result+i;case2:result=result+i*2;case3:result=result+i*3;}returnresult;}

下面程序的运行结果是 include int fun(int a[ ] ,int n) { int result=1; for(in 下面程序的运行结果是#include<iostream.h>int fun(int a[ ] ,int n){int result=1;for(int i=1;i<n;i++)result=result * a[i] ;retum result;}void main( ){int a[3] ={3,4,5};coutA.12B.15C.20D.60

下面程序段的输出结果是( )。 public class Test { public static void main ( String[] args) { int result=0; for ( int i=1;i<=5;i++) { if ( i%2==0 ) continue; result + =i; } System. out. println ("result is " + result ); } }A.result is 7B.result is 8C.result is 9D.result is 10

阅读下列程序,并写程序运行结果【】。include void main() { for(int i=0;i 阅读下列程序,并写程序运行结果【 】。include<iomanip. h>void main() {for(int i=0;i<4;i++)cout<<end1<<setfill(' ')<<setw(4-i)<< '0'<<setfill('*')<<setw(i+i)<<(i>0?' O' : ' ' );}

下面程序的运行结果是()。includeintfun(inta[],int n){int result=1;for(int i=“i 下面程序的运行结果是( )。 #include<iostream.h> intfun(inta[],int n) { int result=1; for(int i=“i<n;i++) result’resultxa[i]; return result; } void main() { inta[3]={3,4,5}; cout<<fun(a,3)<<endl; }A.12B.15C.20D.60

假定a=3,下列程序的运行结果是()。ineludeint fun(int n);void main(){cout 假定a=3,下列程序的运行结果是( )。 #inelude<iostream.h> int fun(int n); void main() { cout<<"Please input a number:"; int a,result=0; cin>>a; result=fun(a); tout<<result<<end1; } intfun(int n) { int p=1,result=0; for(int i=1;i<=n;i++) { p*=i; result+=p; } return result; )A.4B.8C.9D.20

阅读以下说明及C++程序代码,将应填入(n)处的语句写在对应栏内。【说明】本程序的功能是实现任意两个大整数的乘法运算,例如:输入整数1:8934793850094505800243958034985058输入整数2:234584950989689084095803583095820923二者之积:209596817742739508050978890737675662366433464256830959194834854876 8534【C++代码】include<iostream.h>const int MAXINPUTBIT=100;const int MAXRESULTBIT=500;class LargeNumber{int i,j;int temp;int one[MAXINPUTBIT+1];int onebit; //one的位数int two[MAXINPUTBIT+1];int twobit; //two的位数int result[MAXRESULTBIT+1];public:LargeNumber();~LargeNumber();int inputone(); //出错返叫0,否则返回1int inputtwo(); //同上void multiplication(); //乘void clearresult(); //清零void showresult(); //显示};LargeNumber∷LargeNumber(){for(i=0;i<=MAXINPUTBIT;i++){one[i]=0;two[i]=0;}nebit=0;twobit=0;inputone();inputtwo();}LargeNumber∷~LargeNumber(){}int LargeNumber∷inputone(){char Number[MAXINPUTBIT+1];cout<<"Please enter one:";cin>>Number;i=0;j=MAXINPUTBIT;while(Number[i]!='\0')i++;nebit=i;for(i--;i>=0;i--,j--){if(int(Number[i])>=48int(Number[i])<=57)(1); //由字符转换为数字elsereturn 0;}return 1;}int LargeNumber∷inputtwo(){char Number[MAXINPUTBIT+1];cout<<"Please enter two:";cin>>Number;i=0;j=MAXINPUTBIT;while(Number[i]!='\0')i++;twobit=i;for(i--;i>=0;i--,j--){if(int(Number[i])>=48int(Number[i])<=57)two[j]=int(Number[i]-48); //由字符转换为数字elsereturn 0;}return 1;}void LargeNumber∷multiplication() //乘法{clearresult();int m;for(i=MAXINPUTBIT;i>=0;i--){temp=two[i];for(j=(2),m=MAXINPUTBIT;m>=0;m--,j--){result[j]+=temp*one[m];if(result[j]>9){result[j-1]+=result[j]/10;(3);}}&n

在窗体上画一个名称为CoilTlilandl的命令按钮,然后编写如下事件过程: Private Sub command1 Click() Dim m As Integer, i As Integer, x(3)As Integer For i=0 To 3:x(i)=i:Next i For i = 1 To 2: Call sub1(x,i):Next i For i = 0 To 3: Print x(i);: Next i End Sub Private Sub sub1(a()As Integer,k As Integer) Dim i As Integer Do a(k)=a(k)+a(k+1) j = j + 1 Loop While j < 2 End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是A.0 3 7 5B.0 1 2 3C.3 2 4 5D.0 5 8 3

请编制程序,其功能为:已知斐波那契(Fibonacci)数0,1,1,2,3,5,8,13……这些数的关系是:从第三项开始,每项都是它前面两项之和。若用ai表示第i项,则有a1=0、a2=1、 ai=ai-1+ai-2(i≥3)。试求出第24个斐波那契数,存放在RESULT开始的内存单元中。部分程序已经给出,其中原始数据由LOAD过程从文件INPUT1.DAT中读入从SOURCE开始的内存单元,运算结果要求从RESULT开始存放,由SAVE过程保存到OUTPUT1.DAT文件中。请在BEGIN和END之间补充使其完整,完成要求的功能。或删除BEGIN和END之间原有的代码并自行编程来完成要求的功能。对程序必须进行汇编,并与IO.OBJ链接产生PROG1.EXE执行文件,最终产生运行结果。部分程序如下:; PROG1.ASMEXTRN LOAD:FAR, SAVE:FARN EQU 1DSEG SEGMENTSOURCE DW N DUP (?)RESULT DW N DUP (0)NAME0 DB 'INPUT1.DAT',0NAME1 DB 'OUTPUT1.DAT',0DSEG ENDSSSEG SEGMENT STACKDB 128 DUP (?)SSEG ENDSCSEG SEGMENTASSUME CS:CSEG, DS:DSEG;SS:SSEGSTART PROC FARPUSH DSXOR AX,AXPUSH AXMOV AX,DSEGMOV DS,AXLEA DX, SOURCELEA SI,NAME0MOV CX,NCALL LOAD; *** BEGIN ***MOV AX,______MOV BX, 1_____________L1: _______________________________________MOV [RESULT],BX; *** END ***LEA DX,RESULTLEA SI,NAME1MOV CX,NCALL SAVERETSTART ENDPCSEG ENDSEND START

单击一次命令按钮之后,下更程序代码的执行结果为______ 。 Public Sub Proc(a() As Integer) Static i As Integer Do a(i) = a(i) + a(i + 1) i=i+1 Loop While i < 2 End Sub Private Sub Command1_Cliek() Dim m As Integer Dim i As Integer Dim x(10) As Integer For i = 0 To 4 x(i) = i + 1 Next i For i = 1 To 2 Call Proc (x) Next i For i = 0 To 4 Print x(i); Next i End SubA.3 4 7 5 6B.3 5 7 4 5C.1 2 3 4 5D.1 2 3 5 7

窗体中有命令按钮Commandl和文本框Text1,事件过程如下: Function result (By x As Integer)As Boolean If x Mod 2=0 Then result=True else result=False End if End Function PrivateSub Commandl_Click( ) x=Val(InputBox(”请输入一个整数”)) If __________Then Text1=Str(x)”是偶数.” Else Text1=Str(x)”是奇数.” End If End Sub 运行程序,单击命令按钮,输入19,在Text1中会显示“19是奇数”。那么以上程序的空白处应填写( )。A.result(x)=“偶数”B.result(x)C.result(x)=“奇数”D.NOT result(x)

下面程序的运行结果是( )。 #includeiostream.h intfun(inta[],intn) { intresult=1; for(inti=1;i(n;i++) result=result*a[i]; returnresult; } voidmain( ) { inta[3]={3,4,5); coHtfun(a,3)endl; }A.12B.15C.20D.60

下面程序的输出为【】。include void main(){int a[10],i, k=0;for(i=0,i 下面程序的输出为【 】。include <iostream.h>void main(){int a[10],i, k=0;for(i=0,i<10;i++)a[i]=i;for(i=1;i<4;i++)k+=a[i]+i;cout<<k<<end1;}

单击一次命令按钮后,下列程序的执行结果为Private Sub Command1_Click()Dim m As Integer,I As Integer,x(10) As IntegerFor I=0 To 4:x(I)=I+1:Next IFor I=1 TO 2:Call Prioc(x):Next IFor I=0 TO 3:Print x(I);:Next IEnd SubPrivate Sub Prioc(a()As Integer)Static I As IntegerDoa(I)=a(I)+a(I+1)I=I+1Loop While I<2End SubA.3 4 7 5B.3 5 7 4C.1 2 3 4D.1 2 3 5

若有以下窗体单击事件过程:Private SubForm_Click( ) result=1 For i=1To 6 Step 3 result=result*i Next i MsgBoxresult End Sub打开窗体运行后,单击窗体,则消息框的输出内容是( )。A.1B.4C.15D.120

下面程序的运行结果是includeint fun(inta[],int n){ int result=1; for(int i=1:i 下面程序的运行结果是 #include<iostream.h> int fun(inta[],int n) { int result=1; for(int i=1:i<n;i++) result=result*a[i]; remm result; } void main() { int a[3]={3,4,5}; cout <<fun(a,3) <<end1; }A.12B.15C.20D.60

( 17 )下列程序的输出结果是public class Test{public static void main(String[] args){int [] array={2,4,6,8,10};int size=6;int result=-1;try{for{int i=0;isize result==-1;i++}if(array[i]==20) result=i;}catch(ArithmeticException e){System.out.println( " Catch---1 " );catch(ArrayIndexOutOfBoundsException e){System.out.println( " Catch---2 " );catch(Exception e){System.out.println( " Catch---3 " );}}A ) Catch---1B ) Catch---2C ) Catch---3D )以上都不对

int i = 0, j = 5;  tp;   for (;;) {  i++;  for(;;) {  if (i --j) {  break tp;  break tp;  }  }  System.out.println(“i=” +i “,j =”+j); } What is the result?()  A、 i = 1, j = 0B、 i = 1, j = 4C、 i = 3, j = 4D、 i = 3, j = 0E、 Compilation fails.

for (int i =0; i  4; i +=2) {  System.out.print(i + “”);  }  System.out.println(i);  What is the result?()  A、 0 2 4B、 0 2 4 5C、 0 1 2 3 4D、 Compilation fails.E、 An exception is thrown at runtime.

int i = 0;  while (true) { if(i==4) {  break;  }  ++i;  }  System.out.println(“i=”+i);  What is the result?()  A、 i = 0B、 i = 3C、 i = 4D、 i = 5E、 Compilation fails.

public class ForBar {   public static void main(String args) {   int i = 0, j = 5;   tp: for (;;) {   i ++;   for(;;)   if(i  --j) break tp;   }   system.out.printIn(“i = ” + i + “, j = “+ j);   }   }   What is the result? () A、 The program runs and prints “i=1, j=0”B、 The program runs and prints “i=1, j=4”C、 The program runs and prints “i=3, j=4”D、 The program runs and prints “i=3, j=0”E、 An error at line 4 causes compilation to fail.F、 An error at line 7 causes compilation to fail.

单选题int i = 0;  while (true) { if(i==4) {  break;  }  ++i;  }  System.out.println(“i=”+i);  What is the result?()A i = 0B i = 3C i = 4D i = 5E Compilation fails.

单选题What is the result()?A  The program runs and prints “ I = 1 , j = 0”B  The program runs and prints “ I = 1 , j = 4”C  The program runs and prints “ I = 3 , j = 4”D  The program runs and prints “ I = 3 , j = 0”E  An error at line 4 cause compilation to fail.F  An error at line 7 cause compilation to fail.

单选题for (int i =0; i  4; i +=2) {  System.out.print(i + “”);  }  System.out.println(i);  What is the result?()A 0 2 4B 0 2 4 5C 0 1 2 3 4D Compilation fails.E An exception is thrown at runtime.

单选题class Computation extends Thread {  private int num;  private boolean isComplete;  private int result;  public Computation(int num) { this.num = num; }  public synchronized void run() {  result = num * 2;  isComplete = true;  notify();  }  public synchronized int getResult() {  while (!isComplete) {  try {  wait();  } catch (InterruptedException e) { }  }  return result;  }  public static void main(String[] args) {  Computation[] computations = new Computation [4];  for (int i = 0; i  computations.length; i++) {  computations[i] = new Computation(i);  computations[i] .start();  }  for (Computation c : computations)  System.out.print(c.getResult() +“ “);  }  }  What is the result?()A The code will deadlock.B The code may run with no output.C An exception is thrown at runtime.D The code may run with output “0 6”.E The code may run with output “2 0 6 4‟.F The code may ruin with output “0 2 4 6”.

多选题int i = 0, j = 5;  tp;   for (;;) {  i++;  for(;;) {  if (i --j) {  break tp;  break tp;  }  }  System.out.println(“i=” +i “,j =”+j); } What is the result?()Ai = 1, j = 0Bi = 1, j = 4Ci = 3, j = 4Di = 3, j = 0ECompilation fails.