XARRAY
The XARRAY macro may be used to access an array of type object at a fixed absolute address base in the xdata memory class. The XARRAY macros scales the index by the size of object and adds the result to base. The final address is then used to access the memory.
The XARRAY macro is defined as follows:
#define XARRAY(object, base) ((object volatile xdata *) (base)) /* XDATA */
You may use this macro in your programs as shown in the example below:
#include <absacc.h> /* include absolute memory access macros */
:
:
int i;
long l;
l = XARRAY (long, 0x8000)[i]; /* long array at XDATA 0x8000 */
XARRAY (long, 0x8000)[i] = 0x12345678; /* assign a value */
#define DualPortRam XARRAY (int, 0x2000) /* int array at XDATA 0x2000 */
DualPortRam[l] = 0x1234; /* assign a value