Only symbols exported from a compilation unit can be used by other units. You can export symbols using the EXPORT directive. This directive does nothing more than make the symbol visible to other modules: it does not reserve storage for it nor define its type.

##### Syntax

EXPORT symbol [, symbol]...
PUBLIC symbol [, symbol]...
XDEF symbol [, symbol]...

##### Description

EXPORT, PUBLIC, and XDEF are equivalent and are provided in many assemblers: you can use whichever you prefer.

Not all symbols can be exported. Variables, labels, function blocks, and numeric constants defined using EQU can be exported, but macro names and local stack-based variables cannot.

The assembler publishes the symbol in the object file so that other modules can access it. If you don't export a symbol you can only use it in the source file it's declared in.

As a convenience, a label can be defined and exported at the same time using double-colon notation.

##### Example

    data_ptr::

This declares the label data_ptr and exports it. This is equivalent to:

            EXPORT data_ptr
    data_ptr: