Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 User Manual

Product codes
SW006021-1
Page of 518
MPLAB
®
 XC8 C Compiler User’s Guide
DS52053B-page 98
 2012 Microchip Technology Inc.
4.8.13
-S: Compile to Assembler Code
The -S option stops compilation after generating an assembly output file. One 
assembly file will be generated for all the C source code, including p-code library code.
The command xc8 --CHIP=16F877A -S test.c will produce an assembly file called 
test.as
, which contains the assembly code generated from test.c. The generated 
file is valid assembly code which could be passed to xc8 as a source file, however this 
should only be done for exploratory reasons. To take advantage of the benefits of the 
compilation technology in the compiler, it must compile and link all the C source code 
in a single step. See the --PASS1 option (Section 4.8.45 “--PASS1: Compile to 
P-code”
)
 to generate intermediate files if you wish to compile code using a two-step 
process or use intermediate files.
This option is useful for checking assembly code output by the compiler. The file pro-
duced by this option differs to that produced by the --ASMLIST option (see 
Section 4.8.16 “--ADDRQUAL: Set Compiler Response to Memory Qualifiers”) in 
that it does not contain op-codes or addresses and it may be used as a source file in 
subsequent compilations. The assembly list file is more human readable, but is not a 
valid assembly source file.
4.8.14
-U: Undefine a Macro
The -U option, the inverse of the -D option, is used to undefine predefined macros. 
This option takes the form -Umacro, where macro is the name of the macro to be 
undefined
The option, -Udraft, for example, is equivalent to:
#undef  draft
placed at the top of each module compiled using this option.
4.8.15
-V: Verbose Compile
The -V option specifies verbose compilation. When used, the compiler will display the 
command lines used to invoke each of the compiler applications described in 
Section 4.3 “The Compilation Sequence”.
The name of the compiler application being executed will be displayed, plus all the 
command-line arguments to this application. This option is useful for confirming options 
and files names passed to the compiler applications.
If this option is used twice (-V -V), it will display the full path to each compiler applica-
tion as well as the full command-line arguments. This would be useful to ensure that 
the correct compiler installation is being executed, if there is more than one compiler 
installed.