Zilog EZ80F916 User Manual
Page 235

UM014423-0607
ZiLOG Developer Studio II
eZ80Acclaim!
®
User Manual
215
LONGBYTES .UNION
LDATA BLKL 1
BDATA .TAG BYTES
LSIZE .ENDSTRUCT LONGBYTES
.WITH and .ENDWITH Directives
Using the fully qualified names for fields within a structure can result in very long names.
The
.WITH
directive allows the initial part of the name to be dropped.
The
.WITH
and
.ENDWITH
directives have the following form:
.WITH
name
;
directives
.ENDWITH
[name]
The identifier name may be the name of a previously defined
.STRUCT
or
.UNION
, or an
ordinary label to which a structure has been attached using a
.TAG
directive. It can also be
the name of an equate or label with no structure attached. Within the
.WITH
section, the
assembler attempts to prepend “name.” to each identifier encountered, and selects the
modified name if the result matches a name created by the
.STRUCT
,
.UNION
, or
.TAG
directives.
The
.WITH
directives can be nested, in which case the search is from the deepest level of
nesting outward. In the event that multiple names are found, a warning is generated and
the first such name is used.
If name is specified with the
.ENDWITH
directive, the name must match that used for the
.WITH
directive. The intent is to allow for code readability with some checking by the
assembler.
For example, the
COMPUTE_PAY
routine below:
COMPUTE_PAY:
; Enter with pointer to an EMPLOYEE in R2, days in R1
; Return with pay in R0,R1
LD R0,EMPLOYEE.SALARY(R2)
MULT RR0
RET
could be written using the
.WITH
directive as follows:
COMPUTE_PAY:
; Enter with pointer to an EMPLOYEE in R2, days in R1
; Return with pay in R0,R1