Section 3: Assembler
287
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
REPEAT . . . UNTIL — Loop Until Condition True
Syntax
REPEAT
[
statement]
.
.
.
UNTIL[.
size] expression
Description
statement
Specifies an assembler statement.
size
Specifies the size qualifier for the structured control
expression.
The legal values are shown below; if omitted, the size is
determined according to the rules discussed in section
3.4.2 Instruction Sizing.
B
Byte Integer
W
Word Integer
L
Long-word Integer
expression
Specifies a structured control expression (see section
3.8.2.1 Structured Control Expressions).
The REPEAT . . . UNTIL macro generates a loop that executes until the specified
condition becomes true. The termination test is performed at the end of the loop;
therefore, the loop is executed at least once, even if the terminating condition is
true upon entry.
Code is generated to evaluate the structured control expression
expression and
to perform the necessary flow of control. This will include either one or two
branches, depending on the expression’s complexity. Upon normal exit from the
loop, the condition codes will reflect the final evaluation of
expression.
To repeat an instruction or sequence of instructions at assembly-time, refer to
the REP macro in the first example in section 3.8.1.7 Macro Examples.
Example
REPEAT
MOVE.B (A0)+,(A1)+
UNTIL <EQ>