
Creating DSK Assembler Source Files
5-3
Using the DSK Assembler
Using valid labels
Labels are optional for all assembly language instructions and for most (but
not all) assembler directives. When you use them, a label
must begin in col-
umn 1 of a source statement. A label can contain up to eight alphanumeric
characters (A–Z, a–z, 0–9, and _ ). Labels are case-sensitive, and the first
character cannot be a number. For example:
.start ”.text”,0x809C00
.entry start
CTRL .set 0
IN .set 1
OUT .set 2
.text
WSHIFT .word –8
start ldp @stack ; Load data page
ldi @stack,SP ; Initialize the stack
ldf 0.0,R0
ldi 0x100,R0
lsh @WSHIFT,R0
BRD jump
ldf 0.0,R1
ldf 0.0,R2
ldf 1.0,R3
jump: ldf 1.0,R4
b start
stack .word $ + 1
.end
In the preceding example, the colon appended to the jump label is optional.
The DSK assembler does not require 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 it’s associated with). If, for example,
you use the .int directive to initialize several words, a label would point to the
first word. In the following example, the label Begin has the value 0x00809800.
0x00809800 directive Begin .int 0Ah,3,7
0x00809800 0x0000000a <int>
0x00809801 0x00000003 <int>
0x00809802 0x00000007 <int>
When a label appears on a line by itself, it points to the instruction on the next
line:
0x0080981f nocode XMIT
0x0080981f 0x10760010 or 10h, IE
0x00809820 0x06000000 idle
When an opcode or directive references a label, the label is substituted with
the address of the label’s location in memory. The only exception to this is the
.set directive, which assigns a value to a label. If you don’t use a label, the first
character position must contain a blank, a semicolon, or an asterisk.
Summary of Contents for TMS320C3 Series
Page 1: ...TMS320C3x DSP Starter Kit User s Guide...
Page 18: ...1 4...
Page 28: ...2 10...
Page 82: ...5 18...
Page 140: ...Communications Kernel Source Code A 12...
Page 145: ...Schematics B 5 DSK Circuit Board Dimensions and Schematic Diagrams...
Page 146: ...Schematics B 6...
Page 147: ...Schematics B 7 DSK Circuit Board Dimensions and Schematic Diagrams...
Page 148: ...Schematics B 8...
Page 149: ...Schematics B 9 DSK Circuit Board Dimensions and Schematic Diagrams...
Page 150: ...Schematics B 10...
Page 154: ...B 14...
Page 160: ...C 6...
Page 166: ...Index 6...