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 Other wise 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.