Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

MPLAB
®
XC16 C Compiler Users Guide
DS50002071C-page 186 2012-2013 Microchip Technology Inc.
If you specify both inline and extern in the function definition, then the definition is
used only for inlining. In no case is the function compiled on its own, not even if you
refer to its address explicitly. Such an address becomes an external reference, as if you
had only declared the function and had not defined it.
This combination of inline and extern has a similar effect to a macro. Put a function
definition in a header file with these keywords and put another copy of the definition
(lacking inline and extern) in a library file. The definition in the header file will cause
most calls to the function to be inlined. If any uses of the function remain, they will refer
to the single copy in the library.
Inline, like regular, is a suggestion and may be ignored.
13.7 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.
TABLE 13-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 eds to better control the code
generation. For information on setting individual variable or function attributes, see
Section 8.12 Variable Attributes and Section 13.2.1 Function Specifiers.
Option Memory Definition Description
-msmall-data Up to 8 KB of data memory.
This is the default.
Permits use of PIC18 like instructions
for accessing data memory.
-msmall-scalar Up to 8 KB of data memory.
This is the default.
Permits use of PIC18 like instructions
for accessing scalars in data memory.
-mlarge-data Greater than 8 KB of data
memory.
Uses indirection for data references.
-msmall-code Up to 32 Kwords of program
memory. This is the default.
Function pointers will not go through a
jump table. Function calls use RCALL
instruction.
-mlarge-code Greater than 32 Kwords of
program memory.
Function pointers might go through a
jump table. Function calls use CALL
instruction.
-mconst-in-data Constants located in data
memory.
Values copied from program memory
by startup code.
-mconst-in-code Constants located in program
memory. This is the default.
Values are accessed via Program
Space Visibility (PSV) data window.
-mconst-in-aux-
flash
Constants in auxiliary FLASH Values are accessed via Program
Space visibility window.

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh