| |||||
Technical Support Support Resources
Product Information | C51: ABSOLUTE ACCESS FOR FAR VARIABLESInformation in this article applies to:
QUESTIONHow do I access far absolute memory locations? ANSWERThe far memory area is supported for devices with more than 64K of code/xdata space (like the Dallas 390, Philips 51MX, and Analog Devices ADuC812). In C51 V6.14, we have added a new absolute access macro called FVAR. This macro allows you to define a memory type and its far address. For example:
#include <absacc.h>
#define IO_PORT FVAR(unsigned char, 0x200000)
void main (void) {
unsigned int i; /* Delay var */
unsigned char j; /* LED var */
IO_PORT = 0x55;
i = IO_PORT;
}
In C51 V7.07, we have added support for the _at_ keyword. This means that it is now possible to define absolute variables directly using the _at_ attribute:
unsigned char far IO_PORT _at_ 0x200000;
void main (void) {
unsigned int i; /* Delay var */
unsigned char j; /* LED var */
IO_PORT = 0x55;
i = IO_PORT;
}
MORE INFORMATION
SEE ALSOLast Reviewed: Friday, July 15, 2005 | ||||