Keil Logo

C51: PORTING IAR XMEM TO KEIL XDATA


Information in this article applies to:

  • C51 All Versions

QUESTION

I have a question about the way to define xmem address and data. I've used IAR and Archimedes for a long time and that is the reason I'm confused. Here is the situation:

In IAR and Archimedes I can use the following method to access xmem:

// assign xmem address 8000 to xmem1_add
#define xmem1_add    0x018000

// assign xmem content at xmem1_data
#define xmem1_data  (*(char *)0x018000)

or I can define

#define xmem1_data  (*(char *)xmem1_add)

How do I do this with the Keil compiler?

ANSWER

Try the following. They should work just fine.

#define xmem1_data  (*(char xdata *)0x8000)

or

#define xmem1_add    0x8000
#define xmem1_data  (*(char xdata *)xmem1_add)

Last Reviewed: Friday, September 29, 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.