Source Code

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

They have been adapted from sources files for Comanche 55, and updated via disassembly of binary dumps of original core rope memory modules, part numbers 2003972-1081, 2003972-1091, 2003972-1111, 2003972-1121, 2003972-1131, and 2003972-1141.

Since only binary dumps (rather than listings) of Comanche 67 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.

044095,000002:                                                                                                  ## Copyright:   Public domain.
044096,000003:                                                                                                  ## Filename:    RCS-CSM_DAP_EXECUTIVE_PROGRAMS.agc
044097,000004:                                                                                                  ## Purpose:     A section of Comanche revision 067.
044098,000005:                                                                                                  ##              It is part of the reconstructed source code for the flight
044099,000006:                                                                                                  ##              software for the Command Module's (CM) Apollo Guidance Computer
044100,000007:                                                                                                  ##              (AGC) for Apollo 12. No original listings of this program are
044101,000008:                                                                                                  ##              available; instead, this file was created via dissassembly of
044102,000009:                                                                                                  ##              dumps of Comanche 067 core rope modules and comparison with
044103,000010:                                                                                                  ##              other AGC programs.
044104,000011:                                                                                                  ## Assembler:   yaYUL
044105,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
044106,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
044107,000014:                                                                                                  ## Mod history: 2023-08-16 MAS  Created from Comanche 055.
044108,000015: 
044109,000016:                                                                                                  #  CALCULATION OF  AMGB, AMBG  ONCE EVERY SECOND
044110,000017: 
044111,000018:                                                                                                  #        AMGB =  1       SIN(PSI)                0
044112,000019:                                                                                                  #                0       COS(PSI)COS(PHI)        SIN(PHI)
044113,000020:                                                                                                  #                0       -COS(PSI)SIN(PHI)       COS(PHI)
044114,000021: 
044115,000022:                                                                                                  #        AMBG =  1       -TAN(PSI)COS(PHI)       TAN(PSI)SIN(PHI)
044116,000023:                                                                                                  #                0       COS(PHI)/COS(PSI)       -SIN(PHI)/COS(PSI)
044117,000024:                                                                                                  #                0       SIN(PHI)                COS(PHI)
044118,000025: 
044119,000026:                                                                                                  #  WHERE PHI AND PSI ARE CDU ANGLES
044120,000027: 
044121,000028: 20,3651                                           BANK     20                                    
044122,000029: 22,2000                                           SETLOC   DAPS8                                 
044123,000030: 22,2000                                           BANK                                           
044124,000031: 
044125,000032: 22,3447                                           COUNT*   $$/DAPEX                              
044126,000033: 22,3447  E6,1510                                  EBANK=   KMPAC                                 
044127,000034: 22,3447           30102        AMBGUPDT           CA       FLAGWRD6                              #  CHECK FOR RCS AUTOPILOT
044128,000035: 22,3450           00006                           EXTEND                                         
044129,000036: 22,3451           65233                           BZMF     ENDOFJOB                              #  BIT15 = 0, BIT14 = 1
044130,000037: 22,3452           75016                           MASK     BIT14                                 #  IF NOT RCS, EXIT
044131,000038: 22,3453           00006                           EXTEND                                         
044132,000039: 22,3454           15233                           BZF      ENDOFJOB                              #  TO PROTECT TVC DAP ON SWITCHOVER
044133,000040: 
044134,000041: 22,3455           30034                           CA       CDUZ                                  
044135,000042: 22,3456           05111                           TC       SPSIN2                                
044136,000043: 22,3457           55640                           TS       AMGB1                                 #  CALCULATE AMGB
044137,000044: 22,3460           30034                           CA       CDUZ                                  
044138,000045: 22,3461           05110                           TC       SPCOS2                                
044139,000046: 22,3462           55645                           TS       CAPSI                                 #  MUST CHECK FOR GIMBAL LOCK
044140,000047: 22,3463           33507                           CAF      QUADANGL                              #  = 7.25  DEGREES JET QUAD ANGULAR OFFSET
044141,000048: 22,3464           00006                           EXTEND                                         
044142,000049: 22,3465           20032                           MSU      CDUX                                  
044143,000050: 22,3466           40000                           COM                                            #  CDUX - 7.25 DEG
044144,000051: 22,3467           05110                           TC       SPCOS1                                
044145,000052: 22,3470           55644                           TS       AMGB8                                 
044146,000053: 22,3471           00006                           EXTEND                                         
044147,000054: 22,3472           71645                           MP       CAPSI                                 
044148,000055: 22,3473           55641                           TS       AMGB4                                 
044149,000056: 22,3474           33507                           CAF      QUADANGL                              
044150,000057: 22,3475           00006                           EXTEND                                         
044151,000058: 22,3476           20032                           MSU      CDUX                                  
044152,000059: 22,3477           40000                           COM                                            #  CDUX - 7.25 DEG
044153,000060: 22,3500           05111                           TC       SPSIN1                                
044154,000061: 22,3501           55642                           TS       AMGB5                                 
044155,000062: 22,3502           00006                           EXTEND                                         
044156,000063: 22,3503           71645                           MP       CAPSI                                 
044157,000064: 22,3504           40000                           COM                                            
044158,000065: 22,3505           55643                           TS       AMGB7                                 
044159,000066: 22,3506           15233                           TCF      ENDOFJOB                              
044160,000067: 22,3507           01224        QUADANGL           DEC      660        B-14                       #  = 7.25 DEGREES
044161,000068: 

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