Reputation: 11
Here is what I have
addi $s0, $0, 10
top: beq $s0, $0, end
addi $s0, $s0,-1
addi $v0,$0,1
addi $a0,$s0,0
syscall
j top
end:
The output is 9876543210 but I want the loop start from 10 to 0 109876543210
Upvotes: 0
Views: 3778
Reputation: 11
move your "counter" to subtract -1 after your syscall. This way you're subtracting your counter after you run the loop.
...........
syscall
addi $s0, $s0,-1
j top
Upvotes: 1