wlvm
Virtual machine with associated language written in Rust
Installation
cargo install wlvm
Virtual Machine datasheet
Registers
There are 6 multi purposes registers, marked from a to f.
There are 3 special registers :
- sp : The stack pointer
- ip : The instruction pointer
- st : The stack top value
Instruction Set
- psh \ : Pushes an integer onto the stack
- 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
- pop : Pops the stack
- set \ \ : Sets register's value to the specified integer
- mov \ \ : Copies content of registerb in registera
- dst : Prints the stack
- drg \ : Prints the content of the specified register
- peek : Prints the value of the st register
- hlt : Stops the program
- 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
- jmp \ : Jump to \ if Eq register is true