Linking Boot code from RTS2800.lib
Linking Boot code from RTS2800.lib
Boot.ASM
Boot.ASM
-
-
Invoked With
Invoked With
“
“
-
-
C
C
”
”
Reset : PC <
Reset : PC <
-
-
*0x3F FFC0
*0x3F FFC0
_main ...
_main ...
1. Allocate stack
1. Allocate stack
2. Init SP to top of stack
2. Init SP to top of stack
3. Initialize status bits
3. Initialize status bits
4. Copy .
4. Copy .
cinit
cinit
to .bss (skip if “
to .bss (skip if “
-
-
cr”)
cr”)
5. Call “_main”
5. Call “_main”
_c_int00
_c_int00
.ref
.ref
_c_int00
_c_int00
Reset:
Reset:
.long
.long
_c_int00
_c_int00
vectors.
vectors.
asm
asm
The boot routine is used to establish the environment for C before launching main. The boot
routine begins with the label _c_int00 and the reset vector should contain a ".long" to this address
to make boot.asm the reset routine. The contents of the boot routine have been extracted and
copied on the following page so they may be inspected. Note the various functions performed by
the boot routine, including the allocation and setup of the stack, setting of various C-requisite
statuses, the initialization of global and static variables, and the call to main. Note that if the link
was performed using the "–cr" option instead of the "–c" option that the global/static variable
initialization is not performed. This is useful on RAM-based C28x systems that were initialized
during reset by some external host processor, making transfer of initialization values unnecessary.
Later on in this chapter, there is an example on how to do the vectors in C code rather than
assembly.
C28x – C Programming D - 3