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 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
- 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
- mov \ \ : Copies content of registerb in registera
- dst : Prints the stack
- drg \ : Prints the content of the specified 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
- prt \ : Prints the character corresponding to register value
- dmp : Dumps the stack and the registers