This post is part of the Stack Based Virtual Machines series. In the previous part we have started writing some code for our stack based virtual machine. In this part, we’re going to extend the catalog of instructions that our CPU can support. The code for this article can be found on github. Arithmetics Our VM can already handle additions, so teaching it to add subtractions, multiplications and (integer) division won’t be very hard.| andreabergia.com
This post is part of the Stack Based Virtual Machines series. In this series we’re going to delve a bit into stack based virtual machines. First we’re going to see an overview, then we’ll build our own toy VM. Next, we’re going to see how what we’ll build maps to a real CPU. Finally, we’ll discuss the most famous of all: the JVM. Introduction What’s a stack based virtual machine then?| andreabergia.com