SH-4 Stack Frame Layout

The following illustration shows the stack frame layout.

The following list provides more information about the stack frame layout:

  • The Register Save Area holds the preserved values of any permanent registers used by the function. It also contains the function's return address.

  • The Locals and Temporaries area represents the stack space allocated for local variables and compiler-generated temporaries.

  • An alloca() locals area is dynamically allocated during function execution by the use of the alloca() intrinsic function. Compiler-generated code may also dynamically allocate space to manage the construction of outgoing arguments.

  • The Outgoing Arguments area must be large enough to hold all the arguments passed when calling another function, including all arguments passed in registers. For information on how argument registers are mapped to the argument build area, see SH-4 Parameter Passing. This area may be dynamically allocated or extended prior to a call if the rules for alloca() are observed.

    The Outgoing Arguments area must be at least four words in size. This area is available for the called function to use for any purpose.

See Also

SH-4 Calling Sequence Specification | SH-4 Registers | SH-4 Parameter Passing | SH-4 Return Values | SH-4 Prolog and Epilog | SH-4 pdata Format | SH-4 Assembler Macros

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.