User guide

9.2. THE CINTCODE INSTRUCTION SET 163
These in st ru ct i ons provide for all the normal arithmetic and bit pattern dyadic opera-
tors. The instructions DIV and REM generate exception 5 if the divisor is zero. Evalua-
tion of relation al operators in non conditional contexts involve conditional jumps and
the FHOP instruction, see page 166. Addition is the most frequently used arithmetic
operation and so there are various special instructions i mpr ove its efficiency.
An 1 n 5 A := A + n
Sn 1 n 4 A := A - n
A b A := A + b
AH h A := A + h
AW w A := A + w
S b A := A - b
SH h A := A - h
These instructions implement addit i on and subtraction by constant integer amounts.
There are single byte instructions for incrementing by 1 to 5 and decremented by 1 to
4. For other value s longer instructions are available.
APn 3 n 12 A := A + P!n
AP b A := A + P!b
APH h A := A + P!h
APW w A := A + P!w
AG b A := A + G!b
AG1 b A := A + G!(b+256)
AGH h A := A + G!b
These instructions allow local and global vari abl e s to be added to A. Special instructions
for addition by stati c variables are not provided, and subtraction by a variable is not
common enough to warrant special treatment.
9.2.5 Simple Assignment
SPn 3 n 16 P!n := A
SP b P!b := A
SPH h P!h := A
SPW w P!w := A
SG b G!b := A
SG1 b G!(b+256) := A
SGH h G!h := A
SL Ln variable Ln := A
SL$ Ln variable Ln := A
These instructions are used in the compilation of assignments to named local, global
and static variables. The SP instruc ti on s are also used to save anonymous results and
to layout function arguments.