# What Programming Language Was Used for the Apollo 11 Guidance Computer?

> Discover the programming language behind the Apollo 11 Guidance Computer. Learn about the AGC assembly language used for this historic mission. Get the details here.

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

---

**The Apollo 11 Guidance Computer (AGC) source code is written in AGC assembly language and assembled using the modern yaYUL assembler, a reimplementation of the original MIT YUL assembler.**

The Apollo 11 mission relied on groundbreaking software to navigate to the moon and back. According to the `chrislgarry/Apollo-11` repository on GitHub, the programming language used for the Apollo 11 guidance computer code is a specialized assembly dialect designed specifically for the AGC's unique 15-bit word architecture. This low-level language controlled every aspect of the lunar module and command module operations, from trajectory calculations to engine ignition sequences.

## AGC Assembly Language and the yaYUL Assembler

The Apollo Guidance Computer did not run high-level languages like Fortran or C. Instead, it executed **AGC assembly language**, a machine-specific syntax where programmers wrote mnemonic instructions that mapped directly to the computer's binary op-codes. The source files in the repository are processed by **yaYUL**, a modern reimplementation of the original *YUL* assembler developed at MIT in the 1960s.

### Assembler Declaration in Source Files

Every legitimate AGC source file in the repository begins with a header identifying the assembler toolchain. In `Luminary099/GENERAL_LAMBERT_AIMPOINT_GUIDANCE.agc`, the first lines establish:

```asm

# Assembler:	yaYUL

# Purpose:  Part of the source code for Luminary 1A build 099.

```

This header appears consistently across the codebase, including in `Luminary099/WAITLIST.agc`, confirming that the entire Apollo 11 software suite uses this specific assembly dialect.

## Understanding AGC Assembly Syntax

The AGC assembly language uses mnemonic codes to manipulate the computer's registers, memory banks, and control flow. The architecture employs **bank-switching** to handle memory beyond the native 15-bit address space, requiring specific directives to manage program location and execution context.

### Common Instructions and Directives

The following excerpt from `GENERAL_LAMBERT_AIMPOINT_GUIDANCE.agc` illustrates typical AGC assembly constructs:

```asm
SETLOC  GLM
BANK
EBANK= SUBEXIT
COUNT*  $$/P31
P31     TC  P20FLGON
        CAF V06N33      # TIG

        TC  VNPOOH

```

**Key components of this syntax include:**

- **`SETLOC`**: Sets the current location counter for absolute addressing within the program.
- **`BANK`**: Initiates a new memory bank, necessary because the AGC uses bank-switching to access its full memory space.
- **`EBANK=`**: Declares the exit bank for subroutine returns, managing the bank-switching state.
- **`CAF`**: "Clear and Add to Fixed" — loads a constant value into the accumulator (e.g., display code `V06N33`).
- **`TC`**: "Transfer Control" — jumps to a subroutine or address, similar to a function call or jump instruction.

## Summary

- The Apollo 11 guidance computer code is written in **AGC assembly language**, a low-level mnemonic syntax specific to the AGC's 15-bit architecture.
- The **yaYUL** assembler processes these source files; it is a modern reimplementation of MIT's original YUL assembler.
- Source files declare the assembler via headers like `# Assembler: yaYUL`, visible in `Luminary099/GENERAL_LAMBERT_AIMPOINT_GUIDANCE.agc` and `Luminary099/WAITLIST.agc`.

- The language uses bank-switching directives (`BANK`, `EBANK=`) and register operations (`CAF`, `TC`) to manage the limited memory and processing capabilities of 1960s spaceflight hardware.

## Frequently Asked Questions

### Was the Apollo 11 guidance computer code written in Fortran?

No. While Fortran was widely used for ground-based trajectory calculations at NASA during the Apollo era, the onboard Apollo Guidance Computer used **AGC assembly language**. The constraints of the AGC's 15-bit word length, 2 MHz clock speed, and limited memory (approximately 72 KB) required the precision and efficiency of hand-written assembly rather than the overhead of a high-level language compiler.

### What is the difference between YUL and yaYUL?

**YUL** was the original assembler developed at the MIT Instrumentation Laboratory in the 1960s to translate AGC assembly into binary machine code for the Apollo missions. **yaYUL** is a modern, open-source reimplementation created by Ronald Burkey and maintained by the community to assemble the historical source code on contemporary systems. The `chrislgarry/Apollo-11` repository uses yaYUL to verify and build the original Luminary and Colossus programs.

### How was AGC assembly language executed by the hardware?

The AGC featured a unique **15-bit word architecture** with one's complement arithmetic. Assembly instructions were assembled into binary op-codes that the computer's interpretive engine executed directly. The language supported an interrupt-driven architecture (managed via the `WAITLIST` and executive routines) and used **bank-switching** to address memory beyond the 15-bit limit, allowing the system to access approximately 72 KB of storage across multiple memory banks.

### Can I compile and run the Apollo 11 code today?

Yes. Using the **yaYUL** assembler and a virtual AGC emulator, you can assemble the source files from the `chrislgarry/Apollo-11` repository and execute them on a simulated Apollo Guidance Computer. The repository includes build instructions, and the resulting binary can be loaded into emulators that accurately replicate the hardware behavior, allowing you to run the actual Luminary (lunar module) or Colossus (command module) flight software.