Declares to the optimizing linker that the symbol described in the operand field is a symbol to be referenced from another module.
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. |
When defining a symbol to be referenced from another module, use the .public or .weak directive to declare that symbol as an external definitionNote. |
See ".weak" for details on the difference between the .public directive and .weak directive. |
Note that if the second operand is specified, this specifies the size of the data indicated by the symbol. However, specifications of size are ignored (although including them has been allowed to retain compatibility with CX).
The function of this directive for declaring an external symbol does not differ from the function of the .extern directive. Use this directive to declare a symbol with a definition in the specified file as an external symbol. Use the .extern directive to declare symbols without definitions in the specified file as external symbols. |
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. |
.public A1 ; (a) .extern B1 A1: .db2 0x10 .cseg text jr B1 |
.public B1 ; (b) .extern A1 .cseg text B1: mov A1, r12 |