SH-3 Registers

The SH-3 has 16 general-purpose registers. The following table shows the roles that the calling convention assigns to the registers.

Register Description
R0 Return Value, Temporary Register

Used as a temporary register when expanding assembly language pseudo-instructions. Also used as an implicit source or destination in byte and 16-bit operations. Finally, it holds the return value on return from a function.

R1-R3 Temporary Registers
R4-R7 Arguments - Temporary Registers

Registers R4 through R7 hold the first four words of incoming arguments. The calling function constructs remaining arguments in the argument build area that provides space into which R4 through R7 may spill.

R8-R13 Permanent Registers
R14 Frame Pointer, Permanent Register

Recommended frame pointer. Any other permanent register may serve as the frame pointer, and leaf routines may even use a temporary register as the frame pointer. A frame pointer is needed to access frame data in functions that use the alloca() intrinsic. A function may also establish a frame pointer for more efficient access to frame data in larger stack frames. If function does not establish a frame pointer, or if the function uses another register as the frame pointer, R14 is available for other purposes.

R15 Stack Pointer, Permanent Register

See Also

SH-3 Calling Sequence Specification | SH-3 Stack Frame Layout | SH-3 Parameter Passing | SH-3 Return Values | SH-3 Prolog and Epilog | SH-3 Assembler Macros | SH-3 pdata Format

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.