Each general purpose register holds a 32 bit pattern.
In assembly language, these registers are named $0 , $1 , $2 , ... , $31 .
There are 32 floating point registers named $f0 , $f1 , $f2 , ... , $f31 .
By convention (and sometimes by hardware) different registers are used for different purposes.
|
|
Register Number |
Mnemonic Name |
Conventional Use |
$0 |
$zero |
Hardwired constant 0 |
$1 |
$at |
Reserved for assembler |
$2- $3 |
$v0-$v1 |
Return results from functions |
$4- $7 |
$a0-$a3 |
Used for subroutine arguments |
$8-$15 |
$t0-$t7 |
“Temporary,” not saved across a call |
$16-$23 |
$s0-$s7 |
“Saved,” saved across a call |
$24-$25 |
$t8-$t9 |
More temporary |
$26-$27 |
$k0-$k1 |
“Kernel”—reserved for OS use |
$28 |
$gp |
Pointer to global data area |
$29 |
$sp |
Stack pointer |
$30 |
$fp |
Frame pointer |
$31 |
$ra |
Return address of subroutine |
|