Section 3: Assembler
283
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
FOR . . . ENDF — Loop Based on Counter
Syntax
FOR[.
size] op1 = op2 { TO | DOWNTO } op3 [BY op4] DO[.extent ]
[
statement]
.
.
.
ENDF
Description
size
Specifies the size qualifier for instructions that are generated to
operate on
op1, op2, op3, and op4. 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
op1
Specifies the loop counter. It must be an alterable effective
address expression (see section 3.5 Effective Addressing
Modes).
op2
Specifies the initial value of the loop counter. It can be any
effective address expression.
op3
Specifies the final value of the loop counter. It can be any effective
address expression.
op4
Specifies the step value (increment/decrement) for the loop
counter. It can be any effective address expression. If omitted, it
defaults to #1.
extent
Specifies the
extent of the forward branch that is generated to
span the loop body. The legal values are shown below; if omitted,
the branch extent is determined by the current default forward
branch size (see OPT BRB/BRS/BRW directive).
B
8-bit forward branch
S
8-bit forward branch
W
16-bit forward branch
statement
Specifies an assembler statement.