Possible Duplicate:
Compile time initialized array error
I am trying to load data from a compiled time initialized array. But when I try to load the data, I get "Memory OUt of bound error". Here is the code:
.data
array: .space 'A','B','C','D','E','F','G','H','I'
.text
main:
.
.
.
la $t0,array
# $t1 is intialized to 0 and then incremented in code later for next loading
add $s4,$t1,$t0
lb $a0,0($s4) # Here is error "Memory out of bound"
li $v0,4
syscall
How can I solve this issue? I am using QTSpim
Regards
.space
reserves empty space, without data in it. You should use: