Source Code

These source-code files are part of a reconstructed copy of Comanche 051, the original release of the Apollo 11 Command Module (CM) Apollo Guidance Computer (AGC) software.

The reconstruction began with source code of Comanche 055 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes related to the R-2 lunar potential model, using hints from program comments and change-indicating asterisks in the Comanche 055 listing as a guide. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021153D. Note that page numbers in the reconstructed code match those on the Comanche 055 printout, although the added code would likely have changed page numbers for a real Comanche 051 listing.

Comments from 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.

043579,000002:                                                                                                  ## Copyright:   Public domain.
043580,000003:                                                                                                  ## Filename:    MYSUBS.agc
043581,000004:                                                                                                  ## Purpose:     A section of Comanche revision 051.
043582,000005:                                                                                                  ##              It is part of the reconstructed source code for the
043583,000006:                                                                                                  ##              original release of the flight software for the Command
043584,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 11.
043585,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
043586,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
043587,000010:                                                                                                  ##              exactly match those specified for Comanche 51 in NASA drawing
043588,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
043589,000012:                                                                                                  ##              reconstruction is correct.
043590,000013:                                                                                                  ## Reference:   pp. 999-1001
043591,000014:                                                                                                  ## Assembler:   yaYUL
043592,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
043593,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
043594,000017:                                                                                                  ## Mod history: 2019-07-30 MAS  Created from Comanche 55.
043595,000018: 

Page 999

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

Page 1000

043647,000070: 21,2076           40000        DPADD-             COM                                            
043648,000071: 21,2077           64777                           AD       POSMAX                                #  KMPAC LESS THAN 0
043649,000072: 21,2100           12072                           TCF      TSK                                   
043650,000073: 
043651,000074: 21,2101           65001        DPADD2+            AD       NEGMAX                                #  CAN NOT OVERFLOW
043652,000075: 21,2102           55511                           TS       KMPAC      +1                         
043653,000076: 21,2103           35001                           CA       NEGMAX                                #  UPPER WAS = 0
043654,000077: 21,2104           12072                           TCF      TSK                                   
043655,000078: 

Page 1001 This page is empty.

043658,000081: 
043659,000082: 

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