History & Industry
What the "64K limit" in the Z-machine actually limits
The standard sets story files at 128K, 256K or 512K depending on version, yet speaks of a 64K limit. A table separating the two figures, with the arithmetic and what moved authors to Glulx.
Two numbers circulate about the Z-machine, the virtual machine behind Infocom’s text adventures: “64K” and a file size of up to 512K. They are not contradictory, and the difference tells you a lot about how these games were built.
Method
This article reads two primary passages and cross-checks them against two Wikipedia articles. The primary source is section 1 of the Z-Machine Standards Document 1.1, which describes the memory map. No benchmark or measurement was made; the only calculations are conversions and ratios, shown below.
What the standard says
The standard divides memory into three regions: dynamic, static and high. Dynamic memory can be read and written by a game, static memory can be read but not written, and high memory holds routines and strings that cannot be read directly. Dynamic memory must contain at least 64 bytes (the header). Static memory must end by the last byte of the story file or by byte address $0ffff, whichever is lower.
Then two separate limits:
| Limit | Value | Source |
|---|---|---|
| Maximum story file length, versions 1 to 3 | 128K | Standard, section 1.1.4 |
| Maximum story file length, versions 4 and 5 | 256K | Standard, section 1.1.4 |
| Maximum story file length, versions 6 to 8 | 512K | Standard, section 1.1.4 |
| Dynamic plus static memory together | must not exceed 64K (“in fact, 64K minus 2 bytes”) | Standard, note after the memory map |
The standard calls the 64K ceiling on dynamic plus static memory “the most serious limitation on the Z-machine.”
The arithmetic
64K is 64 x 1,024 = 65,536 bytes, so “64K minus 2 bytes” is 65,534 bytes. The three file ceilings compare with the 64K figure as follows (ratios computed here):
| Version group | Story file maximum | Ratio to 64K |
|---|---|---|
| 1 to 3 | 128K | 2 times |
| 4 and 5 | 256K | 4 times |
| 6 to 8 | 512K | 8 times |
So a version 8 story file can be 512K long while the part that the game can write to, plus the static part, still stays within 64K. Most of the story file, in that case, is high memory: text and code that the game reads but never changes. Wikipedia’s article on the Z-machine puts the practical result this way: a version 3 story file can be up to 128K, a version 5 story up to 256K and a version 8 story up to 512K, which it describes as large enough for elaborate text-only adventures.
Why this matters to authors
A story with lots of text and code, and little changing state, can grow to the file limit without touching the 64K ceiling. A story that tracks a lot of changing state, with many objects, flags and tables, reaches the 64K boundary first. That is the practical reason an author might choose a different virtual machine (our inference from the memory map).
Where Glulx fits
Wikipedia describes Glulx as a 32-bit portable virtual machine designed by Andrew Plotkin to relieve some restrictions of the Z-machine format. It says the Z-machine’s 16-bit integers limit RAM to 64KB, while Glulx has a 32-bit address space “allowing gigabytes of memory”. A 32-bit address space is 2^32 = 4,294,967,296 bytes, or 4 GiB; dividing by the 512K version 8 file maximum (524,288 bytes) gives 8,192, so the addressable space is 8,192 times larger than the biggest Z-machine story file. The Glulx infobox lists 1999 as its introduction, and the Z-machine infobox lists 1979. The Glulx article also says that in recent years Glulx has overtaken the Z-machine in the number of published works in each format; that count was not checked here and is Wikipedia’s claim.
What is not known here
The standard’s version table does not give years for each version. Wikipedia says only that the Z-machine was developed in 1979 and that Infocom produced six versions, with Graham Nelson later specifying versions 7 and 8. This article does not date the individual versions.
Sources
- The Z-Machine Standards Document 1.1, section 1 (memory map) — accessed 2026-11-02
- Wikipedia, Z-machine — accessed 2026-11-02
- Wikipedia, Glulx — accessed 2026-11-02
This article is written for: Someone who has read that the Z-machine is limited to 64 kilobytes wonders why story files can be larger, or why modern authors move to Glulx.
AI assistance recorded as: AI draft, not edited. Review status: approved.