A minimal stack-based process virtual machine written in Python.
- Arithmetic Operations:
ADD,SUB,MUL,DIV,MOD,NEG - Stack Operations:
PUSH,POP,DUP,SWAP - Comparisons:
EQ,ST,GT - Control Flow:
JMP,JZ,JNZ PRINT,HALT
chmod +x ./vm.py
./vm.py <program>I implemented a simple parser to be able to write code in files and execute them inside the VM.
Lines starting with a semicolon (;) will be treated as comments.
Programs must end with a HALT instruction.
- Finish replacing OPCODES with real bytecode
- Add memory
- Implement
CALLandREToperations - Add a call stack