ARM Technical Support Knowledge Articles

DEFAULT STARTUP AND INITIALIZATION CODE

Applies to: C51 C Compiler

Answer


Information in this article applies to:


QUESTION

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?

ANSWER

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.

SEE ALSO

Article last edited on: 2000-10-26 00:00:00

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential