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

Mixed Memory Models

C51 v6.03+; uVision v2.07+

I want to build a Project with some files using the SMALL model, but most using LARGE.

If I select LARGE in the Target options, and specify SMALL in the C51 'Misc Controls' where required, or use a #pragma in the file itself, I get a fatal Compiler error:

RESPECIFIED OR CONFLICTING CONTROL

If I select SMALL in the Target options, and specify LARGE in the C51 'Misc Controls' box where required, everything Compiles OK, but I get Linker warnings for each of the 'Large' Modules:
L14: INCOMPATIBLE MEMORY MODEL

If I specify 'large' in each function declaration where required, it all Compiles and Links OK!

Thus it is possible to create a mixed-model Project, but extremely cumbersome to have to specify the model on every function!
Why doesn't it work when the model is specified at the module level?

(yes, I know you wouldn't want to design a Project like this from scratch, but this is "inherited" stuff...)

Parents
  • Could you also explain what the differences between the models available are, or do they ONLY change the default memory type?

    The memory model only affects the DEFAULT place where variables, function arguments, and local vars are stored.

    For example, what causes the stack efficiency in the large model to be worse than small?( P88 , C51 Compiler)

    This reference is to the reentrant stack. It is more efficient in SMALL model because the reentrant stack is stored in IDATA rather than XDATA.

    Jon

Reply
  • Could you also explain what the differences between the models available are, or do they ONLY change the default memory type?

    The memory model only affects the DEFAULT place where variables, function arguments, and local vars are stored.

    For example, what causes the stack efficiency in the large model to be worse than small?( P88 , C51 Compiler)

    This reference is to the reentrant stack. It is more efficient in SMALL model because the reentrant stack is stored in IDATA rather than XDATA.

    Jon

Children
No data