.if

Starts a conditional assembly block, making assembly conditional on the truth of a boolean expression.

  .if bool-expr statement-group    
Parameters

bool-expr

Any boolean expression.

statement-group

Any valid assembly statements.

Remarks

This directive starts an .if ... [.elseif] ... [.else] ... .endif conditional structure (with each of these directives starting a new line). There must be a corresponding .endif directive for each .if directive. An .else directive is optional; one or more .elseif directives are optional.

The simplest such conditional structure follows the pattern .if ... assembly statements ... .endif. The preprocessor implements the assembly statements only if the .if directive's bool-expr condition is true.

The next simplest conditional structure follows the pattern .if ... assembly statements 1 ... .else ... assembly statements 2 ... .endif. The preprocessor implements the assembly statements 1 if the .if directive's bool-expr condition is true; the preprocessor implements assembly statements 2 if the condition is false.

You can use .elseif directives to create increasingly complex conditional structures.