I'm writing a small program in assembly (MIPS) where I have to read 11 floats and store them in an array:
.include "../../ac1_macros.h"
.eqv size, 11
.data
array: .float 0:size
str1: .asciiz "Insert 11 numbers: "
.text
.globl main
main: la $t0, array
print_str(str1)
li $t1, 1
fill_array:
sll $t0, $t0, 2
read_float()
s.s $f0, ($t0)
addi $t1, $t1, 1
bne $t1, 11, fill_array
jr $ra
I get the following exception when inserting the first number.
Runtime exception at 0x0040004c: address out of range 0x40040000
What am I doing wrong? Has it something to do with the directive align that I am not using? Thanks in advance.