Saturn instructions syntax

In this section:

x is a decimal number between 1 and 16. An expression can be used if its value can be determined at the first encounter.

h is a hexadecimal digit.

a is a decimal number ranging from 1 to 16 or a 0 to 15 number depending of the current mode (0-15 or 1-16). An expression can be used, if its value can be determined at the first encounter.

f is a field A, B, X, XS, P, WP, M, S, F1, F2, F3, F4, F5, F6 or F7. Reg is a working register A, B, C or D.

RReg is a scratch register R0, R1, R2, R3 or R4. Exp is an expression.

Cst is a decimal constant. An expression can be used if its value can be determined at the first encounter. DReg is a pointer register D0 or D1.

Data is memory data pointed by D0 or D1. It means DAT0 or DAT1.

Note: For instructions that use two working registers, instruction using the pairs A-B, B-C, C-D and A-C are smaller and faster (if the Fn fields are not used).

For instructions like Reg1=Reg1… you can write only Reg1… Example: A=A+C.A is the same as A+C.A.

Syntax

Example

Notes

 

 

 

 

Reg=0.f

A=0.M

Sets the specific field of the register to 0

Reg=1.f

A=1.M

Sets the specific field of the register to 1

LC hhh..hhh

LC 80100

The number of nibbles loaded in the register is the number of characters

LA hhh..hhh

LA #1024

necessary to write the value. So LC #12 will be equivalent to LC 00C.

 

 

Note: the less significant nibble is loaded in the nibble P (as in the value of

 

 

the register P) of the register, the next one into nibble p+1 mod 16, and

 

 

etcetera.

 

LCASC(x) chrs

LCASC(4) MASD

Loads the hexadecimal value of x characters into C.

LAASC(x) chrs

LAASC(5) ROCKS

x must be between 1 and 8. See note on LC instruction

LC(x) Exp

LC(5)@Buf+Off

Loads the result of an expression into C or A, using x nibbles.

LA(x) Exp

 

See note on LC instruction

Reg1=Reg2.f

A=B.X

Copies the value of a specific field of a register into the same field of

 

 

another register

 

Reg1Reg2EX.f

ABEX.W

Exchanges the value of 2 registers on the given field. Note: this is not valid

 

 

for the Fn fields

 

Reg1=Reg1+Reg2.f

A=A+B.A

Adds the value of the specific field of one register to the other register.

Reg1+Reg2.f

C+D.A

Note: If Reg1 and Reg2 are the same, this is a multiply by 2 instruction

 

 

Note: This instruction is affected by the DEC/HEX mode only if the field

 

 

is not a F field and the registers are AB, BC, CD or AC.

Reg1=Reg1-Reg2.f

A=A-B.A

The following instructions are also available (but not on the Fn fields):

Reg1-Reg2.f

C-D.A

A=B-A.f

B=C-B.f

 

 

C=A-C.f

D=C-D.f

 

 

see note on Reg1=Reg1+Reg2.f

The Development Library 6-23