The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers.    


Datasheet Search Engine   
 
Part # or Description: • 5V RS232 Driver • 2SC5066* • "Real Time Clock" • "USB connector" • "blue led" 5mm • 10 watt zener diode • 2N3055* motorola
 
Search Tip: Try entering the part number only. Include a wildcard (eg. lm317* or 1n4148*)

 

 

Figure 3-0. Table 3-0. Listing 3-0. assembler ADSP-2106x family a


Datasheet Thumbnail

  

Download PDF



Top Searches for this datasheet



Contents/Index Assembler Contents/Index Assembler
Figure 3-0. Table 3-0. Listing 3-0.
assembler ADSP-2106x family assembler that runs within VisualDSP environment from operating system command line. This document contains following information assembler: "Assembler (asm21k) Guide" page This section contains procedures using assembler within environment. "Assembler (asm21k) Reference" page 3-13 This section contains reference information assembler directives operations "Assembler Glossary" page 3-34 This section contains glossary assembler related terms.
VisualDSP User's Guide Reference
$VVHPEOHU *XLGH
$VVHPEOHU *XLGH
assembler processes your assembly source, data, header files, produces object file. Assembler operations depend types controls: assembler options assembler directives. Assembler options selected Assemble environment's Options dialog assembler's command line. options control assembler processes your assembly source, data, header files. Using these options, select features such search directories, output file name, macro preprocessing among others. Assembler directives coded your assembly source file. directives define variables your program, setup some hardware features, identify your program's segments* placement within memory. assembler uses directives guidance translates your source into object code. This section covers assembler information that need know when using assembler from command line within VisualDSP environment. software developers using assembler should familiar with following operations: "Writing Assembly Programs" page "Preprocessing Program" page "Reading Listing File" page "Setting Assembler Options" page 3-12
assembler segment .SEGMENT) declarations referred here corresponds linker input section.
VisualDSP User's Guide Reference
$VVHPEOHU
:ULWLQJ $VVHPEO\ 3URJUDPV
This section describes process developing programs ADSP-210xx Family assembly language. discussion covers structures conventions should follow when writing these programs. information ADSP-210xx Family instruction that writing these assembly programs, ADSP-2106x SHARC User's Manual. Write your assembly language programs using VisualDSP editor editor that produces plain text files. word processor that embeds special control codes text. Append .ASM extension your source files, identifying them assembly files. Assemble your source files, either within VisualDSP environment using assembler's command line. assembler produces object files (.DOJ) optionally listing file (.LST). object file serves input linker when link your executable program. listing file text file that read information results assembly process. Look Figure graphical overview assembly process. figure shows assembler processing assembly source file (.ASM). assembly source file contain preprocessor commands, such #include command that causes assembler process initialization data files (.DAT) header files (.H). After processing, assembler gener-
VisualDSP User's Guide Reference
$VVHPEOHU *XLGH
ated types output files: object file (.DOJ) optional listing file (.LST).
Assembly-Source File
(.ASM)
Initialization-Data File
(.DAT)
Header File
(.H)
Assembler
(ASM21K)
Object File
(.DOJ)
Listing File
(.LST)
Figure 3-1. Assembler Input Output Files 3URJUDP &RQWHQW Statements within assembly source file assembly instructions, assembler directive, preprocessor commands. Instructions assemble executable code while directives commands modify assembly process. Note that statements assembly source file exceed 1024 characters length. syntax these statement types follows: Assembly instructions Instructions follow syntax that appears DSP's user manual. Begin instructions with keyword instructions with
VisualDSP User's Guide Reference
$VVHPEOHU
semicolon (;). program reference purposes (such CALL), place address label beginning instruction line preceding line. label with colon before beginning instruction. then refer address location your program using label instead absolute address. Labels exceed characters length. Assembler directives Directives begin with period with semicolon complete descriptions directives, "Assembler Directives" page 3-27. Preprocessor commands Commands begin with pound sign with carriage return. pound sign must first character line containing command. command longer than line, backslash carriage return continue command next line. characters between backslash carriage return. Unlike other assembly statements, preprocessor commands case sensitive must lowercase. list these commands, "Preprocessing Program" page 3-8. Figure contains examples assembly statements. 3URJUDP 6WUXFWXUH Because program memory data memory store data instructions, must segment your program into memory with .SEGMENT directives corresponding these memory areas. Data memory typically contains data segments memory mapped ports. Program memory typically contains code, this memory contain data memory mapped ports. assembly source file contains more segments. These segments groups instructions data that declare with .SEGMENT assem-
VisualDSP User's Guide Reference
$VVHPEOHU *XLGH
bler directive. Because each segment goes into contiguous memory addresses, that structure your code into segments should follow from memory architecture your system. Some suggested program data segments that could your assembly source appear Figure 3-1. Note that these .SEGMENT names correspond input section names default linker description files; using these names your program makes easier take advantage default linker description files when linking. more information, "Linker Description File (LDF) Reference" Chapter Linker. Table 3-1. Suggested Segment Names
.SEGMENT Names seg_pmco seg_dmda seg_pmda seg_init Usage Description
segment Program Memory that holds code segment Data Memory that holds data segment Program Memory that holds data segment Program Memory that holds system initialization data segment interrupt table area Program Memory that holds system initialization code interrupt service routines
seg_rth
further segment program grouping elements meet hardware constraints. group some code that should reside off-chip memory, declare segment that code place that segment selected memory with linker. Figure shows program divides into segments that match program data memory segmentation system. assembly source file often begins with more statements, such .PRECISION .ROUND directive, that modify assembler runs.
VisualDSP User's Guide Reference
$VVHPEOHU
These directives Figure tell assembler store floating-point data with 40-bit precision round floating-point value zero does 40-bit format. Preprocessor Commands Assembler Directives Data Segment
#include "const.h" #define 3.14159 .PRECISION=40; .ROUND_ZERO; .SEGMENT/DM seg_dmda; .VAR fxd[10] 1,2,3,4,5,6,7,8,9,0xA; .VAR flt[5] PI,PI/2,1.0,2.0,2.0/3.0; .VAR rad; {instructions} .ENDSEG; .SEGMENT/PM seg_port; .PORT clk_in; .PORT tick; {instructions} .ENDSEG; .SEGMENT/PM seg_pmco; {instructions} #ifdef some_variable
Port Segment
Code Segment Preprocessor Commands Conditional Assembly
Figure 3-2. Example Assembly Source File Looking Figure 3-2, notice that program divides into segments, beginning with .SEGMENT directive ending with .ENDSEG directive. example contains three segments. first segment contains data memory data. this segment, variables buffers declared initialized. next segment contains ports mapped program memory. Each port unique name, identifying reading writing. last segment contains code-primarily instructions-but also possibly other types statements, such those needed conditional assembly.
VisualDSP User's Guide Reference
$VVHPEOHU *XLGH
3URJUDP ,QWHUIDFLQJ 5HTXLUHPHQWV some point, want interface your assembly program with program. call functions from assembly program call assembly routines from program. Programming lets write programs without directly accessing DSP's hardware required with assembly programs. When write assembly that interfaces with program, must observe rules that compiler follows produces code DSP. These rules compiled code called compiler's runtime environment. Complying with runtime environment mean following rules memory usage, register usage, commenting, variable names. information particular compiler's runtime environment, compiler's user manual. definition runtime environment compiler appears Compiler Guide Reference.
3UHSURFHVVLQJ 3URJUDP
assembler includes preprocessor that lets preprocessor commands within your assembly source. Table lists these commands provides brief description each. preprocessor automatically runs before assembler, unless assembler's (skip preprocessor) switch. program necessary build your file using preprocessor. Preprocessor commands also useful modifying assembly. Using #include command, include data files (.DAT) that fill areas memory, load configuration registers, other features. macro, which declare with #define preprocessor command, specify simple text substitutions complex substitutions with parameters. preprocessor replaces each occurrence macro reference found throughout program with specified value. example, macro Figure replaced characters 3.14159 during preprocessing.
VisualDSP User's Guide Reference
$VVHPEOHU
more information, "Preprocessor Reference" Chapter Preprocessor. Table 3-2. Preprocessor Commands
Command #define #undef #if, #endif #else, #elif #ifdef #ifndef #include Description define macro constant undo macro definition conditional assembly multiple conditional blocks
condition based macro definition condition based macro defined include source code from another file
5HDGLQJ /LVWLQJ )LOH
listing file (.LST) optional output that lets interpret results assembly process. example listing file appears Listing 3-1. source file, DFT.ASM, that appears listing available /21k/Examples/DFT directory. Listing files provide following information: Address Column shows offset from .SEGMENT's base address Opcode Column shows hexadecimal opcode that assembler generates line assembly source Line Column three shows line number assembly source file
VisualDSP User's Guide Reference
$VVHPEOHU *XLGH
Assembly Source Column four shows line assembly source from file Note that assembler comments, enclosed braces appear listing file, comments, enclosed slash asterisk */), appear listing file. want style comments, must build your file using preprocessor. Listing 3-1. Listing File Example
Analog Devices ADSP-210x0 Assembler dft.lst Page Release 4.0, Version 16:01:56 1997 Copyright 1991-1998 Analog Devices, Inc. {Lines -100 omitted from this listing} 000000 000001 000002 000003 000000 000001 .SEGMENT/DM seg_dmda; .VAR input[64]= "test64.dat"; .VAR real[64]; .VAR imag[64]; .ENDSEG; .SEGMENT/PM seg_pmda; .VAR sine[64]= "sin64.dat"; .ENDSEG; .SEGMENT/PM seg_rth; 000000000000 0f7100108421 117100000002 063e00000000 .ENDSEG; .SEGMENT/PM seg_pmco; 0f2100000001 0f2900000001
NOP; USTAT2= 0x108421; DM(0x02)=USTAT2; JUMP start;
start: M9=1;
M1=1;
3-10
VisualDSP User's Guide Reference
$VVHPEOHU
000002 000003 000004 000005 000006 000007 000008 000009
00000a 00000b 00000c 00000d 00000e 00000f 000010 000011 000012 000013 000014 000015 000016 000017 000018
0f4000000000 0f3000000040 0f1100000000 0f3100000000 06be04000000 0f1200000000 0f3200000000 008000000000 0f4800000000 0f3800000040 0f4900000000 0f1900000010 0f3900000040 0f1a00000000 0f3a00000000 0f0f00000000 0c0040000000 71af940a18f0 2040428a19f0 503f02130c05 0c003f000000 204042d8d904 503f0259c811
B0=input; L0=@input; I1=imag; L1=0; CALL (DB); I2=real; L2=0; end:
IDLE;
000019 00001a 00001b 00001c 00001d
013e0058d904 547e8488288d 047e88000000 527e84000000 0a3e00000000
dft: B8=sine; L8=@sine; B9=sine; I9=sine+64/4; L9=@sine; I10=0; L10=0; F15=0; LCNTR=64, outer UNTIL LCE; F8=PASS F15, M8=I10; F9=PASS F15, F0=DM(I0,M1), F5=PM(I9,M8); F12=F0*F5, F4=PM(I8,M8); CNTR=64-1, inner UNTIL LCE; F13=F0*F4, F9=F9+F12, F0=DM(I0,M1), F5=PM(I9,M8); inner: F12=F0*F5, F8=F8-F13, F4=PM(I8,M8); F13=F0*F4, F9=F9+F12; F8=F8-F13, DM(I2,M1)=F9; MODIFY(I10,M9); outer: DM(I1,M1)=F8; RTS; .ENDSEG;
VisualDSP User's Guide Reference
3-11
$VVHPEOHU *XLGH
6HWWLQJ $VVHPEOHU 2SWLRQV
When developing project, find useful modify assembler's default option settings. following procedure modify assembler's option settings: Select environment's Project window (make active window) Open project options using either following methods: Right-click project's Sources folder icon choose Options from Context menu Select Options from environment's Project menu environment displays build tool.
Options
dialog with tabs each
Select Project Options dialog make sure choose either Debug Release build type Select Assemble Options dialog assembler options custom build more information, "Assembler Options" page 3-14. Select apply options, exiting Options dialog environment saves your settings selected build type. Note that this procedure only applies options that when assembler within VisualDSP environment. When assembler from command line, must assembler's command line switches assembler options. more information, "Assembler Dialog Options" page 3-14 "Assembler Command Line Switches" page 3-15.
3-12
VisualDSP User's Guide Reference
$VVHPEOHU
$VVHPEOHU 5HIHUHQFH
assembler generates object files from assembly source files. linker produces executable programs linking together these separately assembled object files. assembler's primary output object file with file name extension .DOJ. create object file, assembler processes data from assembly source (.ASM), data (.DAT), header (.H) files. archive results assembly into library file (.DLB), which then linked with other objects into executable. Because archive process performs partial link, placing often used objects library reduces time required subsequent links. more information, "Archiver (ar) Reference" Chapter Archiver. This section provides reference information assembler options assembly process. reference information available these topics follows: "Assembler Options" page 3-14 This section describes assembler options, which accessible from Assemble environment's Options dialog assembler's command line. assembler's options control library searches other processing options. "Assembler Expressions Conventions" page 3-20 This section describes assembler's expression operators other conventions. "Assembler Keywords Expressions" page 3-23 This section describes assembler's predefined keywords rules user defined symbols labels. "Assembler Directives" page 3-27 This section describes assembler's directives.
VisualDSP User's Guide Reference
3-13
$VVHPEOHU 5HIHUHQFH
$VVHPEOHU 2SWLRQV
Assembler's dialog options command line switches control assembler runs. When environment builds (compiles, assembles, links) your project, environment runs assembler using options that Assemble environment's Options dialog. When assembler from command line, switches control assembler's features. $VVHPEOHU 'LDORJ 2SWLRQV Figure shows Assemble from environment's Options dialog. Note each option dialog corresponds assembler's command line options. more information, "Assembler Command Line Switches" page 3-15.
3-14
VisualDSP User's Guide Reference
$VVHPEOHU
Corresponding switch assembler's command line: (put only macro[=def] portion switch into definitions field; delimit macros with semicolon)
-Dmacro
Figure 3-3. Assemble From Project Options Dialog $VVHPEOHU &RPPDQG /LQH 6ZLWFKHV This section describes command line switches. list switches appears Table page 3-17, description each switch appears Table page 3-18.
VisualDSP User's Guide Reference
3-15
$VVHPEOHU 5HIHUHQFH
following general syntax assembler command line:
asm21k -switch [-switch sourcefile
Where:
sourcefile
Name source file assemble.
file name include drive, directory, file name, file extension. assembler uses each file's extension determine what operations perform. Table lists allowed extensions.
-switch
Name switch process.
assembler many optional switches. These select operations modes assembler preprocessor. assembler command line case sensitive. following command line, example:
asm21k -dfilter_taps=100 program.doj p0.asm
runs assembler with:
Directs assembler output listing file Defines macro filter_taps equal
-dfilter_taps=100
Turns verbose information, echoing each file's name processed Selects name assembled object output
program.doj p0.asm
Identifies assembly source file assemble
Some assembler switches take file name optional parameter. Table page 3-17 lists type files extensions that assembler expects files.
3-16
VisualDSP User's Guide Reference
$VVHPEOHU
assembler supports relative absolute directory names command line switch, define file search paths. more information searches, VisualDSP Release Note. When provide input output file name parameter, following guidelines naming files: Enclose long file names within straight quotes, "long
file name".
Append appropriate file name extension each file. assembler follows conventions file name extensions that appear Table 3-3. Table 3-3. File Name Extension Conventions
Extension .asm .lst .doj
File Description Assembly source file Preprocessed assembly source file Header file Listing file Object file
Note that assembler treats files with unrecognized extensions assembly files.
summary assembler's command line switches appears Table 3-4; descriptions each switch appear Table 3-5. Table 3-4. Assembler Command Line Switches
sourcefile [-Dmacro[=definition]] [-adsp21060] [-h]
VisualDSP User's Guide Reference
3-17
$VVHPEOHU 5HIHUHQFH
Table 3-4. Assembler Command Line Switches (Cont'd)
directory] filename] [-sp] [-l] [-pp] [-v]
Table 3-5. Assembler Command Line Switch Descriptions
Switch sourcefile Description assembler handles files examining file name extension follows:
Files with extension .ASM extension treated assembly source files assembled. Files named #include command with extension treated header files preprocessed.
assembly source file named command line, assembly fails. -Dmacro def] (define macro) switch directs assembler define macro. include optional definition string, assembler defines macro string `1'. Some examples this switch follows: -Djunk -Dten=10 -Dname="Jake" defines junk defines defines name string "Jake"
(help) switch directs assembler output standard output list command line switches with syntax summary.
3-18
VisualDSP User's Guide Reference
$VVHPEOHU
Table 3-5. Assembler Command Line Switch Descriptions (Cont'd)
Switch directory Description (include path) switch directs assembler search specified directory included files. These files data files (.dat) that refer .VAR directive header files (.h) that include with #include command. (listing file) switch directs assembler produce listing file. This file shows relationship between your source code instruction opcodes that assembler produces. more information, "Reading Listing File" page 3-9. (output) switch directs assembler specified filename output object file. this switch, assembler uses input file name output appends .DOJ extension. (proceed with preprocessing) switch directs assembler preprocessor stop without assembling source into object file. default, preprocessor generates preprocessed assembly (.IS) file. This intermediate file deleted assembler runs without error. When assembly stops after preprocessing with switch, file only output.
filename
VisualDSP User's Guide Reference
3-19
$VVHPEOHU 5HIHUHQFH
Table 3-5. Assembler Command Line Switch Descriptions (Cont'd)
Switch Description (skip preprocessing) switch directs assembler assemble source into object file without running preprocessor. default, preprocessor generates preprocessed assembly (.IS) file. This intermediate file deleted assembler runs without error. When assembly skips preprocessing with switch, file output. (verbose) switch directs assembler output standard output name each file processed version assembler.
$VVHPEOHU ([SUHVVLRQV &RQYHQWLRQV
expression acceptable wherever numeric value indicated assembly instruction's syntax. Expressions come types: constant expressions address expressions. Constant expressions contain arithmetic logical operation more constants, such 2.9e-5 1.29, (128 0x55 0x0F. operators from Table constant expressions.: Table 3-6. Numeric Bitwise Expression Operators1
Operator Description Left, right parenthesis Ones complement, unary minus Multiply, divide, modulus
3-20
VisualDSP User's Guide Reference
$VVHPEOHU
Table 3-6. Numeric Bitwise Expression Operators1 (Cont'd)
Operator @buffer
Description Addition, subtraction
Bitwise shifts Bitwise Bitwise Bitwise Returns length buffer words
Operators appear order precedence.
addition arithmetic bitwise operators, assembler supports special "length operator. When apply this operator symbol that identifies data buffer, assembler returns length words buffer. This operator used with external symbols; only apply @buffer buffer that define same file @buffer expression. example, following code determines base address length circular buffer real_data. buffer length value contained determines when addressing wraps around buffer.
.SEGMENT/DM seg_dmda; .VAR real_data[n]; .ENDSEG; .SEGMENT/PM seg_pmco; B5=real_data; {data segment} {n=number input samples}
{code segment} {buffer base address} loads automatically} L5=@real_data; {buffer length} M6=1; {post-modify LCNTR=@real_data, loop UNTIL LCE;
VisualDSP User's Guide Reference
3-21
$VVHPEOHU 5HIHUHQFH
{loop counter=buffer length} F0=DM(I5,M6); {get next sample} loop: .ENDSEG;
Address expressions contain symbol plus minus integer value, such data data_buffer startup These symbols either data variables, data buffers, program labels. Symbols represent address values. Note that operand expression floating-point value, assembler stores value expression floating-point format. assembler supports numeric bases comments within expressions instructions. Table lists assembler's conventions numeric bases comments. Table 3-7. Numeric base Comment Conventions
Convention 0xnumber Hnumber hnumber number Dnumber dnumber Onumber onumber Bnumber bnumber comment Description "0x", "H", prefix indicates hexadecimal base number
"D", "d", prefix indicates decimal base number
prefix indicates octal base number prefix indicates binary base number string begins single-line comments
3-22
VisualDSP User's Guide Reference
$VVHPEOHU
Table 3-7. Numeric base Comment Conventions (Cont'd)
Convention comment comment Description string encloses multi-line comments string encloses style comments, which handled preprocessor. style comments will cause error preprocessor used
$VVHPEOHU .H\ZRUGV ([SUHVVLRQV
assembler supports predefined keywords, including register names, bitfield names, assembly instructions, assembler directives. Table page 3-24 lists assembler keywords. must augment this keywords with symbols that declare segment names, variable names, constant names, address labels. User defined symbols assembly source files must comply with following conventions: Symbols must unique within file they declared. symbol another file, export symbol with .GLOBAL directive origination file import symbol with .EXTERN directive destination file. Symbols contain alphabetic characters (A-Z a-z), digits dollar signs ($), underscores (_), symbols begin with digit. Symbols exceed characters length. Symbols case sensitive. They conflict with assembler keywords that appear Table 3-8.
VisualDSP User's Guide Reference
3-23
$VVHPEOHU 5HIHUHQFH
Because linker uses segment name symbols placing code memory, segment name symbols conflict with linker description file keywords that described "Linker Description File (LDF) Reference" Chapter Linker. Address label symbols appear start instruction line preceding line. Terminate address label with colon before beginning instruction. following lines code demonstrate some symbol usage:
.VAR xoperand; .VAR input_array[10]; sub_routine_1: .PORT AD_INPUT; .SEGMENT/PM seg_pmco; {xoperand data variable} {input_array data buffer} {sub_routine_1 label} {AD_INPUT port} {seg_pmco segment name}
Table 3-8. Assembler Keywords
BCLR BTGL COMP DMA2E BTST COPYSIGN DMA2S
BITREV CURLCNTR DMBANK1 ASHIFT CACHE CLIP DADDR DMA1E DMBANK2 ASTAT BSET CALL DMA1S DMBANK
CJUMP DMADR
3-24
VisualDSP User's Guide Reference
$VVHPEOHU
Table 3-8. Assembler Keywords (Cont'd)1
DMWAIT ELSE ENDSEG EXTERN FDEP EMUCLK FEXT DOVL EMUCLK2 FILE EMUIDLE EMUN FLAG0 FMERG ENDEF EXP2 FADDR FLAG1 EVER PACK
FLAG2_IN
FLAG3_IN
FLOAT
FLUSH
FPACK
FRACTIONAL
GCC_ COMPILED IMASKP
GLOBAL
LEFTO
IDLE IRPTL LEFTZ
IDLE16 JUMP LADDR LINE
IMASK LCNTR LOAD
VisualDSP User's Guide Reference
3-25
$VVHPEOHU 5HIHUHQFH
Table 3-8. Assembler Keywords (Cont'd)1
LOG2 MR0F LOGB MR1B LOOP MODE1 MR1F MODE2 MR2B LSHIFT MANT MODIFY MR2F MR0B NEWPAGE
NOFO
NOFZ
SPECIAL PCSTKP PMWAIT PSA1E PSA4E RFRAME ROUND _ZERO
PASS PMBANK1 POVL0 PSA2S ROUND _MINUS
PMDAE POVL1 PSA3E READ ROUND _NEAREST
PCSTK PMDAS PRECISION PSA3S RECIPS ROUND _PLUS
PSA1S PSA4S
PACK PMADR PORT PSA2E PUSH RSQRTS
3-26
VisualDSP User's Guide Reference
$VVHPEOHU
Table 3-8. Assembler Keywords (Cont'd)1
SEGMENT TYPE WITH
STEP SUIR USFR UUFR
STKY TPERIOD
SCALB SSFR TRUE UNPACK USIR UUIR
TRUNC UNTIL USTAT1
SIZE SSIR SUFR TCOUNT USTAT2
keywords this table appear UPPERCASE, these keywords case insensitive assembler's syntax. example, assembler accepts both "DM" "dm."
$VVHPEOHU 'LUHFWLYHV
Directives assembly source file control assembly process. Unlike instructions, directives produce opcodes during assembly. following general syntax assembler directives:
.directive qualifiers-or-arguments
assembler directive starts with period ends with semicolon (;). Some directives take qualifiers arguments. directive's qualifiers immediately follow directive separated slashes; arguments follow qualifiers. Comments follow directive's terminating semicolon.
VisualDSP User's Guide Reference
3-27
$VVHPEOHU 5HIHUHQFH
Assembler directives either uppercase lowercase. this manual, they shown uppercase distinguish them from other source code. assembler supports directives listed Table 3-9. Descriptions each directive appear following sections. Table 3-9. Assembler Directive Summary1
.ENDSEG .NEWPAGE .ROUND_MINUS .ROUND_ZERO
.EXTERN .PORT .ROUND_NEAREST .SEGMENT
.GLOBAL .PRECISION .ROUND_PLUS .VAR
directives this table appear UPPERCASE, these keywords case insensitive assembler's syntax. example, assembler accepts both ".GLOBAL" ".global."
'HFODUH 3URJUDP 6HJPHQW .SEGMENT .ENDSEG directives mark beginning segment, section contiguous locations program memory data memory. statements between these directives specify contents segment. .SEGMENT .ENDSEG directives syntax:
.SEGMENT/type seg_name; {contents segment} .ENDSEG;
Within this syntax, /type qualifier must (program memory) (data memory). /type qualifier must match memory type which linker description file places segment. segment name symbol, seg_name, must contain eight fewer characters. Table page shows some typical segment names. assembler segment name must match corresponding input section name that linker descrip-
3-28
VisualDSP User's Guide Reference
$VVHPEOHU
tion file uses placing segment. more information, "Linker Description File (LDF) Reference" Chapter Linker. 'HFODUH 'DWD 9DULDEOH %XIIHU .VAR directive declares (optionally) initializes variables data buffers. variable uses single memory location data buffer uses array memory locations. Because assembler associates .VAR with memory segment where .VAR appears, .VAR directive only valid appears within segment. Declare variables buffers before referring them code. .VAR directive uses following syntax:*
.VAR .VAR .VAR .VAR .VAR .VAR .VAR .VAR name1; name1 init1; name1, name2, name1, name2, init1, init2, buf_name1 [length]; buf_name1 [length] init1, init2, buf_name1 [length] "filename"; buf_name1 [length], buf_name2 [length],
this syntax, following parameters user defined: name buf_name parameters names variables buffers. [length] parameter defines length words associated buffer. specify length, assembler creates word variable. init parameter sets initial values variables buffer elements. size variable's initialization value size buffer's largest initialization value sets word size storing variable
brackets this syntax that enclose optional [length] required. more information, .VAR code examples.
VisualDSP User's Guide Reference
3-29
$VVHPEOHU 5HIHUHQFH
buffer. available word sizes 32-, 40-, 48-bits. These word sizes equate respectively 10-, 12-, 14-digit hexadecimal constant strings. more information, "Assembly Initialization Data Files (.DAT)" Appendix File Formats. filename parameter indicates that elements buffer their initial values from filename data file (.DAT). ellipse represents comma delimited list parameters. list continue limit 1024 characters line. following lines code demonstrate some .VAR directives:
.VAR Ins, Outs, Remains; {declare three uninitialized variables} .VAR samples[100]= "inits.dat"; {declare 100-location buffer initialize with contents inits.dat file} .VAR taps .VAR twiddles[10] "phase.dat"; {declare variable 10-location buffer; initialize variable load buffer with contents phase.dat file}
Whether .VAR directive lists initial values reads them from file, make sure that number initial values matches number variables buffer locations that declare. Initializing from files useful loading buffers with data, such filter coefficients phase rotation factors, that generated other programs. assembler determines values stored memory when reads data files. more information, "Assembly Initialization Data Files (.DAT)" Appendix File Formats. 6HOHFW 3UHFLVLRQ .PRECISION directive controls assembler interprets literal, floating-point, numeric data. This directive determines only
3-30
VisualDSP User's Guide Reference
$VVHPEOHU
assembler handles floating-point values constant declarations variable initializations; configure floating-point precision with software, setting control registers. With .PRECISION, assembler defines number significant bits floating-point data. following options:
.PRECISION=32 {Selects standard IEEE 32-bit single-precision format; this default setting} {Selects 40-bit format with extended mantissa}
.PRECISION=40
Note that .PRECISION only applies floating-point data. precision fixed-point data determined many digits specified. 6HOHFW 5RXQGLQJ .ROUND_ directive controls assembler interprets literal, floating-point, numeric data. This directive determines only assembler handles floating-point values constant declarations variable initializations; configure floating-point rounding modes with software, setting control registers. With .ROUND_, assembler determines rounding mode used when constant does destination format. following IEEE standard modes:
.ROUND_PLUS .ROUND_MINUS .ROUND_ZERO .ROUND_NEAREST default setting} {Selects Round-to-Positive Infinity} {Selects Round-to-Negative Infinity} {Selects Round-to-Zero} {Selects Round-to-Nearest; this
VisualDSP User's Guide Reference
3-31
$VVHPEOHU 5HIHUHQFH
'HFODUH 0HPRU\ 0DSSHG 3RUW .PORT directive assigns port name symbol port. Port name symbols global symbols. This port name corresponds port that define linker description file. .PORT directive uses following syntax:
.PORT port_name;
0DNH 9DULDEOH %XIIHU *OREDOO\ $YDLODEOH .GLOBAL directive exports symbols. These symbols then available other object file that link file defining global symbol. global symbol linked files, import symbol declaring with .EXTERN directive linked file. Normally, labels symbols only valid file which they declared; their scope local that file. local variables different files have same name, assembler considers them independent entities. comparison, symbol that global scope recognizable many files always refers same address value. .GLOBAL directive uses following syntax:
.GLOBAL symbol symbol,
following code example declares variable global:
.VAR coeffs[10]; .GLOBAL coeffs; {make buffer visible other files}
After declare symbol .GLOBAL, segments other files refer declaring symbol .EXTERN. 5HIHU *OREDOO\ $YDLODEOH 9DULDEOH %XIIHU .EXTERN directive imports symbols, providing that they have been declared .GLOBAL other files. more information, ".GLOBAL,
3-32
VisualDSP User's Guide Reference
$VVHPEOHU
Make Variable Buffer Globally Available" page 3-32. .EXTERN directive uses following syntax:
.EXTERN symbol symbol,
following code example declares external variable imports reference this file. This code imports symbol that exported example code .GLOBAL directive description.
.EXTERN coeffs;
)RUPDW /LVWLQJ )LOH .NEWPAGE directive formats optional listing file (.LST) output that assembler produces when switch. assembler inserts page break printed output location .NEWPAGE directive. This directive appear anywhere your source code file.
VisualDSP User's Guide Reference
3-33
$VVHPEOHU *ORVVDU\
$VVHPEOHU *ORVVDU\
Assembler directives tell assembler process your source code some features. Directives structure your program into logical "segment" sections that mirror memory layout your target system. Instruction assembly instructions that work specific DSP. assembler supports ADSP-2106x instruction set. information this instruction set, ADSP-2106x SHARC User's Manual. Linker description file controls linker processes assembler's output object files into executable programs. more information, "Linker Description File (LDF) Reference" Chapter Linker. Preprocessor commands directs preprocessor include files, perform macro substitutions, control conditional assembly. more information, "Preprocessing Program" page 3-8.
3-34
VisualDSP User's Guide Reference

Other recent searches


VLF-80 - VLF-80   VLF-80 Datasheet
R10N11D01 - R10N11D01   R10N11D01 Datasheet
MSM9562 - MSM9562   MSM9562 Datasheet
MSM9563 - MSM9563   MSM9563 Datasheet
M74HC244 - M74HC244   M74HC244 Datasheet
LPC2458 - LPC2458   LPC2458 Datasheet
LHF00L25 - LHF00L25   LHF00L25 Datasheet

 

Privacy Policy | Disclaimer
© 2012 Datasheet Archive