SLT MIPS: Set If Less Than Instruction

Slt is a MIPS Assembly instruction stand for “Set If Less Than”. Slt in MIPS is used for a specific condition like if one value is less than another value then set the value of a particular register. It can be used with both register or can be used with an immediate value(Slti). 

slt Mips pic example

  • The general form of SLT is: slt $t0, $f1, $f2

$t0 is the register of which value will be set to 1 if $f1 is less than $f2, else it will be zero.

  • The general form of SLTI is: slti $t0, $f1, 5

$t0 register will be set to 1 if the value in $f1 is greater than 5, else it will remain zero.

To get the better understanding of slt instruction(opcode) in Mips try the below program on your computer.



In the above example program of slt we have initialized two registers $t1 and $t2 with values and then we applied the instruction of slt. As $t1 is less than $t2, one will be stored in $t0. Then we applied the condition to check the value in $t0 as it is greater than zero so control will be moved downward and addition will be performed.

Nauman Rehmat

Nauman Rehmat is the owner of Assembly Language Tuts.He is interested in Programming and SEO. He is also pursuing a degree in Computer Software Engineering from Comsats.