beautypg.com

Ifsame, Ifma, Macros – Zilog Z8F0130 User Manual

Page 352: Ifsame ifma

background image

Using the Macro Assembler

UM013037-1212

328

Zilog Developer Studio II – Z8 Encore!
User Manual

IFSAME

Checks to see if two string constants are the same. If the strings are the same, the result is
true; otherwise, the result is false. If the strings are not enclosed by quotes, the comma is
used as the separator.

Syntax

IFSAME

<string_const> , <string_const>

<code_body>

[

ELSE

<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.

Syntax

IFMA

<arg_number>

<code_body>

[

ELSE

<code_body>]

ENDIF

Macros

Macros allow a sequence of assembly source lines to be represented by a single assembler
symbol. In addition, arguments can be supplied to the macro in order to specify or alter the
assembler source lines generated once the macro is expanded. The following sections
describe how to define and invoke macros:

Macro Definition

– see page 329

Concatenation

– see page 329

Macro Invocation

– see page 330

Local Macro Labels

– see page 330

Optional Macro Arguments

– see page 331

Exiting a Macro

– see page 331