5.6.3.2 Memory Model

Table 5-5. Memory Model Category
OptionDescriptionCommand Line
Code model
  • default
  • Large - Functions are called with a long call, allowing access to the full memory range of the device. Branches internal to the function are limited by the range of the various branch instructions.
  • Small - Functions are called using the relative call. Call targets must be within +/- 32K words of the call site; otherwise a linker error will occur directing the use of the large code model.

-msmall-code

-mlarge-code

-msmall-code

Data model
  • default
  • Large - No assumptions are made about the location of static and external variables.
  • Small - All static and external variables are assumed to be located in the lower 8 KB of data memory space.

-msmall-data

-mlarge-data

-msmall-data

Scalar model
  • default
  • Large - No assumptions are made about the location of static and external scalars.
  • Small - Like -msmall-data, except that only static and external scalars are assumed to be in the lower 8 KB of data memory space.

-msmall-scalar

-mlarge-scalar

-msmall-scalar

Location of constant model
  • default
  • Data - Put const qualified variables in the data memory space.
  • Code - Put const qualified variables in the code memory space.

6.6.1.2 -mconst-in-code

-mconst-in-data

6.6.1.2 -mconst-in-code

Aggregate data modelUse aggregate data model. -mlarge-aggregate