Advanced User Information
© PHYTEC Meßtechnik GmbH 2002 L-462e_2
77
5.2
STARTUP.A51
The code within the assembly file Startup.a51 initializes the target
hardware for your C project. This includes setting of the system stack,
initialization of variables and clearing of memory areas.
The Startup.a51 routines always start at code memory address
0x0000. This is where the reset vector with the jump instruction to the
actual Startup.a51 initialization functions is located. Following a
hardware or software reset, the microcontroller starts execution at
address 0x0000 and then jumps to the start-up routines location
configured by the reset vector. After performing the initialization
steps, your individual main() function is called by the startup code.
To configure the start-up code to fit the needs of your application,
copy it from the Lib folder of the Keil tool chain to your project
folder. You can then edit, modify and compile it using the Keil
macroassembler.
You must explicitly instruct the linker to take into account your start-
up object file. If not, the start-up code in the default runtime libraries
will be used. To do this, we recommend adding your modified
Startup.a51 file to your project. Ensure that this file is always
included in the Link/Lib process of your project (see options within
the Project window of the Keil tool chain).
We recommend that you add Startup.a51 or Startup.obj (depending
on the kind of file you want to add to the project) within the project
tree.