Question: Problem 4 : ( 2 5 points ) Assume that the C - level integer i is held in register $ 1 1 , $s

Problem 4: (25 points) Assume that the C-level integer i is held in register $11, $s2 holds the C-level integer called result, and $s0 holds the base address of the integer MemArray.
(a) Translate the following loop into C.
(b) Assume MemArray holds 1,3,5,7,9,11,13,15,17,19. What is the value in variable result in the end assuming the result is initially zero?
addi $t1,$0,$0
LOOP
Iw $s1,0($s0)
add $s2, $s2, $s1
addi $s0, $s0,4
addi $t1, $t1,1
sti $ $ 2, $t1,10
bne $t2, $0, LOOP
Problem 4 : ( 2 5 points ) Assume that the C -

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 Programming Questions!