Rules for coding expressions

The rules for coding an absolute or relocatable expression are:
  • Unary (operating on one value) operators and binary (operating on two values) operators are allowed in expressions.
  • An expression can have one or more unary operators preceding any term in the expression or at the beginning of the expression.
  • An expression must not begin with a binary operator, nor can it contain two binary operators in succession. When + and - are used as prefix operators, then they are unary, and not binary, operators.
  • An expression starting with * is interpreted as a location counter reference, and not a multiplication operator.
  • An expression must not contain two terms in succession.
  • No spaces are allowed between an operator and a term, nor between two successive operators.
  • An expression can contain any number of unary and binary operators, and any number of levels of parentheses.
  • A single relocatable term is not allowed in a multiply or divide operation. Paired relocatable terms have absolute values and can be multiplied and divided if they are enclosed in parentheses. See Paired relocatable terms.
Figure 1 shows the definitions of absolute and relocatable expressions.
Figure 1. Definitions of absolute and relocatable expressions