Source Code

These source-code files are part of a reconstructed copy of Comanche 72/3 (AKA Manche72 revision 3), the final, flown mission release of the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 13.

The starting point was the source code of Comanche 72 (itself previously reconstructed). Comanche 72 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 72 and 72/3. 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/3 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.

044394,000002:                                                                                                  ## Copyright:   Public domain.
044395,000003:                                                                                                  ## Filename:    RCS-CSM_DAP_EXECUTIVE_PROGRAMS.agc
044396,000004:                                                                                                  ## Purpose:     A section of Manche72 revision 3.
044397,000005:                                                                                                  ##              It is part of the reconstructed source code for the final, flown
044398,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
044399,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
044400,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
044401,000009:                                                                                                  ##              from a reconstructed copy of Comanche 072. It has been adapted
044402,000010:                                                                                                  ##              such that the resulting bugger words exactly match those
044403,000011:                                                                                                  ##              specified for Manche72 revision 3 in NASA drawing 2021153G,
044404,000012:                                                                                                  ##              which gives relatively high confidence that the reconstruction
044405,000013:                                                                                                  ##              is correct.
044406,000014:                                                                                                  ## Assembler:   yaYUL
044407,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
044408,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
044409,000017:                                                                                                  ## Mod history: 2024-05-19 MAS  Created from Comanche 072.
044410,000018: 
044411,000019:                                                                                                  #  CALCULATION OF  AMGB, AMBG  ONCE EVERY SECOND
044412,000020: 
044413,000021:                                                                                                  #        AMGB =  1       SIN(PSI)                0
044414,000022:                                                                                                  #                0       COS(PSI)COS(PHI)        SIN(PHI)
044415,000023:                                                                                                  #                0       -COS(PSI)SIN(PHI)       COS(PHI)
044416,000024: 
044417,000025:                                                                                                  #        AMBG =  1       -TAN(PSI)COS(PHI)       TAN(PSI)SIN(PHI)
044418,000026:                                                                                                  #                0       COS(PHI)/COS(PSI)       -SIN(PHI)/COS(PSI)
044419,000027:                                                                                                  #                0       SIN(PHI)                COS(PHI)
044420,000028: 
044421,000029:                                                                                                  #  WHERE PHI AND PSI ARE CDU ANGLES
044422,000030: 
044423,000031: 20,3650                                           BANK     20                                    
044424,000032: 22,2000                                           SETLOC   DAPS8                                 
044425,000033: 22,2000                                           BANK                                           
044426,000034: 
044427,000035: 22,3447                                           COUNT*   $$/DAPEX                              
044428,000036: 22,3447  E6,1510                                  EBANK=   KMPAC                                 
044429,000037: 22,3447           30102        AMBGUPDT           CA       FLAGWRD6                              #  CHECK FOR RCS AUTOPILOT
044430,000038: 22,3450           00006                           EXTEND                                         
044431,000039: 22,3451           65233                           BZMF     ENDOFJOB                              #  BIT15 = 0, BIT14 = 1
044432,000040: 22,3452           75016                           MASK     BIT14                                 #  IF NOT RCS, EXIT
044433,000041: 22,3453           00006                           EXTEND                                         
044434,000042: 22,3454           15233                           BZF      ENDOFJOB                              #  TO PROTECT TVC DAP ON SWITCHOVER
044435,000043: 
044436,000044: 22,3455           30034                           CA       CDUZ                                  
044437,000045: 22,3456           05111                           TC       SPSIN2                                
044438,000046: 22,3457           55640                           TS       AMGB1                                 #  CALCULATE AMGB
044439,000047: 22,3460           30034                           CA       CDUZ                                  
044440,000048: 22,3461           05110                           TC       SPCOS2                                
044441,000049: 22,3462           55645                           TS       CAPSI                                 #  MUST CHECK FOR GIMBAL LOCK
044442,000050: 22,3463           33507                           CAF      QUADANGL                              #  = 7.25  DEGREES JET QUAD ANGULAR OFFSET
044443,000051: 22,3464           00006                           EXTEND                                         
044444,000052: 22,3465           20032                           MSU      CDUX                                  
044445,000053: 22,3466           40000                           COM                                            #  CDUX - 7.25 DEG
044446,000054: 22,3467           05110                           TC       SPCOS1                                
044447,000055: 22,3470           55644                           TS       AMGB8                                 
044448,000056: 22,3471           00006                           EXTEND                                         
044449,000057: 22,3472           71645                           MP       CAPSI                                 
044450,000058: 22,3473           55641                           TS       AMGB4                                 
044451,000059: 22,3474           33507                           CAF      QUADANGL                              
044452,000060: 22,3475           00006                           EXTEND                                         
044453,000061: 22,3476           20032                           MSU      CDUX                                  
044454,000062: 22,3477           40000                           COM                                            #  CDUX - 7.25 DEG
044455,000063: 22,3500           05111                           TC       SPSIN1                                
044456,000064: 22,3501           55642                           TS       AMGB5                                 
044457,000065: 22,3502           00006                           EXTEND                                         
044458,000066: 22,3503           71645                           MP       CAPSI                                 
044459,000067: 22,3504           40000                           COM                                            
044460,000068: 22,3505           55643                           TS       AMGB7                                 
044461,000069: 22,3506           15233                           TCF      ENDOFJOB                              
044462,000070: 22,3507           01224        QUADANGL           DEC      660        B-14                       #  = 7.25 DEGREES
044463,000071: 

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