Panasonic PanaXSeries MN1030 Series User Manual page 206

Panasonic microcomputer user's manual
Table of Contents

Advertisement

Chapter 10 Writing Assembler Control Statements
Usage example
A source file that uses #if and #ifn is shown below.
DEVICE
_TEXT
#if
#else
#endif
#ifn
#else
#endif
The assembled list file is shown below. The program first sets DEVICE to 1. Therefore the expression
DEVICE-1 will be 0, so the #if directive causes line number 7 to be assembled and the #ifn directive
causes line number 10 to be assembled.
***
Loc
Object
=00000001 1
00000000
8002
00000002
8503
194 Conditional Assembly
equ
1
section
CODE, PUBLIC, 1
DEVICE-1
mov
0x01, D0
mov
0x02, D0
DEVICE-1
mov
0x03, D0
mov
0x04, D0
PanaX Series MN1030 Cross Assembler
Line
Source
DEVICE
2
3
_TEXT
4
#if
5X
6
#else
7
8
#endif
9
#ifn
10
11
#else
12X
13
#endif
if.lst
Page 1
equ
1
section
CODE, PUBLIC, 1
DEVICE-1
mov
0x01, D0
mov
0x02, D0
DEVICE-1
mov
0x03, D1
mov
0x04, D1
***

Advertisement

Table of Contents
loading

Table of Contents