So this is what i have so far I am not sure where to go from here to branch off or just print out the answer. I tried to print out the message but to no avail. Is there a way to use both slt and branching?
.data
message1: .asciiz "The number is less than. :"
message2: .asciiz "/nThe number is greater than. :"
.text
main:
addi $t0, $zero, 20
addi $t1, $zero, 5
slt $s0, $t0, $t1
beq $s0, $zero, printmessage1
sge $s0, $t0, $t1
beq $s0, $zero, printmessage2
li $v0, 10
syscall
printmessage1:
li $v0 4 #print out message1
la $a0 message1
syscall
printmessage2:
li $v0 4 #print out message1
la $a0 message2
syscall
One solution that is very easier and reduce the use of instruction is to use
blt
orbgt