Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write a MIPS assembly language program to find the sum of the N words of data in

ID: 3746216 • Letter: W

Question

write a MIPS assembly language program to find the sum of the N words of data in the memory data segment with the label “Chico”. Store the result sum in the next memory location beyond the end of the array Write a MIPS assembly language program to find the sum of the N words of data in the memory data segment with the label "chico. Store the result sum in the next memory location beyond the end of the array "chico." all the data and N (10EN>-5) are randomly input by the user. Suppose t2 points to the starting address of "chico The following is the pseudo code: # Pseudocode description of algorithm: # main: #cout

Explanation / Answer

1) .space

2)

la         $a0, chico       # Load address pointer  

lw        $t2, 0($a0)      # $t2 = Mem(a0)

3)

while (t0 > 0)() -----------> assembly instruction as follows

mem[t2] = t1 ------------------

lw        $t1, 0($t2)      # mem(t2) = t1

t2 = t2 +4 -------------------------->

addi     $t2, $t2, 4      # Inc. address pointer