[z-machine] Multiple stacks?
Mose Wingert
beska_miltar@hotmail.com
Fri, 10 Sep 2004 11:09:26 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_0009_01C49726.A2A8A810
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello all...
Though I'm a long time IF-er, I'm very new to the Z-Machine world. For =
a learning project, I'm trying to implement a Z-Machine...but I'm =
running into some troubles. The Z-Machine spec seems a bit unclear in a =
couple of places, and I'm not sure how to try to figure out what is =
correct. (Of course, I could just copy someone else's source, but that =
kind of defeats the purpose).
The big trouble I'm running into right now is "the stack". The Overview =
implies that it is a singular object, but I've discovered that that =
doesn't seem right. (Of course V6 has "user stacks", but I'm not even =
really there yet). =20
In some places, such as the overview, it's mentioned that "the stack" is =
used to keep track of the routines called, and their local variables. =
But then in section 6.1 it mentions both the "stack" and the "routine =
call state" as separate items. =20
My current conception of things is that there are two "stacks"...one =
that is just a stack of two byte words, that is accessed via pop and =
push... And the other is the routine call state, a stack that keeps all =
of its addresses and variable values in a single item on the stack.
This seems like the most likely scenario that I can come up with, but I =
can't find much evidence for (or against) it in the Z-Machine =
spec...much of the spec just refers to "the stack". Am I missing =
something somewhere? I feel l must be...
Thank you for any help you can offer...I did check the archives for =
something on this, but it seemed as if most of the developers were well =
beyond any difficulties like this.
-beska
------=_NextPart_000_0009_01C49726.A2A8A810
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1458" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello all...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Though I'm a long time IF-er, I'm very =
new to the=20
Z-Machine world. For a learning project, I'm trying to implement a =
Z-Machine...but I'm running into some troubles. The Z-Machine spec =
seems a=20
bit unclear in a couple of places, and I'm not sure how to try to figure =
out=20
what is correct. (Of course, I could just copy someone else's =
source, but=20
that kind of defeats the purpose).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The big trouble I'm running into right =
now is "the=20
stack". The Overview implies that it is a singular object, but =
I've=20
discovered that that doesn't seem right. (Of course V6 has "user =
stacks",=20
but I'm not even really there yet). </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>In some places, such as the overview, =
it's=20
mentioned that "the stack" is used to keep track of =
the routines=20
called, and their local variables. But then in section 6.1=20
it mentions both the "stack" and the "routine call state" =
as=20
separate items. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>My current conception of things is that =
there are=20
two "stacks"...one that is just a stack of two byte words, that is =
accessed=20
via pop and push... And the other is the routine call state, a =
stack that=20
keeps all of its addresses and variable values in a single item on the=20
stack.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>This seems like the most likely =
scenario that I can=20
come up with, but I can't find much evidence for (or against) it in the=20
Z-Machine spec...much of the spec just refers to "the stack". Am I =
missing=20
something somewhere? I feel l must be...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thank you for any help you can =
offer...I did check=20
the archives for something on this, but it seemed as if most of the =
developers=20
were well beyond any difficulties like this.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>-beska</FONT></DIV></BODY></HTML>
------=_NextPart_000_0009_01C49726.A2A8A810--