C51: PLACING FAR VARIABLES AT ABSOLUTE LOCATIONS
Information in this article applies to:
How can I locate far variables at absolute memory locations. I have tried the following:
unsigned char far x _at_ 0x00000A;
But this generates the following compiler error message:
Error C274: Absolute Specifier Illegal
Variables of type far may be placed at absolute memory locations using the FVAR, FCVAR, FARRAY, and FCARRAY macros. For example:
#define IOVAL FVAR (long, 0x14FFE) // long at HDATA address 0x14FFE . . . int var; . . . var = IOVAL; /* read */ IOVAL = 0x10; /* write */ var = FCVAR (int, 0x24002) /* read int from HCONST address 0x24002 */ . . .
Support for _at_ and far addresses was added in C51 Version 7.
Last Reviewed: Tuesday, April 10, 2007
of your data.