Z-machine
The Z-machine is a virtual machine that was developed by Joel Berez and Marc Blank in 1979 and used by Infocom for its text adventure games.[src] Infocom compiled game code to files containing Z-machine instructions (called story files or Z-code files) and could therefore port its text adventures to a new platform simply by writing a Z-machine implementation for that platform.[src] With the large number of incompatible home computer systems in use at the time, this was an important advantage over using native code or developing a compiler for each system.[src]
The Z-machine is a virtual machine that was developed by Joel Berez and Marc Blank in 1979 and used by Infocom for its text adventure games.[src] Infocom compiled game code to files containing Z-machine instructions (called story files or Z-code files) and could therefore port its text adventures to a new platform simply by writing a Z-machine implementation for that platform.[src] With the large number of incompatible home computer systems in use at the time, this was an important advantage over using native code or developing a compiler for each system.[src] ==History and design== ===Nomenclature and conventions=== The "Z" of Z-machine stands for Zork, Infocom's first adventure game.[src] Infocom used file extensions of .dat (Data) and .zip (ZIP = Z-machine Interpreter Program), but the latter clashed with the widespread use of .zip for PKZIP-compatible archive files starting in the 1990s, after Activision had closed Infocom.[src] Infocom produced six versions of the Z-machine.[src] Versions 1 and 2 are extremely rare, with only two Infocom-released files known for each of them.[src] Version 3 covers the majority of Infocom's released games.[src] Later versions had more capabilities, culminating in some graphic support in version 6.[src] The modern convention for Z-code files usually have names ending in .z1, .z2, .z3, .z4, .z5, .z6, .z7, or .z8, where the number is the version number of the Z-machine on which the file is intended to be run, as given by the first byte of the story file.[src] As previously noted, the Infocom games used the equivalent of .z1 through .z6; .z7 and .z8 were proposed and adopted after Infocom had shut down.[src] ===Before Z-machine=== The MDL programming language was derived from Lisp at the Massachusetts Institute of Technology by the Dynamic Modeling group of the Laboratory for Computer Science (LCS) in the 1970s; inspired by Colossal Cave Adventure (1977), members of that group went on to write Zork in MDL, completing the initial version two weeks later.[src] Like Adventure, Zork was programmed for the DEC PDP-10; the finished version occupies 1 MB of MDL code and requires 512 KB of RAM to run.[src] Because contemporary home computers did not have these resources, considerable effort was needed to port the game.[src] Eventually, the developers split Zork into two games for personal computers.[src] The compression required to run Zork from floppy disks with approximately 80 KB of storage seemed like an insurmountable barrier to Blank.[src] Berez realized that UCSD Pascal used a virtual machine (VM) model to generate executable files that could be readily ported across platforms, and together with Blank, they devised requirements for a lightweight VM optimized for text adventure games, which would retrieve data and execute instructions as needed from storage to compensate for the relatively small RAM sizes in typical microcomputers.[src] The resulting Z-machine used an object tree structure for in-game items, locations, characters, and weapons.[src] For comparison, the Z-machine parser occupies 3 kB of storage, while the original PDP-10 parser occupies 44 kB (10,000 36-bit words) .[src] ===ZIL and ZIP, ZILCH and ZAP=== To complement the Z-machine, Infocom developed the high-level computer language Zork Implementation Language (ZIL) by streamlining MDL .[src] Infocom's development tools compiled ZIL into Z-machine instructions in a two-stage process; this made text adventure development platform-independent and enabled porting to different systems simply by writing an appropriate Z-machine interpreter.[src] Those tools consisted of a compiler (ZILCH, short for ZIL Compiler Hack) and an assembler (ZAP, the Z-machine Assembler Program).[src] Although ZILCH has never been released, documentation of ZIL still exists, and an open-source replacement called "ZILF" has been written.[src] After Mediagenic moved Infocom to California in 1989, Computer Gaming World stated that "ZIL ...[src] is functionally dead", and reported rumors of a "completely new parser that may never be used".[src] ===Graham Nelson and Inform=== In May 1993, Graham Nelson released the first version of his Inform compiler, which also generates Z-machine story files as its output, even though the Inform source language is quite different from ZIL.[src] Inform has become popular in the interactive fiction community.[src] A large proportion of interactive fiction is in the form of Z-machine story files.[src] Demand for the ability to create larger game files led Nelson to specify versions 7 and 8 of the Z-machine, though version 7 is rarely used.[src] Because of the way addresses are handled, a version 3 story file can be up to 128K in length, a version 5 story can be up to 256K in length, and a version 8 story can be up to 512k in length.[src] Though these sizes may seem small by today's computing standards, for text-only adventures, these are large enough for elaborate games.[src] During the 1990s, Graham Nelson drew up a Z-Machine Standard based on detailed studies of the existing Infocom files.[src] The standard also includes extensions used by his newer versions, as well as links to the "Blorb" resource format and the "Quetzal" savefile format.[src] In 2006, Nelson expanded Z-machine to the 32-bit Glulx format for Inform 7.[src] The Interactive Fiction Technology Foundation, founded in 2016, manages all these standards.[src] ==ZIL (Zork Implementation Language)== The ZIL is based on MDL from MIT.[src] Here is the definition of Zork I's brass lantern in ZIL, with added comments to illustrate the meaning of each line: ;"Defines weight to limit inventory capacity" The equivalent object in MDL is defined as: LANTERN () (ODESC0 "A battery-powered brass lantern is on the trophy case." ODESC1 "There is a brass lantern (battery-powered) here." OSIZE 15 OLINT [0 >])> A more complex example involving combat, along with its MDL Zork equivalent, is presented in a 2019 blog post by Andrew Plotkin.[src] Notably, the Z-machine has no support for garbage collection and ZIL has no concept of Lisp's list system.[src] ==Interpreters== , playing the MIT version of Zork.[src] Interpreters for Z-code files are available on a wide variety of platforms.[src] Infocom quickly ported games to new computers because it only had to write an interpreter.[src] the company published games for 15 different computers, plus generic CP/M and MS-DOS.[src] The Inform website lists links to freely available interpreters for 15 desktop operating systems (including 8-bit microcomputers from the 1980s such as the Apple II, TRS-80, and , and grouping "Unix" and "Windows" as one each), 10 mobile operating systems (including Palm OS and the Game Boy), and four interpreter platforms (Emacs, Java, JavaScript, and Scratch).[src] According to Nelson, it is "possibly the most portable virtual machine ever created".[src] Popular interpreters include Nitfol and Frotz.[src] Nitfol makes use of the Glk API, and supports versions 1 through 8 of the Z-machine, including the version 6 graphical Z-machine.[src] Save files are stored in the standard Quetzal save format.[src] Binary files are available for several different operating systems, including classic Mac OS, Unix-like systems, Windows.[src] Frotz was written in C by Stefan Jokisch in 1995 for DOS.[src] Over time it was ported to other platforms, such as Unix-like systems, RISC OS, and iOS.[src] Sound effects and graphics were supported to varying degrees.[src] By 2002, development stalled and the program was picked up by David Griffith.[src] The code base was split between virtual machine and user interface portions in such a way that the virtual machine became independent from any user interface.[src] This allowed more variety in porting Frotz.[src] One of the stranger ports is also one of the simplest: an instant messaging bot is wrapped around a version of Frotz with the minimum I/O functionality creating a bot with which one can play most Z-machine games using an instant messaging client.[src] Another popular client for macOS and other Unix-like systems is Zoom.[src] It supports the same Quetzal save-format, but the packaging of the file-structure is different.[src] ==See also== SCUMM – by LucasArts, a graphical system similar to Z-machine TADS – Made to address some of the Z-machine's limitations ==External links== The Z-Machine standards document (PDF) is the Infocom ZIL manual from 1989 (PDF) the Z-Language Interpreter Program (Infocom Internal Document) from 1989 Interpreters How to Fit a Large Program Into a Small Machine describes the creation and design of the Z-machine[src]
61 sentences · 61 cited inline · 1 references stored
References
- Z-machine · retrieved 2026-11-23 · rev 1360829977
Cite this reference
MLA "Z-machine." 2026-11-23. https://en.wikipedia.org/w/index.php?oldid=1360829977. Accessed 25 November 2026.
Chicago "Z-machine." 2026-11-23. https://en.wikipedia.org/w/index.php?oldid=1360829977.
APA encyclopegia.org. (2026). Z-machine. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1360829977
Cite this article
MLA
"Z-machine." encyclopegia.org, 2026, https://encyclopegia.org/wiki/z-machine. Accessed 25 November 2026.
Chicago
"Z-machine." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/z-machine.
APA
encyclopegia.org. (2026). Z-machine. Retrieved November 25, 2026, from https://encyclopegia.org/wiki/z-machine
Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON
Claims
| Predicate | Value | Source |
|---|---|---|
| date of foundation | 2016 | Wikipedia |
| definition | a virtual machine that was developed by Joel Berez and Marc Blank in 1979 and used by Infocom for its text adventure games. | article body |
| year mentioned | 1979 | article body |
| known for | each of them | article body |
| year mentioned | 1977 | article body |
| year mentioned | 1989 | article body |
| release date | 1993 | article body |
| year mentioned | 2006 | article body |
| founded | 2016 | article body |
| year mentioned | 2019 | article body |
| year mentioned | 1995 | article body |
| year mentioned | 2002 | article body |