Memory Models

In order to allow for efficient use of addressing modes, the S12Z compiler supports three different memory models: SMALL, MEDIUM and LARGE - with MEDIUM being the compiler default. Depending on the memory model, the compiler generates 14-bit, 18-bit or 24-bit accesses to memory. Since code and constant data reside in Flash and, for each of the available S12Z devices, Flash memory is placed at high addresses and, therefore, requires 24 bits to access, memory models only apply to global non-constant data.

Note: The compiler option for setting the memory model is such that, by default, the compiler uses MEDIUM. However, the actual memory model to be used with an S12Z application depends on the derivative for which that application is being developed. The memory model should be set according to the derivative memory map.

This section covers the following topics: