SLAU131V October 2004 – February 2020
These rules apply to linker expressions:
The linker supports the C language operators listed inTable 8-11 in order of precedence. Operators in the same group have the same precedence. Besides the operators listed in Table 8-11, the linker also has an align operator that allows a symbol to be aligned on an n-byte boundary within an output section (n is a power of 2). For example, the following expression aligns the SPC within the current section on the next 16-byte boundary. Because the align operator is a function of the current SPC, it can be used only in the same context as . —that is, within a SECTIONS directive.
. = align(16);
Group 1 (Highest Precedence) | Group 6 | ||||
---|---|---|---|---|---|
!
~ - |
Logical NOT
Bitwise NOT Negation |
& | Bitwise AND | ||
Group 2 | Group 7 | ||||
*
/ % |
Multiplication
Division Modulus |
| | Bitwise OR | ||
Group 3 | Group 8 | ||||
+
- |
Addition
Subtraction |
&& | Logical AND | ||
Group 4 | Group 9 | ||||
>>
<< |
Arithmetic right shift
Arithmetic left shift |
|| | Logical OR | ||
Group 5 | Group 10 (Lowest Precedence) | ||||
==
! = > < < = > = |
Equal to
Not equal to Greater than Less than Less than or equal to Greater than or equal to |
=
+ = - = * = / = |
Assignment
A + = B A - = B A * = B A / = B |
is equivalent to is equivalent to is equivalent to is equivalent to |
A = A + B A = A - B A = A * B A = A / B |