i have this program where the user inputs an integer and the program simply just prints it. another function of this program is that it is supposed to ask if the user wants to repeat the program and input another number.
so the user should input 'y' if they want to continue and 'n' if not.
.data
repeat: .asciiz "\n Repeat [y/n]? "
store: .byte ' '
.text
.globl main
main: # Main function
li $v0, 5
syscall
move $a0, $v0
li $v0, 1
syscall
li $v0, 4
la $a0, repeat
syscall
li $v0, 12
syscall
la $s0, store
sb $v0, store
syscall
beq $v0, 'y', main
beq $v0, 'Y', main
li $v0, 10
syscall
using this source code, the program can read and print the integer that i input,
but the problem here is that whenever I input 'y' or 'n' and enter, the program prompts that there's an error.
is the problem on the beq instructions? or is it on the part where it reads the character?
i'm just new to programming MIPS and there are still parts that confuse me.
can anyone point out where i'm doing it wrong?
syscallaftersb $v0, store? You should probably remove that.