It is known that the variables i and k correspond to the registers $ s0 and $ s2, and the initial value of i is 0, save is a word array, and the first address is stored in the register $ s3. Which of the following program blocks implement the following C language program blocks?while (save[i]==k)i+=1;
选项:
A:loop: sll $t1,$s0,2 add $t1,$t1,$s3 lw $t0,0($t1) bne $t0,$s2,exit addi $s0,$s0,1 j loop exit:;
B:loop: add $t1,$s0,$s3 lw $t0,0($t1) bne $t0,$s2,exit addi $s0,$s0,1 j loop exit:;
C:loop: add $t1,$s0,$s3 lw $t0,0($t1) bne $t0,$s2,exit addi $s0,$s0,4 j loop exit:;
D:loop: sll $t1,$s0,2 add $t1,$t1,$s3 lw $t0,0($t1) bne $t0,$s2,exit addi $s0,$s0,1 j loop exit:
发布时间:2024-05-06 16:28:09