Keil Logo

BL51: WHAT IS THE _XDATA_GROUP?


Information in this article applies to:

  • C51 Version 6.10a

QUESTION

What is stored in the _XDATA_GROUP_? I don't recall declaring or using this group in my program. However, the linker includes it in the link map.

* * * * * * *  X D A T A   M E M O R Y  * * * * * * *
XDATA   0000H     0006H     UNIT         _XDATA_GROUP_

ANSWER

The _XDATA_GROUP_ is a segment that contains all the automatic variables and function arguments from your program that are stored in XDATA memory. Starting in C51 V6, XDATA variables from your program (automatics and arguments only) are overlaid.

For example, the following call tree (generated by the BL51 linker) shows that the startup code calls the MAIN C function. The MAIN function uses 1 byte of XDATA and calls FUNC_A, FUNC_B, and FUNC_C.

FUNC_A, FUNC_B, and FUNC_C each use 5 bytes of XDATA. However, since each of these routines is mutually exclusive, their XDATA memory may be overlaid. Therefore, the linker starts the XDATA segments for each of these functions at the same address (0001H in this example).

SEGMENT                          XDATA_GROUP
  +--> CALLED SEGMENT          START    LENGTH
----------------------------------------------
?C_C51STARTUP                  -----    -----
  +--> ?PR?MAIN?MAIN

?PR?MAIN?MAIN                  0000H    0001H
  +--> ?PR?_FUNC_B?MAIN
  +--> ?PR?_FUNC_A?MAIN
  +--> ?PR?_FUNC_C?MAIN

?PR?_FUNC_B?MAIN               0001H    0005H

?PR?_FUNC_A?MAIN               0001H    0005H

?PR?_FUNC_C?MAIN               0001H    0005H

MORE INFORMATION

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Monday, October 16, 2006


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.