Keil Logo

EXTERN Assembler Statement

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

The EXTERN 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 EXTERN statement specifies the symbol, its memory class, and its data type.

Valid classes are:

class Description
BIT A symbol located in BIT memory space.
CODE A symbol located in CODE space.
CONST A symbol located in CONST memory.
DATA A symbol located in DATA space.
EBIT A symbol located in the EBIT memory space.
ECONST A symbol located in ECONST memory.
EDATA A symbol located in EDATA memory.
ECODE A symbol located in ECODE memory.
HDATA A symbol located in the HDATA memory space.
HCONST A symbol located in HCONST memory.
IDATA A symbol located in IDATA memory.
XDATA A symbol located in XDATA memory.
NUMBER A symbol located in any memory space.

Following is a list of valid types:

type Description
BYTE A byte variable.
DWORD A double-word variable.
FAR A far label.
NEAR A near label.
WORD A word variable.

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

Note

  • This directive is available in the AX51 Assembler only.
See Also

EXTRN, PUBLIC

Example
EXTERN   CODE:FAR (main)
EXTERN   NUMBER (tabsize)
EXTERN   DATA:BYTE (counter)
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.