Subconditional assembly block directives Format .IF_FALSE .IF_TRUE .IF_TRUE_FALSE
1 – Description
For compatibility with VAX MACRO, MACRO-64 provides three directives for use within .IF blocks: Directive Function .IF_FALSE If the condition of the assembly block tests false, the program includes the source code following the .IF_FALSE directive and continuing up to the next subconditional directive or to the end of the conditional assembly block. .IF_TRUE If the condition of the assembly block tests true, the program includes the source code following the .IF_TRUE directive and continuing up to the next subconditional directive or to the end of the conditional assembly block. .IF_TRUE_ Regardless of whether the condition of the FALSE assembly block tests true or false, the source code following the .IF TRUE_FALSE directive (and continuing up to the next subconditional directive or to the end of the assembly block) is always included. The implied argument of a subconditional directive is the condition test specified when the conditional assembly block was entered. A conditional or subconditional directive in a nested conditional assembly block is not evaluated if the preceding (or outer) condition in the block is not satisfied (see Example 3 and Example 4). A conditional block with a subconditional directive is different from a nested conditional block. If the condition in the .IF is not met, the inner conditional blocks are not assembled, but a subconditional directive can cause a block to be assembled.
2 – Notes
o If a subconditional directive appears outside a conditional assembly block, the assembler displays an error message. o The alternate forms of .IF_FALSE, .IF_TRUE, and .IF_TRUE_FALSE are .IFF, .IFT, and .IFTF. o You cannot use .ELSE in the same conditional block as .IF_x.
3 – Examples
Example 1 Assume that symbol SYM is defined: .IF DEFINED SYM ; Tests TRUE since SYM is defined. . ; Assembles the following code. . . .IF_FALSE ; Tests FALSE since previous . ; .IF was TRUE. Does not . ; assemble the following code. . .IF_TRUE ; Tests TRUE since SYM is defined. . ; Assembles the following code. . . .IF_TRUE_FALSE ; Assembles following code . ; unconditionally. . . .IF_TRUE ; Tests TRUE since SYM is defined. . ; Assembles remainder of . ; conditional assembly block. . .ENDC Example 2 Assume that symbol X is defined and that symbol Y is not defined: .IF DEFINED X ; Tests TRUE since X is defined. .IF DEFINED Y ; Tests FALSE since Y is not defined. .IF_FALSE ; Tests TRUE since Y is not defined. . ; Assembles the following code. . . .IF_TRUE ; Tests FALSE since Y is not defined. . ; Does not assemble the following . ; code. . .ENDC .ENDC Example 3 Assume that symbol A is defined and that symbol B is not defined: .IF DEFINED A ; Tests TRUE since A is defined. . ; Assembles the following code. . . .IF_FALSE ; Tests FALSE since A is defined. . ; Does not assemble the following . ; code. . .IF NOT_DEFINED B ; Nested conditional directive . ; is not evaluated. . . .ENDC .ENDC Example 4 Assume that symbol X is not defined but symbol Y is defined: .IF DEFINED X ; Tests FALSE since X is not defined. . ; Does not assemble the following . ; code. . .IF DEFINED Y ; Nested conditional directive . ; is not evaluated. . . .IF_FALSE ; Nested subconditional . ; directive is not evaluated. . . .IF_TRUE ; Nested subconditional . ; directive is not evaluated. . . .ENDC .ENDC