Keil Logo

C251: PURPOSE OF ?C?INITEDATA


Information in this article applies to:

  • C251 Version 2.14

QUESTION

What is the ?C?INITEDATA routine inside the ?C_C51STARTUP?2 segment for? It seems to be executed immediately before the jump to main.

ANSWER

The ?C?INITEDATA initializes global near variables (which are stored in edata). For example:

char near string[] = "this is a string in EDATA";

The routine copies the initial values from a table in code memory to the locations of the variables. The table is stored in a segment called ?C_INITEDATA and has the following format:

 Byte 0  Byte 1  Byte 2  Byte 3  Byte 4
+-------+-------+-------+-------+-------+
|Len MSB|Len LSB|Adr MSB|Adr LSB|Content|
+-------+-------+-------+-------+-------+
|                               +Rep Len+
+--- Repeated for each Object ----------+

You can set watchpoints on your global near variables in dScope, then step through the ?C?INITEDATA routine to view the variables being initialized one by one.

The ?C?INITEDATA routine may be found in the file INITEDAT.A51 inside the LIB folder of your C251 installation.

Last Reviewed: Tuesday, March 27, 2007


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.