EasyManua.ls Logo

Intel 8080 - B4_Page_14

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
S.
Macros
The SHIFTR macro generates nothing
if
the first parameter
is
neither R nor L. Therefore, the following calls
produce no code. The result
in
the object program
is
as
though the SHIFTR macro does
not
appear
in
the
source program.
SHIFTR 5
SHIFTR 'B',2
The following call to the
SHIFTR macro generates three
RAR
instructions:
SHIFTR 'R',3
Assume that a SET directive elsewhere
in
the source program
has
given COUNT the value
6.
The following call
generates
five
RAL instructions:
SHIFTR
'L ',%COUNT
-1
The following
is
a redefinition
of
the SHIFTR macro.
In
this definition, notice that concatenation
is
used to
form the RAR or RAL operation code.
If
a call to the SHIFTR macro specifies a character other than R or
L,
illegal operation codes are generated. The assembler
flags
all
illegal operation codes
as
errors.
SHIFTR MACRO
REPT
RA&X
ENOM
ENOM
X,Y
Y
NULL.
MACROS
A macro may legally comprise only the MACRO and
ENOM
directives. Thus, the following
is
a legal macro
definition:
NAOA
MACRO
ENOM
Pl,P2,P3,P4
A call to this macro produces no source code and therefore
has
no effect on the program.
Although there
is
no reason to write such a macro, the
null
(or empty) macro body
has
a practical application.
F or example,
all
the macro prototype instructions might
be
enclosed with I F
-END
I F condi tional directives.
When
none
of
the specified conditions
is
satisfied,
all
that remains of the macro
is
the MACRO directive and
the
ENOM
directive.
SAMPLE MACROS
The following sample macros further demonstrate the
use
of
macro directives and operators.
5·16

Table of Contents

Related product manuals