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
L14: INCOMPATIBLE MEMORY MODEL
//main.c #pragma small extern myfunc(unsigned char n) large; void main(void){ myfunc(55); }
//large.c #pragma small myfunc(unsigned char n) large; // //... // myfunc(unsinged char n) large { //do something }
This looks right, however, remember that the C51 compiler can pass arguments in registers! So, that may affect the outcome of such an example. Sometimes, bigger example are better!!! :-) Jon
If the compiler is passing parameters in registers, surely the model has no effect on the parameters; it just affects where the compiler would have put them if it had not been able to use registers? Locals would still be affected (and reentrant stack usage, if appropriate).
Right!