4.37 #include Directive
The MPASM #include
directive is textually replaced with the
specified file.
Suggested Replacement
As assembly source files can be preprocessed, the PIC Assembler's
#include
preprocessor directive can be used as a direct
replacement for this directive, as shown in the example below.
The search for filenames enclosed in angle brackets will be in the
standard header locations. The search for quoted filenames will be in the current
working directory first, then the standard header locations. Ensure the assembly
source file uses a .S
extension so that it will be preprocessed by
the assembler.
#include <xc.inc>
#include "buttons.inc"
Alternatively, the PIC Assembler's INCLUDE
"file"
directive can be used as a replacement. No search paths
are used. If the file to be included is not in the current working directory, the
full path to the file must be specified with the directive. This directive cannot be
used to include header files that contain preprocessor directives, so you cannot,
for example use it to include <xc.inc>
.
INCLUDE "buttons.inc"