beautypg.com

Include (assembly control) – Echelon Neuron User Manual

Page 157

background image

INCLUDE (Assembly Control)

The INCLUDE directive is used to include additional assembly source-code

modules in the compilation of the current file.
Neuron Assembly include files typically use an .inc file extension, and contain

commonly used symbol imports and definitions of mnemonics. However, a

Neuron Assembly include file can also include code or data.
When the assembler encounters an INCLUDE directive, the assembler first

attempts to open the file using the file name or path provided. If the name is not

an absolute path, then the name is treated as relative to the current directory. If

the file is not found, the assembler then attempts to open the file relative to each

directory in the search path. To specify a directory name, you can use a double

backslash (for example, \\myFolder).
The assembler does not distinguish between absolute paths and relative path.

For example, if an INCLUDE directive contains the file name "\myFile.inc", the

assembler attempts to open the file in the root directory, if it exists. Otherwise,

the assembler uses the name as a relative path from each of the directories in the

search path in turn until a file named "myFile.inc" is found. If the file is not

found, the assembler returns an error and stops compilation. See the Neuron

Tools Errors Guide for information about Neuron Assembler errors.
Included files can also contain the INCLUDE directive. The maximum nesting

level of included files is five. The assembler can process a total of 32 input files

during one assembly, counting all included files and the original source file.

Syntax:
The INCLUDE directive requires a file name enclosed in double-quote

characters as its argument. The file name can optionally provide an absolute or

relative path to the file.

INCLUDE “string

The argument is used as a file name to be included in the assembly process, with

the included file appearing in the place of the INCLUDE directive. The file

name must be specified exactly, including extension. There is no default

extension, but the .inc extension is recommended.

Neuron Assembly Language Reference

147