Reference Guide

The Development Library 6-25
Syntax Example Notes
DReg=hh
DReg=hhhh
DReg=hhhhh
DReg=(2)Exp
DReg=(4)Exp
DReg=(5)Exp
D0=AD
D0=0100
D0=80100
D0=(2)label
D0=(4)lab+$10
D1=(5)Variable
Change the first 2, 4 or all nibbles of the Data register with the given value
Dreg=Reg
D0=A
Reg can only be A or C
Dreg=RegS
D0=CS
Sets the first 4 nibbles of Dreg with the 4 first nibbles of Reg
Reg can only be A or C
RegDRegEX
AD0EX
Reg can only be A or C
RegDRexXS
AD1XS
Exchange the first 4 nibbles of Dreg with the 4 first nibbles of Reg
Reg can only be A or C
DReg=DReg+Cst
DReg+Cst
DReg=DReg-Cst
DReg-Cst
D0=D0+12
D1+25
D1=D1-12
D1-5
Note 1: The Saturn processor is not able to add a constant greater than 16
to a register, but if cst is greater than 16, MASD will generate as many
instructions as needed.
Note 2: Even if adding constants to a register is very useful, big constants
should be avoided because they will slow down execution, and generate a
big program.
Note 3: After adding a constant greater than 16, the carry should not be
tested.
Note 4: You can put an expression instead of the constant (MASD must be
able to evaluate the expression right away). If the expression is negative,
MASD will invert the addition to a subtraction and vice versa.
Note 5: Be careful when using subtraction; it’s easy to be misled. D0-5-6.A
is equivalent to D0+1.A, not D0-11.A
Please read the section on test above for information on what MUST follow a test instruction.
f can NOT be a Fn field.
?Reg1=Reg2.f
?A=C.B
?Reg1#Reg2.f
?A#C.A
The HP ≠ character can also be used
?Reg=0.f
?A=0.B
?Reg#0.f
?A#0.A
The HP ≠ character can also be used
?Reg1<Reg2.f
?A<B.X
?Reg1>Reg2.f
?C>D.W
?Reg1<=Reg2.f
?A<=B.X
The HP ≤ character can be used
?Reg1>=Reg2.f
?C>=D.W
The HP ≥ character can be used
?RegBIT=0.a
?RegBIT=1.a
?ABIT=0.5
?ABIT=1.number
Test if a specific bit of A or C register is 0 or 1
Reg must be A or C
A=PC
C=PC
PC=A
PC=C
APCEX
CPCEX
PC=(A)
PC=(C)
Sets Aa or Ca to the address of the next instruction
Set PC to the value contained in Aa or Ca
Exchange the value of PC with register Aa or Ca
Sets PC to the value read at the address contained in Aa or Ca
SB=0
XM=0
SR=0
MP=0
HST=0.a
?SB=0
?XM=0
?SR=0
?MP=0
?HST=0.a
SB, XM, SR and MP are 4 bits in the HST register. They can be set to 0 by
the specific instruction and tested.
SB is set to 1 by RegSR and RegSRB instruction, XM by RTNSXM
instruction and SR and MP should always be 0 (hardware related stuff).
HST=a sets all bits set to 1 in a to 0 in the HST register.
?HST=a test that all bits set to 1 in a are 0 in the HST register