I am trying to write a MIPS program that takes a user entered float value in degrees Fahrenheit and convert it to degrees Celsius. However, I'm having a difficult time finding the user entered float.
My code up to the float read:
.data
getDegreesF: .asciiz "Please enter the degrees in Fahrenheit: "
degreesF: .asciiz " degrees Fahrenheit is "
degreesC: .asciiz " degrees Celsius."
.text
.globl main
addi $sp, $sp, -8
sw $s0, 0($sp)
sw $s1, 84($sp)
main:
la $a0, getDegreesF #load getDegreeF sting
li $v0, 4 #syscall to print string
syscall
li $v0, 6 #syscall to read float
syscall
li $v0, 10 #syscall to exit program
syscall
My understanding is that, once the float is read, it is stored in $f0. I want to place it in $s0, but I keep getting a syntax error. What am I doing wrong?
Thanks.