ebook img

components :: motorola :: 56000 :: 1996 Motorola DSP Assembler Manual 1996 PDF

354 Pages·1996·1.3 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview components :: motorola :: 56000 :: 1996 Motorola DSP Assembler Manual 1996

MOTOROLA DIGITAL SIGNAL PROCESSING DEVELOPMENT SOFTWARE MOTOROLA DSP ASSEMBLER REFERENCE MANUAL Motorola, Incorporated Semiconductor Products Sector DSP Division 6501 William Cannon Drive West Austin, TX, 78735-8598 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 6.0 of the software. © Copyright Motorola, Inc. 1996. All rights reserved. ASM56000, SIM56000, ASM96000, SIM96000, ASM56100, SIM56100, ASM56300, SIM56300, ASM56800 and SIM56800 are trademarks 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. MOTOROLA DSP ASSEMBLER 1 WRITING ASSEMBLY LANGUAGE PROGRAMS 2 EXPRESSIONS 3 SOFTWARE PROJECT MANAGEMENT 4 MACROS AND CONDITIONAL ASSEMBLY 5 ASSEMBLER CHARACTERS AND DIRECTIVES 6 STRUCTURED CONTROL STATEMENTS 7 ASCII CHARACTER CODES A DIRECTIVE SUMMARY B ASSEMBLER MESSAGES C ASSEMBLER LISTING FILE FORMAT D MOTOROLA DSP OBJECT FILE FORMAT (COFF) E DEVICE-DEPENDENT INFORMATION F HOST-DEPENDENT INFORMATION G INDEX I 1 MOTOROLA DSP ASSEMBLER 2 WRITING ASSEMBLY LANGUAGE PROGRAMS 3 EXPRESSIONS 4 SOFTWARE PROJECT MANAGEMENT 5 MACROS AND CONDITIONAL ASSEMBLY 6 ASSEMBLER CHARACTERS AND DIRECTIVES 7 STRUCTURED CONTROL STATEMENTS A ASCII CHARACTER CODES B DIRECTIVE SUMMARY C ASSEMBLER MESSAGES D ASSEMBLER LISTING FILE FORMAT E MOTOROLA DSP OBJECT FILE FORMAT (COFF) F DEVICE-DEPENDENT INFORMATION G HOST-DEPENDENT INFORMATION INDEX I Preface PREFACE Notation The notational conventions used in this manual are: DIRECTIVE All assembler mnemonics and directives are shown in bold upper case to highlight them. However, the assembler will recognize both upper and lower case for mne- monics and directives. { } Contains a list of elements or directives, one of which must be selected. Each choice will be separated by a vertical bar. For example, {R I L} indicates that either R or L must be selected. [ ] Contains one or more optional elements. If more than one optional element is shown, the required element separators are indicated. All elements outside of the angle brackets (< >) must be specified as they appear. For example, the syntacti- cal element [<number>,] requires the comma to be specified if the optional element <number> is selected. MOTOROLA DSP ASSEMBLER REFERENCE MANUAL i Preface < > The element names are printed in lower case and contained in angle brackets. Some common elements used to describe directives are: <comment> A statement comment <label> A statement label <expr> or An assembler expression <expression> <number> A numeric constant <string> A string of ASCII characters enclosed in quotes <delimiter> A delimiter character <option> An assembler option <sym> or An assembler symbol <symbol> Supporting Publications DSP56000 Family Manual. Motorola, Inc. 1992. DSP96002 User’s Manual. Motorola, Inc. 1989. DSP56100 Family Manual. Motorola, Inc. 1993. DSP56300 Family Manual. Motorola, Inc. 1995. DSP56800 Family Manual. Motorola, Inc. 1996. Motorola DSP Simulator Reference Manual. Motorola, Inc. 1996. Motorola DSP Linker/Librarian Reference Manual. Motorola, Inc. 1996. ii DSP ASSEMBLER REFERENCE MANUAL MOTOROLA TABLE OF CONTENTS PREFACE TABLE OF CONTENTS LIST OF FIGURES Chapter 1 MOTOROLA DSP ASSEMBLER 1.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 1.2 ASSEMBLY LANGUAGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 1.3 INSTALLING THE ASSEMBLER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 1.4 RUNNING THE ASSEMBLER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 1.5 ASSEMBLER OPTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 1.6 ASSEMBLER PROCESSING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9 1.7 DEFINITION OF TERMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9 1.8 ASSEMBLER SUPPORT FOR DIGITAL SIGNAL PROCESSING . . . . . . 1-10 Chapter 2 WRITING ASSEMBLY LANGUAGE PROGRAMS 2.1 INPUT FILE FORMAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1 2.2 SYMBOL NAMES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1 2.3 STRINGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 2.4 SOURCE STATEMENT FORMAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 2.4.1 Label Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 2.4.2 Operation Field. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 2.4.3 Operand Field. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5 2.4.4 Operation 2 Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5 2.4.5 Operand 2 Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5 2.4.6 Data Transfer Fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5 2.4.7 Comment Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6 2.5 ASSEMBLER OUTPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6 Chapter 3 EXPRESSIONS 3.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 MOTOROLA DSP ASSEMBLER REFERENCE MANUAL iii Table of Contents 3.2 ABSOLUTE AND RELATIVE EXPRESSIONS . . . . . . . . . . . . . . . . . . . . . .3-1 3.3 EXPRESSION MEMORY SPACE ATTRIBUTE . . . . . . . . . . . . . . . . . . . . .3-1 3.4 INTERNAL EXPRESSION REPRESENTATION . . . . . . . . . . . . . . . . . . . . .3-3 3.5 CONSTANTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3 3.5.1 Numeric Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 3.5.2 String Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 3.6 OPERATORS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4 3.6.1 Unary operators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 3.6.2 Arithmetic operators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 3.6.3 Shift operators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 3.6.4 Relational operators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 3.6.5 Bitwise operators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 3.6.6 Logical operators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 3.7 OPERATOR PRECEDENCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7 3.8 FUNCTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7 3.8.1 Mathematical Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8 3.8.2 Conversion Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 3.8.3 String Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 3.8.4 Macro Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 3.8.5 Assembler Mode Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10 Chapter 4 SOFTWARE PROJECT MANAGEMENT 4.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-1 4.2 SECTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-1 4.3 SECTIONS AND DATA HIDING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-2 4.3.1 Sections and Symbols. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 4.3.2 Sections and Macros. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 4.3.3 Nested and Fragmented Sections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 4.4 SECTIONS AND RELOCATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-5 4.5 ADDRESS ASSIGNMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-6 4.5.1 The ORG Directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7 4.5.2 Overlays. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9 4.5.3 Address Assignment Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10 4.5.4 Circular Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11 4.6 EXAMPLE 1: MULTI-PROGRAMMER ENVIRONMENT . . . . . . . . . . . . . .4-13 4.6.1 Absolute Mode Implementation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14 iv DSP ASSEMBLER REFERENCE MANUAL MOTOROLA Table of Contents 4.6.2 Relative Mode Implementation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15 4.7 EXAMPLE 2: OVERLAYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16 4.7.1 Absolute Mode Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17 4.7.2 Relative Mode Implementation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18 4.8 EXAMPLE 3: BOOTSTRAP OVERLAY . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20 4.8.1 Absolute Mode Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21 4.8.2 Relative Mode Implementation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21 Chapter 5 MACRO OPERATIONS AND CONDITIONAL ASSEMBLY 5.1 MACRO OPERATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1 5.2 MACRO LIBRARIES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 5.3 MACRO DEFINITION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 5.4 MACRO CALLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 5.5 DUMMY ARGUMENT OPERATORS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5 5.5.1 Dummy argument concatenation operator - \. . . . . . . . . . . . . . . . . . . . . 5-5 5.5.2 Return value operator - ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6 5.5.3 Return hex value operator - % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7 5.5.4 Dummy argument string operator - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7 5.5.5 Macro local label override operator - ^ . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8 5.6 DUP, DUPA, DUPC, DUPF DIRECTIVES . . . . . . . . . . . . . . . . . . . . . . . . . 5-9 5.7 CONDITIONAL ASSEMBLY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9 Chapter 6 ASSEMBLER SIGNIFICANT CHARACTERS AND DIRECTIVES 6.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1 6.2 ASSEMBLER SIGNIFICANT CHARACTERS . . . . . . . . . . . . . . . . . . . . . . . 6-1 6.3 ASSEMBLER DIRECTIVES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 6.3.1 Assembly Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 6.3.2 Symbol Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 6.3.3 Data Definition/Storage Allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 6.3.4 Listing Control and Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 6.3.5 Object File Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 6.3.6 Macros and Conditional Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 6.3.7 Structured Programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 MOTOROLA DSP ASSEMBLER REFERENCE MANUAL v Table of Contents Chapter 7 STRUCTURED CONTROL STATEMENTS 7.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-1 7.2 STRUCTURED CONTROL DIRECTIVES . . . . . . . . . . . . . . . . . . . . . . . . . .7-1 7.3 SYNTAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-2 7.3.1 .BREAK Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 7.3.2 .CONTINUE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3 7.3.3 .FOR Statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4 7.3.4 .IF Statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5 7.3.5 .LOOP Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6 7.3.6 .REPEAT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7 7.3.7 .WHILE Statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7 7.4 SIMPLE AND COMPOUND EXPRESSIONS . . . . . . . . . . . . . . . . . . . . . . .7-8 7.4.1 Simple Expressions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8 7.4.1.1 Condition Code Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-8 7.4.1.2 Operand Comparison Expressions . . . . . . . . . . . . . . . . . . . . . . . . . .7-9 7.4.2 Compound Expressions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10 7.5 STATEMENT FORMATTING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-10 7.5.1 Expression Formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10 7.5.2 .FOR/.LOOP Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11 7.5.3 Assembly Listing Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11 7.6 EFFECTS ON THE PROGRAMMER’S ENVIRONMENT . . . . . . . . . . . . .7-11 Appendix A ASCII CHARACTER CODES Appendix B DIRECTIVE SUMMARY B.1 ASSEMBLY CONTROL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-1 B.2 SYMBOL DEFINITION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-2 B.3 DATA DEFINITION/STORAGE ALLOCATION. . . . . . . . . . . . . . . . . . . . . . B-2 B.4 LISTING CONTROL AND OPTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-2 B.5 OBJECT FILE CONTROL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-3 B.6 MACROS AND CONDITIONAL ASSEMBLY . . . . . . . . . . . . . . . . . . . . . . . B-3 B.7 STRUCTURED PROGRAMMING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-3 vi DSP ASSEMBLER REFERENCE MANUAL MOTOROLA

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.