C51: DEFAULT STARTUP AND INITIALIZATION CODE
Information in this article applies to:
I've compiled and linked my 8051 program. I noticed that there is some startup code and variable initialization code that's included in my program. Where did it come from?
The startup code is stored in the STARTUP.A51 file (found in the \C51\LIB directory).
The initialization code is stored in the INIT.A51 file (also found in the \C51\LIB directory).
These 2 files are executed before your main C function. Immediately after RESET, STARTUP is executed. STARTUP calls INIT which initializes your programs global variables. INIT then calls the main C function.
These 2 files are assembled and included in the Keil C library. If you do not copy and modify the STARTUP and INIT files and include them in your project, the linker automatically includes the default ones from the library.
The following Discussion Forum threads may provide information related to this topic.
Last Reviewed: Thursday, October 26, 2000
of your data.