# `mtc0`

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

**Move to coprocessor 0**

Category: System

Writes the value of the first register, a general-purpose register, into the second, a Coprocessor 0 (CP0) control register.

Used in: [Exceptions and coprocessor 0](https://asm-editor.specy.app/learn/courses/mips/talking-to-the-outside-world/exceptions-and-coprocessor-0.md) (MIPS assembly)

## Forms

- `mtc0 $t1, $8`

## 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`).
- `$8`: A coprocessor 0 register, written by number: `$8` (`vaddr`), `$12` (`status`), `$13` (`cause`) or `$14` (`epc`).

## Description

Used by exception handlers to modify the Status register or the EPC, and to set the timer: writing Compare (11) turns the timer on and clears its pending interrupt, and writing Count (9) sets the count. Cause's interrupt-pending bits belong to the interrupt sources and keep their value.

## Example

```mips
# Write 0x1234 to CP0 vaddr register 8. Inspect CP0 $8: 0x1234.
li $t0, 0x1234
mtc0 $t0, $8
```
