Microchip Technology SW006022-2N Data Sheet
MPLAB
®
XC16 C Compiler User’s Guide
DS52071B-page 142
2012 Microchip Technology Inc.
7.12
MEMORY MODELS
The compiler supports several memory models. Command-line options are available
for selecting the optimum memory model for your application, based on the specific
dsPIC DSC device part that you are using and the type of memory usage.
for selecting the optimum memory model for your application, based on the specific
dsPIC DSC device part that you are using and the type of memory usage.
TABLE 7-1:
MEMORY MODEL COMMAND LINE OPTIONS
The command-line options apply globally to the modules being compiled. Individual
variables and functions can be declared as near, far or in eds to better control the
code generation. For information on setting individual variable or function attributes,
see Section 6.11 “Variable Attributes” and Section 10.2.1 “Function Specifiers”.
variables and functions can be declared as near, far or in eds to better control the
code generation. For information on setting individual variable or function attributes,
see Section 6.11 “Variable Attributes” and Section 10.2.1 “Function Specifiers”.
Option
Memory Definition
Description
-msmall-data
Up to 8 KB of data memory.
This is the default.
This is the default.
Permits use of PIC18 like instructions
for accessing data memory.
for accessing data memory.
-msmall-scalar
Up to 8 KB of data memory.
This is the default.
This is the default.
Permits use of PIC18 like instructions
for accessing scalars in data memory.
for accessing scalars in data memory.
-mlarge-data
Greater than 8 KB of data
memory.
memory.
Uses indirection for data references.
-msmall-code
Up to 32 kWords of program
memory. This is the default.
memory. This is the default.
Function pointers will not go through a
jump table. Function calls use RCALL
instruction.
jump table. Function calls use RCALL
instruction.
-mlarge-code
Greater than 32 kWords of
program memory.
program memory.
Function pointers might go through a
jump table. Function calls use CALL
instruction.
jump table. Function calls use CALL
instruction.
-mconst-in-data
Constants located in data
memory.
memory.
Values copied from program memory
by startup code.
by startup code.
-mconst-in-code
Constants located in program
memory. This is the default.
memory. This is the default.
Values are accessed via Program
Space Visibility (PSV) data window.
Space Visibility (PSV) data window.
-mconst-in-aux-
flash
Constants in auxiliary FLASH
Values are accessed via Program
Space visibility window.
Space visibility window.