XWORD
The XWORD macro accesses individual words in the external data memory of the 8051. You may use this macro in your programs as follows:
#include <absacc.h> /* Include Macro Definitions */
.
.
.
rval = XWORD [2];
XWORD [2] = 57;
.
.
.
This example reads and writes the contents of the word in external data memory at address 0004h (2 × sizeof (unsigned int) = 4).
The range of valid index values for this macro is 0-32767.
Note
- The index used with this macro does not represent the memory address of the integer value. To obtain the memory address, you must multiply the index by the size of an integer (2 bytes).
Related Knowledgebase Articles