User guide
9.2. THE CINTCODE INSTRUCTION SET 161
compile code with the opp osi t e endianess to that of the machine on which the compiler
is running, see the description of the bcpl command on page 106.
9.2.2 Loading Values
The following instructions are used to load constants, variables, the addresses of vari-
ables and function entry points. Notice that all loading instructions save the old value
of r e gi st er A in B before updating A. This simplifies the translation of dyadic expression
operators.
Ln 0 ≤ n ≤ 10 B := A; A := n
LM1 B := A; A := -1
L b B := A; A := b
LH h B := A; A := h
LMH h B := A; A := -h
LW w B := A; A := w
MW w MW := w
These instructions load integer constants. Constants are in the range -1 to 10 are the
most common and have single byte instructions. The other cases use successively larger
instructions. The MW instruction is only used in 64-bit Cintcode. See page 155 for more
details.
LPn 3 ≤ n ≤ 16 B := A; A := P!n
LP b B := A; A := P!b
LPH h B := A; A := P!h
LPW w B := A; A := P!w
These instructions load local variable s and anonymous results addressed relative to P.
Offsets in the range 3 to 16 are the most common and use single byte instructions. The
other cases use succesively larger instructi on s.
LG b B := A; A := G!b
LG1 b B := A; A := G!(b + 256)
LGH h B := A; A := G!h
LG loads the value of a global variables in the range 0 to 255, LG1 load globals in the
range 256 to 511, and LGH can load globals up to 65535. Global numbers must be in
the range 0 to 65535.
LL Ln B := A; A := variable Ln
LL$ Ln B := A; A := variable Ln
LF Ln B := A; A := entry point Ln
LF$ Ln B := A; A := entry point Ln
LL loads the value of a static variable and LF loads the entry address of a function,
routine or label in the current module.