Chapter 11 Writing Macro Control Statements

11.6Forced Termination of Macro Expansion (exitm)

Syntax

macro_name

macro

parameter

#ifndef

identifier

 

#endif

exitm

 

.

 

 

 

 

.

 

 

.

 

 

endm

 

Functional description

The exitm directive forcibly terminates macro expansion at the point it appears. Used in conjunction with an #ifndef directive, it can end macro expansion if an identifier is undefined. If the identifier has been defined, expansion beyond #endif will be performed. (The conditions are reversed when #ifdef is used.)

Coding rules

In addition to #ifdef–#endif, all directives listed in chapter 10 "Writing Assembler Control Statements" section 10.5, “Conditional Assembly”, can be used.

The exitm directive can be used at any location. The assembler will terminate macro expansion after it appears.

The exitm directive can only be used within macro definitions.

Usage example

Usage example with #ifb directive

A source file is shown below. The identifier TEST is used for the condition. In main the first macro call is made with TEST undefined. This causes exitm to be executed, so jsr debug will not be expanded.

TEST is defined before the second macro call, so here the statements after #endif will be assembled.

Forced Termination of Macro Expansion (exitm) 215

Page 227
Image 227
Panasonic MN1030 user manual Forced Termination of Macro Expansion exitm, Parameter, #endif Exitm Endm