EasyManuals Logo
Home>Texas Instruments>Computer Hardware>TMS34010

Texas Instruments TMS34010 Reference Guide

Texas Instruments TMS34010
181 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #71 background imageLoading...
Page #71 background image
Runtime
Environment
-
System
Initialization
5.8
System
Initialization
Before you
can
run a C program, the C runtime environment must be created.
This task
is
performed by the C
boot
routine, which
is
a function called
e-intOO. The
boot.
obj
module,
which
is
a member
of
the
rts
.lib
library,
contains the e-intOO routine. (The source for the boot module
is
boot.
c
in
the
rts.
src
library.)
The e-intOO routine
can
be called by reset hardware
to
begin running the
system. The
boot.
obj
module must
be
combined
with
the C object modules
at link time; this occurs by default when you use the -c or -cr linker options
and include
rts
.lib
as
one
of
the linker input files. When C programs
are
linked, the linker sets the entry point value
in
the executable output module
to
the symbol
-c-intOO;
this symbol points to the beginning
of
the e-intOO
routine.
The e-intOO function performs the
following
tasks in order
to
initialize the C
envi ron ment:
1)
Reserves
space
in
the .bss section
for
the program stack and the system
stack and sets up the initial stack and frame pointers.
2)
Autoinitializes global variables by copying the data from the initialization
tables
in
.cinit to the storage allocated for the variables in .bss. (Note
that
in
the RAM initialization model, a loader performs this step before
the program runs - it
is
not
performed by the
boot
routine.)
3)
Calls the function
main
to
begin running the C program.
You can replace or modify the boot routine
to
meet your system requirements.
However, the boot routine must perform the three operations listed above in
order
to
correctly initialize the C environment.
5.8.1
Initializing
the
Stack
5-22
C code
uses
two
stacks
to
manage the runtim6 environment:
The
system
stack
is
used
to
save the status
of
a calling function or
of
an
interrupted function. The system stack starts at the highest address
in the stack space and grows toward lower addresses.
The
SP
register
is
a dedicated register that points to the system stack.
The TMS34010 instruction set supports several instructions for manip-
ulating the system stack, including:
MMTM
(save registers)
MMFM
(restore registers)
CALLA or CALL
(call a function)
RETS
or
RETI
(return from a function or interrupt)
The
program
stack
is used for local frame generation during a function
call;
it
is
used for passing arguments
to
functions and for allocating local
(temporary) variables for a called function. The program stack
is
con-
trolled entirely through software. The TMS34010 does
not
dedicate a
register
to
point
to
the program stack; however, the C compiler
uses
re-
gister A
14
(STK)
as
the program-stack pointer.

Table of Contents

Other manuals for Texas Instruments TMS34010

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS34010 and is the answer not in the manual?

Texas Instruments TMS34010 Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS34010
CategoryComputer Hardware
LanguageEnglish

Related product manuals