Question: .data word Ox44, 22, 33, 55 # array for which we will compute the sum asciiz hWkl .align 2 .word loop, then 1: .text globl

 .data word Ox44, 22, 33, 55 # array for which wewill compute the sum asciiz "hWkl" .align 2 .word loop, then 1:

.data word Ox44, 22, 33, 55 # array for which we will compute the sum asciiz "hWkl" .align 2 .word loop, then 1: .text globl main main: la $t0, Ll li $t1, 4 add $t2, $zero, $zero # initialize sum # initialize starting address # initialize loop count loop: lw $t3, O(St0) add St2, St2, St3 addi $t0, $t0, 4 addi St1, St1, -1 bne $ti, $zero, loop # load first element # update sum # point to next word # decrement count # check if done bgt St2, $0, then move $s0, $t2 j exit # if the sum >0, move sum to $s0 # else move sum to $s! then: move $s1, $t2 exit: li Sv0, 10 syscall .data word Ox44, 22, 33, 55 # array for which we will compute the sum asciiz "hWkl" .align 2 .word loop, then 1: .text globl main main: la $t0, Ll li $t1, 4 add $t2, $zero, $zero # initialize sum # initialize starting address # initialize loop count loop: lw $t3, O(St0) add St2, St2, St3 addi $t0, $t0, 4 addi St1, St1, -1 bne $ti, $zero, loop # load first element # update sum # point to next word # decrement count # check if done bgt St2, $0, then move $s0, $t2 j exit # if the sum >0, move sum to $s0 # else move sum to $s! then: move $s1, $t2 exit: li Sv0, 10 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!