ARM Technical Support Knowledge Articles

PORTING IAR XMEM TO KEIL XDATA

Applies to: C51 C Compiler

Answer


Information in this article applies to:


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)

Article last edited on: 2006-09-29 04:25:29

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential