JavaJack wrote
My guess is the latter, since Sys.vm calls a non-existing Main.main.
I stubbed this in by creating a fake Main.vm:
function Main.main 0
push constant 65
call Output.printChar 1
return
Which doesn't bomb out with the A=-1 error.
This is correct. The vm files in the tools\os directory are, in effect, the system library that need to be linked to all programs.
What's happening when you translate the os directory is that the call to Main.main results in
@Main.main
0;JMP
but since there is no corresponding code label (Main.main) the assembler assigns the next unused RAM address to Main.main and uses that as the ROM address and the generated code jumps to some random place in ROM and blows up.
--Mark