Source Code

These source code files are a reconstruction of Sundance, the Apollo 9 LM (Lunar Module) AGC (Apollo Guidance Computer) flight software, created from binary dumps of original core rope program modules, as follows:
  • B1 — Revision 292
  • B2 — Revision 302
  • B3 — Revision 302
  • B4 — Revision 302
  • B5 — Revision 292
  • B6 — Revision 306
This means that source code does not represent a specific historical revision of Sundance, but rather a mixture of the three released versions. Nonetheless, it is capable of flying the whole Apollo 9 mission. This source code matches the binary dumps, as closely as feasible, but 100% match is not possible, due mostly to changes in memory addresses at which code and variables were allocated in different revisions of Sundance. Refer to this list of explanations for each binary mismatch.

Since only binary dumps (rather than listings) of Sundance are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

058135,000002:                                                                                                  ## Copyright:   Public domain.
058136,000003:                                                                                                  ## Filename:    KALMAN_FILTER.agc
058137,000004:                                                                                                  ## Purpose:     A section of a reconstructed, mixed version of Sundance
058138,000005:                                                                                                  ##              It is part of the reconstructed source code for the Lunar
058139,000006:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 9.
058140,000007:                                                                                                  ##              No original listings of this program are available;
058141,000008:                                                                                                  ##              instead, this file was created via disassembly of dumps
058142,000009:                                                                                                  ##              of various revisions of Sundance core rope modules.
058143,000010:                                                                                                  ## Assembler:   yaYUL
058144,000011:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
058145,000012:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
058146,000013:                                                                                                  ## Mod history: 2020-06-17 MAS  Created from Luminary 69.
058147,000014: 
058148,000015:                                                                                                  ## Sundance 302
058149,000016: 
058150,000017: 17,3526  E6,1514                                  EBANK=   NO.UJETS                              
058151,000018: 16,3705                                           BANK     16                                    
058152,000019: 16,2000                                           SETLOC   DAPS1                                 
058153,000020: 16,2000                                           BANK                                           
058154,000021: 
058155,000022: 16,3705                                           COUNT*   $$/DAP                                
058156,000023: 
058157,000024: 16,3705           35025        RATELOOP           CA       TWO                                   
058158,000025: 16,3706           55741                           TS       DAPTEMP6                              
058159,000026: 16,3707           51741                           INDEX    DAPTEMP6                              
058160,000027: 16,3710           11516                           CCS      TJP                                   
058161,000028: 16,3711           13713                           TCF      +2                                    
058162,000029: 16,3712           13732                           TCF      LOOPRATE                              
058163,000030: 16,3713           63764                           AD       -100MST6                              
058164,000031: 16,3714           00006                           EXTEND                                         
058165,000032: 16,3715           63742                           BZMF     SMALLTJU                              
058166,000033: 16,3716           51741                           INDEX    DAPTEMP6                              
058167,000034: 16,3717           11516                           CCS      TJP                                   
058168,000035: 16,3720           33764                           CA       -100MST6                              
058169,000036: 16,3721           13723                           TCF      +2                                    
058170,000037: 16,3722           43764                           CS       -100MST6                              
058171,000038: 16,3723           51741                           INDEX    DAPTEMP6                              
058172,000039: 16,3724           27516                           ADS      TJP                                   
058173,000040: 16,3725           51741                           INDEX    DAPTEMP6                              
058174,000041: 16,3726           11516                           CCS      TJP                                   
058175,000042: 16,3727           43661                           CS       -100MS                                #  0.1 AT 1
058176,000043: 16,3730           13732                           TCF      +2                                    
058177,000044: 16,3731           33661                           CA       -100MS                                
058178,000045: 16,3732           00006        LOOPRATE           EXTEND                                         
058179,000046: 16,3733           51741                           INDEX    DAPTEMP6                              
058180,000047: 16,3734           71513                           MP       NO.PJETS                              
058181,000048: 16,3735           51741                           INDEX    DAPTEMP6                              
058182,000049: 16,3736           23734                           LXCH     DAPTEMP1                              #  SIGNED TORQUE AT 1 JET-SEC FOR FILTER
058183,000050: 16,3737           11741                           CCS      DAPTEMP6                              
058184,000051: 16,3740           13706                           TCF      RATELOOP   +1                         
058185,000052: 16,3741           13751                           TCF      ROTORQUE                              
058186,000053: 16,3742           35030        SMALLTJU           CA       ZERO                                  
058187,000054: 16,3743           51741                           INDEX    DAPTEMP6                              
058188,000055: 16,3744           57516                           XCH      TJP                                   
058189,000056: 16,3745           00006                           EXTEND                                         
058190,000057: 16,3746           74375                           MP       TEN                                   
058191,000058: 16,3747           30001                           CA       L                                     
058192,000059: 16,3750           13732                           TCF      LOOPRATE                              
058193,000060: 16,3751           31735        ROTORQUE           CA       DAPTEMP2                              
058194,000061: 16,3752           61736                           AD       DAPTEMP3                              
058195,000062: 16,3753           00006                           EXTEND                                         
058196,000063: 16,3754           71524                           MP       1JACCR                                
058197,000064: 16,3755           55744                           TS       JETRATER                              
058198,000065: 16,3756           41736                           CS       DAPTEMP3                              
058199,000066: 16,3757           61735                           AD       DAPTEMP2                              
058200,000067: 16,3760           00006                           EXTEND                                         
058201,000068: 16,3761           71523                           MP       1JACCQ                                
058202,000069: 16,3762           55743                           TS       JETRATEQ                              
058203,000070: 16,3763           12532                           TCF      BACKP                                 
058204,000071: 16,3764           77537        -100MST6           DEC      -160       B-14                       
058205,000072: 

End of include-file KALMAN_FILTER.agc.  Parent file is MAIN.agc