What does it mean when you have an "WARNING L18: SEGMENT DOES NOT FIT IN PDATA PAGE"? I can't find this warning in manual.
Sounds like you have a segment that is larger than the size of the PDATA memory space (256 bytes). Jon
It's sounds very strange, because I use compact memory model and all structures create in xdata.
That does sound strange, since it's the large memory model in which variables are supposed to default to xdata. In the compact model, the default is pdata. (C51 Version 7, at least.) Keep in mind that any local variables and temporaries that spill out of registers will also go into the default memory space, in addition to explicitly declared locals. A number of people express the opinion that all variables should have an explicit memory type declared for them. Saves some grief when changing memory models. Also, the most desirable default location for those locals and temps isn't necessarily the same as for some bulky global structures; the memory model is too coarse of a specifier to use to control allocation in detail. On the other hand, it certainly makes code simpler and more portable to leave out the memory types if you can get away with it.
The Keil tools allow you to specify the memory model for a C file or for a project. However, you can also specify the memory model on a function-by-function basis. You can also specify the memory space on a variable-by-variable basis. I think that's pretty flexible. Jon
"you can also specify the memory model on a function-by-function basis." Last time I tried that (v6.something), it didn't work. :-( The Linker just kept complaining about incompatible memory models. :-(
"I can't find this warning in manual." Neither can I :-( Keil have really let this area of the documentation slip. :-( The warning/error message documentation & online help are way out of date - especially for the LX51 Linker. :-(
Last time I tried that (v6.something), it didn't work. :-( The Linker just kept complaining about incompatible memory models. :-( You must also create function prototypes with the memory model specified. For example:
int junk ( int a, int b, int c) large;