mtc0
Move to coprocessor 0
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 0MIPS assembly
Forms
mtc0 ,
Operands
$t1- Any general-purpose register,
$0to$31, using its numeric or named spelling, such as$8or$t0($zerois$0;$rais$31). $8- A coprocessor 0 register, written by number:
$8(vaddr),$12(status),$13(cause) or$14(epc).
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.
# Write 0x1234 to CP0 vaddr register 8. Inspect CP0 $8: 0x1234.
li $t0, 0x1234
mtc0 $t0, $8