Reference Guide
6-24 The Development Library
Syntax Example Notes
Reg=Reg+Cst.f
Reg+Cst.f
Reg=Reg-Cst.f
Reg-Cst.f
A=A+10.A
A+10.A
A=A-10.A
A-FOO.A
Note 1: The Saturn processor is not able to add a constant greater than 16
to a register. 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, large values
should be avoided because this generates a large program. Prefer another
solution like LC(5) Cte A+C.A
Note 3: Adding a constant greater than 1 to a P, WP, XS or S field is a
bugged Saturn instruction (problem with carry propagation). Use these
instructions with care.
Note 4: After adding a constant greater than 16 to a register, the carry
should not be tested (because you do not know if the last generated
instruction generated the carry or not)
Note 5: 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 in a subtraction and vice versa.
Note 6: Be careful when using subtraction; it’s easy to be misled. A-5-6.A is
equivalent to A+1.A, not A-11.A because the instruction is: A-(5-6).A
Note 7: If using Fn fields, be careful if non nibble bounded masks are
used.
RegSR.f
ASR.W
Shift register right by 4 bit on the specified field, set SB if bits are lost.
Note: this instruction is not available on the Fn fields
RegSL.f
ASL.W
Shift register left by 4 bit on the specified field, set carry if bits are lost.
Note: this instruction is not available on the Fn fields
Reg1=Reg1<Reg2.f
Reg1<Reg2.f
A=A<B.W
Shift register left by n bits (as defined by the value of Reg2) on the specified
field
Reg1=Reg1>Reg2.f
Reg1>Reg2.f
A=A>B.W
Shift register right by n bits (as defined by the value of Reg2) on the
specified field
RegSRB.f
BSRB.X
Shift register right by 1 bit on the specified field, set SB if bits are lost.
RegSRC
ASRC
Circular right shift by 1 nibble
RegSLC
BSLC
Circular left shift by 1 nibble
Reg1=Reg1&Reg2.f
Reg1&Reg2.f
A=A&B.X
A&C.B
Logical and on the specified field
Reg1=Reg1!Reg2.f
Reg1!Reg2.f
A=A!B.X
A!C.B
Logical or on the specified field
Reg1=Reg1^Reg2.f
Reg1^Reg2.f
A=A^B.X
A^C.B
Logical xor on the specified field
Reg1=-Reg1.f
C=-C.A
Mathematical not on the specified field
Reg1=-Reg1-1.f
Reg1=~Reg1.f
C=-C-1.A
C=~C.A
Logical not on the specified field
RReg=Reg.f
R0=A.W
Sets the specified field of RReg to the value of the specified field of Reg
Only A and C are valid for Reg.
If f is W, the shorter encoding of the instruction is used
Reg=RReg.f
A=R0.A
Sets the specified field of Reg to the value of the specified field of RReg
Only A and C are valid for Reg.
If f is W, the shorter encoding of the instruction is used
RegRRegEX.f
AR0EX.A
Exchanged the value of the specified field of RReg with the value of the
specified field of Reg Only A and C are valid for Reg.
If f is W, the shorter encoding of the instruction is used
Data=Reg.f
Data=Reg.x
DAT1=C.A
DAT0=A.10
Write the content of the specified field of the specified register in the
memory location pointed by Data register (POKE)
Reg can only be A or C
Reg= Data.f
Reg Data.x
C=DAT1.A
A=DAT0.10
Read the content of the memory location pointed by Data register in the
specified field of the REG register (PEEK)
Reg can only be A or C