| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
syntax assembler directives common across assemblers. provides common
Top Searches for this datasheetEngineer Engineer Note EE-130 syntax assembler directives common across assemblers. provides common environment options. VisualDSP debugger based robust complete DWARF-2 format. also: Note Quick Primer DWARF-2". Getting Started assist upgrade existing 21xx applications, assembler optionally process legacy syntax. using command line version assembler IDE, default assembler directives: easm219x myNew.asm Specify -legacy option have 5.x/6.x syntax accepted assembler: addition, will likely want specify option. This makes 21xx -legacy case sensitive: easm219x -legacy myLegacy.dsp -legacy assembler option processes 21xx directives syntax that pre-date family assemblers. assembler legacy option allows focus core issues ignore syntax differences. enable assemble legacy code within build environment: Project Options Assemble Additional Options "-legacy Technical Notes using Analog Devices' components development tools Phone: (800) ANALOG-D, FAX: (781) 461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp Making Fast Transition from ADSP-21xx ADSP-219x Contributed Barbara Zino Version Introduction Whether upgrading existing 21xx code writing code, will want aware what different with ADSP219x instruction tools. This application note written anyone coming on-board with ADSP-219x would like detailed information assembler tools. intended assist Upgrading existing 21xx assembly code ADSP-219x Writing assembly code ADSP219x complete description ADSP-219x, please ADSP-219x Instruction Reference (Part 82-00390-02). DWARF-2 ADSP-219x assembler linker part family assemblers linkers that operate within VisualDSP environment. tools produce industry standard formats: Object File Format DWARF-2 Debugging Format Copyright 2000, Analog Devices, Inc. rights reserved. Analog Devices assumes responsibility customer product design application customers' products infringements patents rights others which result from Analog Devices assistance. trademarks logos property their respective holders. Information furnished Analog Devices Applications Development Tools Engineers believed accurate reliable, however responsibility assumed Analog Devices regarding technical accuracy content provided Analog Devices' Engineer-to-Engineer Notes. When Upgrading Existing Code Assemble with -legacy Review instruction diagnostics any) revise ADSP-219x Resulting error with assembler: [Error E24] "MYSQRT.DSP":61 Assembler Error: 218x 219x incompatibility: More NEG. Must CCODE register. When Writing Code Code with directives -legacy option Solution: CCODE register. "SE" LONGER D-REGISTER 218x code: AX0=SE, SR=NORM (HI); Please note that cannot "old new" syntax same assembly source file. combine "old new" same application assembling distinct source files that then linked together. Upgrading Existing Code Some existing 21xx assembly applications will require source code changes. Others need changes ADSP-219x core instruction set. Here sampling 21xx legacy code with invalid ADSP-219x instructions assembler messages that reported after passing code through ADSP-219x assembler. These places code that need change. following diagnostics reported whether -legacy option effect. -legacy option assembler 21xx syntax compatibility only, instruction compatibility. processing, -legacy option with assembler. easm218x -legacy myApp.dsp CONDITION 218x code: pwr_ok: JUMP frac; Resulting error with assembler: [Error E22] "MYSQRT.DSP":32 Illegal Multi Instruction Formation Instruction Component: register move Instruction Component: shift Solution: Since longer DREG (group register), multi function move illegal. Select ADSP-219x DREG. "MF" REGISTER REPLACED 218x code: MF=AR*MY0 (RND), MX0=DM(I3,M3); MR=MR+MX0*MF (SS), MX0=DM(I3,M3); approx: MF=AR*MF (RND); Resulting error with assembler: "MYSQRT.DSP":38 Invalid Register 'MF': Illegal destination register MACC instruction Solution: 21xx register been replaced 219x SR2-SR0 dual accumulator CCODE LATENCY 218x code: ccode=0x03; swcond 8192; EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp Resulting warning with assembler: [Warning W35] "CcodeLatency.asm":26 Assembler Warning: Detected CCODE latency problem. CCODE write immediately followed CCODE conditional check. There 1-cycle latency between writing CCODE register testing condition. There stall sequencer. don't instruction after CCODE write, your conditional check will based CCODE! .SECTION DIRECTIVE Sections named contiguous locations program data memory. .section sectionQualifiers sectionName sectionType? more section qualifiers indicate section properties. Section qualifiers begin with "/". example "/dm" "/pm". section type optional default SHT_PROGBITS. unlikely will ever need override section type sections binary object file your application just ignore this paragraph altogether .SECTION Examples Solution: CCODE latency accounted ccode=0x03; i0=1; swcond ax0; WRITING CODE When write code, directives that common across assemblers. There three directives that building blocks assembly program. Think them "The Three Musketeers": .SECTION .VAR .GLOBAL NOTATION notation used describe syntax this document: more more Optional item appear) There some advantages using .section directives: Permits multiple code sections Gives more control over data placement Readable displays ElfDump utility .section/pm program; .section/dm data1; Multiple (/code) .sections allowed 219x. 21xx there only single .module (code section). 219x, determine placement data buffers assembler source locating them within desired section. This differs from 21xx where linker placed data buffers locations choosing. EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp specify section placement memory (Linker-Description-File) your application. more info files, Linker Guide "LDF Programming Examples", "Linker Description File Reference" Overlay Example 2192-12. ELFDUMP ElfDump utility shows contents object executable files readable format. many options. Total section size variable placement within each section easily viewed ElfDump section displays. example, want code disassembly (mnemonic display) section "program" object file file9x: elfdump program file9x.doj Please ElfDump -help complete list options. .VAR DIRECTIVE .VAR directive defines initializes data objects. .var /init24 variableName expression initializerList .VAR INITIALIZATION -legacy directives separated .VAR/DM .VAR/PM declarations from .INIT .INIT24 initializations. style "all one" declare initialize. default treat .VAR initializers constants. constants supported /INIT24 qualifier .VAR directive. default .VAR directive initialization treat initializers constants. Data Variable Initialization .section/dm data1; .var buffer[2] 0x1234, 0x4321; data correctly padded assembler: Data Variable Initialization .section/pm program; .var buffer[3] 0x1234, 0x3210, 0x2130; initialization memory with padding: 123400 321000 213000 .var /init24 variableName variableName .var /init24 expression expression)* constant initialization, specify .var/init24. Data Variable Initialization .VAR directives must within section. .section/pm program; .var/init24 GiveMe24 0x123456; EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp Recommendation: .VAR form with explicit sizing initialization. example: #define bufferSize .section/data data1; .var bufferOk[bufferSize]= 1,2,3,4,5; .var bufferTooFew[bufferSize]= 1,2,3; MEMORY REFERENCE SYNTAX directives were designed with syntax semantics mind. Memory reference notation been extended more familiar C-style. find this notation self-documenting less prone error prefer keep coding style already accustomed Note: -legacy option needed process memory reference syntax where ordering operands determined action taken. assembler always accepts both memory reference syntax styles. APPENDIX MEMORY REFERENCE SYNTAX following examples identified description instruction type number defined 219x Instruction Guide. Type Multifunction MACC with memory read write using post-modify AF=AF+1,AX0=DM(I0,M1); legacy AF=AF+1,AX0=DM(I0+=M1); syntax Type Modify MODIFY(I4,M5); legacy MODIFY(I4+=M5); syntax Type Immediate Modify MODIFY(I4,3); legacy MODIFY(I4+=3); syntax Type Memory Read/Write with Immediate Modify (Post-modify with update offset without update) DM(2,I1)=MR1; offset DM(I1+2)=MR1; offset, syntax Type Pre-modify offset/ Post-modify Update memory read/write DM(M5,I4)=m3; pre-modify offset DM(I4+M5)=m3; syntax assembler provides error diagnostics incorrect initializers form syntax with explicit declarator followed initializers. example above, bufferTooFew .VAR directive explicitly declared with elements. Only elements initialized assembler reports discrepancy. [Warning W41] "test.asm":4 'bufferTooFew': initializers specified. Expected found remaining elements were initialized zero. .GLOBAL DIRECTIVE Symbols declared global program scope thus visible outside local file. default, symbols file scope (local). .global directive must used export symbol. another file needs access symbol, specify .global file that declares .extern file(s) that references .global symbol symbol .GLOBAL Example .global Function1, Function2; Function1: dm(1, i4); Function2: EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp PRE-PROCESSOR Here pre-processor basics: pre-processor 219x assembler linker style pre-processor pp.exe. This same pre-processor used other assemblers linkers, including 21k, 2116x, TigerSharc. pre-processor 21xx asmpp.exe. preserve legacy code pre-processing, specify -legacy option 219x assembler will call asmpp.exe additional preprocessing step after pp.exe preprocessor. Specify (skip preprocessor) option neither pre-processor will called. EASM219x -legacy Pre-Processing Flow Control EXAMPLE.DSP PP.EXE EXAMPLE.IS ASMPP.EXE EXAMPLE.APP default, pre-processor files written temporary directory specified environment variable TMPDIR Unix). temporary files deleted upon completion assembly. obtain permanent copies pre-processor temporary files, assembler with preprocessor only option: easm219x example.tmp example.asm Pre-Processor Flow Control 219x pre-processor produces "*.is" output files. naming convention ADSP-219x assembly source suffixes .ASM. EASM219x Default Pre-Processing Flow Control EXAMPLE.ASM PP.EXE EXAMPLE.IS When -legacy option specified, additional pre-processing pass added after *.is produced. calls legacy preprocessor asmpp.exe which processes .macro, .const, .include, .local directives. legacy suffix convention assembly source .DSP. This runs pre-processor example.asm writes temporary file example.is current directory. deleted. easm219x -legacy example.dsp This runs pre-processor example.dsp leaves temporary files example.is example.app current directory. .CONST UPGRADE EXAMPLE .const directive replaced C-style #define macro with constant syntax 21xx asmpp.exe .CONST base=H#0D49,sqrt2=H#5A82; EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp 219x pp.exe #define base #define sqrt2 0x0D49 0x5A82 uniqueLabel_2: uniqueLabel_3: PRE-PROCESSOR SYNTAX .MACRO UPGRADE EXAMPLE .macro directive replaced C-style #define macro. arguments replaced named arguments. 21xx asmpp.exe .MACRO getsfirst(%1); .ENDMACRO; getsfirst(MR1); 219x pp.exe #define getsfirst(Rg) getsfirst(MR1); using -legacy option, legacy pre-processor directives will processed addition pre-processor directives. Without -legacy, rely solely preprocessor directives. APPENDIX PRE_PROCESOR REFERENCE EXPRESSIONS There places source where assembler processes symbols literal constants that form expressions. lump these under category "expressions". POINTER point operator legacy syntax recognized when assembled with -legacy option. point operator longer required. Simply omit when writing code ADSP-219x. -legacy Pointer start: I2=^x_input; PRE-PROCESSOR EXAMPLE question mark used replace .local directive avoid creating duplicate labels when macro expanded multiple times. 219x pp.exe #define getsfirst(Rg) uniqueLabel?: MACRO-INVOCATIONS getsfirst(MR1) getsfirst(MR1) getsfirst(MR1) POST-EXPANSIONS Each label unique uniqueLabel_1: EE-130 219x Pointer start: I2=x_input; DATA INITIALIZATION FILES .VAR directive accepts list more initializers from external data file that convention file ending ".dat" referred "dat" files. legacy behavior initializers files quirky. treated initializers explicitly typed in.INIT INIT24 differently than those read from *.dat files. Page Technical Notes using Analog Devices' components development tools Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp (21xx) (21xx) Default case insensitive -legacy CALL AllMixedUp; CALL allmixedup; CALL ALLmixedUP; Will treated referencing same function. .var/dm/seg=dmdata x_input[n]; .init x_input <xin.dat>; xin.dat 1234 (219x) make case sensitive: -legacy .section/dm dmdata; .var x_input[n] "xin.dat"; xin.dat (219x) Case sensitive assemblers follow rules (case sensitive) 0x1234 0x123 There some legacy behavior that seemed just plain wrong -legacy doesn't duplicate instance "123" tools treated decimal "1230". Recommendation: -legacy option trouble with some legacy files. recommended change file constants prefixed with whether using -legacy not. APPENDIX DATA INITIALIZATION FILES CASE SENSITIVITY 219x assembler case sensitive, meaning symbols must have exact same case letter letter recognized same symbol. default 21xx case insensitive. uppercased symbol references. CALL AllMixedUp; CALL allmixedup; Will treated referencing different functions. POSSIBLE SURPRISE mixing legacy non-legacy assemblies surprised linker report unresolved reference. reason default case sensitivity differs between assemblers. unintentionally reference define function different case. Look example below. ALLMIXEDUP referenced upper-case, definition case sensitive AllMixedUp. linker will report error ALLMIXEDUP unresolved these objects linked together. Solution: -legacy when mixing new. Page EE-130 Technical Notes using Analog Devices' components development tools Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp option makes case insensitive avoids potential mismatch definitions non-legacy modules. Assembled with -legacy .extern AllMixedUp; CALL AllMixedUp; with case sensitive AllMixedUp without case insensitive upper-cased "ALLMIXEDUP" Directives Welcome world legacy directives directives. This section shows legacy directives would rewrite them using directives instead. Side side examples presented. .MODULE DIRECTIVE 21xx, every assembly program began with .module directive. assemblers, .section directives that define code sections replace modules. When -legacy option specified, assembler translates .module directive appropriate .section directive. "program" name code section default *.ldf (linker-description-file) used compilers. absence specific /SEG qualifier .module directive, 219x assembler uses "program" default name. .section directive when writing code. .ENDMOD directive needed. beginning next section end-offile indicates section ending point. (21xx) .MODULE _dummy_; .ENDMOD; .MODULE/SEG=myCode _dummy_; .ENDMOD; Assembled without -legacy: .global AllMixedUp; AllMixedUp: code case sensitive "as-is" "AllMixedUp" EXPRESSIONS SYNTAX Expression syntax writing constants performing length, pointer, address page operations. Legacy expression syntax accepted only when -legacy option specified. When writing code, specify -legacy option change expression syntax, where applicable. APPENDIX EXPRESSIONS REFERENCE (219x) .SECTION/PM program; .SECTION/PM myCode; -orspecify /CODE place .SECTION EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp .SECTION DIRECTIVES .SECTION directives provide assembler with explicit directions where place code data. switch back forth between sections assembler adds appropriate section wherever left off. Note: directives include .PREVIOUS directive treating sections stack. recommend explicitly specify section name reduce chance error when adding code. .section/data data1; .var .var .section/code program; label1: code code .section/data data1; .var .section/code program; code code label2: code (219x) .SECTION/DM seg_mydata; .VAR sqrt_coeff[3] 0x5D1D, 0xA9ED, 0x46D6; specify /DATA place .SECTION .VAR DIRECTIVE WITHOUT 219x, segment determined which section .VAR directive located within. Every .VAR directive must reside within section. (21xx) .VAR/DM sqrt_coeff[3]; .INIT sqrt_coeff H#5D1D, H#A9ED, H#46D6; (219x) .SECTION/DM data1; .VAR sqrt_coeff[3] 0x5D1D, 0xA9ED, 0x46D6; specify /DATA place .SECTION .VAR DIRECTIVE WITH .VAR directive 21xx optional /SEG=segName qualifier. 219x, segment determined which .section .VAR directive located within. /seg qualifier does appear .VAR directive. section name. (21xx) .VAR/DM/SEG=seg_mydata sqrt_coeff[3]; .INIT sqrt_coeff H#5D1D, H#A9ED, H#46D6; -legacy .VAR WITHOUT /SEG When assembler -legacy mode, must determine what section each .VAR belongs .var explicit /seg=segName qualifier creates section that name adds already existing that name). EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp there /seg=segName qualifier, assembler defaults "data1" "program" (These match section names compiler uses). -legacy .VAR WITH /ABS support -legacy /ABS=address qualifier .var directive, assembler automatically generates linker commands file that included your application's LDF. -legacy .VAR/ABS=address #define CMN_BASE 0x010000 .VAR/DM/ABS=CMN_BASE+0x22 eq_outq; .GLOBAL eq_outq; (21xx) .MODULE test; .VAR/DM myData[3]; .INIT myData H#001, H#002, H#003; .ENDMOD; (219x) .SECTION/DM data1; .VAR myData[3] 0x001, 0x002, 0x003; .SECTION/PM program; .VAR .INIT24 SECTION Declaring initializing data 21xx accomplished .VAR directive declaration .INIT24 directive initialization. With directives, .VAR directive declares initializes. /INIT24 qualifier needed indicate full initialization. Remember, .VAR directive default bits whether data. (21xx) .MODULE test; .VAR/PM myPMData; .INIT24 myPMData: 0x123456; .ENDMOD; Auto-Generates RESOLVE RESOLVE commands .var eq_outq "cmn.asm", line section 'data1', section index RESOLVE( eq_outq, 0x10022 Include Application INCLUDE command INCLUDE(resolve_cmn.ldf) .VAR .INIT DIRECTIVES Declaring initializing data 21xx accomplished .VAR directive declaration .INIT directive initialization. With directives, .VAR directive declares initializes "all one" directive. default 16-bit initialization. (219x) .SECTION/PM program; .VAR/INIT24 myPMData 0x123456; EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp "TRICK TRADE" ever need work-around assembler encoding bug, here with directives: .SECTION/PM program; explicitly assemble instruction, placing .var/init24 code section following opcode DM(I4,M5) AX0; .VAR/INIT24 myMove 0x157001; .EXTERNAL DIRECTIVES Change spelling .external directive keyword .extern. directives equivalent. This just name change. (21xx) Equalizer data .EXTERNAL Complex_Filter_Id; (219x) .VAR WITH BUFFER LENGTH 21xx, unary operator used obtain length. With directives, LENGTH() keyword. binary operand modulus operator. Equalizer data .EXTERN Complex_Filter_Id; DATA DIRECTIVES REFERENCE Appendix provides summary data directives from 21xx other legacy assemblers their equivalent directives. APPENDIX DATA DIRECTIVES REFERENCE JUMP CALL OPTIMIZATIONS optimization available with ADSP219x tools automatically convert range jump call instructions long. jump/call optimization optional. continue code with short long syntax 21xx, prefer. (The 21xx method means must manually optimize code). (21xx) .MODULE test; .VAR/DM x_input[10]; legacy length operator start: L2=%x_input; .ENDMOD; (219x) .SECTION/DM data1; .VAR x_input[10]; .SECTION/PM program; start: L2=LENGTH(x_input); EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp -legacy option bearing jump/call syntax expansion option. SHORT VERSUS LONG SYNTAX assembler will encode instructions based syntax. encodes short versus long jumps calls based keyword that specified. means long. LJUMP JUMP LCALL CALL done automatically tools. There re-coding needed source level. APPENDIX JUMP/CALL EXPANSION REFERENCE UNIVERSAL DIRECTIVES universal directives common among family assemblers, please keep mind that some them have meaning particular processor. example, floating point directives applicable 219x which fixed point processor. Reference chart complete. Some these directives used compiler. will them look "*.s" intermediate file produced compiler. APPENDIX DIRECTIVES REFERENCE SOFTWARE UPDATE NEWS following features since initial release that relevant upgrading from 5.x/6.x: Comment Conversion .VAR Blocks Initialization range short jumps/calls receive errors [Error E33] "JumpOutOfRange10.asm":2539 Jump offset range: -4096 4095 (Type 10). Jump offset destination '_L_250512' offset 5764. Recode with LJUMP -jcs2l (JumpCallShort2Long) option automatic conversion long jump. Long jumps/calls range that short range receive warnings. [Warning W32] "LJumpShort.asm":32 Jump doesn't require long range: address (Type Word Instruction). LJUMP offset destination 'endLabel' offset 154. This recoded with single word Type JUMP. -JCS2L OPTION (Jump-Call-Short-2-Long) optimization introduced ADSP-219x assembler linker. easm219x -jcs2l easm219x -JumpCallShort2Long -jcs2l option instructs tools change range short jumps calls long. This CommentConverter legacy comment syntax supported -legacy assemblies. longer supported assemblies without -legacy option. EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp comment conversion utility available. will automatically upgrade sources with legacy comment styles, converting them C/C++ style comments. commentconverter -help complete list options. Here highlight. Note that there space between argument: -rsall (default) replace style comments -rs{ replace style comments -rs! replace style comments declaration more symbols .VAR directive guarantees consecutive placement both 5.x/6.x toolset. C-style initialization syntax initialize data buffers that must kept contiguous linker. (21xx) .var/dm LState1[2], LState2[2]; .init Lstate1 0x10, 0x11; .init Lstate2 0x20, 0x21; Example: commentconverter -rs{ OldFile.dsp >NewFile.dsp (21xx) SendMessage: transmit data (219x) .section/dm data1; .var Lstate1[2] 0x10, 0x11 Lstate2[2] 0x20, 0x21 (219x) SendMessage: transmit data CONCLUSION This completes grand tour "old" "new" ADSP-21xx assembler family. writing assembly code ADSP-219x, please online Assembler Linker documentation your software more details. They files located installation directory: \Program Files\Analog Devices\ VisualDSP\Docs .VAR Blocks Initialization default, data within section placed consecutive memory locations linker. With linker (individual placement) option, data maybe re-arranged. They also available online from within VisualDSP IDE. EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp Engineer Engineer Note EE-130 Technical Notes using Analog Devices' components development tools Phone: (800) ANALOG-D, FAX: (781) 461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp APPENDIX MEMORY REFERENCE SYNTAX (Referenced from Page TYPE POST MODIFY WITH UPDATE MODIFY OFFSET IMMEDIATE OFFSET DM(<Ireg>,<Mreg>) DM(<Ireg> <Mreg>) DM(<Mreg>,<Ireg>) DM(<Expr <Ireg>) <Expr> compliment number DM(<Ireg> <Mreg>) DM(<Ireg> <Expr>) <Expr> compliment number IMMEDIATE MODIFY DM(<Ireg>,<Expr>) <Expr> compliment number DM(<Ireg> <Expr>) <Expr> compliment number Copyright 2000, Analog Devices, Inc. rights reserved. Analog Devices assumes responsibility customer product design application customers' products infringements patents rights others which result from Analog Devices assistance. trademarks logos property their respective holders. Information furnished Analog Devices Applications Development Tools Engineers believed accurate reliable, however responsibility assumed Analog Devices regarding technical accuracy content provided Analog Devices' Engineer-to-Engineer Notes. APPENDIX PRE-PROCESSOR REFERENCE (Referenced from Page LEGACY DIRECTIVE *.app file .const PURPOSE UPGRADING BEHAVIOR 219x pre-processor output file *.is. pre-processing style Pre-processor output *.is file *.app. Constant definition. Pre-processor asmpp.exe. Pre-processor asmpp.exe. Applies program labels macros prevent duplicate names upon macro expansion. Macro definition. Pre-processor asmpp.exe. Macro arguments. #define .include .local symbol; #include question mark each label reference within macro definition (See example) #define pre-processing style #define DoMacro(codeBlock) (pc,macLabel?) until ce;\ codeBlock macLabel?: .macro .endmacro; Example: .macro alter(%1); comment-style comment style multi-line comment style pre-processing style Example: #define alter(x) M5=x; multi-line comment style comment style style macro arguments Comment syntax supported asmpp.exe. pp.exe supports comment syntax only. commentconverter utility upgrade sources with legacy comment styles: comment style comment style EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp APPENDIX DATA INITIALIZATION FILES (Referenced from Page example below <xin.dat> data file from Vect2100.dsp example. Change prefix Commas allowed optional. -legacy Syntax Syntax (with commas) 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A Syntax (without commas) 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp APPENDIX EXPRESSIONS REFERENCE (Referenced from Page LEGACY EXPRESSION prefix B#01010101 prefix 0001, 000A prefix H#0D49 %symbol ^symbol Address(symbol) PURPOSE Binary format. constant. constant. LENGTH operation symbol. pointer Complement Address operation gets lower bits address Page operation gets upper bits address UPGRADING prefix B#01010101 prefix 0x01, 0x0a prefix 0x0D49 LENGTH(symbol) Omit address(symbol) BEHAVIOR changes needed. Same behavior. syntax constants. syntax constants. LENGTH operation symbol. Operator required. changes needed. Same behavior. changes needed. Same behavior. syntax. page symbol pageof(symbol) label names page(symbol) Reserved words Reserved words Case insensitive Case sensitive! default Case sensitive -legacy case sensitive EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp APPENDIX DATA DIRECTIVES REFERENCE (Referenced from Page LEGACY DIRECTIVE .dmseg PURPOSE Data memory segment. UPGRADING .section/data -oror .section/dm BEHAVIOR Data memory segment. .endmod Indicates module. omit need marker. .entry .export Makes label visible outside current file. .global Makes label visible outside current file declaring symbol with binding STB_GLOBAL. .external Allows references symbols declared other files .global .entry. .extern Allows references symbols declared other files .global. .global Makes symbol visible outside current file. .global Makes symbol visible outside current file declaring symbol with binding STB_GLOBAL. .init Data initializer(s) bits. .var within either .section/dm .section/pm Data initializer(s) bits. .init24 Data initializer(s) bits. .var/init24 within .section/pm Data initializer(s) bits. .init <fileName> Data initialization from file. .var x[5] "fileName"; Quotes replace angle brackets filename. required. EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp APPENDIX DATA DIRECTIVES REFERENCE (continued) LEGACY DIRECTIVE .module qualifiers more qualifiers: /ABS addr /BOOT =0-7 /RAM /ROM /SEG /STATIC Appears before .module directive paged memory system. Program memory segment. PURPOSE single .module code definition. UPGRADING .section qualifiers more qualifiers linker file /ABS addr /BOOT =0-7 /RAM /ROM /SEG /STATIC BEHAVIOR more code sections contiguous memory. .page .pmseg .port/dm pName1; .port/pm pName2; /push /pop section qualifiers Declares memory mapped port. Keeps stack sections. .section/code -or.section/pm .var create section linker *.LDF file each port variable. Explicitly reference section name Program memory segment. Treat other external variable linker resolve. 219x equivalent. .setdata expr Appears undocumented feature a2100 specify data instruction encoding explicitly. 21xx used .var qualifiers. .var/init24 expr; 219x equivalent encode instruction explicitly. .var qualifiers more qualifiers: /ROM /RAM /CIRC /ABS expr /SEG /STATIC .var/abs=100 .var qualifiers: /init24 .section qualifiers, .var qualifiers. Declare symbol with absolute placement. .section/abs=100 .var related, need .var/abs .var/circ Declare circular buffer. .var 219x base registers. EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp APPENDIX UNIVERSAL DIRECTIVES DIRECTIVE 219X (Supported) BEHAVIOR .align Specifies byte alignment requirement. .extern Variable imported (not defined file scope). .file Override filename given command line. .global Variable program scope (exported). .leftmargin Left margin listing page. #line Output from pre-processor tracking line numbers original source before pre-processing. .newpage Page break listing. .pagelength Length listing page. .pagewidth Width listing page. .precision Number significant bits floating point constant. .previous Reverts previous section. .round_minus IEEE Round negative infinity. EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp APPENDIX UNIVERSAL DIRECTIVES (continued) DIRECTIVE 219X (Supported) BEHAVIOR .round_nearest IEEE Round nearest (the default). .round_plus IEEE Round positive infinity. .round_zero IEEE Round zero. .section Names contiguous block program data memory .section qualifiers /data /code /ABS expr /BOOT expr /RAM /ROM /SEG /STATIC Section qualifiers 219x .size Size calculation sizing functions .type Changes default data symbol type (for compiler). .size directive Specifies calculation size function (for compiler) symbol qualifiers /INIT24 initialization Symbol qualifiers 219x EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp APPENDIX JUMP/CALL EXPANSION JUMP INSTRUCTIONS Type 13-Bit Relative Conditional Jump JUMP label1 (DB); slot slot JUMP label1; Type 16-Bit Unconditional Jump JUMP label2 (DB); slot slot JUMP label2; Type Word) (long) Conditional Jump JUMP labelFarAway; JUMP labelFarAway; LJUMP labelFar; LJUMP labelFarAway; DELAY BRANCH SLOTS (Optional) slots executed whether JUMP taken not. RANGE Relative -4096 +4095 (Optional) Relative -32768 +32767 Absolute Address reach portion 24bit address space. CALL INSTRUCTIONS Type There 13-Bit Conditional CALL Type 16-Bit Unconditional CALL CALL funcNextDoor (DB); slot slot CALL funcNextDoor; Type Word) (long) Conditional CALL CALL FuncFarAway; CALL FuncFarAway; LCALL FuncFar; LCALL FuncFarAway; DELAY BRANCH SLOTS RANGE (Optional) Relative -32768 +32767 Absolute Address reach portion 24bit address space. EE-130 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp Other recent searchesSN74LVC1G14 - SN74LVC1G14 SN74LVC1G14 Datasheet ML60852 - ML60852 ML60852 Datasheet LOC210 - LOC210 LOC210 Datasheet IXTX24N100 - IXTX24N100 IXTX24N100 Datasheet HV430DB1 - HV430DB1 HV430DB1 Datasheet EM63A165TS - EM63A165TS EM63A165TS Datasheet AAT2806 - AAT2806 AAT2806 Datasheet
Privacy Policy | Disclaimer |