By convention, many MIPS registers have special purpose uses. To help clarify this, SPIM defines aliases for each register that represent its purpose. The following table lists these aliases and the commonly accepted uses for the registers.
Register | Number | Usage |
zero | 0 | Constant 0 |
at | 1 | Reserved for assembler |
v0 | 2 | Used for return values from function calls. |
v1 | 3 | |
a0 | 4 | Used to pass arguments to procedures and functions. |
a1 | 5 | |
a2 | 6 | |
a3 | 7 | |
t0 | 8 | Temporary (Caller-saved, need not be saved by called procedure) |
t1 | 9 | |
t2 | 10 | |
t3 | 11 | |
t4 | 12 | |
t5 | 13 | |
t6 | 14 | |
t7 | 15 | |
s0 | 16 | Saved temporary (Callee-saved, called procedure must save and restore) |
s1 | 17 | |
s2 | 18 | |
s3 | 19 | |
s4 | 20 | |
s5 | 21 | |
s6 | 22 | |
s7 | 23 | |
t8 | 24 | Temporary (Caller-saved, need not be saved by called procedure) |
t9 | 25 | |
k0 | 26 | Reserved for OS kernel |
k1 | 27 | |
gp | 28 | Pointer to global area |
sp | 29 | Stack pointer |
fp | 30 | Frame pointer |
ra | 31 | Return address for function calls. |
No comments:
Post a Comment