
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[scHDpftumiJReokgbN+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: use '.' in front of decimal constants
   f: no object format directive is printed
   t: no tabulators, normal spaces only
   u: no extra info at the end of the assembly file
   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.
   R: detailed macro expansion
   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

-B[pims] : write output from preprocessor to <src>.cpr
   p : partial preprocessing
   i : no include files
   m : modify symbols
   s : modify strings

-cd : allow cdata outside program space (warning only)
-cfc : use old format on config and idlocs in generated assembly file
-chu: disable sorting of addresses in generated HEX file
-cl<N> : set code generator level, N=0:old, N=1:improved
-cu : use 32 bit evaluation of constant expressions
-cxc : do not search current directory for include files

-CC[<file>] : produce COD file, C mode
-CA[<file>] : produce COD file, ASM mode
-Ce:remove extra byte names (nnn_e<N>) from COD file

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

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

-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

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

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

-F : produce error file <src>.err
-FM : MPLAB compatible error format

-g : don't replace call by goto

-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

-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

-li<ENVI> : include directory from environment variable (default CCINC)
-lh<ENVD> : load default directory from environment variable (default CCHOME)

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

-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)

-Ma : truncate all automatic generated labels in the assembly/list files

-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.

-p- : clear any preceding option -p<chip> to allow chip redefinition

-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
-rb<N> : name on RAM bank 0 is BANK<N>, default BANK0
-ro<N> : add offset <N> when generating local variable block name
-rp<N> : name on codepage 0 is PROG<N>, default PROG1
-rx : make variables static by default

-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

-wB : warning when function is called from another code page
-wC : warning on upward compatibility issues
-we : no warning when fixed point constants are rounded
-wi : no warning on multiple inline math integer operations
-wL : (12 bit core only) print warning on all GOTO links to functions
      residing on hidden half of a codepage.
-wm : no warning on single call to math integer function
-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

-x<file> : assembler executable incl. path
-X<option> : option to assembler executable




Options can be put in 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 in 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.

    String translation rules for options in a file:
      1. Doublequotes " " allows spaces in the option, quotes are removed
      2. Using \" means a single quote " in an option

        -I"C:\Program Files\cc5x"     ==>   -IC:\Program Files\cc5x
        -IC:"\Program Files"\cc5x     ==>   -IC:\Program Files\cc5x

        -DMyString="\"Hello\n\""      ==>   -DMyString="Hello\n"
        -DQuote='\\"'                 ==>   -DQuote='\"'


A path name can be written using '/' if this is supported by the
file system, 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

