Tabulka 11.1. Tabulka instrukcí
kód | instr. | slovo | PSP efekt | RSP efekt | popis |
---|---|---|---|---|---|
0 | add | + | ( n1 n2 → n3 ) | ( → ) | addition |
1 | nand | NAND | ( n1 n2 → n3 ) | ( → ) | negative and |
2 | xor | XOR | ( n1 n2 → n3 ) | ( → ) | exclusive-or |
3 | ashr | 2/ | ( n1 → n2 ) | ( → ) | arithmetic shift right, sign retained |
4 | fetch | @ | ( addr → n ) | ( → ) | fetch cell at addr |
5 | store | ! | ( n addr → ) | ( → ) | store n to cell at addr |
6 | lit | LIT | ( → n ) "value" | ( → ) | push inline cell, PSP++ |
7 | dup | DUP | ( n → n n ) | ( → ) | duplicate |
8 | swap | SWAP | ( n1 n2 → n2 n1 ) | ( → ) | exchange |
9 | drop | DROP | ( n → ) | ( → ) | discard |
A | tor | >R | ( n → ) | ( → n ) | pop parameter stack to return stack |
B | rfrom | R> | ( → n ) | ( n → ) | pop return stack to parameter stack |
C | enter | CALL | ( → ) | ( → PC) | DOCOL, NEST - call subroutine |
D | exit | SEMIS | ( → ) | ( addr → ) | RETURN - return from subroutine |
E | zjmp | JZ | ( n → ) | ( → ) | jump if false |
F | iptor | BEGIN | ( → ) | ( → ip ) | push IP (next instruction fetch addr) to R |
NOP | ( → ) | ( → ) | no operation |