beautypg.com

Anonymous labels, Local labels, Importing and exporting labels – Zilog Z8F0130 User Manual

Page 357: Label spaces, Table 21

background image

UM013037-1212

Anonymous Labels

Zilog Developer Studio II – Z8 Encore!

User Manual

333

Anonymous Labels

The ZDS II assembler supports anonymous labels. The following table lists the reserved
symbols provided for this purpose.

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.

Table 55. Anonymous Labels

Symbol

Description

$$

Anonymous label. This symbol can be used as a label an arbitrary number of times.

$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 next anonymous label
defined after the reference.