




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































Specification and information herein are subject to change without notice. Motorola re- serves the right to make changes without further notice to any products described in this document to improve reliability, function, or design. Motorola does not assume any liability arising out of the application or use of any product or circuit described herein, neither does it convey any license under its patent rights or the rights of others. Motorola is a registered trademark of Motorola, Inc. Motorola, Inc. is an Equal Employment/Affirmative Action Em- ployer.
This manual documents the assembler as of version 5.3.2 of the software.
© Copyright Motorola, Inc. 1994. All rights reserved.
ASM56000, SIM56000, ASM96000, SIM96000, ASM56100, and SIM56100 are trade- marks of Motorola.
MS-DOS and Windows are trademarks of Microsoft Corporation.
Sun-4 and SunOS are trademarks of Sun Microsystems, Inc.
Macintosh and MPW are trademarks of Apple Computer.
iv DSP ASSEMBLER REFERENCE MANUAL MOTOROLA
Preface
The element names are printed in lower case and contained in angle brackets. Some common elements used to describe directives are:
Supporting Publications
DSP56000 Family Manual. Motorola, Inc. 1992.
DSP96002 User’s Manual. Motorola, Inc. 1989.
DSP56100 Family Manual. Motorola, Inc. 1993.
Motorola DSP Simulator Reference Manual. Motorola, Inc. 1994.
Motorola DSP Linker/Librarian Reference Manual. Motorola, Inc. 1994.
Paragraph Page Number Title Number
MOTOROLA DSP ASSEMBLER REFERENCE MANUAL vii
Paragraph Page
viii DSP ASSEMBLER REFERENCE MANUAL MOTOROLA
Paragraph Page Number Title Number
6.3.6 Macros and Conditional Assembly............................. 74
6.3.7 Structured Programming.................................... 74
Chapter 7 STRUCTURED CONTROL STATEMENTS
7.1 INTRODUCTION............................................ 171
7.2 STRUCTURED CONTROL DIRECTIVES......................... 171
7.3 SYNTAX................................................... 172
7.3.1 .BREAK Statement........................................ 172
7.3.2 .CONTINUE Statement.................................... 173
7.3.3 .FOR Statement.......................................... 174
7.3.4 .IF Statement............................................ 175
7.3.5 .LOOP Statement......................................... 176
7.3.6 .REPEAT Statement....................................... 177
7.3.7 .WHILE Statement........................................ 177
7.4 SIMPLE AND COMPOUND EXPRESSIONS....................... 178
7.4.1 Simple Expressions....................................... 178
7.4.1.1 Condition Code Expressions.............................. 178
7.4.1.2 Operand Comparison Expressions......................... 179
7.4.2 Compound Expressions.................................... 180
7.5 STATEMENT FORMATTING................................... 180
7.5.1 Expression Formatting..................................... 180
7.5.2 .FOR/.LOOP Formatting.................................... 181
7.5.3 Assembly Listing Format................................... 181
7.6 EFFECTS ON THE PROGRAMMER’S ENVIRONMENT............. 181
Appendix A ASCII CHARACTER CODES
Appendix B DIRECTIVE SUMMARY
B.1 ASSEMBLY CONTROL....................................... 185
B.2 SYMBOL DEFINITION....................................... 186
B.3 DATA DEFINITION/STORAGE ALLOCATION..................... 186
TABLE OF CONTENTS (Continued)
Paragraph Page Appendix F
MOTOROLA DSP ASSEMBLER REFERENCE MANUAL xi
Paragraph Page Number Title Number
F.1.9 Condition Code Mnemonics................................. 305
Appendix G HOST-DEPENDENT INFORMATION
G.1 INTRODUCTION............................................ 307
G.2 DOS/386 ENVIRONMENT.................................... 307
G.2.1 Hardware Requirements................................... 307
G.2.2 Installation.............................................. 308
G.2.3 Source File Text.......................................... 308
G.2.4 Invoking the Assembler.................................... 308
G.3 SunOS ENVIRONMENT...................................... 309
G.3.1 Hardware Requirements................................... 309
G.3.2 Installation.............................................. 309
G.3.3 Source File Text.......................................... 310
G.3.4 Invoking the Assembler.................................... 310
G.4 MACINTOSH ENVIRONMENT................................. 310
G.4.1 Hardware Requirements................................... 311
G.4.2 Installation.............................................. 311
G.4.3 Source File Text.......................................... 311
G.4.4 Invoking the Assembler.................................... 312
The Motorola DSP Assemblers are programs that process assembly language source statements written for Motorola’s family of digital signal processors. The assembler trans- lates these source statements into object programs compatible with other Motorola DSP software and hardware products.
The assembly language provides mnemonic operation codes for all machine instructions in the digital signal processor instruction set. In addition, the assembly language contains mnemonic directives which specify auxiliary actions to be performed by the assembler. These directives are not always translated into machine language. The assembly lan- guage enables the programmer to define and use macro instructions which replace a sin- gle statement with a predefined sequence of statements found in the macro definition. Conditional assembly also is supported.
The assembler is distributed on various media and in different formats depending on the host environment. See Appendix G, HOST-DEPENDENT INFORMATION, for details on installing and operating the assembler on your particular machine.
The general format of the command line to invoke the assembler is:
DSPASM [options]
where:
DSPASM
The name of the Motorola DSP assembler program appropriate for the tar- get processor (see Appendix F, DEVICE-DEPENDENT INFORMATION).
Chapter 1 - MOTOROLA DSP ASSEMBLER
For example, for the Motorola DSP56000 processor the name of the assem- bler executable is ASM.
[options]
Any of the following command line options. These can be in any order, but must precede the list of source filenames. Some options can be given more than once; the individual descriptions indicate which options may be speci- fied multiple times. Option letters can be in either upper or lower case.
Command options that are used regularly may be placed in the environment variable DSPASMOPT. If the variable is found in the environment the as- sembler adds the associated text to the existing command line prior to pro- cessing any options. See your host documentation for instructions on how to define environment variables.
Option arguments may immediately follow the option letter or may be sepa- rated from the option letter by blanks or tabs. However, an ambiguity arises if an option takes an optional argument. Consider the following command line:
ASM56000 -B MAIN IO
In this example it is not clear whether the file MAIN is a source file or is meant to be an argument to the -B option. If the ambiguity is not resolved the assembler will assume that MAIN is a source file and attempt to open it for reading. This may not be what the programmer intended.
There are several ways to avoid this ambiguity. If MAIN is supposed to be an argument to the -B option it can be placed immediately after the option letter:
ASM56000 -B MAIN IO
If there are other options on the command line besides those that take op- tional arguments the other options can be placed between the ambiguous option and the list of source file names:
ASM56000 -B MAIN -V IO
An alternative is to use two successive hyphens to indicate the end of the option list:
ASM56000 -B -- MAIN IO
In this latter case the assembler interprets MAIN as a source file name and uses the default naming conventions for the -B option.
Chapter 1 - MOTOROLA DSP ASSEMBLER
bol>
Example: ASM96000 -D POINTS 16 prog.asm
All occurrences of the symbol POINTS in the program PROG.ASM will be replaced by the string ‘16’.
-EA
These options allow the standard error output file to be reassigned on hosts that do not support error output redirection from the command line.
The -EA option causes the standard error stream to be written to
Example: ASM96000 -EW errors prog.asm
Redirect the standard error output to the file ERRORS. If the file al- ready exists, it will be overwritten.
-F
Indicates that the assembler should read command line input from
The -F option was introduced to circumvent the problem of limited line lengths in some host system command interpreters. It may be used as often as desired, including within the argument file itself. Command options may also be supplied using the DSPASMOPT environment variable. See the dis- cussion of DSPASMOPT under [options] at the beginning of this section.
Example: ASM96000 -F opts.cmd
Invoke the assembler and take command line options and source filenames from the command file OPTS.CMD.
Chapter 1 - MOTOROLA DSP ASSEMBLER
Send source file line number information to the object file. This option is val- id only in conjunction with the -B command line option. The generated line number information can be used by debuggers to provide source-level de- bugging.
Example: ASM56000 -B -G myprog.asm
Assemble the file MYPROG.ASM and send source file line number information to the resulting object file MYPROG.CLN.
-I
When the assembler encounters INCLUDE files, the current directory (or the directory specified in the INCLUDE directive) is first searched for the file. If it is not found and the -I option is specified, the assembler prefixes the file- name (and optional pathname) specified in the INCLUDE directive with
The pathname must be a legal operating system pathname. The -I option may be repeated as many times as desired. The directories will be searched in the order specified on the command line.
Example: ASM56000 -I \project\ testprog
This example uses IBM PC pathname conventions, and would cause the assembler to prefix any INCLUDE files not found in the current directory with the \project\ pathname.
-L
This option specifies that a listing file is to be created for assembler output.
If a pathname is not specified, the file will be created in the current directory. If no filename is specified, the assembler will use the basename (filename without extension) of the first filename encountered in the source input file list and append .LST to the basename. If the -L option is not specified, then the assembler will route listing output to the standard output (usually the console or terminal screen) by default. The -L option should be specified
Chapter 1 - MOTOROLA DSP ASSEMBLER
below. Note that if this option is not used the assembler runs with all latest revision level enhancements on by default.
Processor Identifier
DSP56001 Rev. C 56001c DSP56002 56002 DSP56004 56004 DSP56166 56166 DSP96001 Rev. B 96001b DSP96002 96002
Example: ASM56000 -P 56001c myprog.asm
Assemble MYPROG.ASM with the DSP56000 Revision C enhance- ments.
-Q
On some hosts the assembler displays a banner on the console when in- voked. This option inhibits the banner display. It has no effect on hosts where the signon banner is not displayed by default.
Example: ASM56000 -Q myprog.asm
Assemble the file MYPROG.ASM but do not display the signon ban- ner on the console.
-R
Run the assembler without the specified processor revision level enhance- ments. This is for backward compatibility so that the assembler will flag new constructions as illegal.
This option is superseded by the -P option.
Processor Revision
DSP56001 Rev. C C DSP56002 2 DSP56004 4 DSP56166 6 DSP96000 Rev. B B DSP96001 1
Example: ASM56000 -RC myprog.asm
Assemble MYPROG.ASM without the DSP56000 Revision C en- hancements.
Chapter 1 - MOTOROLA DSP ASSEMBLER
This option causes the assembler to report assembly progress (beginning of passes, opening and closing of input files) to the standard error output stream. This is useful to insure that assembly is proceeding normally.
Example: ASM56000 -V myprog.asm
Assemble the file MYPROG.ASM and send progress lines to the standard error output.
-Z
This option causes the assembler to strip symbol information from the ab- solute load file. Normally symbol information is retained in the object file for symbolic reference purposes. Note that this option is valid only when the assembler is in absolute mode via the -A command line option and when an object file is created ( -B option).
Example: ASM56000 -A -B -Z myprog.asm
Assemble the file MYPROG.ASM in absolute mode and strip symbol information from the load file created as output.
A list of operating system compatible filenames (including optional path- names). If no extension is supplied for a given file, the assembler first will attempt to open the file using the filename as supplied. If that is not suc- cessful the assembler appends .ASM to the filename and attempts to open the file again. If no pathname is specified for a given file, the assembler will look for that file in the current directory. The list of files will be processed sequentially in the order given and all files will be used to generate the ob- ject file and listing.
The assembler will redirect the output listing to the standard output if the output listing is not suppressed with the IL option, or if it is not redirected via the -L command line option described above. The standard output generally goes to the console or terminal screen by default, but can be diverted to a file or to a printer by using the I/O redirection facilities of the host operating system, if available. Error messages will always appear on the stan- dard output, regardless of any option settings. Note that some options ( -B , -L ) allow a hyphen as an optional argument which indicates that the corresponding output should be sent to the standard output stream. Unpredictable results may occur if, for example, the object file is explicitly routed to standard output while the listing file is allowed to default to the same output stream.
For more details on assembler operation in a particular machine environment see Appen- dix G, HOST-DEPENDENT INFORMATION.