Skip to content

mustooch/vitual-machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Basic Vitual Machine

Made with LUA 5.3

This is a stack based virtual machine

Instructions :
PSH A -> push A to TOS
POP -> pop TOS
ADD -> pop TOS-1 and TOS, add values, store in TOS
SUB -> pop TOS-1 (a) and TOS (b), subsitute (b) to (a), store in TOS
MUL -> pop TOS-1 and TOS, multiply values, store in TOS
DIV -> pop TOS-1 (a) and TOS (b), divide b by a, store in TOS
JNP A -> jump to program[A]
JNZ A -> jump to program[A] if TOS not zero
OUT -S -> prints string S to the console

About

Very basic virtual machine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages