# Registers

Registers all begin with a dollar-symbol ($). The floating point registers are named $f0, $f1, ..., $f31. The general-purpose registers have both names and numbers, and are listed below. When programming in MIPS assembly, it is usually best to use the register names.

<table><thead><tr><th width="126.33333333333331">Number</th><th width="146">Name</th><th>Comments</th></tr></thead><tbody><tr><td>$0</td><td>$zero, $r0</td><td>Always zero</td></tr><tr><td>$1</td><td>$at</td><td>Reserved for assembler</td></tr><tr><td>$2, $3</td><td>$v0, $v1</td><td>First and second return values, respectively</td></tr><tr><td>$4, ..., $7</td><td>$a0, ..., $a3</td><td>First four arguments to functions</td></tr><tr><td>$8, ..., $15</td><td>$t0, ..., $t7</td><td>Temporary registers</td></tr><tr><td>$16, ..., $23</td><td>$s0, ..., $s7</td><td>Saved registers</td></tr><tr><td>$24, $25</td><td>$t8, $t9</td><td>More temporary registers</td></tr><tr><td>$26, $27</td><td>$k0, $k1</td><td>Reserved for kernel (operating system)</td></tr><tr><td>$28</td><td>$gp</td><td>Global pointer</td></tr><tr><td>$29</td><td>$sp</td><td>Stack pointer</td></tr><tr><td>$30</td><td>$fp</td><td>Frame pointer</td></tr><tr><td>$31</td><td>$ra</td><td>Return address</td></tr></tbody></table>

In addition to the general purpose registers, the MIPS32 architecture also includes a number of special purpose registers, which are used to control the operation of the processor and to store certain types of data. These include the **program counter (PC) and** the **status register (SR).**

## Resources

{% embed url="<https://www.mips.com/products/architectures/mips32-2/>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.ctfrecipes.com/pwn/architectures/mips32/registers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
