Source Code

These source-code files are part of a reconstructed copy of Comanche 45, the second release, though not the final mission release, of the Apollo 10 Command Module (CM) Apollo Guidance Computer (AGC) software. Comanche 45 was preceded by Comanche 44 and followed by Comanche 45/2 (the flown release). The reconstruction is believed to be exactly accurate, but in the absence of an actual Apollo-era listing of Comanche 45, some explanation of the reconstruction process is needed to insure confidence in that accuracy.

The starting point was the source code of Comanche 44 (itself previously accurately reconstructed). Comanche 44 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 44 and 45. The now-reconstructed Comanche 45 source code was verified by assembling it and checking that the assembled code had the expected known-correct memory-bank checksums. Note that page numbers in the reconstructed code tend to match those in the Comanche 55, the most-similar revision of Comanche for which we have access to an actual non-reconstructed hardcopy; the source code would likely have different page numbers in a contemporary Comanche 45 listing.

Annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change relative to Comanche 44. Here's a guide to the Apollo documentation referenced in those annotations:
There is also a detailed commentary about the reconstruction process.

Comments expected to have been present in the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC Project's GitHub repository.

045194,000002:                                                                                                  ## Copyright:   Public domain.
045195,000003:                                                                                                  ## Filename:    RCS-CSM_DAP_EXECUTIVE_PROGRAMS.agc
045196,000004:                                                                                                  ## Purpose:     A section of Comanche revision 045.
045197,000005:                                                                                                  ##              It is part of the reconstructed source code for the
045198,000006:                                                                                                  ##              second release of the flight software for the Command
045199,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
045200,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
045201,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
045202,000010:                                                                                                  ##              exactly match those specified for Comanche 45 in NASA drawing
045203,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
045204,000012:                                                                                                  ##              reconstruction is correct.
045205,000013:                                                                                                  ## Assembler:   yaYUL
045206,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
045207,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
045208,000016:                                                                                                  ## Mod history: 2020-12-06 MAS  Created from Comanche 44.
045209,000017: 

Page 1037

045211,000019:                                                                                                  #  CALCULATION OF  AMGB, AMBG  ONCE EVERY SECOND
045212,000020: 
045213,000021:                                                                                                  #        AMGB =  1       SIN(PSI)                0
045214,000022:                                                                                                  #                0       COS(PSI)COS(PHI)        SIN(PHI)
045215,000023:                                                                                                  #                0       -COS(PSI)SIN(PHI)       COS(PHI)
045216,000024: 
045217,000025:                                                                                                  #        AMBG =  1       -TAN(PSI)COS(PHI)       TAN(PSI)SIN(PHI)
045218,000026:                                                                                                  #                0       COS(PHI)/COS(PSI)       -SIN(PHI)/COS(PSI)
045219,000027:                                                                                                  #                0       SIN(PHI)                COS(PHI)
045220,000028: 
045221,000029:                                                                                                  #  WHERE PHI AND PSI ARE CDU ANGLES
045222,000030: 
045223,000031: 20,3612                                           BANK     20                                    
045224,000032: 22,2000                                           SETLOC   DAPS8                                 
045225,000033: 22,2000                                           BANK                                           
045226,000034: 
045227,000035: 22,3447                                           COUNT*   $$/DAPEX                              
045228,000036: 22,3447  E6,1510                                  EBANK=   KMPAC                                 
045229,000037: 22,3447           30102        AMBGUPDT           CA       FLAGWRD6                              #  CHECK FOR RCS AUTOPILOT
045230,000038: 22,3450           00006                           EXTEND                                         
045231,000039: 22,3451           65217                           BZMF     ENDOFJOB                              #  BIT15 = 0, BIT14 = 1
045232,000040: 22,3452           75002                           MASK     BIT14                                 #  IF NOT RCS, EXIT
045233,000041: 22,3453           00006                           EXTEND                                         
045234,000042: 22,3454           15217                           BZF      ENDOFJOB                              #  TO PROTECT TVC DAP ON SWITCHOVER
045235,000043: 
045236,000044: 22,3455           30034                           CA       CDUZ                                  
045237,000045: 22,3456           05075                           TC       SPSIN2                                
045238,000046: 22,3457           55640                           TS       AMGB1                                 #  CALCULATE AMGB
045239,000047: 22,3460           30034                           CA       CDUZ                                  
045240,000048: 22,3461           05074                           TC       SPCOS2                                
045241,000049: 22,3462           55645                           TS       CAPSI                                 #  MUST CHECK FOR GIMBAL LOCK
045242,000050: 22,3463           33507                           CAF      QUADANGL                              #  = 7.25  DEGREES JET QUAD ANGULAR OFFSET
045243,000051: 22,3464           00006                           EXTEND                                         
045244,000052: 22,3465           20032                           MSU      CDUX                                  
045245,000053: 22,3466           40000                           COM                                            #  CDUX - 7.25 DEG
045246,000054: 22,3467           05074                           TC       SPCOS1                                
045247,000055: 22,3470           55644                           TS       AMGB8                                 
045248,000056: 22,3471           00006                           EXTEND                                         
045249,000057: 22,3472           71645                           MP       CAPSI                                 
045250,000058: 22,3473           55641                           TS       AMGB4                                 
045251,000059: 22,3474           33507                           CAF      QUADANGL                              
045252,000060: 22,3475           00006                           EXTEND                                         
045253,000061: 22,3476           20032                           MSU      CDUX                                  
045254,000062: 22,3477           40000                           COM                                            #  CDUX - 7.25 DEG
045255,000063: 22,3500           05075                           TC       SPSIN1                                
045256,000064: 22,3501           55642                           TS       AMGB5                                 
045257,000065: 22,3502           00006                           EXTEND                                         
045258,000066: 22,3503           71645                           MP       CAPSI                                 
045259,000067: 22,3504           40000                           COM                                            

Page 1038

045261,000069: 22,3505           55643                           TS       AMGB7                                 
045262,000070: 22,3506           15217                           TCF      ENDOFJOB                              
045263,000071: 22,3507           01224        QUADANGL           DEC      660        B-14                       #  = 7.25 DEGREES
045264,000072: 

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