
Z3 – The Zork CPU - mnem
http://opencores.org/project,z3
======
captncraig
This is awesome to see. There's been a lot of articles about zork lately, so I
started writing my own interpreter, just to see what all the fuss is about.
It's a pretty interesting system. I'm currently trying to step/debug through
zork too see how they implemented the parsing, game state, and other such
things, and it is really quite interesting.

I've considered trying to do a hardware implementation, but concluded it is
beyond my skill. Some things like user input can be complicated. It is the
interpreter's job to split the input on a program-defined set of delimiters,
look up each token in a dictionary provided by the program, and copy a
variable number of specified values it finds base on that info into other
locations. That's really complicated for a single instruction, and makes it
pretty apparent to me that their target from the beginning was interpreters,
not any kind of special hardware.

Nevertheless, its an awesome project, and a really fun thought experiment. I'd
love to see a physical version of something like this from 74xx chips.

~~~
duskwuff
> I'm currently trying to step/debug through zork too see how they implemented
> the parsing, game state, and other such things, and it is really quite
> interesting.

FYI: Allen Garvin has a set of tools to generate annotated disassemblies of
many of Infocom's games -- not just Zork I:

[https://github.com/allengarvin/reform-
conf](https://github.com/allengarvin/reform-conf)

------
Klasiaster
In university we wrote a compiler¹ for the Z-machine, source input was in
Twee², a language for web-based interactive fiction. Finding enough
information about the opcodes was sometimes not easy.

¹ [https://github.com/Drakulix/zwreec](https://github.com/Drakulix/zwreec) ²
[http://en.wikipedia.org/wiki/Twine_(software)](http://en.wikipedia.org/wiki/Twine_\(software\))

------
derefr
Is there an overview of the _evolution_ of the Z-Machine through the
years—what features were added and how the architecture changed in each
version, and what these changes allowed that was previously difficult?

It'd also be interesting to see similar "release notes" for proprietary game
VMs, like the runtimes of Game Maker Studio or RPG Maker—though these would
probably have to be the result of reverse-engineering + wild-ass guessing.

~~~
edmccard
The "Z-Machine Standards Document"[1] has an appendix[2] with a very brief
summary of the history of the Z-Machine; several of the other sections have
tables (for the opcodes, and header formats, etc) with "V" or "Version" column
showing when features were introduced.

[1] [http://inform-
fiction.org/zmachine/standards/z1point1/index....](http://inform-
fiction.org/zmachine/standards/z1point1/index.html)

[2] [http://inform-
fiction.org/zmachine/standards/z1point1/appd.h...](http://inform-
fiction.org/zmachine/standards/z1point1/appd.html)

------
mardiros
Sadly, spec link is broken.

~~~
kmill
[http://inform-
fiction.org/zmachine/standards/z1point1/index....](http://inform-
fiction.org/zmachine/standards/z1point1/index.html)

------
PhasmaFelis
> _Save /Restore isn't currently supported (as my hardware hasn't any storage)
> and is the only notable omission._

That's an awfully notable omission.

Really cool project, still.

