Share via


ARM Directives for Conditional Assembly

The ARM assembler supports conditional assembly for sections of a source file; that is, it assembles the specified sections if certain conditions are true. In addition, the assembler supports WHILE...WEND directives for conditional looping that are useful for generating repetitive tables. Conditional looping produces an assembly-time loop, not a run-time loop. Because the test for the WHILE condition is made at the top of the loop, it is possible that no code is generated during assembly; lines are listed as for conditional assembly.

The following table describes the ARM assembler directives required for conditional and repetitive assembly.

Directive Description
[ or IF Marks the start of the condition.
] or ENDIF Marks the end of the condition.
| or ELSE Provides an else construct.
WHILE Marks the start of the repetitive condition.
WEND Marks the end of the repetitive condition.

Note   The characters [, |, and ] may not be the first character in a line. The must be preceded by a space or by a tab.

The following code shows the proper syntax for conditional assembly.

[ logical-expression
...code...
|
...code...
]

The following code shows the proper syntax for repetitive assembly.

WHILE logical-expression
...code...
WEND

See Also

ARM Assembler Directives | ARM Assembler | ARM Initialization and Layout Directives | ARM Linking Directives | ARM Diagnostic Directives | ARM Dynamic Listing Directive Options | ARM-Thumb Interworking Directives | ARM Constant and Variable Declarations | ARM Assembler Directives for Macro Definition | Miscellaneous ARM Directives

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.