Ax51 User's Guide

Simple Relocatable Expressions

Simple relocatable expressions contain symbols that are defined in a relocatable segment. Segment and external symbols are not allowed in simple relocatable expressions.

Simple relocatable expression may be used in four contexts:

  1. As an operand to the ORG directive.
  2. As an operand to a symbol definition directive (i.e. EQU, SET).
  3. As an operand to a data initialization directive (DB or DW).
  4. As an operand to a machine instruction.
Examples for simple relocatable expressions
REL1 + ABS1 * 10
REL2   ABS1
REL1 + (REL2   REL3)    assuming REL2 and REL3 refer to the same segment.
Invalid form of simple relocatable expressions
(REL1 + ABS1) * 10    relocatable value may not be multiplied.
(EXT1   ABS1)         this is a general relocatable expression
REL1 + REL2           you cannot add relocatable symbols.