We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all, How to use _at_ keyword? The varaibles are declared in onchip EEPROM space. (T89C51RD2) Regards.
What difficulty are you having with the explanation in the manual? Stefan
Thank you for your responce. This is a sample program. "fvalue" is declared in EEPROM space at unknown addess. I can locate starting address of fvalue but that is not enouth. There is a linker error when I use _at_ keyword. If fvalue is declared in RAM or XRAM that is OK. #include <89c51rd2.H> #include <absacc.h> #pragma USERCLASS (HDATA = eeprom) // use HDATA_EEPROM for E2PROM area float far fvalue;// _at_ 0x20; void main (void) { f = 12.5; while(1); }
You're not making too much sense. Either the location of fvalue is unknown, or it can be located. You can't meaningfully have it both ways. If it's actually unknown, you can't use it, period. The _at_ directive is exactly the way to tell the compiler the actual location, in those cases where that location is not known from some other file being linked into your final executable. It had better not be in the source file that just uses this variable, though. It should be in a header file exported by the piece of code defining this variable.
"There is a linker error" To help you, we'd need to know precisely what that error is!
The error is *** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: HDATA I also add my project xbanking.a51 configuration file and uses extended linker.