External symbols

A symbol may be made external using the XDEF - External Symbol Definition assembler directive. In another source file, an XREF - External Symbol Reference assembler directive must reference it. Since its address is unknown in the referencing file, it is considered to be relocatable. See the following listing for an example of using XDEF and XREF.

Listing: Examples of external symbols

      XREF extLabel       ; symbol defined in an other module.
                          ; extLabel is imported in the current module

      XDEF label          ; symbol is made external for other modules

                          ; label is exported from the current module

constSec: SECTION

label:    DC.W 1, extLabel