I am working on implementing the Jack Compiler. For the first script, Main.jack (which outputs 7), the VME is saying that Output.printInt is causing a null pointer exception.
Here are photos taken before and after the function is run.
By specification the VMEmulator stats Sys.init, which initializes the system and calls the Main.main(), which is the entry point of the user program. I don't remember if there was some .tst file, which could skip the Sys.init() and directy run your program as it is now. If so, that should be described in the task in the book.
In any case, I was able to run your program by adding one line at the start:
The VM program specification (Section 7.2.1 of 1st Ed) is pretty explicit:
A VM program is a collection of on or more files with a .vm extension, each consisting of one or more functions.
Since your program had bare code in it, it violated the spec, which invoked undefined behavior. In this case, that manifested itself by the VM emulator through a Null-pointer exception.
A subtle telltale that something along this lines is afoot is that your code has a bare return statement in it. So what is supposed to happen when that return statement is executed? Return from what? Return to where?