S5U1C62000A MANUAL
EPSON
55
(S1C60/62 FAMILY ASSEMBLER PACKAGE)
CHAPTER 5: ASSEMBLER
Scope
The scope is a reference range of a label. It is called local if the label is to be referenced within the
same file, and it is called global if the label is to be referenced from other files.
Any defined label's scope is local in default. To make a label's scope global, use the .global pseudo-
instruction both in the file in which the label is defined and in the file that references the label.
A double definition of local labels will be an error at the assembly stage, while a double definition of
global labels will be an error at the link stage.
Example:
File in which global label is defined (file1)
.global
SYMBOL
... Global declaration of a label which is to be defined in this file.
SYMBOL:
:
LABEL:
... Local label
:
(Can be referenced to only in this file)
File in which a global label is referenced to (file2)
.global
SYMBOL
... Global declaration of a label defined in other source file.
call
SYMBOL
... Label externally referenced to.
:
LABEL:
... Local label
:
(Treated as a different label from LABEL of file1)
The assembler regards those labels as those of undefined addresses in the assembling, and includes
that information in the object file it delivers. Those addresses are finally determined by the processing
of the linker.
∗
When a label is defined by the .comm pseudo-instruction, that label will be a global label. Therefore,
in a defined file, no global declaration needs to be made using the .global pseudo-instruction. On the
contrary, in a file to be referenced, the global declaration is necessary prior to the reference.
Restrictions
• The maximum number of characters of a label is limited to 259 the same as that of one line.
• Only the following characters can be used:
A–Z a–z _ 0–9 ?
• A label cannot begin with a numeral.
Examples:
;OK
;Error
FOO;
1lable:
_Abcd:
0_ABC:
L1:
L 1:
.comm BUF 4
.lcomm 1st_BUF 2
• Since labels are case sensitive, uppercase and lowercase are discriminated. When referencing a
defined label, use the symbol exactly the same as the defined label.
Examples:
_Abcd:
:
jp
_ABCD
... Does not jump to _Abcd