Table 4-3 Volatile and nonvolatile registers
Type | Register | Preserved by a routine call? | Notes |
General- purpose register | GPR0 | No | |
| GPR1 | See next column | Used as the stack pointer to store parameters and other temporary data items. |
|
General- purpose register | GPR2 | See next column | Used as the base register to access the direct data area. GPR2 is preserved by direct calls; for indirect calls the caller must restore the value after the call. |
| GPR3 | See next column | Holds the return value or the address of the return value in function calls. For routine calls that do not return a value, GPR3 is used to pass parameter values. |
| GPR4-GPR10 | No | Used to pass parameter values in routine calls. |
| GPR11-GPR12 | No | |
| GPR13-GPR31 | Yes | |
Floating- point register | FPR0 | No | |
| FPR1-FPR13 | No | Used to pass floating- point parameters in routine calls. |
| FPR14-FPR31 | Yes | |
Link Register | LR | No | Stores the return address of the calling routine during a routine call. |
Count Register | CTR | No | |
|
Fixed-point exception register | XER | No | |
Condition Registers | CR0-CR1 | No | |
| CR2-CR4 | Yes | |
| CR5-CR7 | No | |