was wondering what instruction i would need to do to make sure the integers inputted from the user using PCspim would make sure only numbers 1-15 can be entered and if not display an error message?
i have read the instructions such as SLT but i dont quite understand the definition - ""If $s is less than $t, $d is set to one. It gets zero otherwise."" i dont want to print zero....
is there a way to efficiently do a greater than 1 but less than 15?
i would do
beq $t0, 1, add_num #if content in $t0 = 1, branch to add numbers
beq $t0, 2, add_num
beq $t0, 3, add_num
beq $t0, 4, add_num
beq $t0, 5, add_num etc...right up to 15. but this is soo inefficient
MIPS processors don't have traditional condition codes. Conditional tests instead set the contents of a register to 1 or 0, as you indicated. You can then test the result register using a beq against the zero register.