You are not connected. Please login or register

MIPs Registers

Go down  Message [Page 1 of 1]

1 MIPs Registers on Wed Jul 07, 2010 3:34 pm

So just go to this site and there is a nice list of all the mips registers.

This is geefive's guide to registers. Link to original page under this.

geefive wrote:
MIPS32 has 32 General Purpose Registers, 32 Floating Point Registers and
various special purpose registers. This post attempts to explain each of
these registers and a general overview of their purpose.

What are Registers?
Registers could be compared to containers. Personally, I like to think of them as post office boxes. Registers, like post office boxes hold information. In the case of the General Purpose Registers, these boxes hold only integer values. The Floating Point Registers are special boxes. They are numbered only in pairs. They are only referred to by the even part of their number, even though they are numbered 0 through 31. So consider these two post office boxes that have only one door and one key. It is still two boxes, it is just accessed through one door. Floating Point Registers hold Floating Point values (1.23) instead of integer values (1,2,3).

General Purpose Registers (GPR)


0   $zero
1   $at   
2   $v0   
3   $v1   
4   $a0
5   $a1
6   $a2
7   $a3
8   $t0
9   $t1
10   $t2
11   $t3
12   $t4
13   $t5
14   $t6
15   $t7
16   $s0
17   $s1
18   $s2
19   $s3
20   $s4
21   $s5
22   $s6
23   $s7
24   $t8
25   $t9
26   $k0
27   $k1
28   $gp
29   $sp
30   $fp
31   $ra

$zero ($0)
Always has the value 0.

Reserved for the assembler

Used for expression evaluations and to hold integer results of function calls. Also used to pass a static link when calling nested procedures.

$a0-$a3 (Actual)
Used to pass the first 4 words of integer type actual arguments. The values of these registers are preserved across function calls.

$t0-$t9 (Temporary)
Temporary registers used for expression evaluation. The values of these registers are not preserved across function calls.

$s0-$s7 (Saved)
Saved Registers. The value of these registers must be manually saved across function calls.

$k0-$k1 (Kernel)
Reserved for the Operating System kernel.

$gp (Global)
Contains the Global Pointer.

$sp (Stack)
Contains the Stack Pointer.

$fp (Frame)
Contains the Frame Pointer.

$ra (Return Address)
Contains the Return address from an expression evaluation or the next
instruction to execute after a branch or jump and link operation.

Special Purpose Registers
Program Counter (PC)
The Program Counter is a special register that holds the address of the
current instruction in memory to process. Whatever instruction that is
at the memory location specified in the Program Counter is the instruction
that the processor will execute next.

Instruction Register (IR)
The Instruction Register is a 32-bit register that holds a copy of the last
fetched instruction. Consider it a buffer of sorts to hold the next instruction
while executing that instruction.

Integer Multiplication Registers (HI, LO)
The HI and LO registers hold the result of multiplication and division operations (MULT, MULTU, DIV, DIVU).
HI holds either the most significant 32 bits of a multiply or the remainder of a divide.
LO holds either the least significant 32 bits of a multiply or the quotient of a divide.

Floating Point Registers
The FPU has 16 floating point registers numbered in pairs. Each register holds either a single-precision (32-bit) value or a double-precision (64-bit) value. When a double precision value is held, the first register holds the least significant half and the following register holds the most significant half.

$f0-$f2 (FP Result)
Used to hold floating-point function results. $f0 has the real part, $f2 has the imaginary.

$f4-$f10 (FP Temporary)
Temporary Registers used to evaluate expressions. The values are not preserved across function calls.

$f12-$f14 (FP Actual)
Used to pass the first two single or double precision actual arguments. The values are not preserved across function calls.

$f16-$f18 (FP Temporary)
Temporary Registers used to evaluate expressions. The values are not preserved across function calls.

$f20-$f30 (FP Saved)
Saved Registers whose values must be manually preserved across function calls.


View user profile

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum


Forum create on Forumotion | © PunBB | Free forum support | Contact | Report an abuse |