Chapter 10 Writing Assembler Control Statements

10.4.5 #ifgt, #ifge

Syntax

Syntax for #ifgt

Syntax for #ifge

#ifgt

expression

#ifge

expression

 

block1

 

block1

[#else

block2]

[#else

block2]

 

 

#endif

 

#endif

 

Coding rules

#ifgt

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

#ifge

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

Note that 0 is not included in positive numbers.

Usage example

A source file that uses #ifgt is shown below.

DEVICE

equ

1

_TEXT

section

CODE, PUBLIC, 1

#ifgt

DEVICE-1

 

#else

mov

0x01, D0

mov

0x02, D0

#endif

 

 

#ifge

DEVICE-1

 

#else

mov

0x03, D1

mov

0x04, D1

#endif

 

 

200 Conditional Assembly

Page 212
Image 212
Panasonic MN1030 user manual 10.4.5 #ifgt, #ifge, #else Mov 0x01, D0 0x02, D0 #endif #ifge