I need to loop through a fixed length array, and while looping find the lowest value and print it. Initially have:
.text
main:
li $s0,0
lw $t4,l
lw $s2,TABLE
FOR_LOOP:
bge $s0,$t4,END_FOR # define loop boundary
lw $t1,($s2)
addi $s2, $s2,4
addi $s0,$s0,1
j FOR_LOOP
END_FOR:
addi $s0, $s0, -1
addi $s2, $s2,-4
PRINT:
li $s0,0
la $s2,TABLE
li $v0,10
syscall
.data
TABLE: .word 1 2 3
l: .word 3
The problem is that I am not even able to print the values of the TABLE yet, let alone looping...any ideas how to accomplish this?