beautypg.com

Macros, Macro definition, Ifma – Zilog ZUSBOPTS User Manual

Page 275

background image

UM017105-0511

Macros

Zilog Developer Studio II – ZNEO™

User Manual

247

<code_body>]

ENDIF

IFMA

Used only within a macro, this directive checks to determine if a macro argument has been
defined. If the argument is defined, the result is true. Otherwise, the result is false. If
<arg_number> is 0, the result is TRUE if no arguments were provided; otherwise, the
result is FALSE.

IFMA

refers to argument numbers that are one based (that is, the first argument is numbered

one).

Syntax

IFMA

<arg_number>

<code_body>

[

ELSE

<code_body>]

ENDIF

Macros

Macros allow a sequence of one or more assembly source lines to be represented by a sin-
gle assembler symbol. In addition, arguments can be supplied to the macro to specify or
alter the assembler source lines generated once the macro is expanded. The following sec-
tions describe how to define and invoke macros.

Macro Definition

A macro definition must precede the use of the macro. The macro name must be the same
for both the definition and the

ENDMACRO

line. The argument list contains the formal argu-

ments that are substituted with actual arguments when the macro is expanded. The argu-
ments can be optionally prefixed with the substitution character (\) in the macro body.

During the invocation of the macro, a token substitution is performed, replacing the formal
arguments (including the substitution character, if present) with the actual arguments.

Note:

This manual is related to the following products: