.data array: .word 2,3,8,1 length: .word 4 minimum: .word 0 # minimum value storage location .text # This program should store the lowest integer in the array into location "minimum". main: la $a0, array # a0 contains the first address of the array lw $a1,length # a1 contains the length of the array lw $t1, minimum # t1 contains the current minimum beqz $a1,end # skip if 0-length array # Loop to find the minimum element loop: lw $t0, 0($a0) # load array[index] bge $t0, $t1, continue # skip if value >= existing_low move $t1, $t0 # remember the new low value continue: add $a0, $a0, 1 # update the array index for the next element bnez $a1, loop # continue if there are more elements in the array end: jr $ra # return