07.04.2013 Views

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Using the <strong>Compiler</strong> on the Comm<strong>and</strong> Line<br />

3.5.1 Options Specific to <strong>dsPIC</strong> DSC Devices<br />

For more in<strong>for</strong>mation on the memory models, see Section 4.6 “Memory Models”.<br />

TABLE 3-2: <strong>dsPIC</strong> ® DSC DEVICE-SPECIFIC OPTIONS<br />

Option Definition<br />

-mconst-in-code Put constants in the auto_psv space. The compiler will access these<br />

constants using the PSV window. (This is the default.)<br />

-mconst-in-data Put constants in the data memory space.<br />

-merrata= This option enables specific errata work arounds identified by id. Valid<br />

id[,id]*<br />

values <strong>for</strong> id change from time to time <strong>and</strong> may not be required <strong>for</strong> a<br />

particular variant. An id of list will display the currently supported<br />

errata identifiers along with a brief description of the errata. An id of<br />

all will enable all currently supported errata work arounds.<br />

-mlarge-code Compile using the large code model. No assumptions are made about<br />

the locality of called functions.<br />

When this option is chosen, single functions that are larger than 32k<br />

are not supported <strong>and</strong> may cause assembly-time errors since all<br />

branches inside of a function are of the short <strong>for</strong>m.<br />

-mlarge-data Compile using the large data model. No assumptions are made about<br />

the location of static <strong>and</strong> external variables.<br />

-mcpu=<br />

This option selects the target processor ID (<strong>and</strong> communicates it to the<br />

target<br />

assembler <strong>and</strong> linker if those tools are invoked). This option affects how<br />

some predefined constants are set; see Section 3.7 “Predefined<br />

Macro Names” <strong>for</strong> more in<strong>for</strong>mation. A full list of accepted targets can<br />

be seen in the Readme.htm file that came with the release.<br />

-mpa (1)<br />

Enable the procedure abstraction optimization. There is no limit on the<br />

nesting level.<br />

-mpa=n (1)<br />

-mno-pa (1)<br />

Enable the procedure abstraction optimization up to level n. If n is zero,<br />

the optimization is disabled. If n is 1, first level of abstraction is allowed;<br />

that is, instruction sequences in the source code may be abstracted<br />

into a subroutine. If n is 2, a second level of abstraction is allowed; that<br />

is, instructions that were put into a subroutine in the first level may be<br />

abstracted into a subroutine one level deeper. This pattern continues<br />

<strong>for</strong> larger values of n.<br />

The net effect is to limit the subroutine call nesting depth to a maximum<br />

of n.<br />

Do not enable the procedure abstraction optimization.<br />

(This is the default.)<br />

Note 1: The procedure abstractor behaves as the inverse of inlining functions. The pass is<br />

designed to extract common code sequences from multiple sites throughout a<br />

translation unit <strong>and</strong> place them into a common area of code. Although this option<br />

generally does not improve the run-time per<strong>for</strong>mance of the generated code, it can<br />

reduce the code size significantly. Programs compiled with -mpa can be harder to<br />

debug; it is not recommended that this option be used while debugging using the<br />

COFF object <strong>for</strong>mat.<br />

The procedure abstractor is invoked as a separate phase of compilation, after the<br />

production of an assembly file. This phase does not optimize across translation<br />

units. When the procedure-optimizing phase is enabled, inline assembly code must<br />

be limited to valid machine instructions. Invalid machine instructions or instruction<br />

sequences, or assembler directives (sectioning directives, macros, include files,<br />

etc.) must not be used, or the procedure abstraction phase will fail, inhibiting the<br />

creation of an output file.<br />

© 2008 <strong>Microchip</strong> Technology Inc. DS51284H-page 35

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!