This post is part of the Stack Based Virtual Machines series. After the introduction in the last part, it’s time to start writing some code and dig into stack based virtual machines. We’re going to write a very simple VM in Java (yes, that’s a stack-based virtual machine - our program - running on a stack-based virtual machine - the JVM - that runs on a register-based hardware machine - your CPU.