# `movn`

[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/movn

**Move if not zero**

Category: Data movement

Copies the second register into the first if the third is not zero, without a branch.

## Forms

- `movn $t1, $t2, $t3`

## 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`.
- `$t3`: A general-purpose register. It may be the same register as `$t1`.

## Description

Allows branchless conditional assignment — avoids a branch instruction when you only need to update a register conditionally.

## Example

```mips
# Set condition to make movn copy its source. Inspect $t2: 7.
li $t1, 7
li $t0, 1
movn $t2, $t1, $t0
```
