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.

042972,000002:                                                                                                  ## Copyright:   Public domain.
042973,000003:                                                                                                  ## Filename:    MYSUBS.agc
042974,000004:                                                                                                  ## Purpose:     A section of Comanche revision 072.
042975,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
042976,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
042977,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
042978,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
042979,000009:                                                                                                  ##              from a printout of Comanche 055, binary dumps of a set of
042980,000010:                                                                                                  ##              Comanche 067 rope modules, and changelogs between Comanche 067
042981,000011:                                                                                                  ##              and 072. It has been adapted such that the resulting bugger words
042982,000012:                                                                                                  ##              exactly match those specified for Comanche 072 in NASA drawing
042983,000013:                                                                                                  ##              2021153G, which gives relatively high confidence that the
042984,000014:                                                                                                  ##              reconstruction is correct.
042985,000015:                                                                                                  ## Assembler:   yaYUL
042986,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
042987,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
042988,000018:                                                                                                  ## Mod history: 2024-05-13 MAS  Created from Comanche 067.
042989,000019: 
042990,000020: 20,3650                                           BANK     20                                    
042991,000021: 21,2000                                           SETLOC   MYSUBS                                
042992,000022: 21,2000                                           BANK                                           
042993,000023: 
042994,000024: 21,2054  E6,1510                                  EBANK=   KMPAC                                 
042995,000025: 21,2054     5110               SPCOS1             EQUALS   SPCOS                                 
042996,000026: 21,2054     5111               SPSIN1             EQUALS   SPSIN                                 
042997,000027: 21,2054     5110               SPCOS2             EQUALS   SPCOS                                 
042998,000028: 21,2054     5111               SPSIN2             EQUALS   SPSIN                                 
042999,000029: 
043000,000030: 21,2054                                           COUNT    21/DAPMS                              
043001,000031: 
043002,000032:                                                                                                  #  ONE AND ONE HALF PRECISION MULTIPLICATION ROUTINE
043003,000033: 
043004,000034: 21,2054           55512        SMALLMP            TS       KMPTEMP                               #  A(X+Y)
043005,000035: 21,2055           00006                           EXTEND                                         
043006,000036: 21,2056           71511                           MP       KMPAC      +1                         
043007,000037: 21,2057           55511                           TS       KMPAC      +1                         #  AY
043008,000038: 21,2060           35035                           CAF      ZERO                                  
043009,000039: 21,2061           57510                           XCH      KMPAC                                 
043010,000040: 21,2062           00006                           EXTEND                                         
043011,000041: 21,2063           71512                           MP       KMPTEMP                               #  AX
043012,000042: 21,2064           21511                           DAS      KMPAC                                 #  AX+AY
043013,000043: 21,2065           00002                           TC       Q                                     
043014,000044: 
043015,000045:                                                                                                  #  SUBROUTINE FOR DOUBLE PRECISION ADDITIONS OF ANGLES
043016,000046:                                                                                                  #  A AND L CONTAIN A DP(1S) ANGLE SCALED BY 180 DEGS TO BE ADDED TO KMPAC.
043017,000047:                                                                                                  #  RESULT IS PLACED IN KMPAC.  TIMING = 6 MCT (22 MCT ON OVERFLOW)
043018,000048: 
043019,000049: 21,2066           21511        DPADD              DAS      KMPAC                                 
043020,000050: 21,2067           00006                           EXTEND                                         
043021,000051: 21,2070           12105                           BZF      TSK        +1                         #  NO OVERFLOW
043022,000052: 21,2071           11510                           CCS      KMPAC                                 
043023,000053: 21,2072           12106                           TCF      DPADD+                                #  + OVERFLOW
043024,000054: 21,2073           12075                           TCF      +2                                    
043025,000055: 21,2074           12110                           TCF      DPADD-                                #  - OVERFLOW
043026,000056: 21,2075           11511                           CCS      KMPAC      +1                         
043027,000057: 21,2076           12113                           TCF      DPADD2+                               #  UPPER = 0, LOWER +
043028,000058: 21,2077           12101                           TCF      +2                                    
043029,000059: 21,2100           40000                           COM                                            #  UPPER = 0, LOWER -
043030,000060: 21,2101           65013                           AD       POSMAX                                #  LOWER = 0, A = 0
043031,000061: 21,2102           55511                           TS       KMPAC      +1                         #  CAN NOT OVERFLOW
043032,000062: 21,2103           35013                           CA       POSMAX                                #  UPPER WAS = 0
043033,000063: 21,2104           55510        TSK                TS       KMPAC                                 
043034,000064: 21,2105           00002                           TC       Q                                     
043035,000065: 
043036,000066: 21,2106           65015        DPADD+             AD       NEGMAX                                #  KMPAC GREATER THAN 0
043037,000067: 21,2107           12104                           TCF      TSK                                   
043038,000068: 
043039,000069: 21,2110           40000        DPADD-             COM                                            
043040,000070: 21,2111           65013                           AD       POSMAX                                #  KMPAC LESS THAN 0
043041,000071: 21,2112           12104                           TCF      TSK                                   
043042,000072: 
043043,000073: 21,2113           65015        DPADD2+            AD       NEGMAX                                #  CAN NOT OVERFLOW
043044,000074: 21,2114           55511                           TS       KMPAC      +1                         
043045,000075: 21,2115           35015                           CA       NEGMAX                                #  UPPER WAS = 0
043046,000076: 21,2116           12104                           TCF      TSK                                   

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