This post is part of the Stack Based Virtual Machines series. In the previous part we have implemented quite a few instructions for our virtual machine. In this part, we’ll further extend its capabilities by adding some comparison instructions, the ability to do jumps and local variables. The relevant code for this part can be seen on github. Comparison instructions Let’s add a few simple instructions to our repertoire: we’re going to add some instructions to compare two numbers.