So, recent I have been taking assembly classes and one of them gave me an assignment. I coded everything except the last part... I just have to add the numbers in a given array and print the sum... easy right? No, i have an error when i run it says that line 12 is out of range for some reason =/
So, here is my code:
.data
array: .word 1,2
size: .word 2
la $s0, array
lw $s1, size
li $t9, 0
.text
loop:
lw $a0, ($s0)
add $a0, $a0, $a0
addi $s0, $s0, 4
add $t9, $t9, 1
blt $t9, $s1, loop
li $v0, 1
syscall
lw $a0, ($s0)? What exactly is the error message? And what do you see when you run this in a debugger and look at register values?