
Structured Control Statements
Effects On The Programmer’s Environment
MOTOROLA
DSP ASSEMBLER REFERENCE MANUAL
For More Information On This Product,
Go to: www.freescale.com
7-11
there must be white space (blank, tab) between all operands and their associated opera-
tors, including boolean operators in compound expressions. Moreover, there must be
white space between the structured control directive and the expression, and between the
expression and any optional directive modifier (
THEN
,
DO
). An Assembler expression
(Chapter 3) used as an operand in a structured control statement expression must not
have white space in it, since it is parsed by the standard Assembler evaluation routines:
.IF
#@CVI(@SQT(4.0))
<GT> #2
; no white space in first operand
7.5.2
.FOR/.LOOP Formatting
The
.FOR
and
.LOOP
directives represent special cases. The
.FOR
structured control
statement consists of several fields:
.FOR <op1> = <op2> TO <op3> BY <op4> DO
There must be white space between all operands and other syntactic entities such as
=
,
TO
,
BY
, and
DO
. As with expression formatting, an Assembler expression used as an
operand must not have white space in it:
.FOR X:CNT = #0 TO
Y:(targ*2)+1
BY
#@CVI(@POW(2.0,@CVF(R)))
In the example above, the
.FOR
loop operands represented as Assembler expressions
(symbol, function) do not have embedded white space, whereas the loop operands are
always separated from structured control statement keywords by white space.
The count field of a
.LOOP
statement must be separated from the
.LOOP
directive by
white space. The count itself may be any arbitrary Assembler expression, and therefore
must not contain embedded blanks.
7.5.3
Assembly Listing Format
Structured control statements begin with the directive in the opcode field; any optional la-
bel is output in the label field. The rest of the statement is left as is in the operand field,
except for any trailing comment; the X and Y data movement fields are ignored. Com-
ments following the statement are output in the comment field (unless the unreported
comment delimiter is used; see Chapter 6).
Statements are expanded using the macro facilities of the Assembler. Thus the generated
code can be sent to the listing by specifying the
MEX
Assembler option, either via the
OPT
directive (Chapter 6) or the
-O
command line option (Chapter 1).
7.6
EFFECTS ON THE PROGRAMMER’S ENVIRONMENT
During assembly, global labels beginning with "
Z_L
" are generated. They are stored in the
symbol table and should not be duplicated in user-defined labels. Because these non-lo-
cal labels ordinarily are not visible to the programmer there can be problems when local
F
Freescale Semiconductor, Inc.
n
.