Luminary099: The Apollo 11 Lunar Module Guidance Computer Software Explained

Luminary099 is the complete source code for the Lunar Module's Apollo Guidance Computer (AGC) that executed the powered descent, navigation, and landing sequences during the Apollo 11 mission.

Luminary099 represents the software revision that flew on the Lunar Module Eagle during the historic 1969 moon landing. According to the chrislgarry/Apollo-11 repository, this code was assembled as revision 001 of AGC program LMY99 by NASA, serving as the reference implementation for both the Apollo II software milestone and the actual Apollo 11 flight hardware.

What is Luminary099?

Luminary099 is the complete source-code archive for the Lunar Module (LM) Apollo Guidance Computer (AGC). The software was developed as the production version that would control the LM's flight computers during the descent to the lunar surface.

As documented in Luminary099/README.md, the code was officially assembled as revision 001 of AGC program LMY99 by NASA. While the repository is named Apollo-11, this specific codebase also represents the Apollo II milestone—the second major software milestone in the project's AGC development cycle—before its final deployment on the Apollo 11 mission hardware.

Role in the Apollo 11 Mission

During the Apollo 11 mission, Luminary099 provided all guidance, navigation, and control (GNC) routines necessary for the LM's powered descent and lunar landing. The software operated in conjunction with the Command Module code (Comanche055) to manage the critical descent phase.

The system handled four primary flight functions:

  • Guidance equations computing the ideal thrust vector for lunar touchdown
  • Attitude-hold and RCS control maintaining proper orientation via Reaction Control System jets
  • Landing-site navigation transforming inertial measurements into lunar-fixed coordinates
  • Safety and abort handling monitoring alarms and triggering emergency sequences

Core Flight Software Functions

Lunar Landing Guidance Equations

The primary descent logic resides in LUNAR_LANDING_GUIDANCE_EQUATIONS.agc. This file defines the guidance phases, TTF/8 integration algorithms, and the main guidance loop that computed the quadratic descent trajectory.

The ?GUIDSUB routine serves as the entry point for the ignition algorithm, delivering multiple passes of quadratic guidance during the critical IGNALG phase. The LUNLAND label marks the normal entry point used after each guidance cycle, handling phase changes and task priority management to ensure the guidance computations take precedence over lower-priority servicer tasks.

Attitude Control and RCS Management

Attitude stabilization and Reaction Control System (RCS) firing logic appear across several modules. The RCS_FAILURE_MONITOR.agc tracks jet performance, while GUILDENSTERN.agc contains sub-routines for attitude manipulation. The VERTGUID and P65 guidance phases referenced in VERTGUID.agc manage the vertical descent profile and attitude holds during braking and final approach phases.

Landing-site navigation relies on REDESIG.agc and RGVGCALC routines to transform inertial platform data into lunar-fixed coordinates and calculate landing-site vectors. Display routines including WHATDISP.agc and P63DISPS present critical flight data to the crew through the DSKY interface, showing altitude, velocity, and fuel consumption during descent.

Safety Monitoring and Abort Logic

Critical safety checks reside in STEER?.agc, which monitors steering compliance and can trigger attitude-hold modes. The RATESTOP and EXOVFLOW.agc modules detect overflow conditions and rate deviations that could indicate system failures, providing automatic abort sequencing capabilities if the LM deviated from safe flight parameters.

Architecture and Source Organization

Luminary099 follows the original AGC development practice of monolithic assembly broken into modular include files. The master file MAIN.agc serves as the entry point, using INCLUDE directives to incorporate over 200 individual source files in the correct assembly order.

This structure mirrors the physical punch-card decks used by NASA engineers in the 1960s, preserving the historic development workflow while organizing the code into manageable logical units. Each .agc file handles specific subsystems—guidance, navigation, displays, or utility functions—allowing modern readers to locate specific algorithms while maintaining the original build process integrity.

Key Source Files in Luminary099

The Luminary099 directory contains over 200 assembly files organized by subsystem:

  • Luminary099/MAIN.agc — Master include file that assembles the entire LM program by including all subsystem modules in the correct order.
  • Luminary099/LUNAR_LANDING_GUIDANCE_EQUATIONS.agc — Core guidance equations, phase handling, and integration logic for the lunar descent trajectory.
  • Luminary099/REDESIG.agc — Redesignation logic that performs rotational-frame corrections to refine landing site targeting during descent.
  • Luminary099/STEER?.agc — Abort monitoring and attitude-hold safety checks that validate steering compliance.
  • Luminary099/GUILDENSTERN.agc — RCS jet control sub-routines and attitude manipulation utilities.
  • Luminary099/WHATDISP.agc — Display formatting routines for the DSKY crew interface during descent phases.
  • Luminary099/EXOVFLOW.agc — Overflow detection and exception handling for critical arithmetic operations.

Code Example: The Guidance Loop

The following excerpt from LUNAR_LANDING_GUIDANCE_EQUATIONS.agc demonstrates how the guidance phase selects the main guidance routine and manages computational priorities:

; Entry point for the ignition algorithm (delivers N passes of quadratic guidance)
?GUIDSUB  EXIT
        CAF   TWO        ; N = 3 passes
        TS    NGUIDSUB
        TCF   GUILDRET +2

; Normal entry from the main guidance loop
LUNLAND  TC    PHASCHNG
        OCT   00035      ; retain PIPA task only
        TC    PHASCHNG
        OCT   05023      ; protect guidance with priority 21
        OCT   21000      ; higher than Servicer's priority

The ?GUIDSUB routine initializes the ignition algorithm with three passes of quadratic guidance. The LUNLAND sequence uses PHASCHNG (phase change) instructions to elevate the guidance task priority above the Servicer's priority level, ensuring critical descent calculations execute without interruption while maintaining only essential PIPA (Pulse Integrating Pendulous Accelerometer) tasks.

Summary

  • Luminary099 is the complete AGC source code for the Apollo 11 Lunar Module, assembled as revision 001 of program LMY99.
  • The software provided guidance, navigation, and control for the powered descent and lunar landing phase.
  • Key functions include landing guidance equations in LUNAR_LANDING_GUIDANCE_EQUATIONS.agc, RCS control logic, navigation transformations, and abort safety systems.
  • The architecture uses a monolithic build with MAIN.agc including over 200 modular source files, preserving the original 1960s development structure.
  • The codebase served as the reference implementation for the Apollo II software milestone and flew on the actual Apollo 11 mission.

Frequently Asked Questions

What is the difference between Luminary099 and Comanche055?

Luminary099 controlled the Lunar Module (LM), while Comanche055 ran on the Command Module (CM). Both are AGC assembly language programs, but Luminary099 contains the specific guidance equations and descent logic required for lunar landing, whereas Comanche055 manages orbital mechanics and transposition/docking maneuvers.

Was Luminary099 actually used on the Apollo 11 mission?

Yes. According to the source annotations in Luminary099/README.md, this code represents the exact software revision flown on the Lunar Module Eagle during the Apollo 11 mission in July 1969. The assembly revision 001 of AGC program LMY99 was the production version loaded into the LM's guidance computer for the lunar descent.

What programming language is Luminary099 written in?

Luminary099 is written in AGC assembly language (.agc files). This is a symbolic machine code for the Apollo Guidance Computer's custom architecture, featuring specialized instructions for vector arithmetic, interpreter-based floating-point operations, and bitwise manipulation required for real-time spacecraft control.

How does the guidance loop in Luminary099 handle priority tasks?

The guidance loop uses the PHASCHNG (phase change) instruction to dynamically adjust task priorities. As shown in LUNAR_LANDING_GUIDANCE_EQUATIONS.agc, the LUNLAND entry point sets the guidance priority to 21—higher than the Servicer's priority—ensuring critical descent calculations preempt less critical background tasks while retaining essential inertial measurement unit (PIPA) updates.

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 →