Structured Control - Repeat


Repeat - Repeats the commands specified until the <expression> is true.

The Repeat statement has the following syntax:

REPEAT 
   code 
UNTIL[.size] expression [DO[.extent]]

size - The value B, W, or L, specifying the size of the operand comparison.  These values correspond to the Byte, Word, or Long word data size.
         A size may not be specified when the expression consists of only a condition code.

expression - The expression tested.  For a description of the expression syntax, see the Expression Syntax page.

extent - Optional value S or L, indicating the size of the branch to use (short or long). If no extent is specified the assembler will use a short branch if possible.

code - The series of assembly commands executed until the <expression> is true.

One space should be used to separate each part of the statement.

===Notes===

The code instructions are executed once even if the expression is true upon entry.

The CCR's (condition code register) flags are set and tested by using this command after each execution of the code instructions.

EXAMPLE

REPEAT
   code
UNTIL.B D4 <LT> #5 DO.S