Instruction | Code | Registre1 | Registre2 | Commentaires |
---|---|---|---|---|
NOP | 0000 ***0 | / | / | Ne fait rien. |
FREEZE | 0000 ***1 | / | / | Endort la machine jusqu'au top suivant. |
LOAD | 0001 **** | destination | adresse | Lit en RAM. |
STO | 0010 **** | source | adresse | Écrit en RAM. |
MOV | 0011 **** | destination | source | Copie un registre. |
CST | 0100 **** | destination | / | La constante occupe le mot suivant qui n'est pas considéré comme une instruction. |
GOTC | 0110 XY** | RI | adresse | Goto conditionnel testant au choix : X: eg; Y: ovf; les deux: eg et ovf; aucun: eg ou ovf. |
ADD | 1000 ***X | R1 | R2 | R1<-R1+R2+X*ovf |
SUB | 1001 ***X | R1 | R2 | R1<-R1-R2-X*ovf |
SHIFT | 1010 ***X | registre | / | X=1 : vers les poids forts. X=0 : vers les poids faibles. |
NUL | 1011 **** | registre | / | Teste la nullité du registre. |
NOT | 1100 **00 | registre | / | NON bit à bit. |
OR | 1100 **01 | R1 | R2 | OU bit à bit. |
AND | 1100 **10 | R1 | R2 | ET bit à bit. |
XOR | 1100 **11 | R1 | R2 | OU exclusif bit à bit. |
IN | 1101 ***0 | registre | provenance | Entrée. |
OUT | 1101 ***1 | registre | destination | Sortie. |
Instruction | Traduction | Commentaires |
---|---|---|
LOAD Rk Adr | CST RG Adr LOAD Rk RG | / |
STO Rk Adr | CST RG Adr STO Rk RG | / |
GOTO Rk | MOV RI Rk | / |
GOTO Adr | CST RI Adr | / |
GOTC Adr | CST RG Adr GOTC RG |
/ |
GOSUB Rk |
MOV RG RI CST R+ 9 ADD RG R+ CST R+ 1 STO RG RP SUB RP R+ MOV RI Rk |
Appel d'un sous-programme. |
GOSUB Adr |
MOV RG RI CST R+ 10 ADD RG R+ CST R+ 1 STO RG RP SUB RP R+ CST RI Adr |
Appel d'un sous-programme. |
RETURN |
ADD RP R+ LOAD RI RP |
Retour d'un sous-programme. |
CST est ainsi la seule instruction sur plusieurs mots.
Adr désigne ici soit une adresse mémoire en décimal, binaire (précédée d'un b) ou hexadécimal (précédée d'un h), soit une étiquette (chaîne de caractères alphanumériques commençant par une lettre distincte de R, b et h et de longueur au plus 100).
L'assembleur a été réalisé en C ANSI.