150
Section 3: Assembler
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
asm68
asm68k
Operator
Associativity
Operator
Associativity
(
)
left to right
(
)
left to right
~
−
right to left
~
−
right to left
*
/ %
left to right
<< >>
left to right
+
−
left to right
& | ! ^
left to right
<< >>
left to right
*
/ %
left to right
&
left to right
+
−
left to right
| !
left to right
^
left to right
Table 3.9: Operator Precedence/Associativity
3.3.7.3. Expression
Evaluation
Expressions are evaluated using the precedence and associativity rules
described above. They are always calculated with 32-bit intermediate values,
regardless of the size of the result. An expression can be evaluated when it is
encountered if it contains no forward or undefined symbol references. Otherwise,
the evaluation of the expression is deferred until the source file has been
completely scanned so that any forward references can be resolved.
Once an expression has been evaluated by the assembler, it can be classified as
one of the following three types: absolute, simple relocatable, or complex
relocatable. An expression that evaluates to an absolute value is classified
absolute. If the expression has reduced to an absolute offset from an external
symbol or from the base address of a relocatable section, then the expression is
simple relocatable; otherwise, the expression is complex relocatable. An
expression that references multiple external symbols or symbols from different
relocatable sections would be classified as complex relocatable. See Figure 3.1
for an example of the different types of expressions.
.xref
sym_x
sym_a = 18
sym_b:
.long
0xff << sym_a
; absolute
.long
sym_f
−
sym_b
; absolute (deferred)
.long
. + 8
; simple relocatable
.long
sym_f
−
4
; simple relocatable (deferred)
.long
sym_b
−
sym_x
; complex relocatable
.long
sym_b + sym_f
; complex relocatable (deferred)
sym_f:
Figure 3.1: Expression Evaluation