Assembly-Time Symbol Directives
4-21
Assembler Directives
4.9
Assembly-Time Symbol Directives
Assembly-time symbol directives equate meaningful symbol names to con-
stant values or strings.
-
The .asg directive assigns a character string to a substitution symbol. The
value is stored in the substitution symbol table. When the assembler
encounters a substitution symbol, it replaces the symbol with its character
string value. Substitution symbols can be redefined.
.asg
”10, 20, 30, 40”, coefficients
.byte
coefficients
-
The .eval directive evaluates an expression, translates the results into a
character, and assigns the character string to a substitution symbol. This
directive is most useful for manipulating counters:
.asg
1 , x
.loop
.byte
x*10h
.break
x = 4
.eval
x+1, x
.endloop
-
The .label directive defines a special symbol that refers to the loadtime
address within the current section. This is useful when a section loads at
one address but runs at a different address. For example, you may want
to load a block of performance-critical code into slower off-chip memory
to save space, and move the code to high-speed on-chip memory to run.
-
The .set and .equ directives set a constant value to a symbol. The symbol
is stored in the symbol table and cannot be refined. For example:
bval
.set
0100h
.byte
bval, bval*2, bval+12
B
bval
The .set and .equ directives produce no object code. The two directives
are identical and can be used interchangeably.
-
The .struct /.endstruct directives set up C-like structure definitions, and
the .tag directive assigns the C-like structure characteristics to a label.
The .struct /.endstruct directives allow you to organize your information
into structures, so that similar elements can be grouped together. Element
offset calculation is then left up to the assembler. The .struct/.endstruct
directives do not allocate memory. They simply create a symbolic template
that can be used repeatedly.
Summary of Contents for TMS320C54x
Page 38: ......
Page 39: ......
Page 40: ......
Page 41: ......
Page 42: ......
Page 43: ......
Page 44: ......
Page 45: ......
Page 46: ......
Page 47: ......
Page 48: ......
Page 49: ......
Page 50: ......
Page 51: ......
Page 52: ......
Page 53: ......
Page 54: ......
Page 55: ......
Page 56: ......
Page 57: ......
Page 58: ......
Page 59: ......
Page 60: ......
Page 61: ......
Page 62: ......
Page 276: ......
Page 277: ......
Page 278: ......
Page 279: ......
Page 280: ......
Page 281: ......
Page 282: ......
Page 283: ......
Page 284: ......
Page 285: ......
Page 286: ......
Page 287: ......
Page 288: ......
Page 289: ......
Page 290: ......
Page 291: ......
Page 292: ......
Page 293: ......
Page 294: ......
Page 295: ......
Page 296: ......
Page 297: ......
Page 298: ......
Page 299: ......
Page 300: ......
Page 301: ......
Page 302: ......