Chapter 11 Writing Macro Control Statements

Coding rules

The following instructions cannot be used within macro definitions.

include directive

macro directive — within a macro definition another different macro cannot be defined

purge directive — within a macro definition macros cannot be purged

The symbols used in the label fields within a macro definition must be declared with the local directive or passed from the outside using dummy parameters. Refer to section 11.5, "Local Symbol Declaration (local)", for details.

A macro can be redefined. The new definition will be effective from the following line on.

The purge directive can purge a macro definition. The macro will be recognized as an instruction or symbol from the following line on.

The macro name cannot be the same as a machine language mnemonic.

The assembler does not perform syntax checks when a macro is defined. If there are errors or warnings, they will be output when the macro is expanded.

Usage example

An example macro definition is shown below.

xchg

macro

 

 

 

mov

D2, D0

 

mov

D1,

D2

 

mov

D0,

D1

 

endm

 

 

208 Macro Definitions (macro, endm)

Page 220
Image 220
Panasonic MN1030 user manual Coding rules, An example macro definition is shown below