If I wish to declare an absolute variable using _at_, and I wish to declare it in a header file so that it is available to more than one module, I keep getting the SPACE OVERLAP message. How can I solve this?
declare an absolute variable using _at_, There's your problem already. The moment you use _at_, what you're writing is no longer a declaration, but a definition. So the "declare in headers, define in .c source" rule applies, telling you that such a definition doesn't belong in a .h file. Put it in a single .c file, and change the .h file back into an actual declaration (no initializer, no _at_).
Thank you, Hans-Bernhard, for your reply. I have tryed that, but the problem is that the variable is no not available to other C modules that may wish to access it. I'll bet I'm being dumb, but I just cannot get it right!
In other modules, simply declare it as extern - for example: In the main definition module: xdata unsigned char IOPORT _at_ 0x7FF0; and in all other modules: extern xdata unsigned char IOPORT; regards Dejan
Thank you guys - that has fixed it...
and in all other modules: extern xdata unsigned char IOPORT; Or rather, put that line into the header file, to be #included by the other modules. That's what I was trying to tell you to do when I wrote "change the header to a declaration" --- I had assumed it goes without telling that the relevant other modules would all be #including that header file.
extern xdata unsigned char IOPORT;
Even better... Thanks. I migrated my code from another Compiler recently, which somehow preempted this issue, but I'm happy to have added another little skill to my coding.