2.1 File Types

The source file extensions used by the PIC Assembler differ to those used by MPASM.

Use a .s extension (lower case) for assembly source files. Use .S (upper case) for assembly source files that must be preprocessed before being passed to the assembler, or alternatively, use the -xassembler-with-cpp option to request that source files be preprocessed regardless of their extension.

A list of common file extension equivalents is shown in the table below.

Table 2-1. Equivalent File Extensions
MPASM File ExtensionFile typePIC Assembler Equivalent
.asmAssembly source file.s or .S
.incInclude (header) file.inc
.hexHEX file output.hex
.oObject file.o
.libLibrary archive.a

As output, the PIC Assembler will produce a .hex and .elf file, each with the same basename as the first source file listed on the command line. If you are building from within the MPLAB X IDE, the files' basename will be the project name. Note that Hexmate, which is often run by the driver, can create a log file with a .hxl extension. Do not confuse this file with MPASM split hex files, which also use this extension.

Object files are the intermediate file format used by the assembler, but note that the format of MPASM and PIC Assembler object files are very different. The PIC Assembler cannot read object files created by MPASM, so these cannot be included in PIC Assembler projects. Instead, include into the project the migrated original source code from which the MPASM object files were built.

Library archives created with the archiver, xc8-ar, should use a .a extension. Library archives may be passed to the assembler on the command line. Although these archives may contain any mix of p-code (intermediate code derived from C source) or object modules, only the object modules will be searched by the assembler. Note that the format of MPASM and PIC Assembler library archives are very different. The PIC Assembler cannot read library files created by MPASM, so these cannot be included in PIC Assembler projects. Instead, include into the project the migrated original source code from which the MPASM libraries were built.

The PIC Assembler does not support the generation of cross reference files. The MPASM assembler produces these files (.xrf extension), which can be used to obtain listings of program symbols. When using the PIC Assembler, all the symbols used by a module are shown in the assembly list file associated with that module. All program-wide global symbols are also shown in the map file.