Declares to the optimizing linker that the symbol described in the operand field is a symbol to be referenced from another module.
[Syntax]
Symbol field
|
Mnemonic field
|
Operand field
|
Comment field
|
[label:]
|
.public
|
label-name[, absolute-expression ]
|
[; comment]
|
[Function]
- | The .public directive declares to the optimizing linker that the symbol described in the operand field is a symbol to be referenced from another module. |
[Use]
- | When defining a symbol to be referenced from another module, the .public directive must be used to declare the symbol as an external definition. |
[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 ".extern" directive in that it declares an external label, if this directive is used to declare a label with a definition in the specified file as an external label, use the ".extern" directive to declare labels without definitions in the specified file as external labels. |
- | The .public directive may be described anywhere in a source program. |
- | The ".public" directive can only define one symbol per line. |
- | When the symbol(s) to be described in the operand field isn't defined within the same module, an warning is output. When the symbol(s) isn't defined in any file, it will cause an error during linking. |
- | The following symbols cannot be used as the operand of the .public directive: |
(a) | Symbol defined with the .set directive |
[Example]
.public A1 ; (a)
.extern B1
A1:
.db2 0x10
.cseg text
jr B1
|
.public B1 ; (b)
.extern A1
.cseg text
B1:
mov A1, r12
|
(a) | This .public directive declares that symbol "A1" is to be referenced from other modules. |
(b) | This .public directive declares that symbol "B1" is to be referenced from another module. |