Syntax | Example | Notes |
|
|
|
DReg=hh | D0=AD | Change the first 2, 4 or all nibbles of the Data register with the given value |
DReg=hhhh | D0=0100 |
|
DReg=hhhhh | D0=80100 |
|
DReg=(2)Exp | D0=(2)label |
|
D0=(4)lab+$10 |
| |
DReg=(4)Exp |
| |
D1=(5)Variable |
| |
DReg=(5)Exp |
| |
|
| |
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 | D0=D0+12 | Note 1: The Saturn processor is not able to add a constant greater than 16 |
DReg+Cst | D1+25 | 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. |
|
| is equivalent to D0+1.A, not |
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 |
?Reg=0.f | ?A=0.B |
?Reg#0.f | ?A#0.A |
?Reg1<Reg2.f | ?A<B.X |
?Reg1>Reg2.f | ?C>D.W |
?Reg1<=Reg2.f | ?A<=B.X |
?Reg1>=Reg2.f | ?C>=D.W |
?RegBIT=0.a | ?ABIT=0.5 |
?RegBIT=1.a | ?ABIT=1.number |
| A=PC |
| C=PC |
| PC=A |
| PC=C |
| APCEX |
| CPCEX |
| PC=(A) |
| PC=(C) |
| SB=0 |
| XM=0 |
| SR=0 |
| MP=0 |
| HST=0.a |
| ?SB=0 |
| ?XM=0 |
| ?SR=0 |
| ?MP=0 |
| ?HST=0.a |
The HP ≠ character can also be used
The HP ≠ character can also be used
The HP ≤ character can be used
The HP ≥ character can be used
Test if a specific bit of A or C register is 0 or 1
Reg must be A or 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, 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
The Development Library