Simple Virtual Machine in C
I recently did a similar project but I tried something different in an attempt to avoid large switch statements. I created a collection of functions which could mutate my version of the "Frame" object, created an array of pointers to these functions, and called them as their opcodes were encountered. [0] It's a little over complicated for a simple example but adding a new opcode will never be more work then this [1].I hope one day my VM/Assembler will become as fully featured as this.My last major achievement was implementing multiplication in my assembly language [2] so I've got a lot of catching up to do with this author![0] - https://github.com/gravypod/computer/blob/master/isa/main.c#...[1] - https://github.com/gravypod/computer/blob/master/isa/instruc...[2] - https://github.com/gravypod/computer/blob/master/examples/mu...