[z-machine] Multiple stacks?

Mose Wingert beska_miltar@hotmail.com
Sun, 12 Sep 2004 21:06:08 -0400


Everyone: Thanks for all the help!  It is making a lot more sense now.
Also, thanks to Katre for the extra info about why the game stack should be
contained within the call stack.  I had no idea before, though it seems
obvious now.

Now, my new question is somewhat related in that I'm at the stage where I
want to start adding some CALL opcodes to test out my stack
functionality...when I realized I have no idea how to tell the opcode where
the routine to be called is!

The spec says that all instructions consist of the following:

Opcode
(Type of Operands)
Operands
(Store variable)
(Branch offset)
(Text to print)

And there doesn't seem to be a routine address in there anywhere.  At first
I figured it must be the branch offset, but the spec says that branch offset
is only used for instructions that test a condition...and it seems to
support this by indicating in the chapter 14 opcode table by indicating that
no CALL instructions take a branch offset.  But then how does the
instruction know where the routine to call is?

Many thanks for your help...hopefully my questions will get less frequent,
and more intellegent as time goes on.