I'm a noob using SPIM MIPS simulator.
I get the error in title X 26 times, when I try to initialize an array of 26 words to 0. I've isolated the problem to be the store word operation sw $t0, 0($s3)
, but have no clue what am I doing wrong.
The code:
.data
theArray: .space 104
theArraySz: .word 26
.text
.globl main
main:
move $t0, $zero
la $s3, theArray
lw $s4, theArraySz
add $t2, $zero
initLoop:
beq $t2, $s4, initEnd
sw $t0, 0($s3)
addi $s3, $s3, 4
addi $t2, $t2, 1
j initLoop
initEnd:
jr $ra