|ARM Technical Support Knowledge Articles|
Applies to: C51 C Compiler
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 C51LIB directory).
The initialization code is stored in the INIT.A51 file (also found in the C51LIB 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.
Article last edited on: 2000-10-26 00:00:00
Did you find this article helpful? Yes No
How can we improve this article?