I’m working with a class where we’re implementing a Z-Machine from scratch.
The project is now here: https://github.com/jeffnyman/quendor
As we go through this, we’re trying to document the code via what we read in the specification. One thing that was interesting was a remark in the specification that says:
“Inform’s “main” routine is required not to have local variables and has to be the first defined routine.”
One of our sample files, however, is this:
[ Main result value; value = 2; result = 3 + value -1; ]
Unless I’m very much mistaken, that’s a Main routine with two local variables.
So it’s not clear what the spec is referring to. But it is interesting because if you look at txd output for that simple example (), you see:
Main routine 496, 0 locals () 497: call 49e -> gef 49c: quit Routine 49e, 2 locals (0000, 0000)
Clearly the 49e (with two locals) is the Main from the Inform source text. So the “Main routine 496” is some other main routine.
I’m just curious if I’m reading this correctly.