Keil Logo

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:

class Description
BIT A symbol located in BIT memory space.
CODE A symbol located in CODE space.
CONST1 A symbol located in CONST memory.
DATA A symbol located in DATA space.
EBIT1 A symbol located in the EBIT memory space.
ECONST1 A symbol located in ECONST memory.
EDATA1 A symbol located in EDATA memory.
ECODE1 A symbol located in ECODE memory.
HDATA1 A symbol located in the HDATA memory space.
HCONST1 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.

Note

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

Following is a list of valid types:

type1 Description
BYTE A byte variable.
DWORD A double-word variable.
FAR A far label.
NEAR A near label.
WORD A 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)
  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.