
COMPILER OPTIONS
----------------

The compiler needs a C source file name to start compiling. Other
arguments can be added if required. The syntax is:

    CC5X [options] <src>.c [options]

Please note that the options are CASE sensitive.

-a[<asmfile>]: produce assembly file. The default
               file name is <src>.asm

-A[scHDpftmiJbeokgN+N+N]: assembly file options
   s: symbolic arguments are replaced by numbers
   c: no C source code is printed
   H: hexadecimal numbers only
   D: decimal numbers only
   p: no '.' in front of decimal constants
   f: no object format directive is printed
   t: no tabulators, normal spaces only
   m: no multiple source lines, only the last
      source line is printed for each block of
      assembly instructions.
   i: no source indentation, straight left margin
   J: put source after instructions to achieve
      a compact assembly file.
   b: don't add rambank info to variables in the assembly
      file (backward compatibility option).
   e: don't add ',1' when the result is written back to
      a register
   o: don't replace OPTION with OPTION_REG
   k: don't convert all hexadecimal numbers (11h -> 0x11)
   g: don't use PROCESSOR instead of the list directive
   N+N+N: label, mnemonic and argument spacing
           Default is 8+6+10.

-b: don't update bank selection bits
     12 bit core: FSR.5 and 6
     14 bit core: STATUS.RP0 and RP1

-bu: non-optimized updating of the bank selection bits

-CC[<file>]: produce COD file, C mode
-CA[<file>]: produce COD file, ASM mode

-cu: use 32 bit evaluation of constant expressions

-D<name>[=xxx]: define macro, same as: #define name xxx

-dc: do not write compiler output file <src>.occ

-E<N>: stop after <N> errors (default is 4).

-e: single line error messages (no source lines).
-ed : do not print error details
-ew : do not print warning details
-eL : list error and warning details at the end

-F: produce error file <src>.err

-f<hex-file-format>: i.e. INHX8M, INHX8S, INHX16, INHX32.
   Default is INHX8M. Note that INHX8S use output files:
   <file>.HXH and <file>.HXL

-GW: dynamic selected skip() format, warning on long format (default)
-GD: dynamic selected skip() format
-GS: always short skip() format (error if boundary is crossed)
-GL: always long skip() format

-g: don't replace call by goto

-I<directory>: include files directory.
   Up to 5 library directories can be supplied by using
   separate -I<dir> options. When using #include "test.h" the
   current directory is first searched. If the file is not found
   there, then the library directories are searched, in the same
   order as supplied in the command line option list (-I<dir>).
   The current directory is skipped when using #include <test.h>.

-j: don't update page selection bits
     12 bit core: STATUS.PA0 and PA1
     14 bit core: PCLATH.3 and 4

-L[<col>,<lin>]: produce list file <src>.lst
    The maximun number of columns per line <col> and lines per
    page <lin> can be changed. The default setting is -L80,60

-mc1: default 'const' pointer size is 1 byte (8 bits)
-mc2: default 'const' pointer size is 2 bytes (16 bits)
-mr1: default RAM pointer size is 1 byte
-mr2: default RAM pointer size is 2 bytes
-mm1: default pointer size is 1 byte (all pointer types)
-mm2: default pointer size is 2 bytes (all pointer types)

-o<name>: generated hex file

-O<directory>: output files directory. Files generated by the
   compiler are put on this directory, except when a full path
   name is supplied.

-p<device> : defines the chip type. The device have to be known
 internally: 16C54,55,56,57,58, 61,64,65, 71,73,74, 84 or supported
 by a header file (i.e. 16F877.H). Default device is 16C54.

-q<N> : assume disabled interrupt at the <N> deepest call levels.
 I. e. -q1 allows the main program to use all stack levels for
 function calls. If the interrupt routine makes function calls, then
 -q2 etc. can be used. Disabling interrupt at the deepest call level
 MUST be properly ensured in the user application program.

-Q: write the call tree to <src>.fcs.

-r : generate relocatable assembly (no hex file)
-r2[<filename.lkr>] : use separate logical section for interrupt routine
-rp<N> : name on codepage 0 is PROG<N>, default PROG1
-rb<N> : name on RAM bank 0 is BANK<N>, default BANK0
-ro<N> : add offset <N> when generating local variable block name

-S: silent operation of the compiler

-u: no optimizing

-V[rnuD]: generate variable file, <src>.var, sorted by
           address as default.
   r: only variables which are referenced in the code
   n: sort variables by name
   u: keep the variables unsorted
   D: use decimal numbers

-x<file> : assembler executable: -xC:\progra~1\mplab\mpasm.exe
-X<option> : assembler option: -X/q (all options must be separate)

-we: no warning when fixed point constants are rounded

-wB: warning when function is called from another code page

-wI: warning on long inline code for multiplication and division

-wL: (12 bit core only) print warning on all GOTO links to functions
     residing on hidden half of a codepage.

-wO: warning on operator library calls

-wP: warning when code page bits are not correct

-wr: no warning on recursive calls

-wS: warning (no error) when constant expression loses significant
     bits

-wU: warning on uncalled functions

-W: wait until key pressed after compilation




Options can be put on a file. The syntax is:

        cc5x [..] +<filename> [..]

    Many option files can be included, and up to 5 levels of nested
    include files are allowed. Options on a file allows an unlimited
    number of options to be stated. Linefeed, space and TAB
    separates each option. Comments can be added in the option file
    using the syntax:

        // the rest of the line is a comment

    Spaces can be added to each option if a space is added behind
    the '-' starting the option. This syntax disables using more
    than one option on each line. Examples:

        - D MAC = 1 + OP
        - p 16C54      // comment
        -p 16C54       // this will not work
        - p 15C64  -a  // not this either

    Note that the file path is required if the file does not reside
    on the current directory.


A path name can be written using '/' if this is supported by the
MSDOS version used, example:

  c:/compiler/lib/file.h


Default compiler settings:
    * object file output on file <name>.hex
    * no assembly output
    * processor = 16C54
    * optimizing on
    * extended call level is allowed
    * update bank selection bits
    * update page selection bits

Permanent assigned settings:
    * nested comments is allowed
    * char is unsigned

