RAM[cell] |
Available memory (256 cells, each with 2 bytes) for variables, commands and contents of stack. |
Akku |
Akku (Akkumulator) is a buffer to temporarily store results or to read parameters for binary operations. Many commands take use of Akku . |
Result |
Saves the result of a comparison. |
CP |
CP (command pointer) points to the actual command line in RAM. |
SP |
SP (stack pointer) points to the next empty cell of the stack (bottom of RAM). |
BP |
BP (base pointer) points to a cell within the stack for relative accesses. |
LDAU n |
Akku := n |
LDAD var |
Akku := RAM[var] |
STAD var |
RAM[var] := Akku |
LEA var |
Akku := var (store address) |
IN |
Akku := User input |
OUT |
Display value of Akku |
ADDU n |
Akku := Akku + n |
ADDD var |
Akku := Akku + RAM[var] |
SUBU n |
Akku := Akku - n |
SUBD var |
Akku := Akku - RAM[var] |
CMPU n |
Result := Akku - n |
CMPD var |
Result := Akku - RAM[var] |
JUM lable |
CP := lable |
JP lable |
if Result > 0 then CP := lable |
JNP lable |
if Result ≤ 0 then CP := lable |
JN lable |
if Result < 0 then CP := lable |
JNN lable |
if Result ≥ 0 then CP := lable |
JZ lable |
if Result = 0 then CP := lable |
JNZ lable |
if Result ≠ 0 then CP := lable |
STOP |
Stops execution |
CAL lable |
RAM[SP] := CP (memorise old CP)CP := lable SP := SP - 1 |
RET |
SP := SP + 1 CP := RAM[SP] |
NEWB |
RAM[SP] := BP BP := SP SP := SP - 1 |
OLDB |
SP := SP + 1 BP := RAM[SP] |
RES n |
SP := SP - n |
RED n |
SP := SP + n |
PUSH |
RAM[SP] := Akku SP := SP - 1 |
POP |
SP := SP - 1 Akku := RAM[SP] |
STL n |
RAM[BP + n] := Akku |
LDL n |
Akku := RAM[BP + n] |
ADL n |
Akku := Akku + RAM[BP + n] |
SBL n |
Akku := Akku - RAM[BP + n] |
CPL n |
Result := Akku - RAM[BP + n] |
STLI n |
RAM[RAM[BP + n]] := Akku |
LDLI n |
Akku := RAM[RAM[BP + n]] |
ADLI n |
Akku := Akku + RAM[RAM[BP + n]] |
SBLI n |
Akku := Akku - RAM[RAM[BP + n]] |
CPLI n |
Result := Akku - RAM[RAM[BP + n]] |