.BREAK

Exit from structured loop construct.

.BREAK [ expression]

Remarks

The .BREAK statement causes an immediate exit from the innermost enclosing loop construct ( .WHILE, .REPEAT, .FOR, .LOOP). If the optional expression is given, loop exit depends on the outcome of the condition.

A .BREAK statement does not exit an .IF- THEN- .ELSE construct. If a .BREAK is encountered with no loop statement active, a warning is issued.

The .BREAK statement should be used with care near .ENDL directives or near the end of DO loops. It generates a jump instruction which is illegal in those contexts. The optional expression is limited to condition code expressions only.

Example

.WHILE x:(r1)+ <GT> #0 ;loop until zero is found

...IF <cs>

.BREAK ;causes exit from WHILE loop

.ENDI

. ;any instructions here are skipped.

.ENDW

;execution resumes here after .BREAK