The assembler uses directives for guidance as it translates a source program into object code. Write assembly language programs using the IDE editor or any
147 pages

41 KB – 147 Pages

PAGE – 2 ============
• 2019 Analog Devices, Inc., ALL RIGHTS RESERVED. This document may not be reproduced in any form without prior, express written consent from Analog Devices, Inc. Printed in the USA. Analog Devices, Inc. reserves the right to change this product without prior notice. Information furnished by Ana- log Devices is believed to be accurate and reliable. However, no responsibility is assumed by Analog Devices for its use; nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted by implication or otherwise under the patent rights of Analog Devices, Inc. The Analog Devices logo, Blackfin, CrossCore, EngineerZone, EZ-Board, EZ-KIT Lite, EZ-Extender, SHARC, SHARC+, Blackfin+, A 2B and VisualDSP++ are registered trademarks of Analog Devices, Inc. EZ-KIT Mini and SigmaStudio are trademarks of Analog Devices, Inc. All other brand and product names are trademarks or service marks of their respective owners. CCES 2.9.0 Assembler and Preprocessor Manual ii

PAGE – 3 ============
Preface Purpose of This Manual1±1 Intended Audience..1±1 Manual Contents.1±1 Technical Support1±2 Supported Processors.1±2 Product Information..1±3 Analog Devices Website1±3 EngineerZone1±3 Notation Conventions..1±3 AssemblerAssembler Guide..2±1 Assembler Overview..2±2 Writing Assembly Programs2±2 Program Content2±3 Assembly Instructions..2±4 Assembler Directives.2±4 Preprocessor Commands.2±4 Program Structure..2±4 Code File Structure for SHARC Processors2±6 Code File Structure for Blackfin Processors2±6 Program Interfacing Requirements.2±7 Using Assembler Support for C Structs2±7 Preprocessing a Program..2±9 Using Assembler Feature Macros..2±10 __CCESVERSION__ Predefined Macro..2±31 Generating Make Dependencies2±32 CCES 2.9.0 Assembler and Preprocessor Manual iii

PAGE – 4 ============
Reading a Listing File.2±32 Assembler Syntax Reference.2±33 Assembler Keywords and Symbols2±33 Assembler Expressions2±37 Assembler Operators..2±38 Numeric Formats..2±40 Representation of Constants in Blackfin2±41 Fractional Type Support2±41 1.31 Fracts..2±42 1.0r Special Case..2±42 Fractional Arithmetic.2±42 Mixed Type Arithmetic.2±43 Comment Conventions.2±43 Conditional Assembly Directives..2±43 C Struct Support in Assembly Built-In Functions.2±45 OFFSETOF Built-In Function..2±45 SIZEOF Built-In Function..2±45 Struct References..2±46 Assembler Directives2±47 .ALIGN, Specify an Address Alignment2±51 .ASCII2±52 .BYTE, Declare a Byte Data Variable or Buffer.2±52 ASCII String Initialization Support.2±54 .COMPRESS, Start Compression2±54 .EXTERN, Refer to a Globally Available Symbol.2±55 .EXTERN STRUCT, Refer to a Struct Defined Elsewhere..2±55 .FILE_ATTR, Create an Attribute in the Object File.2±56 .FILE, Override the Name of a Source File..2±56 .FORCECOMPRESS, Compress the Next Instruction.2±57 .GLOBAL, Make a Symbol Available Globally..2±57 .IMPORT, Provide Structure Layout Information2±58 ivCCES 2.9.0 Assembler and Preprocessor Manual

PAGE – 5 ============
.INC/BINARY, Include Contents of a File..2±59 .LEFTMARGIN, Set the Margin Width of a Listing File.2±60 .LIST_DATFILE/.NOLIST_DATFILE, List Data Init Files..2±60 .LIST_DATA/.NOLIST_DATA, Listing Data Opcodes2±61 .LIST_DEFTAB/.LIST_LOCTAB, Set Tab Widths for Listings..2±61 .LIST_WRAPDATA/.NOLIST_WRAPDATA..2±62 .LIST/.NOLIST, Listing Source Lines and Opcodes..2±62 .LONG, Define and Initialize 4-Byte Data Objects.2±63 .MESSAGE, Alter the Severity of an Assembler Message..2±63 .NEWPAGE, Insert a Page Break in a Listing File2±65 .NOCOMPRESS, Terminate Compression.2±65 .PAGELENGTH, Set the Page Length of a Listing File.2±65 .PAGEWIDTH, Set the Page Width of a Listing File.2±66 .PORT, Legacy Directive..2±66 .PRECISION, Select Floating-Point Precision..2±67 .PREVIOUS, Revert to the Previously Defined Section.2±68 PRIORITY, Allow Prioritized Symbol Mapping in Linker..2±68 Linker Operation.2±69 .REFERENCE, Provide Better Info in an X-REF File.2±70 .RETAIN_NAME, Stop Linker from Eliminating Symbol..2±70 .ROUND_, Select Floating-Point Rounding..2±71 .SECTION, Declare a Memory Section2±72 Common .SECTION Attributes..2±72 DOUBLE* Qualifiers2±73 SHARC-Specific Qualifiers.2±73 Initialization Section Qualifiers.2±74 .SET, Set a Symbolic Alias2±75 .SHORT, Defines and Initializes 2-Byte Data Objects2±75 .STRUCT, Create a Struct Variable.2±76 .TYPE, Change Symbol Type.2±78 .VAR, Declare a Data Variable or Buffer2±79 VAR and ASCII String Initialization Support.2±81 CCES 2.9.0 Assembler and Preprocessor Manual v

PAGE – 6 ============
.WEAK, Weak Symbol Definition and Reference.2±82 Assembler Command-Line Reference.2±82 Running the Assembler..2±83 Assembler Command-Line Switch Descriptions2±84 -anomaly-detect {id1[, id2]|all|none} -anomaly-warn {id1[,id2]|all|none}.2±87 -anomaly-workaround {id1[, id2]|all|none}..2±87 -Dmacro[=definition].2±88 -dependency-add-target.2±88 -double-size-32..2±88 -double-size-64..2±88 -double-size-any2±88 -expand-symbolic-links..2±89 -expand-windows-shortcuts.2±89 -file-attr attr[=val].2±89 -flags-compiler2±89 User-Specified Defines Options2±89 Include Options2±89 -flags-pp -opt1[, -opt2]..2±90 -g..2±90 WARNING ea1121: Missing End Labels.2±90 -gnu-style-dependencies2±91 -h[elp]2±91 -i..2±91 -l filename2±92 -li filename..2±92 -M2±92 -MM..2±92 -Mo filename..2±93 -Mt filename..2±93 -micaswarn..2±93 -no-anomaly-detect {id1[, id2]|all|none}2±93 -no-anomaly-workaround {id1[, id2]|all|none}..2±93 viCCES 2.9.0 Assembler and Preprocessor Manual

PAGE – 8 ============
User Header Files3±3 Sequence of Tokens3±4 Include Path Search3±4 Writing Macros.3±5 Macro Definition and Usage Guidelines..3±5 Examples of Multi-Line Code Macros With Arguments..3±8 Debugging Macros.3±8 Using Predefined Preprocessor Macros.3±9 Specifying Preprocessor Options3±10 Preprocessor Command Reference3±10 Preprocessor Commands and Operators3±11 #define..3±11 #elif.3±12 #else3±13 #endif.3±13 #error.3±14 #if.3±14 #ifdef..3±15 #ifndef3±15 #include3±15 #line3±16 #pragma3±17 #undef3±17 #warning..3±17 # (Argument).3±18 ## (Concatenate)..3±18 ? (Generate a unique label)..3±19 Variable-Length Argument Definitions..3±20 Preprocessor Command-Line Reference.3±20 Running the Preprocessor.3±21 Preprocessor Command-Line Switches..3±21 viiiCCES 2.9.0 Assembler and Preprocessor Manual

PAGE – 9 ============
-cpredef.3±23 -cs!..3±23 -cs/*.3±23 -cs//.3±23 -cs{..3±23 -csall3±23 -Dmacro[=def]..3±24 -dependency-add-target.3±24 -expand-symbolic-links..3±24 -expand-windows-shortcuts.3±24 -gnu-style-dependencies3±24 -h[elp]3±24 -i..3±24 -Idirectory3±24 -I-.3±25 -M3±25 -MM..3±26 -Mo filename..3±26 -Mt filename..3±26 -o filename..3±26 -stringize..3±26 -tokenize-dot..3±26 -Uname.3±26 -v[erbose].3±27 -version.3±27 -w.3±27 -Wnumber..3±27 -warn..3±27 -Wwarn-error.3±27 CCES 2.9.0 Assembler and Preprocessor Manual ix

PAGE – 10 ============
Thank you for purchasing CrossCore † Embedded Studio (CCES), Analog Devices development software for Black- fin†, Blackfin+ †, SHARC †, and SHARC+ † processors. The Assembler and Preprocessor Manual contains information about the assembler and preprocessor utilities for the following Analog Devices processor families: Blackfin (ADSP-BFxxx) and SHARC (ADSP-21xxx/SC5xx). The manual describes how to write assembly programs for these processors and provides reference information about related development software. It also provides information on new and legacy syntax for assembler and preprocessor directives and comments, as well as command-line switches. The primary audience for this manual is a programmer who is familiar with Analog Devices processors. This manual assumes that the audience has a working knowledge of the appropriate processor architecture and instruction set. Programmers who are unfamiliar with Analog Devices processors can use this manual, but should supplement it with other texts (such as the appropriate hardware reference and programming reference manuals) that describe your target architecture. The manual consists of:AssemblerProvides an overview of the process of writing and building assembly programs. It also provides information about assembler switches, expressions, keywords, and directives. Preprocessor Provides procedures for using preprocessor commands within assembly source files as well as the preprocessor©s command-line interface options and command sets. CCES 2.9.0 Assembler and Preprocessor Manual 1±1

PAGE – 11 ============
You can reach Analog Devices processors and DSP technical support in the following ways: Post your questions in the processors and DSP support community at EngineerZone †: Submit your questions to technical support directly at: E-mail your questions about processors, DSPs, and tools development software from CrossCore Embedded Stu- dio or VisualDSP++ †:Choose Help > Email Support . This creates an e-mail to and automatical-ly attaches your CrossCore Embedded Studio or VisualDSP++ version information and file.E-mail your questions about processors and processor applications to: Contact your Analog Devices sales office or authorized distributor. Locate one at: Send questions by mail to: The CCES assembler and preprocessor support the following processor families from Analog Devices. ADSP-BF504, ADSP-BF504F, ADSP-BF506F, ADSP-BF512, ADSP-BF514, ADSP-BF516, ADSP-BF518, ADSP- BF522, ADSP-BF523, ADSP-BF524, ADSP-BF525, ADSP-BF526, ADSP-BF527, ADSP-BF531, ADSP-BF532,ADSP-BF533, ADSP-BF534, ADSP-BF536, ADSP-BF537, ADSP-BF538, ADSP-BF539, ADSP-BF542, ADSP-BF542M, ADSP-BF544, ADSP-BF544M, ADSP-BF547, ADSP-BF547M, ADSP-BF548, ADSP-BF548M, ADSP-BF549, ADSP-BF549M, ADSP-BF561, ADSP-BF592-A, ADSP-BF606, ADSP-BF607, ADSP-BF608, ADSP-BF609, ADSP-BF700, ADSP-BF701, ADSP-BF702, ADSP-BF703, ADSP-BF704, ADSP-BF705, ADSP-BF706,ADSP-BF707 , ADSP-BF715, ADSP-BF716, ADSP-BF718, ADSP-BF719 1±2CCES 2.9.0 Assembler and Preprocessor Manual

41 KB – 147 Pages