|ARM Technical Support Knowledge Articles|
Applies to: C51 C Compiler
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.
Article last edited on: 2007-04-10 11:58:22
Did you find this article helpful? Yes No
How can we improve this article?