# `slti`

[MIPS Documentation](https://asm-editor.specy.app/documentation/mips.md) › [Instructions](https://asm-editor.specy.app/documentation/mips/instruction.md)

Web page: https://asm-editor.specy.app/documentation/mips/instruction/slti

**Set on less than immediate (signed)**

Category: Comparison

Sets the first register to 1 if the second is less than an immediate as signed integers, otherwise to 0.

Used in: [Comparing two numbers](https://asm-editor.specy.app/learn/courses/mips/introduction/comparing-two-numbers.md) (MIPS assembly)

## Forms

- `slti $t1, $t2, imm16`

## Operands

- `$t1`: Any general-purpose register, `$0` to `$31`, using its numeric or named spelling, such as `$8` or `$t0` (`$zero` is `$0`; `$ra` is `$31`).
- `$t2`: A general-purpose register. It may be the same register as `$t1`.
- `imm16`: A signed 16-bit immediate, `-32768` to `32767`.

## Description

Convenient for loop bounds and range checking without a separate load instruction.

## Example

```mips
# Signed comparison: -1 is less than 1. Inspect $t2: 1.
li $t0, -1
slti $t2, $t0, 1
```
