
System Initialization
6-32
6.8.1 Run-time Stack
The run-time stack is allocated in a single contiguous block of memory and
grows up from low addresses to higher addresses. Register AR1 usually
points to the next available word in the stack (top of the stack plus one word).
The compiler can use this word as a temporary memory location, so it must
be saved by interrupt routines.
The code does not check to see if the run-time stack overflows. Stack overflow
occurs when the stack grows beyond the limits of the memory space that was
allocated for it. Be sure to allocate adequate memory for the stack.
The stack size can be changed at link time by using the
−
stack linker option
on the linker command line and specifying the stack size as a constant directly
after the option.
6.8.2 Automatic Initialization of Variables
Some global variables must have initial values assigned to them before a C
program starts running. The process of retrieving these variables’ data and
intializing the variables with the data is called autoinitialization.
The compiler builds tables in a special section called .cinit that contains data
for initializing global and static variables. Each compiled module contains
these initialization tables. The linker combines them into a single table (a single
.cinit section). The boot routine or a loader uses this table to initialize all the
system variables.
Global variables are either autoinitialized at run time or at load time (see sec-
tions 6.8.4,
Autoinitialization of Variables at Run Time
, on page 6-34 and 6.8.5,
Initialization of Variables at Load Time
Содержание TMS320C2x
Страница 8: ...viii...
Страница 69: ...2 47 C Compiler Description...
Страница 159: ...6 36...
Страница 226: ...8 6...
Страница 250: ...Index Index 14 Z z shell option 2 2 2 4 2 14 overriding with c option 4 5 overriding with n option 2 13...