This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

shared variable slots

The feature of shared variables in C is a wonderful saver of DATA space. Can the same be implemented in assembler ?

Erik

Parents Reply Children
  • 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?