| ||||||||
Technical Support On-Line Manuals C251 User's Guide | The _at_ KeywordThe best method for accessing absolute memory locations is to use the _at_ keyword when you declare variables in your C source files. The _at_ keyword also reserves the memory required for the object. In cases where you do not want to reserve memory, you may use the Absolute Access Macros. The _at_ keyword allows you to specify the address for variables in your C source files. The following example demonstrates how to locate several different variable types using the _at_ keyword.
struct link {
struct link idata *next;
char code *test;
};
struct link list idata _at_ 0x40; /* list at idata 0x40 */
char xdata text[256] _at_ 0xE000; /* array at xdata 0xE000 */
int xdata i1 _at_ 0x8000; /* int at xdata 0x8000 */
char far ftext[256] _at_ 0x02E000; /* array at xdata 0x03E000 */
void main ( void ) {
link.next = (void *) 0;
i1 = 0x1234;
text [0] = 'a';
ftext[0] = 'f';
}
Refer to the Absolute Variable Location topic for more information about the _at_ keyword. Note
| |||||||
| ||||||||