An expression is a symbol, constant, an operator combined with one of the above, or a combination of operators.
Elements of an expression other than the operators are called terms, and are referred to as the 1st term, 2nd term, and so forth from left to right, in the order that they occur in the expression.
The assembler supports the operators shown in "Table 5.3 Operator Types". Operators have priority levels, which determine when they are applied in the calculation. The priority order is shown in "Table 5.4 Operator Precedence Levels".
The order of calculation can be changed by enclosing terms and operators in parentheses "( )".
In the above example, "5 * (SYM+1)" is an expression. "5" is the 1st term, "SYM" is the 2nd term, and "1" is the 3rd term. The operators are "*", "+", and "( )".
The above operators can also be divided into unary operators and binary operators.
Expressions are operated according to the following rules.
The order of operation is determined by the priority level of the operators. |
Expressions are operated using unsigned 32-bit values. However, terms of expressions in multiplication, division, and modulo operation and the second term of logical shift are handled as signed 32-bit values. |
Relative expressions are evaluated as 0 at the time when the source is assembled (the evaluation value is determined at link time). |