![](http://datasheet.mmic.net.cn/330000/DSPASMRM_datasheet_16391695/DSPASMRM_85.png)
Macro Operations And Conditional Assembly
DUP, DUPA, DUPC, DUPF Directives
MOTOROLA
DSP ASSEMBLER REFERENCE MANUAL
For More Information On This Product,
Go to: www.freescale.com
5-9
macro label called _LOCAL and attempting to reference it as in the above example. In
that case the macro local label override operator prevents the Assembler from seeing the
local label definition for that reference, and an error would result.
5.6
DUP, DUPA, DUPC, DUPF DIRECTIVES
The
DUP
,
DUPA
,
DUPC
, and
DUPF
directives are specialized macro forms. They can be
thought of as a simultaneous definition and call of an unnamed macro. The source state-
ments between the
DUP
,
DUPA
,
DUPC
, and
DUPF
directives and the
ENDM
directive fol-
low the same rules as macro definitions, including (in the case of
DUPA
,
DUPC
, and
DUPF
) the dummy operator characters described previously. For a detailed description of
these directives, refer to Chapter 6.
5.7
CONDITIONAL ASSEMBLY
Conditional assembly facilitates the writing of comprehensive source programs that can
cover many conditions. Assembly conditions may be specified through the use of argu-
ments in the case of macros, and through definition of symbols via the
DEFINE
,
SET
, and
EQU
directives. Variations of parameters can then cause assembly of only those parts
necessary for the given conditions. The built-in functions of the Assembler provide a ver-
satile means of testing many conditions of the assembly environment (see Section 3.8 for
more information on the Assembler built-in functions).
Conditional directives can also be used within a macro definition to ensure at expansion
time that arguments fall within a range of allowable values. In this way macros become
self-checking and can generate error messages to any desired level of detail.
The conditional assembly directive
IF
has the following form:
IF
.
.
[
ELSE
]
.
.
ENDIF
<expression>
(the
ELSE
directive is optional)
A section of a program that is to be conditionally assembled must be bounded by an
IF
-
ENDIF
directive pair. If the optional
ELSE
directive is not present, then the source state-
ments following the
IF
directive and up to the next
ENDIF
directive will be included as part
of the source file being assembled only if the <expression> had a nonzero result. If the
<expression> has a value of zero, the source file will be assembled as if those statements
between the
IF
and the
ENDIF
directives were never encountered. If the
ELSE
directive
is present and <expression> has a nonzero result, then the statements between the
IF
and
ELSE
directives will be assembled, and the statements between the
ELSE
and
ENDIF
directives will be skipped. Alternatively, if <expression> has a value of zero, then
F
Freescale Semiconductor, Inc.
n
.