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.
The feature of shared variables in C is a wonderful saver of DATA space. Can the same be implemented in assembler ? Erik
I think you just need to specify your Segments as OVERLAYABLE (where appropriate) and the Linker just does it? No need for 'C'!
You still need to follow the C51 naming conventions exactly to use this. So first learn the conventions. Then apply then very carfully. Overlap errors are real hard to find. Or, just let the C compiler generate it for you. Being quit dumb, I choose the later. For the smarter types just do it in assembly.
Do you really? Surely, it's the Linker which does the overlaying, and all it cares about is whether the segment has the 'Overlayable' attribute or not? The Linker doesn't know (or care) about the naming conventions of C51, A51, PL/M, Pascal, or whatever source language you choose to use; the naming conventions are only of interest to you as the programmer if you want to mix these languages? I've not actually tried this on the Keil tools, so I could be totally wrong. Again ;-)
I thought, that certain information like a function data segement is associated with a particular function, is passed to the linker by the "Naming Convention". I could be wrong.
I think that this is not the case: the name is simply what the Linker uses to identify an object; all the other information about the attributes of the object are conveyed in the Object File format (eg, whether it's a Segment or a variable; whether it's overlayable or not,...) But I could be wrong; maybe someone from Keil could clarify?