Question: Complete the corresponding assembly language fragments by selecting the correct instruction, register, or value: (Choices in bold) Consider the following fragment of C code: while

Complete the corresponding assembly language fragments by selecting the correct instruction, register, or value: (Choices in bold)

Consider the following fragment of C code:

while (A[ i ] == 0){

A[ i ] = A[ i ] + 10; i += 1;

}

Assume that variable i is assigned to $s0 and the base address for array A is in $s1. A is an array of words. Registers $t0 and $t1 are used for storing results temporarily.

Loop: sll $t0, $s0, (0 / 1 / 2 / 4 / 10)

add $t0, $t0, $s1

lw $t1, 0($s0 / $s1 / $t0 / $st1 / $zero)

bne $t1, $zero, (Loop / Exit)

addi $t1, ($s0 / $s1/ $t0 / $t1 / $zero) , 10

sw $t1, 0($t0)

addi ($s0 / $s1 / $t0 / $t1 / $zero) , $s0, 1 j Loop Exit:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!