SPNU118Y September 1995 – February 2020
All legal expressions can be reduced to one of two forms:
relocatable symbol ± absolute symbol
or
absolute value
Unary operators can be applied only to absolute values; they cannot be applied to relocatable symbols. Expressions that cannot be reduced to contain only one relocatable symbol are illegal.
Table 4-6 summarizes valid operations on absolute, relocatable, and external symbols. An expression cannot contain multiplication or division by a relocatable or external symbol. An expression cannot contain unresolved symbols that are relocatable to other sections.
Symbols that have been defined as global with the .global directive can also be used in expressions; in Table 4-6, these symbols are referred to as external.
If A is... and | If B is... , then | A + B is... and | A - B is... |
---|---|---|---|
absolute | absolute | absolute | absolute |
absolute | relocatable | relocatable | illegal |
absolute | external | external | illegal |
relocatable | absolute | relocatable | relocatable |
relocatable | relocatable | illegal | absolute(1) |
relocatable | external | illegal | illegal |
external | absolute | external | external |
external | relocatable | illegal | illegal |
external | external | illegal | illegal |