Chapter 10 Writing Assembler Control Statements

10.4.4 #iflt, #ifle

Syntax

Syntax for #iflt

 

Syntax for #ifle

#iflt

expression

#ifle

expression

 

block1

 

block1

[#else

block2]

[#else

block2]

 

 

#endif

 

#endif

 

Functional description

#iflt

If the value of expression is negative, block1 will be assembled. If it is not negative and an #else directive has been coded, block2 will be assembled.

#ifle

If the value of expression is 0 or negative, block1 will be assembled. If it is positive and an #else directive has been coded, block2 will be assembled.

Usage example

The first example will be of #iflt. A source file is shown below. The "size-16" expression of the #iflt is not negative, so block 2 is assembled

MNXXX

equ

32

;

 

 

dsize

macro

size

#iflt

size-

32

#else

mov

0x01, D0

mov

0x02, D0

#endif

endm

 

 

 

_TEXT

section

CODE, PUBLIC, 1

 

dsize

MNXXX

 

 

 

198 Conditional Assembly

Page 210
Image 210
Panasonic MN1030 user manual 10.4.4 #iflt, #ifle