[z-machine] So-called bad practice in the Z-machine
Thomas Thurman
marnanel@marnanel.org
Thu, 18 Sep 2003 22:32:27 +0100 (BST)
On Thu, 18 Sep 2003, Amir Karger wrote:
> So my question is (finally!), if we grant that the programs I output
> won't follow the 1.0 spec, how bad is that? How many games abuse the
> Z-machine this way? If the answer is "all the Infocom games" I guess
> I'll have to bite the bullet and be exacting (or write two different
> translators :) But if the answer is "only the Z-machine Befunge
> interpreter" then, even if I'm disappointed, I may go ahead and use
> actual subroutines.
Gnusto is in fact a compiler under the hood, although to the user it
appears to be an interpreter. So I'm quite interested to know the answer
too-- I strongly suspect that there are no games other than abuses that
break such rules, since almost all games, Infocom and post-Infocom, are
generated with compilers, and no sane compiler would generate such code.
Since your program has the special benefit of being able to review the
entire story before translation, though, you could implement the
subroutine calls as function calls in the general case, and either have a
special case for subroutines which branch to other subroutines, or just
make the translation fail in those cases.
T