XVAR
The XVAR macro accesses variables of any type at fixed absolute memory locations in the code memory class.
The XVAR macro is defined as:
#define XVAR(object, addr) (*((object volatile xdata *)(addr))) /* XDATA */
You may use this macro in your programs as follows:
#include <absacc.h> /* include absolute memory access macros */
:
:
int i;
long l;
l = XVAR (long, 0xFFE0); /* read long value at XDATA 0FFE0H */
XVAR (int, 0x1000) = i; /* write the value of i to XDATA 1000H */
#define IO XVAR (char, 0x1000) /* IO port at XDATA 1000H */
if (IO == 0) IO = 1; /* test port and write 1 to IO address */