# MIPS Registers

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

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

The general purpose registers, the FPU and coprocessor 0.

24 entries, each with its own page of markdown:

- [The register files](https://asm-editor.specy.app/documentation/mips/registers/general-registers.md): The MIPS architecture has 32 general-purpose registers, $HI and $LO registers for multiplication and division, and two coprocessors with registers of their…
- [`$zero`](https://asm-editor.specy.app/documentation/mips/registers/register-0.md) `$0`: Always contains the value 0.
- [`$at`](https://asm-editor.specy.app/documentation/mips/registers/register-1.md) `$1`: Assembly temporary, reserved for assembler internal use.
- [`$v0 - $v1`](https://asm-editor.specy.app/documentation/mips/registers/register-2-3.md) `$2 - $3`: Used to return non-floating point values from a subroutine.
- [`$a0 - $a3`](https://asm-editor.specy.app/documentation/mips/registers/register-4-7.md) `$4 - $7`: Arguments, used to pass the first four non-floating point arguments to a subroutine.
- [`$t0 - $t7`](https://asm-editor.specy.app/documentation/mips/registers/register-8-15.md) `$8 - $15`: Temporary registers, their values are not preserved across subroutine calls.
- [`$s0 - $s7`](https://asm-editor.specy.app/documentation/mips/registers/register-16-23.md) `$16 - $23`: Saved registers, subroutines must preserve their values across calls, either by not using them or by saving and restoring them on the stack.
- [`$t8 - $t9`](https://asm-editor.specy.app/documentation/mips/registers/register-24-25.md) `$24 - $25`: Additional temporary registers, same conventions as $t0-$t7.
- [`$k0 - $k1`](https://asm-editor.specy.app/documentation/mips/registers/register-26-27.md) `$26 - $27`: Reserved for OS/interrupt handler use.
- [`$gp`](https://asm-editor.specy.app/documentation/mips/registers/register-28.md) `$28`: Global pointer, used for two distinct purposes.
- [`$sp`](https://asm-editor.specy.app/documentation/mips/registers/register-29.md) `$29`: Stack pointer, points to the top of the stack.
- [`$fp`](https://asm-editor.specy.app/documentation/mips/registers/register-30.md) `$30`: Frame pointer, also known as $s8.
- [`$ra`](https://asm-editor.specy.app/documentation/mips/registers/register-31.md) `$31`: Return address, automatically written by jal with the address of the instruction following the call.
- [FPU (coprocessor 1)](https://asm-editor.specy.app/documentation/mips/registers/fpu.md): Floating point numbers live in a coprocessor with registers and instructions of its own: add.s adds two single precision values the way add adds two integers,…
- [`$f0 - $f31`](https://asm-editor.specy.app/documentation/mips/registers/register-fpu-f0-f31.md) `32 bits each`: The floating point registers.
- [`Double precision pairs`](https://asm-editor.specy.app/documentation/mips/registers/register-fpu-double-precision-pairs.md) `$f0, $f2, $f4 … $f30`: A double precision value is 64 bits, so it occupies a pair of registers: the even one holds the low word and the odd one above it holds the high word.
- [`Condition flags`](https://asm-editor.specy.app/documentation/mips/registers/register-fpu-condition-flags.md) `0 - 7`: A floating point comparison writes no register.
- [CP0 (coprocessor 0)](https://asm-editor.specy.app/documentation/mips/registers/cp0.md): Coprocessor 0 holds the state used for exceptions and interrupts: their cause, the saved program address, interrupt enables and the timer.
- [`$8 (vaddr)`](https://asm-editor.specy.app/documentation/mips/registers/register-cp0-8-vaddr.md): The memory address that caused an address-error exception, such as the address a lw or sw could not access.
- [`$9 (count)`](https://asm-editor.specy.app/documentation/mips/registers/register-cp0-9-count.md): The timer counter.
- [`$11 (compare)`](https://asm-editor.specy.app/documentation/mips/registers/register-cp0-11-compare.md): Set this ahead of Count, for example to Count + 1000.
- [`$12 (status)`](https://asm-editor.specy.app/documentation/mips/registers/register-cp0-12-status.md): The interrupt enable bits and source mask.
- [`$13 (cause)`](https://asm-editor.specy.app/documentation/mips/registers/register-cp0-13-cause.md): The exception code is in bits 2 to 6.
- [`$14 (epc)`](https://asm-editor.specy.app/documentation/mips/registers/register-cp0-14-epc.md): The return address used by eret.
