Keil Logo

C51: INITIALIZING FAR DATA


Information in this article applies to:

  • C51 All Versions

SYMPTOM

I have a data object in far memory, that I initalize in the declaration. When I reach "main" in my program, this data object is blank.

CAUSE

Initialization of far data is disabled by default. You must explicitly turn it on.

RESOLUTION

To activate far data initialization, do the following:

  • copy Init.A51, from C:\Keil\C51\lib, to your project directory.
  • add this local copy to your project
  • edit the file, and change $SET (XBANK = 0) to $SET (XBANK = 1)
  • rebuild and run your program

You should now see the data in far memory initialized, once your program executes to Main.

MORE INFORMATION

SEE ALSO

Last Reviewed: Tuesday, January 16, 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.