
Memory Usage
Motorola
About g56k
4-11
3. Return address — which is pushed on the DSP’s system stack high (ssh) register.
This is the return address to the calling subroutine. The return address is
not
saved
for subroutines that have been determined to be a leaf. A leaf subroutine is one that
makes no subroutine calls.
4. Local data space. The location of C variables that have a lifetime that extends only
as long as the subroutine is active and that could
not
be explicitly promoted to
register storage class by the optimizer.
Note:
The frame pointer (r0) points to the first element in the local data space
.
5. Register spill and compiler temporary space. This area is utilized by the compiler to
store intermediate results and preserve registers.
Note:
The Stack Pointer (r6) points to the next available data memory location.
Figure 4-3. Activation Record
Each subroutine called puts a new copy of the subroutine activation record in the run-time
stack and returning from the subroutine removes the activation record. The run-time stack
is described in Figure 4-4, “Default Data Memory Configuration,” on page 4-12. The
variables shown in the bottom of the “X or Y memory option selected” memory are
controlled by the crt0 file. For example, the
F_ _fp_shift
variable is typically 23 words but
can be changed by the user or may vary with later releases of this compiler. When the L
memory option is selected, the heap, run-time stack, global/static data and data that is
more than 24 bits in length will occupy one word in L memory i.e., 48-bit memory. 16-bit
param N
param 1
param 2
old frame pointer
(1 word)
return address (
ssh
)
(1 word)
local data
register spill/temp area
Stack Pointer
R6
Frame Pointer
R0
Higher Memory
Lower Memory
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.