Download TMS320C6000 Assembly Language Tools User's Guide

Transcript
.struct/.endstruct/.tag
Syntax
Description
Declare Structure Type
[stag]
[mem0 ]
[mem1 ]
.
.
.
[memn ]
.
.
.
[memN ]
[size]
.struct
element
element
.
.
.
.tag stag
.
.
.
element
.endstruct
[expr]
[expr0 ]
[expr1 ]
.
.
.
[exprn]
.
.
.
[exprN ]
label
.tag
stag
The .struct directive assigns symbolic offsets to the elements of a data structure definition. This allows you to group similar data elements together and let
the assembler calculate the element offset. This is similar to a C structure or
a Pascal record. The .struct directive does not allocate memory; it merely
creates a symbolic template that can be used repeatedly.
The .endstruct directive terminates the structure definition.
The .tag directive gives structure characteristics to a label, simplifying the
symbolic representation and providing the ability to define structures that contain other structures. The .tag directive does not allocate memory. The structure tag (stag) of a .tag directive must have been previously defined.
Following are descriptions of the parameters used with the .struct, .endstruct,
and .tag directives:
- The element is one of the following descriptors: .string, .byte, .char, .int,
.half, .short, .word, .long, .double, .float, .tag, or .field. All of these except
.tag are typical directives that initialize memory. Following a .struct directive, these directives describe the structure element’s size. They do not
allocate memory. A .tag directive is a special case because stag must be
used (as in the definition of stag).
- The expr is an optional expression indicating the beginning offset of the
structure. The default starting point for a structure is 0.
- The exprn/N is an optional expression for the number of elements de-
scribed. This value defaults to 1. A .string element is considered to be one
byte in size, and a .field element is one bit.
- The memn/N is an optional label for a member of the structure. This label
is absolute and equates to the present offset from the beginning of the
structure. A label for a structure member cannot be declared global.
4-68