Skip to main content

The game executable

Home · Memory map · Overlays · Routines · Data · Display drivers · File inventory

Most of the game's rules live in its DOS executable, START.EXE. The mechanics pages explain what that code does; this reference is where they point to show where it does it. Each entry names a location in the executable, says what it does and links back to the pages that rely on it. An entry has a Status line only when part of it is inferred, unknown or not examined.

The executable studied here is the DOS START.EXE identified by its SHA-256 hash in the file inventory. Every address in this reference applies to that file only.

How addresses are written​

The same byte can be described in several ways. This reference uses the following conventions, and every entry states which one it uses.

Address spaceWhat it meansHow to convert
Analysis addressLinear address of the resident program as loaded in a disassembler at load segment 0x1000.analysis = file offset − 0x3200 + 0x10000 (resident part only).
Physical file offsetByte position in START.EXE. Used for overlay code and file data.—
Data-segment offsetOffset within the program's data segment, written DS:0x….analysis = 0x3b160 + offset; file offset = 0x2e360 + offset.
Runtime addressAddress in memory while the game runs.Not used here: the placement of overlays at run time is not established.
Driver image offsetOffset in a display driver (MGA.OVL, XGA.OVL), also its code offset once loaded.image offset = driver file offset − 0x200.

The 0x3200 bytes subtracted in the first conversion are the executable's MZ header. Unless an entry says otherwise, an address is an analysis address.

Anchors follow the address space: r- for resident code (analysis address), o- for overlay code (file offset), d- for the data segment (data-segment offset), p- for data outside the data segment (file offset), and the driver's name, such as mga-, for display-driver code (image offset). Hexadecimal digits are written in lower case, without 0x or leading zeros, for example r-19c1a or d-2268.

Other notations​

Some sources and tools write locations differently. These conversions hold for this file:

NotationExampleConversion
Disassembler labelFUN_24ec_0a81analysis = 24ec × 16 + 0a81 = 0x25941.
Far pointer stored in the program0x14ec:0x0789analysis = 0x10000 + segment × 16 + offset; file offset = 0x3200 + segment × 16 + offset.
Far segment in overlay code0x50:0x148The segment indexes the segment table at file offset 0x2d520 (8-byte entries); the entry's first word is the paragraph, then as for a stored far pointer. See overlays.

Resident code and overlays​

The executable has a resident part, always in memory, and a set of overlays: blocks of code stored after it in the file and loaded on demand. Resident code is identified by analysis addresses. Overlay code has no fixed analysis address and is identified by physical file offsets.

Contents​

  • Memory map: how the file is laid out, from the MZ header to the overlay images.
  • Overlays: how overlay code is reached, and the resolved overlay routines by file offset.
  • Routines: resolved resident code, one page per subject, including the script interpreter and its opcode handlers.
  • Data: resolved tables and variables, one page per subject, mostly in the data segment.
  • Display drivers: how the game loads its display driver and what each slot of the driver table is for. Every routine of each driver is on its own page: MGA.OVL, the VGA driver, and XGA.OVL, the EGA driver.
  • Address index: every entry of these pages in address order, one page per address space, for a reader who starts from an address.

This reference lists what is resolved well enough to support the public pages. It is not a complete map of the executable, and a location missing from it is not necessarily unexamined.