4.41 #include – INCLUDE ADDITIONAL SOURCE FILE
4.41.1 Syntax
Preferred:
#include include_file
#include "include_file"
#include <include_file>
Supported:
include include_file
include "include_file"
include <include_file>
4.41.2 Description
The specified file is read in as source code. The effect is the same as if the entire text
of the included file were inserted into the file at the location of the include statement.
Upon end-of-file, source code assembly will resume from the original source file. Up to
5 levels of nesting are permitted. Up to 255 include files are allowed.
If include_file contains any spaces, it must be enclosed in quotes or angle
brackets. If a fully qualified path is specified, only that path will be searched. Otherwise,
the search order is:
• current working directory
• source file directory
• MPASM assembler executable directory
4.41.3 Usage
This directive is used in the following types of code: absolute or relocatable. For
information on types of code, see Section 1.6 “Assembler Operation”.
You should use the include directive once to include that standard header file for your
selected processor. This file contains defined register, bit and other names for a
specific processor, so there is no need for you to define all of these in your code.
4.41.4 See Also
#define #undefine
4.41.5 Simple Example
#include p18f452.inc ;standard include file
#include "c:\Program Files\mydefs.inc" ;user defines