| Register conventions | ||||||||||||
| register conventions and mnemonics | ||||||||||||
| Number | Name | Use | ||||||||||
| 0 | $zero | hardwired 0 value | ||||||||||
| 1 | $at | used by assembler (pseudo-instructions) | ||||||||||
| 2-3 | $v0-1 | subroutine return value | ||||||||||
| 4-7 | $a0-3 | arguments: subroutine parameter value | ||||||||||
| 8-15 | $t0-7 | temp: can be used by subroutine without saving | ||||||||||
| 16-23 | $s0-7 | saved: must be saved and restored by subroutine | ||||||||||
| 24-25 | $t8-9 | temp | ||||||||||
| 26-27 | $k0-1 | kernel: interrupt/trap handler | ||||||||||
| 28 | $gp | global pointer (static or extern variables) | ||||||||||
| 29 | $sp | stack pointer | ||||||||||
| 30 | $fp | frame pointer | ||||||||||
| 31 | $ra | return address for subroutine | ||||||||||
| Hi, Lo | used in multiplication (provide 64 bits for result) | |||||||||||
| hidden registers | ||||||||||||
| PC, the program counter, which stores the current address of the instruction | ||||||||||||
| being executed | ||||||||||||
| IR, which stores the instruction being executed | ||||||||||||