Warum habe ich diesen Fehler:MIPS Holadresse nicht auf Wortgrenze ausgerichtet
ine 101: Runtime exception at 0x00400138: fetch address not aligned on word boundary 0x10010005
Hier ist der Code:
.data
array: .word 3.1, 3.2, 20.0
.text
la $s1, array
li $t0, 0
li $s5, 1
li $t1,0
sortloop: slti $s0, $t0, 3 #Checking if the counter is less than 20
beq $s0, $zero, exitout #if it's greater or equal to 20 exit the loop
sll $t4, $t0, 2 # i*4
add $t4, $t4, $s1 # adding the base register to $t4
l.s $f11, 0($t4) # loading from memory the element of the array that holds a float value
add $s5, $s5, $t0
innloop: slti $s0, $s5, 3 #Checking if the counter is less than 20
beq $s0, $zero, exitinn #if it's greater or equal to 20 exit the loop
sll $t1, $s5, 2 # i*4
add $t1, $t1, $s1 # adding the base register to $t7
l.s $f19, 0($t1) //this is line 101
c.le.s $f19, $f11
bc1f, addcounter
add.s $f20, $f14, $f19
l.s $f11, 0($t1)
l.s $f20, 0($t4)
add $s1, $s1,1
j innloop
addcounter:
add $s1, $s1,1
j innloop
exitinn:
add $t0, $t0,1
j sortloop
exitout:
'add $ s1, $ s1,1' sieht verdächtig aus. – Michael