TMS320C5x DSP STARTER KIT USER'S GUIDE
TMS320C5x DSP STARTER KIT USER'S GUIDE TMS320C5x DSP STARTER KIT USER'S GUIDE
Creating DSK Assembler Source Files4.1 Creating DSK Assembler Source FilesTo create a DSK assembler source file, you can use almost any ASCII programeditor. Be careful using word processors; these files contain various formattingcodes and special characters which word processors may alter.DSK assembly language source programs consist of source statements thatcan contain assembler directives, assembly language instructions, and comments.Your source statement lines can be up to 80 characters per line.The following example shows several lines of source statements:.ps 0a00h ;initialize PCsym .set 2 ;symbol sym=2Begin: add #sym ;add sym (5) to accumulator.word 016h ;initialize a word with 016hsacl sym ;store accumulator–location sym(5)LAB_1:LAB_2: b LAB_1LAB_3: b LAB_2 ;location of LAB_1 & LAB_2 are sameb LAB_3 ;LAB_3 is at next addressYour source statement can contain four ordered fields. The general syntax forsource statements is as follows:[label][:] mnemonic [operand list] [; comment]Follow these guidelines: All statements must begin with a label, a blank, an asterisk, or a semicolon. Labels are optional; if you use them, they must begin in column 1. One or more blanks must separate each field. Note that tab characters areequivalent to blanks. Comments are optional. Comments that begin in column 1 can begin withan asterisk or a semicolon (* or ;), but comments that begin in any othercolumn must begin with a semicolon.4-2
Creating DSK Assembler Source FilesUsing valid labelsLabels are optional for all assembly language instructions and for most (but notall) assembler directives. When you use them, a label must begin in column 1of a source statement. A label can contain up to 16 alphanumeric characters(A–Z, a–z, 0–9, and _ ). Labels are case sensitive and the first character cannotbe a number. For example:.ps 0a00h ; Your code can start here.entryStart: mar *,AR0lar AR0,#0lacl #03fh ; Turn on all interruptsldp #0 ;IMR located in page 0sacl 4 ;store mask to IMRIn the preceding example, the colon is optional. The DSK assembler does notrequire a label terminator.When you use a label, its value is the current value of the section program counter(the label points to the statement with which it is associated). If, for example, youuse the .word directive to initialize several words, a label would point to the firstword. In the following example, the label Begins has the value 0a00h.00001 –––– –––– *assume other code was assembled00002 –––– ––––00003 –––– 0a00 .ps 0a00h00004 0a00 000a Begins: .word 0Ah,3,70a01 00030a02 0007When a label appears on a line by itself, it points to the instruction on the nextline:00018 –––– fb00 .ds 0fb00h00019 –––– –––– Here:00020 fb00 000a .word 0Ah,3,700021 –––– ––––When an opcode or directive references a label, the label is substituted withthe address of the label’s location in memory. The only exceptions are the .setdirective, which assigns a value to a label, and the LDP opcode, which loadsthe nine most significant bits (MSB) of the address.If you don’t use a label, the first character position must contain a blank, a semicolon,or an asterisk.Using the DSK Assembler4-3
- Page 1 and 2: TMS320C5xDSP Starter KitUser’s Gu
- Page 3 and 4: PrefaceRead This FirstAbout This Ma
- Page 5 and 6: Notational Conventions / Informatio
- Page 7 and 8: If You Need AssistanceIf You Need A
- Page 9 and 10: ContentsContentsPart I: Hands-On In
- Page 11: ContentsPart III: Debugger Descript
- Page 14 and 15: Running Title—Attribute Reference
- Page 16 and 17: Key Features1.1 Key FeaturesThis se
- Page 18 and 19: Memory1.3 MemoryThe ’C5x DSK is o
- Page 20 and 21: MemoryFigure 1-3. DSK to RS-232 Con
- Page 22 and 23: What You’ll Need2.1 What You’ll
- Page 24 and 25: What You’ll NeedDSK module connec
- Page 26 and 27: Step 2: Installing the DSK Software
- Page 28 and 29: Step 4: Modifying the PATH Statemen
- Page 30 and 31: Step 5: Verifying the InstallationI
- Page 32 and 33: Description of the DSK Assembler3.1
- Page 34 and 35: Developing Code for the DSK3.3 Deve
- Page 36 and 37: Getting Started2) Enter the followi
- Page 38 and 39: Getting Started5) Now you are ready
- Page 42 and 43: Creating DSK Assembler Source Files
- Page 44 and 45: Creating DSK Assembler Source Files
- Page 46 and 47: Symbols4.3 SymbolsSymbols are used
- Page 48 and 49: Assembling Your Program4.5 Assembli
- Page 50 and 51: 4-12
- Page 52 and 53: Using the DSK Assembler Directives5
- Page 54 and 55: Directives That Define Sections5.2
- Page 56 and 57: Directives That Reference Other Fil
- Page 58 and 59: Directives That Initialize Memory5.
- Page 60 and 61: Miscellaneous Directives5.6 Miscell
- Page 62 and 63: .byte/.stringDirectives ReferenceSy
- Page 64 and 65: .copy/.includeDirectives ReferenceL
- Page 66 and 67: .endDirectives ReferenceSyntax.endD
- Page 68 and 69: .float/.bfloat/.double/.efloat/.tfl
- Page 70 and 71: .if/.else/.endifDirectives Referenc
- Page 72 and 73: .liston/.listoffDirectives Referenc
- Page 74 and 75: .lqxx/.qxxDirectives ReferenceSynta
- Page 76 and 77: .mmregsDirectives ReferenceTable 5-
- Page 78 and 79: .setDirectives ReferenceSyntax symb
- Page 80 and 81: .spaceDirectives ReferenceListing f
- Page 82 and 83: .text / .psDirectives ReferenceExam
- Page 84 and 85: 5-34
- Page 86 and 87: Invoking the Debugger6.1 Invoking t
- Page 88 and 89: Invoking the DebuggerSetting the co
Creating DSK Assembler Source Files4.1 Creating DSK Assembler Source FilesTo create a DSK assembler source file, you can use almost any ASCII programeditor. Be careful using word processors; these files contain various formattingcodes and special characters which word processors may alter.DSK assembly language source programs consist of source statements thatcan contain assembler directives, assembly language instructions, and comments.Your source statement lines can be up to 80 characters per line.The following example shows several lines of source statements:.ps 0a00h ;initialize PCsym .set 2 ;symbol sym=2Begin: add #sym ;add sym (5) to accumulator.word 016h ;initialize a word with 016hsacl sym ;store accumulator–location sym(5)LAB_1:LAB_2: b LAB_1LAB_3: b LAB_2 ;location of LAB_1 & LAB_2 are sameb LAB_3 ;LAB_3 is at next addressYour source statement can contain four ordered fields. The general syntax forsource statements is as follows:[label][:] mnemonic [operand list] [; comment]Follow these guidelines: All statements must begin with a label, a blank, an asterisk, or a semicolon. Labels are optional; if you use them, they must begin in column 1. One or more blanks must separate each field. Note that tab characters areequivalent to blanks. Comments are optional. Comments that begin in column 1 can begin withan asterisk or a semicolon (* or ;), but comments that begin in any othercolumn must begin with a semicolon.4-2