Local labels, Importing and exporting labels, Label spaces – Zilog EZ80F916 User Manual
Page 243

UM014423-0607
ZiLOG Developer Studio II
eZ80Acclaim!
®
User Manual
223
Local Labels
Any label beginning with a dollar sign (
$
) or ending with a question mark (
?
) is consid-
ered to be a local label. The scope of a local label ends when a SCOPE directive is encoun-
tered, thus allowing the label name to be reused. A local label cannot be imported or
exported.
Example
$LOOP:
JP $LOOP
; Infinite branch to $LOOP
LAB?:
JP LAB? ; Infinite branch to LAB?
SCOPE ; New local label scope
$LOOP:
JP $LOOP
; Reuse $LOOP
LAB?:
JP LAB? ; Reuse LAB?
Importing and Exporting Labels
Labels can be imported from other modules using the
EXTERN
or
XREF
directive. A space
can be provided in the directive to indicate the label’s location. Otherwise, the space of the
current segment is used as the location of the label.
Labels can be exported to other modules by use of the
PUBLIC
or
XDEF
directive.
Label Spaces
The assembler makes use of a label’s space when checking the validity of instruction oper-
ands. Certain instruction operands require that a label be located in a specific space
because that instruction can only operate on data located in that space. A label is assigned
to a space by one of the following methods:
•
The space of the segment in which the label is defined.
•
The space provided in the
EXTERN
or
XREF
directive.
•
If no space is provided with the
EXTERN
or
XREF
directive, the space of the segment
where the
EXTERN
directive was encountered is used as the location of the label.
$B
Anonymous label backward reference. This symbol references the most recent anonymous label
defined before the reference.
$F
Anonymous label forward reference. This symbol references the most recent anonymous label
defined after the reference.
Table 10. Anonymous Labels (Continued)
Symbol
Description