我需要打印 num1 和 num2 之间的奇数,到目前为止我想出的代码会打印所有数字。我一直在努力让它只打印奇数。
addi $v0, $zero, 4
la $a0, str.displaynum
syscall
add $s0,$zero, $t0 #starting number / loop counter
loop:
addi $v0, $zero, 1
add $a0, $zero, $s0
syscall
addi $a0,$zero,','
addi $v0,$zero, 11
syscall
addi $s0,$s0,1 #add one to loop count
ble $s0, $t1, loop #end loop if number is equal to end number