wlvm
Virtual machine with associated language written in Rust

Installation
cargo install wlvm
(https://crates.io/crates/wlvm)
Build
git clone https://github.com/wafelack/wlvm
cd wlvm/
cargo build
cargo test
Usage
Run repl
wlvm
Run program
wlvm run $program
Dump program's memory and registers
wlvm dump $program
Details
Virtual Machine datasheet
Registers
There are 6 multi purposes registers, marked from a to f.
There are 4 special registers :
- sp : The stack pointer
- ip : The instruction pointer
- st : The stack top value
- eq : The result of the last test performed
Instruction Set
Stack instructions
- psh \ : Pushes an integer onto the stack
- pop : Pops the stack
Arithmetic operations
- add \ \ : Adds the content of registerb to registera
- sub \ \ : Substracts the content of registerb to registera
- mul \ \ : Multiplies the content of registerb to registera
- div \ \ : Divides the content of registera by registerb
Memory operations
- mov \ \ : Copies content of registerb in registera
- jmp \ : Jump to \ if Eq register is true
Boole algebra operations
- tee \ \ : Test if registera == registerb
- tne \ \ : Test if registera != registerb
- tll \ \ : Test if registera < registerb
- tmm \ \ : Test if registera > registerb
- tel \ \ : Test if registera <= registerb
- tem \ \ : Test if registera >= registerb
Other