Set on less than (signed) : Sets $t1 = 1 if $t2 < $t3 (signed comparison), otherwise $t1 = 0. Useful for conditional logic without branches. Pair with 'bne $t1,$zero,label' or 'beq $t1,$zero,label' to branch on the result.
slt
Operands
$reg, $reg, $regVariants
- Set on less than (signed) : Sets $t1 = 1 if $t2 < $t3 (signed comparison), otherwise $t1 = 0. Useful for conditional logic without branches. Pair with 'bne $t1,$zero,label' or 'beq $t1,$zero,label' to branch on the result. slt $t1,$t2,$t3
# Compare signed and unsigned bit patterns: $t0 is -1 (0xFFFFFFFF), $t1 is 1. Inspect $t2: 1.
li $t0, -1
li $t1, 1
slt $t2, $t0, $t1