# `mv`

[RISC-V Documentation](https://asm-editor.specy.app/documentation/risc-v.md) › [Instructions](https://asm-editor.specy.app/documentation/risc-v/instruction.md)

Web page: https://asm-editor.specy.app/documentation/risc-v/instruction/mv

**Move** · Pseudo-instruction

Category: Data movement

Copies the value of the second register into the first.

[RISC-V manual: add](https://docs.riscv.org/reference/isa/v20260120/unpriv/rv32.html#norm:add_op)

Used in: [The stack and sp](https://asm-editor.specy.app/learn/courses/risc-v/think-in-assembly/the-stack-and-sp.md) (RISC-V assembly), [jal, ret and the calling convention](https://asm-editor.specy.app/learn/courses/risc-v/think-in-assembly/jal-ret-and-the-calling-convention.md) (RISC-V assembly), [ecall](https://asm-editor.specy.app/learn/courses/risc-v/talking-to-the-outside-world/ecall.md) (RISC-V assembly), [Moving values around](https://asm-editor.specy.app/learn/courses/risc-v/examples/moving-values.md) (RISC-V assembly), [The bigger of two numbers](https://asm-editor.specy.app/learn/courses/risc-v/examples/if-else.md) (RISC-V assembly), [The largest element](https://asm-editor.specy.app/learn/courses/risc-v/examples/max-of-an-array.md) (RISC-V assembly), [Length of a string](https://asm-editor.specy.app/learn/courses/risc-v/examples/string-length.md) (RISC-V assembly), [Reverse a string in place](https://asm-editor.specy.app/learn/courses/risc-v/examples/reverse-a-string.md) (RISC-V assembly), [Even or odd, count the set bits, multiply by shifting](https://asm-editor.specy.app/learn/courses/risc-v/examples/bit-tricks.md) (RISC-V assembly), [A subroutine with its arguments in registers](https://asm-editor.specy.app/learn/courses/risc-v/examples/subroutine-with-register-arguments.md) (RISC-V assembly)

## Forms

- `mv t1, t2`
  - `mv t1,t2` → `add t1, zero, t2`

## Operands

- `t1`: Any integer register, `x0` to `x31`, or its named alias, such as `zero`, `t0` or `t6`.
- `t2`: An integer register. It may be the same register as `t1`.

## Example

```riscv
# mv copies a prepared value; t0=12 and t2 shows the result.
.text
li t0, 12
# t0=12; mv copies it, so t2 becomes 12.
mv t2, t0
```
