Writing Assembly Language Programs
Source Statement Format
2-4
DSP ASSEMBLER REFERENCE MANUAL
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
the terminating address of a
DO
loop). Note that the maximum length of a local label in-
cludes the leading underscore (
_
) character.
Use of local labels in macros represents a special case. All local labels within a macro are
considered distinct for the currently active level of macro expansion (unless the macro lo-
cal label override operator is used; see Chapter 5). These local labels are valid for the en-
tire macro expansion and are not considered bounded by non-local labels. Therefore, all
local labels within a macro must be unique. This mechanism allows the programmer to
freely use local labels within a macro definition without regard to the number of times that
the macro is expanded. Non-local labels within a macro expansion are considered to be
normal labels and therefore cannot occur more than once unless used with the
SET
di-
rective (see Chapter 6).
A label may occur only once in the label field of an individual source file unless it is used
as a local label, a label local to a section, or is used with the
SET
directive. If a non-local
label does occur more than once in a label field, each reference to that label after the first
will be flagged as an error.
A line consisting of a label only is a valid line and has the effect of assigning the value of
the location counter to the label. With the exception of some directives, a label is assigned
the value of the location counter of the first word of the instruction or data being assem-
bled.
2.4.2
Operation Field
The operation field appears after the label field, and must be preceded by at least one
space or tab. Entries in the operation field may be one of three types:
Opcode
-
Mnemonics that correspond directly to DSP machine instructions.
Directive
-
Special operation codes known to the Assembler which control
the assembly process.
Macro call
-
Invocation of a previously defined macro which is to be inserted
in place of the macro call.
The Assembler first searches for operation codes in an internal macro definition table. If
no match is found, the table of machine operation codes and Assembler directives is
searched. If neither of the tables holds the specified operation code, an error message is
generated (this sequence can be altered with the
MACLIB
directive). Macro names can
therefore replace standard machine operation codes and Assembler directives, although
a warning will be issued if such a replacement occurs. The warning can be avoided by use
of the
RDIRECT
directive. See Chapter 6 for more information on the
MACLIB
and
RDI-
RECT
directives.
F
Freescale Semiconductor, Inc.
n
.