I have this issue using assembly MIPS.
From the keyboard I read an integer and the range must be 1..20
li $v0,5
syscall
move $t2,$v0 # value read
blez $t2,err1 # if $t2 <0 go to error1 function
bgt $t2,20,err1 # if $t2 >20 go to error1 function
I want to add a default integer value and if the user clicks the Enter key (.byte 0x0d 0x0a ) the program should continue. How can I do this?
E.g.
Insert in position 6 [return confirm/overwrite old]: <1,2,3..20>
Thanks!
Do a dummy program which reads a number just like you did then it prints out what it has just read. Run it, press enter and you know what to look for. 🙂