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

libraries and memory models

We have a library called 834keil.lib. This library seems to like being linked under the small memory model. There is an associated header file containing two globals with the data attribute. Removing the data attribute yields an error.

We are compiling under the small memory model now and giving our globals an xdata attribute as a work-around.

Parents
  • "In the small memory model, the default memory location for globals is in the 'data' space"

    To be more precise, the Memory Model defines the default memory space for everything - locals, globals, parameters, etc...

    If you mix memory models, the different parts of your code will be making different assumptions about the locations of all these things - that way lies disaster!!

    It's like the two old ladies shouting across the street - they could never reach an agreement, because they were arguing from different premises! ;-)

Reply
  • "In the small memory model, the default memory location for globals is in the 'data' space"

    To be more precise, the Memory Model defines the default memory space for everything - locals, globals, parameters, etc...

    If you mix memory models, the different parts of your code will be making different assumptions about the locations of all these things - that way lies disaster!!

    It's like the two old ladies shouting across the street - they could never reach an agreement, because they were arguing from different premises! ;-)

Children
No data