Module 7: Overview of the code

We’re back to the SVM! Adding support for calls will extend VM state and will add support for the three instructions.

New code you will write or edit

vmstack.h

You’ll define the contents of an activation record.

Code you will extend

vmstate.h

You’ll add a call stack to the VM state, and you’ll enlarge the register file.

opcodes.h

You’ll add internal opcodes for call, tail-call, and return instructions.

instructions.c

To make the call, tail-call, and return instructions known to the loader, you’ll add them to the instruction table.

vmrun.c

You’ll add the run-time behavior of the call, tail-call, and return instructions.

Code that has changed

disasm.c

I fixed a bug in lastglobalset

vmerror.c

I made run-time error messages slightly easier to read.