Home

Awesome

An extension of the (split-stack branch) simple VM I did that codyebberson converted to C. I added CALL/RET and make VM a struct. Added more tests.

Branches:

while ( more opcodes ) {
  switch ( code[ip] ) {
  ...

we use goto *dispatch[code[ip]] to instantly jump to the code that interprets the next opcode via an appropriate label within the exec method.

Build and run:

$ cc -o vm src/*.c
$ vm