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.

042609,000002:                                                                                                  ## Copyright:   Public domain.
042610,000003:                                                                                                  ## Filename:    MYSUBS.agc
042611,000004:                                                                                                  ## Purpose:     A section of Comanche revision 067.
042612,000005:                                                                                                  ##              It is part of the reconstructed source code for the flight
042613,000006:                                                                                                  ##              software for the Command Module's (CM) Apollo Guidance Computer
042614,000007:                                                                                                  ##              (AGC) for Apollo 12. No original listings of this program are
042615,000008:                                                                                                  ##              available; instead, this file was created via dissassembly of
042616,000009:                                                                                                  ##              dumps of Comanche 067 core rope modules and comparison with
042617,000010:                                                                                                  ##              other AGC programs.
042618,000011:                                                                                                  ## Assembler:   yaYUL
042619,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
042620,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
042621,000014:                                                                                                  ## Mod history: 2023-08-16 MAS  Created from Comanche 055.
042622,000015: 
042623,000016: 20,3651                                           BANK     20                                    
042624,000017: 21,2000                                           SETLOC   MYSUBS                                
042625,000018: 21,2000                                           BANK                                           
042626,000019: 
042627,000020: 21,2054  E6,1510                                  EBANK=   KMPAC                                 
042628,000021: 21,2054     5110               SPCOS1             EQUALS   SPCOS                                 
042629,000022: 21,2054     5111               SPSIN1             EQUALS   SPSIN                                 
042630,000023: 21,2054     5110               SPCOS2             EQUALS   SPCOS                                 
042631,000024: 21,2054     5111               SPSIN2             EQUALS   SPSIN                                 
042632,000025: 
042633,000026: 21,2054                                           COUNT    21/DAPMS                              
042634,000027: 
042635,000028:                                                                                                  #  ONE AND ONE HALF PRECISION MULTIPLICATION ROUTINE
042636,000029: 
042637,000030: 21,2054           55512        SMALLMP            TS       KMPTEMP                               #  A(X+Y)
042638,000031: 21,2055           00006                           EXTEND                                         
042639,000032: 21,2056           71511                           MP       KMPAC      +1                         
042640,000033: 21,2057           55511                           TS       KMPAC      +1                         #  AY
042641,000034: 21,2060           35035                           CAF      ZERO                                  
042642,000035: 21,2061           57510                           XCH      KMPAC                                 
042643,000036: 21,2062           00006                           EXTEND                                         
042644,000037: 21,2063           71512                           MP       KMPTEMP                               #  AX
042645,000038: 21,2064           21511                           DAS      KMPAC                                 #  AX+AY
042646,000039: 21,2065           00002                           TC       Q                                     
042647,000040: 
042648,000041:                                                                                                  #  SUBROUTINE FOR DOUBLE PRECISION ADDITIONS OF ANGLES
042649,000042:                                                                                                  #  A AND L CONTAIN A DP(1S) ANGLE SCALED BY 180 DEGS TO BE ADDED TO KMPAC.
042650,000043:                                                                                                  #  RESULT IS PLACED IN KMPAC.  TIMING = 6 MCT (22 MCT ON OVERFLOW)
042651,000044: 
042652,000045: 21,2066           21511        DPADD              DAS      KMPAC                                 
042653,000046: 21,2067           00006                           EXTEND                                         
042654,000047: 21,2070           12105                           BZF      TSK        +1                         #  NO OVERFLOW
042655,000048: 21,2071           11510                           CCS      KMPAC                                 
042656,000049: 21,2072           12106                           TCF      DPADD+                                #  + OVERFLOW
042657,000050: 21,2073           12075                           TCF      +2                                    
042658,000051: 21,2074           12110                           TCF      DPADD-                                #  - OVERFLOW
042659,000052: 21,2075           11511                           CCS      KMPAC      +1                         
042660,000053: 21,2076           12113                           TCF      DPADD2+                               #  UPPER = 0, LOWER +
042661,000054: 21,2077           12101                           TCF      +2                                    
042662,000055: 21,2100           40000                           COM                                            #  UPPER = 0, LOWER -
042663,000056: 21,2101           65013                           AD       POSMAX                                #  LOWER = 0, A = 0
042664,000057: 21,2102           55511                           TS       KMPAC      +1                         #  CAN NOT OVERFLOW
042665,000058: 21,2103           35013                           CA       POSMAX                                #  UPPER WAS = 0
042666,000059: 21,2104           55510        TSK                TS       KMPAC                                 
042667,000060: 21,2105           00002                           TC       Q                                     
042668,000061: 
042669,000062: 21,2106           65015        DPADD+             AD       NEGMAX                                #  KMPAC GREATER THAN 0
042670,000063: 21,2107           12104                           TCF      TSK                                   
042671,000064: 
042672,000065: 21,2110           40000        DPADD-             COM                                            
042673,000066: 21,2111           65013                           AD       POSMAX                                #  KMPAC LESS THAN 0
042674,000067: 21,2112           12104                           TCF      TSK                                   
042675,000068: 
042676,000069: 21,2113           65015        DPADD2+            AD       NEGMAX                                #  CAN NOT OVERFLOW
042677,000070: 21,2114           55511                           TS       KMPAC      +1                         
042678,000071: 21,2115           35015                           CA       NEGMAX                                #  UPPER WAS = 0
042679,000072: 21,2116           12104                           TCF      TSK                                   

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