5.8.67. WHILE directive

The WHILE directive starts a sequence of instructions or directives that are to be assembled repeatedly. The sequence is terminated with a WEND directive. See WEND directive.

Syntax

The syntax of WHILE is:

WHILE logical-expression
code
WEND

where:

logical-expression

is an expression that can evaluate to either {TRUE} or {FALSE}. See Logical expressions.

Usage

Use the WHILE directive, together with the WEND directive, to assemble a sequence of instructions a number of times. The number of repetitions may be zero.

You can use IF...ENDIF conditions within WHILE...WEND loops.

WHILE...WEND loops can be nested. See Nesting directives.

Example

count		SETA		1					; you are not restricted to
		WHILE		count <= 4					; such simple conditions
count			SETA		count+1				; In this case,
			; code						; this code will be
			; code						; repeated four times
		WEND
Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0041C
Non-Confidential