next up previous contents index
Next: 3.13 Inline Assembler Code Up: 3 Using SDCC Previous: 3.11 Functions using private   Contents   Index


3.12 Startup Code

The compiler inserts a call to the C routine _sdcc_external_startup() at the start of the CODE area. This routine is in the runtime library. By default this routine returns 0, if this routine returns a non-zero value, the static & global variable initialization will be skipped and the function main will be invoked. Otherwise static & global variables will be initialized before the function main is invoked. You could add a _sdcc_external_startup() routine to your program to override the default if you need to setup hardware or perform some other critical operation prior to static & global variable initialization. See also the compiler option --no-xinit-opt.



Bernhard Held 2003-08-29