|ARM Technical Support Knowledge Articles|
Applies to: C51 C Compiler
Information in this article applies to:
How does the compiler handle variables that are initialized when declared? If I write something like the following in a function:
static int temp = 1;
or initialize a global variable, how will the variable be initialized? I do not see anything in the STARTUP.A51 file to move initialized data from ROM to RAM.
The initial values of global and static variables are stored in ROM in a segment called ?C_INITSEG. They are then copied to the relevent RAM locations after the code in STARTUP.A51 has been executed and before the main() function is called. The code that performs the variable initialization may be found in the file INIT.A51 inside the LIB folder.
We strongly recommend that you do not modify the INIT.A51 file.
Article last edited on: 2005-07-15 12:12:58
Did you find this article helpful? Yes No
How can we improve this article?