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