Memory Model
6-4
The linker takes the individual sections from different modules and combines
sections with the same name to create output sections. The complete program
is made up of these output sections, which include the assembler’s .data
section. You can place these output sections anywhere in the address space
as needed in order to meet system requirements.
The .text, .cinit, and .switch sections are usually linked into either ROM or
RAM, and must be in program memory (page 0). The .const section can also
be linked into either ROM or RAM but must be in data memory (page 1). The
.bss, .stack, and .sysmem sections should be linked into RAM, and must be
in data memory (page 1). The following table shows the type of memory and
page designation each section type requires:
Section
Type of Memory
Page
.text
ROM or RAM
0
.cinit
ROM or RAM
0
.switch
ROM or RAM
0
.const
ROM or RAM
1
.bss
RAM
1
.stack
RAM
1
.sysmem
RAM
1
For more information about allocating sections into memory, see the
TMS320C1x/C2x/C2xx/C5x Assembly Language Tools User’s Guide
.
6.1.2 C System Stack
The C compiler uses the software stack to:
-
Allocate local variables
-
Pass arguments to functions
-
Save the processor status
-
Save function return address
-
Save temporary results
-
Save registers
The run-time stack grows up from low addresses to higher addresses. The
compiler uses two auxiliary registers to manage this stack:
AR1
is the
stack pointer
(SP). It points to the current top of the stack
or
to the word that follows the current top of the stack.
AR0
is the
frame pointer
(FP). It points to the beginning of the current
frame. Each function invocation creates a new frame at the top
of the stack, from which local and temporary variables are
allocated.
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...