Source Code

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

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

043556,000002:                                                                                                  ## Copyright:   Public domain.
043557,000003:                                                                                                  ## Filename:    MYSUBS.agc
043558,000004:                                                                                                  ## Purpose:     A section of Manche45 revision 2.
043559,000005:                                                                                                  ##              It is part of the reconstructed source code for the
043560,000006:                                                                                                  ##              final, flown release of the flight software for the Command
043561,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
043562,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
043563,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
043564,000010:                                                                                                  ##              exactly match those specified for Manche 45/2 in NASA drawing
043565,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
043566,000012:                                                                                                  ##              reconstruction is correct.
043567,000013:                                                                                                  ## Assembler:   yaYUL
043568,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
043569,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
043570,000016:                                                                                                  ## Mod history: 2020-12-24 MAS  Created from Comanche 45.
043571,000017: 

Page 999

043573,000019: 20,3612                                           BANK     20                                    
043574,000020: 21,2000                                           SETLOC   MYSUBS                                
043575,000021: 21,2000                                           BANK                                           
043576,000022: 
043577,000023: 21,2042  E6,1510                                  EBANK=   KMPAC                                 
043578,000024: 21,2042     5074               SPCOS1             EQUALS   SPCOS                                 
043579,000025: 21,2042     5075               SPSIN1             EQUALS   SPSIN                                 
043580,000026: 21,2042     5074               SPCOS2             EQUALS   SPCOS                                 
043581,000027: 21,2042     5075               SPSIN2             EQUALS   SPSIN                                 
043582,000028: 
043583,000029: 21,2042                                           COUNT    21/DAPMS                              
043584,000030: 
043585,000031:                                                                                                  #  ONE AND ONE HALF PRECISION MULTIPLICATION ROUTINE
043586,000032: 
043587,000033: 21,2042           55512        SMALLMP            TS       KMPTEMP                               #  A(X+Y)
043588,000034: 21,2043           00006                           EXTEND                                         
043589,000035: 21,2044           71511                           MP       KMPAC      +1                         
043590,000036: 21,2045           55511                           TS       KMPAC      +1                         #  AY
043591,000037: 21,2046           35021                           CAF      ZERO                                  
043592,000038: 21,2047           57510                           XCH      KMPAC                                 
043593,000039: 21,2050           00006                           EXTEND                                         
043594,000040: 21,2051           71512                           MP       KMPTEMP                               #  AX
043595,000041: 21,2052           21511                           DAS      KMPAC                                 #  AX+AY
043596,000042: 21,2053           00002                           TC       Q                                     
043597,000043: 
043598,000044:                                                                                                  #  SUBROUTINE FOR DOUBLE PRECISION ADDITIONS OF ANGLES
043599,000045:                                                                                                  #  A AND L CONTAIN A DP(1S) ANGLE SCALED BY 180 DEGS TO BE ADDED TO KMPAC.
043600,000046:                                                                                                  #  RESULT IS PLACED IN KMPAC.  TIMING = 6 MCT (22 MCT ON OVERFLOW)
043601,000047: 
043602,000048: 21,2054           21511        DPADD              DAS      KMPAC                                 
043603,000049: 21,2055           00006                           EXTEND                                         
043604,000050: 21,2056           12073                           BZF      TSK        +1                         #  NO OVERFLOW
043605,000051: 21,2057           11510                           CCS      KMPAC                                 
043606,000052: 21,2060           12074                           TCF      DPADD+                                #  + OVERFLOW
043607,000053: 21,2061           12063                           TCF      +2                                    
043608,000054: 21,2062           12076                           TCF      DPADD-                                #  - OVERFLOW
043609,000055: 21,2063           11511                           CCS      KMPAC      +1                         
043610,000056: 21,2064           12101                           TCF      DPADD2+                               #  UPPER = 0, LOWER +
043611,000057: 21,2065           12067                           TCF      +2                                    
043612,000058: 21,2066           40000                           COM                                            #  UPPER = 0, LOWER -
043613,000059: 21,2067           64777                           AD       POSMAX                                #  LOWER = 0, A = 0
043614,000060: 21,2070           55511                           TS       KMPAC      +1                         #  CAN NOT OVERFLOW
043615,000061: 21,2071           34777                           CA       POSMAX                                #  UPPER WAS = 0
043616,000062: 21,2072           55510        TSK                TS       KMPAC                                 
043617,000063: 21,2073           00002                           TC       Q                                     
043618,000064: 
043619,000065: 21,2074           65001        DPADD+             AD       NEGMAX                                #  KMPAC GREATER THAN 0
043620,000066: 21,2075           12072                           TCF      TSK                                   
043621,000067: 

Page 1000

043623,000069: 21,2076           40000        DPADD-             COM                                            
043624,000070: 21,2077           64777                           AD       POSMAX                                #  KMPAC LESS THAN 0
043625,000071: 21,2100           12072                           TCF      TSK                                   
043626,000072: 
043627,000073: 21,2101           65001        DPADD2+            AD       NEGMAX                                #  CAN NOT OVERFLOW
043628,000074: 21,2102           55511                           TS       KMPAC      +1                         
043629,000075: 21,2103           35001                           CA       NEGMAX                                #  UPPER WAS = 0
043630,000076: 21,2104           12072                           TCF      TSK                                   
043631,000077: 

Page 1001 This page is empty.

043634,000080: 
043635,000081: 

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