[z-machine] So-called bad practice in the Z-machine

Matthew T. Russotto mrussotto@speakeasy.net
Thu, 18 Sep 2003 20:01:59 -0400


On Thursday, September 18, 2003, at 05:32 PM, Thomas Thurman wrote:

> 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.

There are, as far as I know, no Infocom or Inform games which jump 
across subroutine boundaries.  Nor any which access the attributes 
directly.

> 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.
>

TXD, and presumably anything using a similar algorithm to determine 
routine bounds, will become confused if there's a jump across 
subroutine boundaries.