Assembly-Time Symbol Directives
4-22
The .tag directive assigns a label to a structure. This simplifies the sym-
bolic representation and also provides the ability to define structures that
contain other structures. The .tag directive does not allocate memory, and
the structure tag (stag) must be defined before it is used.
type .struct ; structure tag definition
X .int
Y .int
T_LEN .endstruct
COORD .tag type ; declare COORD (coordinate)
ADD COORD.Y, A
.bss COORD, T_LEN ; actual memory allocation
-
The .union /.endunion directives create a symbolic template that can be
used repeatedly, providing a way to manipulate several different kinds of
data in the same storage area. The union sets up a C-like union definition.
While it does not allocate any memory, it allows alternate definitions of size
and type that may be temporarily stored in the same memory space.
The .tag directive assigns a label to the union, and is associated with the
beginning of the union. A union can be defined and given a tag, and later it
can be declared as a member of a structure by using the .tag directive. A
union may also be declared without a tag, in which case all of its members
will be entered in the symbol table, and each member must have a unique
name. A union may also be defined within a structure, in which case any
reference to such a union will be in association with the structure that en-
closes it. For example:
.data
s2_tag .struct
;structure tag definition
.union
;union is first structure member
.struct
;structure is union member
h1
.half
;h1, h2, and w1
h2
.uhalf
;exist in the same memory
.endstruct
w1
.word
;word is another union member
.endunion
w2
.word
;second structure member
s2_len .endstruct
XYZ
.tag
s2_tag
.bss
XYZ,s2_len
;declare instance of structure
ADD
XYZ.h2, A
Содержание TMS320C54x
Страница 38: ......
Страница 39: ......
Страница 40: ......
Страница 41: ......
Страница 42: ......
Страница 43: ......
Страница 44: ......
Страница 45: ......
Страница 46: ......
Страница 47: ......
Страница 48: ......
Страница 49: ......
Страница 50: ......
Страница 51: ......
Страница 52: ......
Страница 53: ......
Страница 54: ......
Страница 55: ......
Страница 56: ......
Страница 57: ......
Страница 58: ......
Страница 59: ......
Страница 60: ......
Страница 61: ......
Страница 62: ......
Страница 276: ......
Страница 277: ......
Страница 278: ......
Страница 279: ......
Страница 280: ......
Страница 281: ......
Страница 282: ......
Страница 283: ......
Страница 284: ......
Страница 285: ......
Страница 286: ......
Страница 287: ......
Страница 288: ......
Страница 289: ......
Страница 290: ......
Страница 291: ......
Страница 292: ......
Страница 293: ......
Страница 294: ......
Страница 295: ......
Страница 296: ......
Страница 297: ......
Страница 298: ......
Страница 299: ......
Страница 300: ......
Страница 301: ......
Страница 302: ......