EasyManua.ls Logo

Intel 8080 - B4_Page_03

Intel 8080
224 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter
5.
Macros
ENDM Directive
NOTE
The following macro definition contains a potential error
that
is
clarified
in
the description
of
the LOCAL directive
later
in
this chapter.
MACl MACRO G 1 ,G2,G3 ;MACRO DIRECTIVE
MOVES:
LHLD Gl ;MACRO
BODY
MOV
A,M
LHLD G2
MOV
B,M
LHLD
G3
MOV
C,M
ENDM
;ENDM DIRECTIVE
Label
Opcode Operand
ENDM
The
ENDM
directive
is
required to terminate a macro definition and follows the last prototype instruction.
It
is
also required to terminate code repetition blocks defined
by
the REPT, IRP, and IRPC directives.
Any data appearing
in
the label or operand fields
of
an
ENDM
directive causes
an
error.
LOCA L Directive
NOTE
Because nested macro calls are not expanded during macro
definition, the
ENDM
directive to close
an
outer macro can-
not
be
contained
in
the expansion
of
an
inner, 'nested'
macro
call. (See 'Nested Macro Definitions' later
in
this
chapter
.)
Label
Opcode
Operand
LOCAL label name(s)
The specified
label name, are defined to have meaning only within the current macro expamion. Each time the
macro
is
called and expanded, the assembler assigns each local symbol a unique 5ymbol
in
the form 77nnnn.
The
assembler assigns nOOOl to the first local symbol, 770002 to the second, and
\0
on. The most recent symbol
name generated always indicates the total number
of
symbols created for
all
macro expansion,. The as,embler
never duplicate, these symbols. The u,er should avoid coding
symbol<.,
in
the form
)7
nnn
n
so
that there
will
not
be
a conflict with these assembler-generated symbols.
5-5

Table of Contents

Related product manuals