# How Does the DSKY Interface Work in the Apollo Guidance Computer: Inside the Pinball Subsystem Explained

> Explore the DSKY interface, also known as Pinball, within the Apollo Guidance Computer. Understand how it decodes commands and drives displays via the DSPTAB buffer and DSPOUT routine.

- Repository: [Chris Garry/Apollo-11](https://github.com/chrislgarry/Apollo-11)
- Tags: deep-dive
- Published: 2026-03-04

---

**TLDR:** The DSKY interface operates through **Pinball**, a software subsystem that captures keyboard interrupts on channel 15, decodes verb/noun command pairs, and drives the display panel via the **DSPTAB** buffer and **DSPOUT** routine.

The Apollo Guidance Computer (AGC) used aboard the Apollo 11 Lunar Module did not rely on dedicated display hardware controllers. Instead, the **DSKY** (Display-Keyboard) interface was managed entirely by **Pinball**, a comprehensive software subsystem found in the `chrislgarry/Apollo-11` repository. Pinball processes astronaut inputs, manages the 11-digit display buffer, and controls status lamps through a series of interrupts and dispatch tables implemented in AGC assembly language.

## Interrupt Handling and Entry Points

Pinball receives input through three distinct entry points that all converge on the **CHARIN** executive routine located in bank 40 of `PINBALL_GAME_BUTTONS_AND_LIGHTS.agc`.

**Keyboard Input** triggers the `KEYRUPT1` interrupt when a key press generates a 5‑bit code on input channel 15. The routine stores the key code in **MPAC** and invokes `VBRELDSP` to process the character.

**Uplink Commands** from mission control follow the identical path through `UPRUPT`, allowing ground operators to inject data using the same verb/noun syntax as the crew.

**Internal Software Requests** bypass the hardware interrupts by calling **`NVSUB`** directly with the verb/noun pair loaded into accumulator **A**. This allows flight programs to update the display programmatically without simulating key presses.

All three paths execute `CHARIN`, which saves the current display lock state (`DSPLOCK`) and turns on the *operator‑error* lamp while any key remains depressed.

## Verb and Noun Decoding Architecture

Pinball implements the DSKY’s iconic **verb/noun** user interface by splitting the 14‑bit command word into two fields:

* **Verb** (bits 0‑6): Specifies the action (display, load, monitor, or extended function).
* **Noun** (bits 7‑13): Specifies the data target (erasable registers, timers, or navigation variables).

The decoder validates the verb against the `LOWVERB` constant and indexes into **`VERBTAB`**, a jump table stored in `PINBALL_GAME_BUTTONS_AND_LIGHTS.agc` (lines 986‑994). Each entry in `VERBTAB` contains the bank address for the corresponding verb handler.

For display verbs (`DSPABC`, `DSPA`, etc.), Pinball consults **`PINBALL_NOUN_TABLES.agc`** to resolve the noun number into an **ECADR** or **IDAD** memory address. Routines like **`LODNNLOC`** and **`GETCOMP`** fetch the actual data values from erasable storage or fixed memory before formatting them for the display buffer.

## Display Buffer and Output Handling

All DSKY characters reside in the **DSPTAB** buffer, an 11‑register array defined in `PINBALL_GAME_BUTTONS_AND_LIGHTS.agc` (lines 14‑31). The buffer layout follows the physical panel organization:

```

MD1 MD2  VD1 VD2  ND1 ND2  R1D1 … R1D5  R2D1 … R2D5  R3D1 … R3D5

```

Pinball never writes directly to the DSKY hardware. Instead, the **`DSPOUT`** routine—triggered by the **T4RUPT** interrupt in `T4RUPT_PROGRAM.agc` (line 129)—copies the contents of **DSPTAB** to **output channel 10**. This buffered approach ensures atomic display updates and prevents flickering during computation.

The display refresh runs independently of command processing, allowing the AGC to update telemetry values in real time while the crew enters new commands.

## The PINBRNCH Re-Entry Mechanism

When an astronaut presses the **KEY RELEASE** button (verb 37), Pinball must restore the previous display state without losing the active request. The **`PINBRNCH`** routine in `DISPLAY_INTERFACE_ROUTINES.agc` (lines 325‑333) serves as the re‑entry point for flashing displays.

`PINBRNCH` re‑establishes the interrupt environment and resumes the flashing pattern for the verb/noun fields, ensuring that temporary interruptions (such as alarm displays or uplink activity) do not corrupt the crew’s current workflow. The routine uses the saved `DSPLOCK` state to determine which display fields require restoration.

## Indicator Lamp Control

Pinball manages the DSKY’s physical status lamps by manipulating specific bits in **channel 11**:

* **Bit 5**: Key Release light
* **Bit 6**: Verb/Noun Flash (alternates to indicate waiting input)
* **Bit 7**: Operator Error light (set by **`ELRCODE1`** when an invalid sequence is detected)
* **Bit 4**: Temp light (maintained by `T4RUPT` for thermal monitoring)

The **`ELRCODE1`** routine in `PINBALL_GAME_BUTTONS_AND_LIGHTS.agc` (lines 66‑68) illuminates the operator‑error lamp immediately when an illegal key combination is detected, providing instant feedback before the command is fully processed.

## Practical Code Examples

### Simulating a Major Mode Change (Verb 37)

Flight programs can invoke Pinball internally to switch major modes without crew intervention:

```assembly
        CAF     37D            # Load verb 37 (CHANGE MAJOR MODE)

        AD      76D            # Load noun 76 (desired program number)

        TS      A              # Place combined verb/noun in accumulator

        TC      NVSUB          # Call Pinball interpreter

        # Pinball updates MD1/MD2 via DSPABC and sets the Major Mode lights

```

*Source:* `NVSUB` entry in `PINBALL_GAME_BUTTONS_AND_LIGHTS.agc` (lines 107‑110) → `DSPABC` (lines 123‑126).

### Handling the Key Release Button

When the crew presses KEY RELEASE to abort a pending operation:

```assembly
        CAF     37D            # Verb 37 = KEY RELEASE

        CAF     0D             # Noun 0 = no data

        TC      NVSUB
        # Pinball sets bit 5 of channel 11 and jumps to PINBRNCH

```

*Source:* `PINBRNCH` logic in `DISPLAY_INTERFACE_ROUTINES.agc` (lines 325‑333).

### Displaying Mission Elapsed Time (Verb 47, Noun 71)

```assembly
        CAF     47D            # Verb 47 = DISPLAY MISSION ELAPSED TIME

        CAF     71D            # Noun 71 = MET register

        TC      NVSUB          # Pinball reads MET registers, formats HH:MM:SS

                               # writes to DSPTAB, and triggers DSPOUT

```

*Source:* Verb 47 entry in `VERBTAB` → `MHSOUT`; noun mapping in `PINBALL_NOUN_TABLES.agc` (lines 71‑73).

## Summary

* The **Pinball** subsystem in the Apollo 11 AGC provides a purely software‑defined interface for the DSKY hardware, residing primarily in `PINBALL_GAME_BUTTONS_AND_LIGHTS.agc`.
* Input arrives via **KEYRUPT1** (keyboard) or **UPRUPT** (uplink), converging on the **CHARIN** routine that stores codes in **MPAC**.
* Commands decode into **verb** (action) and **noun** (target) pairs, validated against `VERBTAB` and noun tables to locate data addresses.
* The **DSPTAB** buffer holds 11 display registers refreshed to channel 10 by the **DSPOUT** routine during **T4RUPT** interrupts.
* **PINBRNCH** restores flashing displays after interruptions, while **channel 11** bits control the Key Release, Operator Error, and Temp lamps.

## Frequently Asked Questions

### What is the difference between DSKY and Pinball in the Apollo Guidance Computer?

**DSKY** refers to the physical Display-Keyboard hardware unit used by astronauts, while **Pinball** is the software subsystem that drives it. Pinball resides in the AGC’s memory and handles all logic for decoding key presses, managing the display buffer (DSPTAB), and controlling indicator lamps through output channels.

### How does the AGC handle invalid key sequences on the DSKY?

When the crew enters an illegal verb/noun combination or presses keys out of sequence, the **`ELRCODE1`** routine immediately sets **bit 7 of channel 11**, illuminating the **Operator Error** lamp. This occurs before command execution, preventing invalid data from reaching flight software. The lamp remains on until the crew presses the **KEY RELEASE** button (verb 37), which triggers `PINBRNCH` to reset the interface state.

### Why does the DSKY use a verb/noun command structure?

The verb/noun architecture separates **what action to perform** (verb) from **what data to act upon** (noun), creating a compact, unambiguous command language that fits within the AGC’s limited keyboard and display constraints. This design allows 99 distinct verbs and 99 nouns using only two 5‑digit display registers (VD1/VD2 and ND1/ND2), maximizing functionality while minimizing hardware complexity and crew training requirements.

### Which source files contain the Pinball subsystem in the Apollo 11 repository?

The core Pinball logic resides in **`Luminary099/PINBALL_GAME_BUTTONS_AND_LIGHTS.agc`**, containing the interrupt handlers and verb dispatcher. Supporting files include **`PINBALL_NOUN_TABLES.agc`** for data address mappings, **`DISPLAY_INTERFACE_ROUTINES.agc`** for buffer management and `PINBRNCH`, and **`T4RUPT_PROGRAM.agc`** for the display output interrupt (`DSPOUT`) that refreshes the physical DSKY panel.