Syntax | Example | Notes |
|
|
|
Reg=Reg+Cst.f | A=A+10.A | Note 1: The Saturn processor is not able to add a constant greater than 16 |
Reg+Cst.f | A+10.A | 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. |
|
| equivalent to A+1.A, not |
|
| 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 | A=A<B.W | Shift register left by n bits (as defined by the value of Reg2) on the specified |
Reg1<Reg2.f |
| field |
Reg1=Reg1>Reg2.f | A=A>B.W | Shift register right by n bits (as defined by the value of Reg2) on the |
Reg1>Reg2.f |
| 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 | A=A&B.X | Logical and on the specified field |
Reg1&Reg2.f | A&C.B |
|
Reg1=Reg1!Reg2.f | A=A!B.X | Logical or on the specified field |
Reg1!Reg2.f | A!C.B |
|
Reg1=Reg1^Reg2.f | A=A^B.X | Logical xor on the specified field |
Reg1^Reg2.f | A^C.B |
|
Mathematical not on the specified field | ||
Logical not on the specified field | ||
Reg1=~Reg1.f | C=~C.A |
|
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 | DAT1=C.A | Write the content of the specified field of the specified register in the |
Data=Reg.x | DAT0=A.10 | memory location pointed by Data register (POKE) |
|
| Reg can only be A or C |
Reg= Data.f | C=DAT1.A | Read the content of the memory location pointed by Data register in the |
Reg Data.x | A=DAT0.10 | specified field of the REG register (PEEK) |
|
| Reg can only be A or C |