Handling non-digit user input to a MARS read-integer system call?
问题 I'm doing a simple program of car park that takes the input from the user, and branch to a label in accordance of the input. The problem is, the program always ends abruptly if the user enter an input with different data type than integer (like "a" or any alphabets) Below is my code (that relevant to the input part) : li $v0,5 #system call to get input from user syscall li $t1,2 beq $v0,1,park # go to "park" section of codes if input is 1 beq $v0,2,exit # go to "exit" section of codes if