280
Section 3: Assembler
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
3.8.2.2. Macro
Invocation
The structured control constructs are specified with a set of predefined macros,
which are shown in Table 3.31. Each of these macros and their associated
parameters expand into the appropriate labels and instructions to produce the
desired control structure. These expansions will appear in the listing file if the
OPT SCEX directive is specified (default: OPT NOSCEX). An alphabetically
arranged set of macro descriptions is provided below. Structured control macros
can be nested to form more complicated control structures.
Mnemonic
Function
BREAK
Terminate Loop Execution
CONTINUE
Begin Next Loop Iteration
FOR . . . ENDF
Loop Based on Counter
IF . . . ELSE . . . ENDI
Perform Conditional Execution
REPEAT . . . UNTIL
Loop Until Condition True
WHILE . . . ENDW
Loop While Condition True
Table 3.31: Structured Control Macros
In addition to the macro mnemonics, there is a set of supporting keywords, which
are not reserved; they are AND, BY, DO, DOWNTO, OR, THEN, and TO. These
keywords are required syntax for macro invocations, but can be used elsewhere
as ordinary symbols.
As with user-defined macros, invocations of structured control macros can be
continued on additional lines, if necessary. Because of the syntax, no
continuation characters are needed; however, blank lines cannot appear
between any of the continuation lines. Comments used prior to a continuation
line must begin with an exclamation point ( ! ).
Note:
The labels that are created during the expansion of structured control macros have local
scope. They are defined using the same mechanism that is used for labels local to
user-defined macros (see section 3.8.1.4 Local Labels). The labels are named ZL1\@,
ZL2\@, ZL3\@, and ZL4\@; the \@ designator is replaced by a period ( . ) and a unique
four-digit number. These labels are treated the same as compiler local labels as far as
the symbol tables in the object and listing files are concerned (i.e., their presence or
absence is controlled with the
-S
and
-s
command line flags).
3.8.2.3.
Structured Control Reference
The remainder of this section contains detailed descriptions of the various
structured control macros. The descriptions are ordered alphabetically.