Literals, constants, and self-defining terms differ in three important
ways:
Where you can specify them in machine instructions, that is, whether
they represent data or an address of data
Whether they have relocatable or absolute values
What is assembled into the object code of the machine instruction
in which they appear
Figure 1 shows
examples of the differences between literals, constants, and self-defining
terms. Figure 1. Differences between literals,
constants, and self-defining terms
A literal with a relocatable address:
L 3,=F'33' Register 3 set to 33. See note 1
L 3,F33 Register 3 set to 33. See note 2
.
.
.
F33 DC F'33'
A literal with a self-defining term and a symbol with an absolute value
MVC STAT,=X'00' STAT set to X'00'. See note 1
MVI STAT,X'00' STAT set to X'00'. See note 3
MVI STAT,ZERO STAT set to X'00'. See note 4
.
.
.
STAT DS X
ZERO EQU X'00'
A symbol having an absolute address value specified by a self-defining
term
LA 4,LOCORE Register 4 set to 1000. See note 4
LA 4,1000 Register 4 set to 1000. See note 3
.
.
.
LOCORE EQU 1000
Notes:
A literal both defines data and represents data. The address
of the literal is assembled into the object code of the instruction
in which it is used. The constant specified by the literal is assembled
into the object code, in the literal pool.
A constant is represented by a symbol with a relocatable value.
The address of a constant is assembled into the object code.
A self-defining term has an absolute value. In this example,
the absolute value of the self-defining term is assembled into the
object code.
A symbol with an absolute value does not represent the address
of a constant, but represents either immediate data or an absolute
address. When a symbol with an absolute value represents immediate
data, it is the absolute value that is assembled into the object code.