So I'm making something that looks like this
for(i=0; i<10; i++){
print i;
}
but in MIPS, and i'm having trouble understanding how i'm supposed to increment the index location. Here is what I have so far
.data
a:
.word 3, 2, 1, 8, 6, 9, 3, 4, 2, 5
nline:
.asciiz "\n"
.text
.globl main
main:
li $v0, 0
loop1:
bgt $t0, 10, exit
addi $t0, $t0, 1 #counter
lw $t1, a
li $v0, 1
move $a0, $t1
syscall
exit:
li $v0, 10
syscall
so I wouldn't want to put lw $t1, a inside the loop, but the idea is that with every iteration of the loop it would print 3, 4, 1, 8 and I know that would be a, a+4, a+8, a+12, ect, but I don't understand how to code that without there being a thousand functions.