Question: The MIPS assembly program given here is expected to find the sum of elements in array myArr. Even though the code is syntactically correct, there

 The MIPS assembly program given here is expected to find the

The MIPS assembly program given here is expected to find the sum of elements in array "myArr". Even though the code is syntactically correct, there are four bugs because of which the program is not giving the required output. With the help of the line numbers given identify the bug. Write the line number where you find the bug and give how the correct statement to eliminate the corresponding logical error. (avn -tial Arrant - 1 data 2 myArr: .word 4,3,6,12,24,3,7,15 3 sum:. word o 4 .text 5 main: 6 li $t1,5 7 li $t3,0 8 9 loop1: 10 sw $a 1, myArr($t3) 11 add $t4, $t4,$a1 12 sub $t1,$t1,1 13 addi $t3,$t3,4 14 bltz $t1, loop1 15 jal Disp 16 jal Exit 17 Disp: 18 li $v0,1 19 move $a 2, $t4 20 syscall 21 jr $ra 22 Exit: 23 li $v0, 10 24 syscall

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!