.extern


Declares to the optimizing linker that a symbol (other than bit symbols) in another module is to be referenced in this module.

[Syntax]

Symbol field

Mnemonic field

Operand field

Comment field

[label:]
.extern
label-name[,  absolute-expression ]
[; comment]

[Function]

-

The .extern directive declares to the optimizing linker that a symbol in another module is to be referenced in this module.

[Use]

-

When referencing a symbol defined in another module, the .extern directive must be used to declare the symbol as an external reference.

[Description]

-

A label with the same name as the one specified by the first operand is declared as an external labelNote.
Note that if a second operand was specified, this specifies the size of the data indicated by that label. However, specifications of size are ignored (although including them has been allowed to retain compatibility with CX).

Note

This is an external symbol (symbol with a GLOBAL binding class).

 

-

Although this directive does not function any differently than an ".public" directive in that it declares an external label, if this directive is used to declare a label without a definition in the specified file as an external label, use the ".public" directive to declare labels with definitions in the specified file as external labels.

-

The .extern directive may be described anywhere in a source program.

-

The ".extern" directive can only define one symbol per line.

-

No error is output even if a symbol declared with the .extern directive is not referenced in the module.

-

The following symbols cannot be used as the operand of the .public directive:

(a)

Symbol defined with the .set directive

(b)

Section name

(c)

Macro name