Chapter 10 Writing Assembler Control Statements

Usage example

A source file that uses #ifb is shown below. If the dummy parameter para to the macro debug is a null character, the program will execute next_cycle. If it is not a null character, the program will execute test and then execute next_cycle. In this example, the identifier MODE is passed to the macro debug. When a replacement string has been specified, the call is without a null character.

;

global

check

proc

 

 

 

debug

macro

string

 

#ifb

string

 

 

 

jsr

check

 

#else

jsr

proc

 

jsr

proc

 

#endif

 

endm

 

 

;

 

 

 

 

 

_TEXT

section

CODE, PUBLIC,

 

 

 

1

 

#define

MODE

debug_on

 

 

debug

MODE

 

#undef

MODE

 

 

#define

MODE

 

 

 

debug

MODE

 

Conditional Assembly 203

Page 215
Image 215
Panasonic MN1030 user manual Usage example, Debugon