Where to Find the Apollo 11 Command Module Source Code in the GitHub Repository

The complete source code for the Apollo 11 Command Module (CM) software is stored in the Comanche055 directory of the chrislgarry/Apollo-11 repository.

The Apollo 11 repository on GitHub preserves the original Apollo Guidance Computer (AGC) software developed by the MIT Instrumentation Laboratory. While the repository also houses the Lunar Module software in the Luminary099 directory, the Command Module code—specifically the Comanche 055 build used for the Apollo 11 mission—resides entirely within the Comanche055 folder, organized into modular .agc assembly files.

Understanding the Comanche055 Directory Structure

The repository follows the historical file structure used by the original Apollo developers. The AGC program is divided into dozens of individual .agc files, each representing a logical sub-module such as navigation, guidance, display routines, and autopilot systems.

Modular Architecture and AGC Files

The source code is partitioned into functional groups that mirror the original punch-card deck organization. These groups include COMERASE, COMAID, COMEKISS, CHIEFTAN, TVCDAPS, and MISCELLANEOUS. Each group contains related sub-programs that were originally stored on separate physical media but are now preserved as distinct source files.

Key characteristics of the file structure:

  • File extension: All source files use the .agc extension (Apollo Guidance Computer assembly)

  • Assembler compatibility: Every file header specifies # Assembler: yaYUL, indicating compatibility with the modern yaYUL assembler that recreates the original YUL/GAP assemblers

  • In-file documentation: Each module begins with a header comment documenting its purpose, the corresponding page range from the original Apollo manuals, and provenance information

The MAIN.agc Include System

The original developers operated without a modern linker. Instead, they used a simple inclusion mechanism where one file is concatenated inside another. The MAIN.agc file serves as the master include list, specifying the exact order in which component files must be assembled to recreate the historic monolithic build.

$CONTRACT_AND_APPROVALS.agc            # p. 1

$ASSEMBLY_AND_OPERATION_INFORMATION.agc # pp. 2-26

...
$CM_ENTRY_DIGITAL_AUTOPILOT.agc        # pp. 1063-1092

$DOWN-TELEMETRY_PROGRAM.agc            # pp. 1093-1102

...

This inclusion order mirrors the original printed source listings, ensuring that modern assembly produces a binary identical to the 1969 build.

Files implementing Command Module-only logic are prefixed with CM_ and reside primarily within the COMEKISS section of the source index. These modules handle re-entry guidance, attitude control, and CM-specific telemetry.

Entry Digital Autopilot (CM_ENTRY_DIGITAL_AUTOPILOT.agc)

The CM_ENTRY_DIGITAL_AUTOPILOT.agc file implements the digital autopilot subsystem responsible for controlling the Command Module during atmospheric entry. This module spans pages 1063-1092 of the original documentation and contains the guidance routines that controlled the spacecraft's descent from lunar transfer orbit through splashdown.


# Copyright: Public domain.

# Filename:    CM_ENTRY_DIGITAL_AUTOPILUT.agc

# Purpose:    Part of the source code for Colossus 2A, AKA Comanche 055.

#            It is part of the source code for the Command Module's (CM)

#            Apollo Guidance Computer (AGC), for Apollo 11.

# Assembler:   yaYUL

...

Body Attitude Calculations (CM_BODY_ATTITUDE.agc)

The CM_BODY_ATTITUDE.agc file contains the mathematical routines for calculating spacecraft body-attitude angles specific to the Command Module. These calculations were essential for maintaining proper orientation during service module separation and re-entry maneuvers.


# Filename: CM_BODY_ATTITUDE.agc

# Purpose: Calculates the spacecraft body-attitude angles for the CM.

...

How to Read the Source Code Index

The Comanche055/README.md file provides a comprehensive index that maps every .agc file to its original page numbers in the scanned Apollo manuals. This README contains direct GitHub hyperlinks for quick navigation to specific modules.

To explore the CM code effectively:

  1. Open Comanche055/README.md to view the complete file index with page mappings
  2. Review MAIN.agc to understand the assembly order and module dependencies
  3. Examine specific CM modules like CM_ENTRY_DIGITAL_AUTOPILOT.agc or CM_BODY_ATTITUDE.agc for implementation details

Summary

  • The Apollo 11 Command Module source code resides in the Comanche055 directory, not to be confused with the Lunar Module code in Luminary099
  • The build system relies on MAIN.agc, which includes all component files in a specific historical order
  • CM-specific logic is contained in files prefixed with CM_, located primarily in the COMEKISS functional group
  • All files are written for the yaYUL assembler and include detailed provenance headers linking them to original Apollo documentation page numbers
  • The README.md in Comanche055 provides the definitive index for navigating the source-to-page mappings

Frequently Asked Questions

What is the difference between Comanche055 and Luminary099?

Comanche055 is the software build for the Apollo 11 Command Module (CM), while Luminary099 is the software build for the Lunar Module (LM). Both are written in AGC assembly language but control different spacecraft with distinct hardware configurations and mission phases. The Command Module software handles trans-lunar injection, lunar orbit operations, and Earth re-entry, whereas the Lunar Module software manages powered descent, lunar surface operations, and ascent.

How do I assemble the Comanche055 source code?

The source files are designed for the yaYUL assembler, a modern recreation of the original YUL/GAP assemblers used at MIT in the 1960s. You must install yaYUL, then process the MAIN.agc file, which automatically includes all other modules in the correct order. The assembler produces a binary that can be run on AGC simulators or actual hardware replicas.

Are the page numbers in the source comments accurate?

Yes. The page references in the file headers (e.g., pp. 1063-1092) correspond exactly to the scanned pages of the original "Colossus 2A" (Comanche 055) assembly listings published by NASA. The Comanche055/README.md file maintains a complete cross-reference between filenames and original document pages, allowing researchers to verify digital source against historical paper records.

Why are some filenames prefixed with CM_?

Files prefixed with CM_ contain logic that executes exclusively on the Command Module. These routines handle CM-specific hardware such as the Earth re-entry autopilot, service module separation systems, and CM-specific attitude determination algorithms. Modules without this prefix generally contain code shared between the CM and LM, or code specific to other spacecraft systems.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →