SDKZSPF LSI, SDKZSPF Datasheet - Page 66

no-image

SDKZSPF

Manufacturer Part Number
SDKZSPF
Description
Manufacturer
LSI
Datasheet

Specifications of SDKZSPF

Lead Free Status / Rohs Status
Supplier Unconfirmed
3.2.6 Example Code for Function Prologue and Epilogue
3.2.6.1 sdcc/zdxcc
3-12
Table 3.7
bar, after foo calls bar.
Table 3.7
Note that within the body of a function, the stack pointer points to the
beginning of the next stack frame. When a function is called, the compiler
places arguments into registers, if possible, and puts the remaining
arguments in the outgoing arguments of the caller’s stack frame. The
compiler places any required arguments on the stack from lower to
higher addresses. Thus the first argument placed on the stack is the one
closest to the callee’s stack frame. The function call is made after all the
arguments have been properly placed.
The following is a sample prologue that saves r0-r3, r7-r9, and %rpc
and reserves 30 words of space on the stack. Note that with optimization,
this code is reordered with non-prologue code for better scheduling by
sdopt.
C Cross Compiler
Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved.
high address
low address
shows the two example stack frames for the functions foo and
Stack Frame Example
Callee saved registers of foo
locals/temps of foo
max args of all functions called by foo
callee saved registers of bar
locals/temps of bar
max args of all functions called by bar
memory location pointed to by r12/a7
(stack pointer)
foo’s stack frame
bar’s stack frame
not part of any
stack frame