3.9.4
Conditional Expressions
3.9.5
Relocatable Symbols and Legal Expressions
Table 3–2. Expressions With Absolute and Relocatable Symbols
The assembler supports relational operators that can be used in any
expression; they are especially useful for conditional assembly. Relational
operators include the following:
=
Equal to
! =
Not equal to
<
Less than
>
Greater than
Conditional expressions evaluate to 1 if true and 0 if false; they can be used
only on operands of equivalent types, for example, absolute value compared
to absolute value, but not absolute value compared to relocatable value.
Table 3–2 summarizes valid operations on absolute, relocatable, and external
symbols. An expression cannot contain multiplication or division by a relocat-
able or external symbol. An expression cannot contain unresolved symbols
that are relocatable to other sections.
Symbols or registers that have been defined as global with the .global directive
can also be used in expressions; in Table 3–2, these symbols and registers are
referred to as external .
Relocatable registers can be used in expressions; the addresses of these
registers are relocatable with respect to the register section they were defined
in, unless they have been declared as external.
If A is...
and
absolute
absolute
absolute
relocatable
relocatable
relocatable
external
external
external
† A and B must be in the same section; otherwise, this is illegal.
= =
Equal to
<=
Less than or equal to
> =
Greater than or equal to
If B is...
, then
A + B is...
absolute
absolute
external
external
relocatable
relocatable
absolute
relocatable
relocatable
illegal
external
illegal
absolute
external
relocatable
illegal
external
illegal
Expressions
and
A – B is...
absolute
illegal
illegal
relocatable
absolute
illegal
external
illegal
illegal
Assembler Description
†
3-27
Need help?
Do you have a question about the TMS320C54x and is the answer not in the manual?