286
Section 3: Assembler
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
extent
Specifies the
extent of the forward branches that are generated to
span the THEN and ELSE statement groups. 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.
The IF . . . ELSE . . . ENDI macro is analogous to the if-else construct in C. If the
specified expression is true, the set of statements following the THEN keyword is
executed; otherwise, the set of statements following the ELSE keyword (if
present) is executed.
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.
When IF macros are nested, each ELSE clause is associated with the
immediately preceding IF macro that is not matched by an ENDI or ELSE
directive.
Example
IF.W D1 <GT> D2 THEN.S
MOVE.W D1,D0
ELSE.S
MOVE.W D2,D0
ENDI