Question: This is a high level, C programming language for loop that is accessing all the 1 0 0 elements of an integer array named A:
This is a high level, C programming language for loop that is accessing all the elements of an integer array named A:
fori ; i ; i
sumAi;
This is a low level MIPS assembly language program that works similarly to the for loop that is accessing all the elements of the integer array named A:
and $t $t $zero
addi $t $zero,
LOOP: lw $t$s
add $t $t $t
addi $s $s
addi $t $t
bne $t $t LOOP
Given these facts, please answer the following questions.
a Which register is being used to store the equivalent of the for loop's i variable? points
b List the assembly language instruction or instructions that correspond to the high level language part of the for loop that states
i ;
points
c List the assembly language instruction or instructions that correspond to the high level language part of the for loop that states
i
points
d Assume the register $s contains the base address of the array A List the assembly language instructions that correspond to the high level language statement
sumAi;
points
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
