Chapter 11 Writing Macro Control Statements

;

global

debug

 

 

extml

macro

 

 

mov

1, D0

#ifndef

TEST

 

#endif

exitm

 

jsr

debug

 

;

endm

 

 

 

_TEXT

section

CODE, PUBLIC, 1

 

extm1

 

#define

TEST

 

 

extm1

 

The list file is shown below. The second macro call has been expanded after #endif.

 

 

 

exitm.lst

 

Page 1

 

*** Panax Series MN1030 Cross Assembler** *

Loc

Object

Line

Source

 

 

 

 

1

 

global

debug

 

 

2

;

 

 

 

 

M3

extm1

macro

 

 

 

4

 

mov

1, D0

 

 

5

#ifndef

TEST

 

 

 

6

 

exitm

 

 

 

7

#endif

 

 

 

 

8

 

jsr

debug

 

 

9

 

endm

 

 

 

10

;

 

 

 

 

11

_TEXT

section

CODE, PUBLIC, 1

 

 

M12

 

extm1

 

00000000

8001

12+

 

mov

1, D0

 

 

12+

#ifndef

TEST

 

 

 

M12+

 

exitm

 

 

 

13

#define

TEST

 

 

 

M14

 

extm1

 

00000002

8001

14+

 

mov

1, D0

 

 

14+

#itndef

TEST

 

 

 

14x

 

exitm

 

 

 

14+

#endif

 

 

00000004

F8FEFCFCFF000000

+14+

 

jsr

debug

0000000c

00F8FE04

14+

 

 

 

216 Forced Termination of Macro Expansion (exitm)

Page 228
Image 228
Panasonic MN1030 user manual Test