Texas Instruments TMS320C54x User Manual page 162

Digital signal processors
Hide thumbs Also See for TMS320C54x:
Table of Contents

Advertisement

Syntax
Description
Example
symbol .set value
symbol .equ value
The .set and .equ directives equate a constant value to a symbol. The symbol
can then be used in place of a value in assembly source. This allows you to
equate meaningful names with constants and other values.
-
The symbol is a label that must appear in the label field.
-
The value must be a well-defined expression; that is, all symbols in the ex-
pression must be previously defined in the current source module.
Undefined external symbols and symbols that are defined later in the module
cannot be used in the expression. If the expression is relocatable, the symbol
to which it is assigned is also relocatable.
The value of the expression appears in the object field of the listing. This value
is not part of the actual object code and is not written to the output file.
Symbols defined with .set or .equ can be made externally visible with the .def
or .global directive. In this way, you can define global absolute constants.
This example shows how symbols can be assigned with .set and .equ.
1
**********************************************
2
**
3
**
4
**********************************************
5
0011
6 000000 7711
000001 0056
7
8
**********************************************
9
**
10
**
11
**********************************************
12
0035
13 000002 F000
000003 0035
14
15
**********************************************
16
** Set symbol SYMTAB to a relocatable expr. **
17
**
18
**********************************************
19 000004 000A
20
0005' SYMTAB
21
22
**********************************************
23
**
24
**
25
**********************************************
26
0035
27 000005 0035
Define Assembly-Time Constant
Equate symbol AUX_R1 to register AR1
and use it instead of the register.
AUX_R1
.set
AR1
STM
#56h, AUX_R1
Set symbol index to an integer expr.
and use it as an immediate operand.
INDEX
.equ
100/2 +3
ADD
#INDEX, A
and use it as a relocatable operand.
LABEL
.word
10
.set
LABEL + 1
Set symbol NSYMS equal to the symbol
INDEX and use it as you would INDEX.
NSYMS
.set
INDEX
.word
NSYMS
.set/.equ
Assembler Directives
**
**
**
**
**
**
**
4-79

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C54x and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents