EasyManua.ls Logo

Intel 8080 - B4_Page_06

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
5·8
This example illustrates a classic programming trade-off: speed versus memory. Although this example executes
more quickly than the example
in
Chapter 6, it requires more memory.
I RP Directive
Label
Opcode Operand
optional: IRP dummy param, dist>
The operand field for the
I
RP
(indefinite repeat) directive must contain one macro dummy parameter followed
by
a list of actual parameters enclosed
in
angle brackets. I
RP
expands
its
associated macro prototype code sub-
stituting the first actual parameter for each occurrence
of
the dummy parameter. IRP then expands the proto-
type code again substituting the second actual parameter from the list. This process continues until the list
is
exhausted.
The list
of
actual parameters to
be
substituted for the dummy parameter must
be
enclosed
in
angle brackets
«
».
Individual items
in
the list must
be
separated
by
commas. The number
of
actual parameters
in
the list
controls the number
of
times the macro body
is
repeated; a list
of
n items causes n repetitions.
An
empty list
(one with no parameters coded) specifies a null operand list.
IRP
generates one copy
of
the macro body sub-
stituting a null for each occurrence
of
the dummy parameter. Also, two commas with no intervening character
create a null parameter within the list. (See 'Special Operators' later
in
this chapter for a description
of
null
operand
s.)
Example:
The following code sequence gathers bytes of data from different areas
of
memory and then stores them
in
consecutive bytes beginning at the address
of
STORIT:
PROGRAM
CODE
GENERA
TED
CODING
LXI
H,STORIT
LXI
H,STORIT
IRP
X,<FL01,3E20H,FL03>
LOA
FLOl
LOA
X
MOV
M,A
MOV
M,A
INX
H
INX
H
LOA
3E20H
EN
OM
MOV
M,A
INX
H
LOA
FL03
MOV
M,A
INX
H
IRPC Directive
Label
Opcode
Operand
optional:
IRPC
dummy param,text

Table of Contents

Related product manuals