beautypg.com

Library (include library) – Echelon Neuron User Manual

Page 158

background image

LIBRARY (Include Library)

The LIBRARY directive is used to instruct the linker to use a specific function

library when linking an application containing this module. This directive is

used when writing assembly code that has a known dependency on a specific

function library; the LIBRARY directive can be used to express that dependency

within the source code itself, without the need to document the dependency or to

instruct the development tool about the dependency.
When the Neuron Assembler encounters the LIBRARY directive, it accepts the

directive and its argument without validation. Errors, such as references to non-

existent function libraries, can occur during linking.
Included files can also contain the LIBRARY directive. The assembler can

process a total of 19 input libraries during one assembly, counting all included

files and the original source file.
This directive is only available with the IzoT NodeBuilder FX Development Tool

(and later versions)

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

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

relative path to the library.

LIBRARY “string

The argument is used as a library name to be passed to the linker. The library

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

extension, but the .LIB extension is recommended.
The library reference (the double-quoted string argument) can optionally contain

pre-defined macros. A macro is a keyword, enclosed in single dollar-signs, which

expands to a well-defined value during linking. Using macros allows you to

create code (and library references) that is location-independent and can

assemble and link on different machines.
Table 61 lists the macros that are supported for the LIBRARY directive.

Table 61. System Macros for LIBRARY Directive

Macro

Expansion

$LONWORKS$

The local LonWorks directory, generally c:\LonWorks.
Note that there is no trailing backslash.

$IMG$

$LONWORKS$\Images

$STD$

$LONWORKS$\NeuronC\Libraries


148

Neuron Assembler Directives