I'm writing a program to convert temperature from F to C in MIPS but the compiler returns 0. It works when I do it with integers, any ideas on what could be wrong?
Code Section
.text
main:
# Print msg
la $4, input_msg
li $2, PRINT_STR
syscall
# Prompt user for input
li $2, READ_INT
syscall
move $t0, $2 #load f from memory
sub $t0, $t0, 32 # f -32
mul $t0, $t0, 5 #(f-32)*5
div $t0, $t0, 9 #((f-32)*5)/9
mtc1 $t0, $t1
move $4, $t1
li $2, 2
syscall
li $4, 0
li $2, 17
syscall
The output should be the Celsius temperature in float but it returns 0.