Ax51 User's Guide

EXTRN Assembler Statement

Arguments
EXTRN class (symbol <[>, symbol ...<]>)
EXTRN class:type (symbol <[>, symbol ...<]>)
Description

The EXTRN statement (which may appear anywhere in the assembler source file) specifies symbols that the current source file uses but which are defined in other object modules. The module where the symbols are defined must export them using a PUBLIC statement. The EXTRN statement specifies the symbol, its memory class, and its data type (for the AX51 Assembler only).

Valid classes are:

classDescription
BITA symbol located in BIT memory space.
CODEA symbol located in CODE space.
CONST1A symbol located in CONST memory.
DATAA symbol located in DATA space.
EBIT1A symbol located in the EBIT memory space.
ECONST1A symbol located in ECONST memory.
EDATA1A symbol located in EDATA memory.
ECODE1A symbol located in ECODE memory.
HDATA1A symbol located in the HDATA memory space.
HCONST1A symbol located in HCONST memory.
IDATAA symbol located in IDATA memory.
XDATAA symbol located in XDATA memory.
NUMBERA symbol located in any memory space.

Note

  1. These classes are available in the AX51 Assembler only.

Following is a list of valid types:

type1Description
BYTEA byte variable.
DWORDA double-word variable.
FARA far label.
NEARA near label.
WORDA word variable.

Note

  1. Symbol types are supported in the AX51 Assembler only.

The linker resolves all external symbols and verifies that the classes and types match. Symbols whose class is NUMBER match any memory class.

See Also

EXTERN, PUBLIC

Example
EXTRN   CODE:FAR (main)
EXTRN   NUMBER (tabsize)
EXTRN   DATA:BYTE (counter)