Source Code

These source-code files are part of a reconstructed copy of Comanche 72, the first release of the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 13.

They have been adapted from sources files created from a listing of Comanche 55. These source files were updated to match binary dumps of a set of Comanche 67 rope modules. They were then further modified by applying known changes between Comanche 67 and Comanche 72. A binary dump of module B2 of Comanche 72, part number 2010802-021, was also used to validate changes made to banks 05-13. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments.

Since no contemporary listings of Comanche 72 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.

044470,000002:                                                                                                  ## Copyright:   Public domain.
044471,000003:                                                                                                  ## Filename:    RCS-CSM_DAP_EXECUTIVE_PROGRAMS.agc
044472,000004:                                                                                                  ## Purpose:     A section of Comanche revision 072.
044473,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
044474,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
044475,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
044476,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
044477,000009:                                                                                                  ##              from a printout of Comanche 055, binary dumps of a set of
044478,000010:                                                                                                  ##              Comanche 067 rope modules, and changelogs between Comanche 067
044479,000011:                                                                                                  ##              and 072. It has been adapted such that the resulting bugger words
044480,000012:                                                                                                  ##              exactly match those specified for Comanche 072 in NASA drawing
044481,000013:                                                                                                  ##              2021153G, which gives relatively high confidence that the
044482,000014:                                                                                                  ##              reconstruction is correct.
044483,000015:                                                                                                  ## Assembler:   yaYUL
044484,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
044485,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
044486,000018:                                                                                                  ## Mod history: 2024-05-13 MAS  Created from Comanche 067.
044487,000019: 
044488,000020:                                                                                                  #  CALCULATION OF  AMGB, AMBG  ONCE EVERY SECOND
044489,000021: 
044490,000022:                                                                                                  #        AMGB =  1       SIN(PSI)                0
044491,000023:                                                                                                  #                0       COS(PSI)COS(PHI)        SIN(PHI)
044492,000024:                                                                                                  #                0       -COS(PSI)SIN(PHI)       COS(PHI)
044493,000025: 
044494,000026:                                                                                                  #        AMBG =  1       -TAN(PSI)COS(PHI)       TAN(PSI)SIN(PHI)
044495,000027:                                                                                                  #                0       COS(PHI)/COS(PSI)       -SIN(PHI)/COS(PSI)
044496,000028:                                                                                                  #                0       SIN(PHI)                COS(PHI)
044497,000029: 
044498,000030:                                                                                                  #  WHERE PHI AND PSI ARE CDU ANGLES
044499,000031: 
044500,000032: 20,3650                                           BANK     20                                    
044501,000033: 22,2000                                           SETLOC   DAPS8                                 
044502,000034: 22,2000                                           BANK                                           
044503,000035: 
044504,000036: 22,3447                                           COUNT*   $$/DAPEX                              
044505,000037: 22,3447  E6,1510                                  EBANK=   KMPAC                                 
044506,000038: 22,3447           30102        AMBGUPDT           CA       FLAGWRD6                              #  CHECK FOR RCS AUTOPILOT
044507,000039: 22,3450           00006                           EXTEND                                         
044508,000040: 22,3451           65233                           BZMF     ENDOFJOB                              #  BIT15 = 0, BIT14 = 1
044509,000041: 22,3452           75016                           MASK     BIT14                                 #  IF NOT RCS, EXIT
044510,000042: 22,3453           00006                           EXTEND                                         
044511,000043: 22,3454           15233                           BZF      ENDOFJOB                              #  TO PROTECT TVC DAP ON SWITCHOVER
044512,000044: 
044513,000045: 22,3455           30034                           CA       CDUZ                                  
044514,000046: 22,3456           05111                           TC       SPSIN2                                
044515,000047: 22,3457           55640                           TS       AMGB1                                 #  CALCULATE AMGB
044516,000048: 22,3460           30034                           CA       CDUZ                                  
044517,000049: 22,3461           05110                           TC       SPCOS2                                
044518,000050: 22,3462           55645                           TS       CAPSI                                 #  MUST CHECK FOR GIMBAL LOCK
044519,000051: 22,3463           33507                           CAF      QUADANGL                              #  = 7.25  DEGREES JET QUAD ANGULAR OFFSET
044520,000052: 22,3464           00006                           EXTEND                                         
044521,000053: 22,3465           20032                           MSU      CDUX                                  
044522,000054: 22,3466           40000                           COM                                            #  CDUX - 7.25 DEG
044523,000055: 22,3467           05110                           TC       SPCOS1                                
044524,000056: 22,3470           55644                           TS       AMGB8                                 
044525,000057: 22,3471           00006                           EXTEND                                         
044526,000058: 22,3472           71645                           MP       CAPSI                                 
044527,000059: 22,3473           55641                           TS       AMGB4                                 
044528,000060: 22,3474           33507                           CAF      QUADANGL                              
044529,000061: 22,3475           00006                           EXTEND                                         
044530,000062: 22,3476           20032                           MSU      CDUX                                  
044531,000063: 22,3477           40000                           COM                                            #  CDUX - 7.25 DEG
044532,000064: 22,3500           05111                           TC       SPSIN1                                
044533,000065: 22,3501           55642                           TS       AMGB5                                 
044534,000066: 22,3502           00006                           EXTEND                                         
044535,000067: 22,3503           71645                           MP       CAPSI                                 
044536,000068: 22,3504           40000                           COM                                            
044537,000069: 22,3505           55643                           TS       AMGB7                                 
044538,000070: 22,3506           15233                           TCF      ENDOFJOB                              
044539,000071: 22,3507           01224        QUADANGL           DEC      660        B-14                       #  = 7.25 DEGREES
044540,000072: 

End of include-file RCS-CSM_DAP_EXECUTIVE_PROGRAMS.agc.  Parent file is MAIN.agc