SPRUI03E June 2015 – January 2023
Conditional assembly directives enable you to instruct the assembler to assemble certain sections of code according to a true or false evaluation of an expression. Two sets of directives allow you to assemble conditional blocks of code:
|
||
.if condition | marks the beginning of a conditional block and assembles code if the .if condition is true. | |
[.elseif condition] | marks a block of code to be assembled if the .if condition is false and the .elseif condition is true. | |
.else | marks a block of code to be assembled if the .if condition is false and any .elseif conditions are false. | |
.endif | marks the end of a conditional block and terminates the block. | |
|
||
.loop [count] | marks the beginning of a repeatable block of code. The optional expression evaluates to the loop count. | |
.break [end condition] | tells the assembler to assemble repeatedly when the .break end condition is false and to go to the code immediately after .endloop when the expression is true or omitted. | |
.endloop | marks the end of a repeatable block. | |
The assembler supports several relational operators that are useful for conditional expressions. For more information about relational operators, see Section 5.10.2. |