I am currently writing some stuff in MIPS-Assembler and I have some trouble: I wrote this function:
PRINT_FLOAT:
addi $sp, $sp, -4 #stackpointer um ein wort weiterrücken
sw $ra, 0($sp) #rücksprungadresse auf stack speichern
la $a0, strFloat
add $a1, $s0, $zero
jal printf
lw $ra, 0($sp) #rücksprungadresse aus stack holen
addi $sp, $sp, 4 #stackpointer um ein wort zurückrücken
jr $ra
if I run this program the instruction add $a1, $s0, $zero is skipped and I don't know why...
Another funny thing, if I debug this program with GDB:
main:
addi $t0, $zero, 3
addi $t0, $zero, 3
addi $t0, $zero, 3
jal READ_FLOAT
jal PRINT_FLOAT
and set a breakpoint at main, the breakpoint is set at the third "addi $t0, $zero, 3" What happens here?
addistatements, since they all do the same thing making two of them superfluous. - Konrad Lindenbach