next up previous contents index
Next: 3.17 DS390 Memory Models Up: 3. Using SDCC Previous: 3.15 Floating Point Support   Contents   Index

3.16 MCS51 Memory Models

SDCC allows two memory models for MCS51 code, small and large. Modules compiled with different memory models should never be combined together or the results would be unpredictable. The library routines supplied with the compiler are compiled as both small and large. The compiled library modules are contained in seperate directories as small and large so that you can link to either set.

When the large model is used all variables declared without a storage class will be allocated into the external ram, this includes all parameters and local variables (for non-reentrant functions). When the small model is used variables without storage class are allocated in the internal ram.

Judicious usage of the processor specific storage classes and the 'reentrant' function type will yield much more efficient code, than using the large model. Several optimizations are disabled when the program is compiled using the large model, it is therefore strongly recommdended that the small model be used unless absolutely required.


next up previous contents index
Next: 3.17 DS390 Memory Models Up: 3. Using SDCC Previous: 3.15 Floating Point Support   Contents   Index
Johan Knol
2001-07-13