I'm writing a program in MIPS using Spim and I want to convert temperatures to/from fahrenheit and celsius. For example:
Enter a number to convert: 100
Enter the Temperature: C
100 C is the same as 212 F
So I'm having trouble getting the program to recognize if the user input a "C" or an "F" and jump to the appropriate label. Here's the part of the code I'm having trouble with:
li $v0, 8 # Loads System service to read string
syscall
move $s1, $v0 # Move value to register to save for later use
beq $s1, 'C', Fahrenheit
beq $s1, 'F', Celsius
The program just passes by the 'beq' lines without doing anything. Any help would be much appreciated!