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.

019096,000002:                                                                                                  ## Copyright:   Public domain.
019097,000003:                                                                                                  ## Filename:    GROUND_TRACKING_DETERMINATION_PROGRAM_-_P21.agc
019098,000004:                                                                                                  ## Purpose:     A section of Comanche revision 067.
019099,000005:                                                                                                  ##              It is part of the reconstructed source code for the flight
019100,000006:                                                                                                  ##              software for the Command Module's (CM) Apollo Guidance Computer
019101,000007:                                                                                                  ##              (AGC) for Apollo 12. No original listings of this program are
019102,000008:                                                                                                  ##              available; instead, this file was created via dissassembly of
019103,000009:                                                                                                  ##              dumps of Comanche 067 core rope modules and comparison with
019104,000010:                                                                                                  ##              other AGC programs.
019105,000011:                                                                                                  ## Assembler:   yaYUL
019106,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
019107,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
019108,000014:                                                                                                  ## Mod history: 2023-08-16 MAS  Created from Comanche 055.
019109,000015:                                                                                                  ##              2024-05-13 MAS  Updated for Comanche 067.
019110,000016: 
019111,000017:                                                                                                  #  GROUND TRACKING DETERMINATION PROGRAM P21
019112,000018: 
019113,000019:                                                                                                  #  PROGRAM DESCRIPTION
019114,000020:                                                                                                  #  MOD NO - 1
019115,000021:                                                                                                  #  MOD BY - N. M. NEVILLE
019116,000022:                                                                                                  #  FUNCTIONAL DECRIPTION-
019117,000023: 
019118,000024:                                                                                                  #  TO PROVIDE THE ASTRONAUT DETAILS OF THE LM OR CSM GROUND TRACK WITHOUT
019119,000025:                                                                                                  #  THE NEED FOR GROUND COMMUNICATION (REQUESTED BY DSKY).
019120,000026:                                                                                                  #  CALLING SEQUENCE-
019121,000027: 
019122,000028:                                                                                                  #  ASTRONAUT REQUEST THROUGH DSKY V37E21E
019123,000029:                                                                                                  #  SUBROUTINES CALLED-
019124,000030: 
019125,000031:                                                                                                  #  GOPERF4
019126,000032:                                                                                                  #  GOFLASH
019127,000033:                                                                                                  #  THISPREC
019128,000034:                                                                                                  #  OTHPREC
019129,000035:                                                                                                  #  LAT-LONG
019130,000036:                                                                                                  #  NORMAL EXIT MODES-
019131,000037: 
019132,000038:                                                                                                  #  ASTRONAUT REQUEST TROUGH DSKY TO TERMINATE PROGRAM V34E
019133,000039:                                                                                                  #  ALARM OR ABORT EXIT MODES-
019134,000040: 
019135,000041:                                                                                                  #  NONE
019136,000042:                                                                                                  #  OUTPUT-
019137,000043: 
019138,000044:                                                                                                  #  OCTAL DISPLAY OF OPTION CODE AND VEHICLE WHOSE GROUND TRACK IS TO BE
019139,000045:                                                                                                  #  COMPUTED
019140,000046:                                                                                                  #           OPTION CODE  00002
019141,000047:                                                                                                  #           THIS         00001
019142,000048:                                                                                                  #           OTHER                00002
019143,000049:                                                                                                  #  DECIMAL DISPLAY OF TIME TO BE INTEGRATED TO HOURS , MINUTES , SECONDS
019144,000050:                                                                                                  #  DECIMAL DISPLAY OF LAT,LONG,ALT
019145,000051:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
019146,000052: 
019147,000053:                                                                                                  #  AX0    2DEC   4.652459653 E-5   RADIANS       %68-69 CONSTANTS"
019148,000054: 
019149,000055:                                                                                                  #  -AY0   2DEC   2.147535898 E-5   RADIANS
019150,000056: 
019151,000057:                                                                                                  #  AZ0    2DEC   .7753206164       REVOLUTIONS
019152,000058:                                                                                                  #  FOR LUNAR ORBITS 504LM VECTOR IS NEEDED
019153,000059: 
019154,000060:                                                                                                  #  504LM  2DEC   -2.700340600 E-5  RADIANS
019155,000061: 
019156,000062:                                                                                                  #  504LM _2 2DEC -7.514128400 E-4  RADIANS
019157,000063: 
019158,000064:                                                                                                  #  504LM _4 2DEC _2.553198641 E-4  RADIANS
019159,000065: 
019160,000066:                                                                                                  #  NONE
019161,000067:                                                                                                  #  DEBRIS
019162,000068: 
019163,000069:                                                                                                  #  CENTRALS-A,Q,L
019164,000070:                                                                                                  #  OTHER-THOSE USED BY THE ABOVE LISTED SUBROUTINES
019165,000071:                                                                                                  #  SEE LEMPREC, LAT-LONG
019166,000072: 
019167,000073: 33,3776  30,2000                                  SBANK=   LOWSUPER                              #  FOR LOW 2CADR'S.
019168,000074: 
019169,000075: 33,3776                                           BANK     33                                    
019170,000076: 37,2000                                           SETLOC   P20S                                  
019171,000077: 37,2000                                           BANK                                           
019172,000078: 
019173,000079: 37,2001  E4,1715                                  EBANK=   P21TIME                               
019174,000080: 37,2001                                           COUNT    24/P21                                
019175,000081: 
019176,000082: 37,2001           35033        PROG21             CAF      ONE                                   
019177,000083: 37,2002           55132                           TS       OPTION2                               #  ASSUMED VEHICLE IS LM, R2 = 00001
019178,000084: 37,2003           35032                           CAF      BIT2                                  #   OPTION 2
019179,000085: 37,2004           04676                           TC       BANKCALL                              
019180,000086: 37,2005           21055                           CADR     GOPERF4                               
019181,000087: 37,2006           04106                           TC       GOTOPOOH                              #  TERMINATE
019182,000088: 37,2007           02011                           TC       +2                                    #  PROCEED VALUE OF ASSUMED VEHICLE OK
019183,000089: 37,2010           02003                           TC       -5                                    #  R2 LOADED THROUGH DSKY
019184,000090: 37,2011           32157                           CAF      P21ONENN   +1                         #  ZERO DSPTEM
019185,000091: 37,2012           55045                           TS       DSPTEM1                               
019186,000092: 37,2013           55046                           TS       DSPTEM1    +1                         
019187,000093: 37,2014           32161        P21PROG1           CAF      V6N34                                 #  LOAD DESIRED TIME OF LAT-LONG.
019188,000094: 37,2015           04676                           TC       BANKCALL                              
019189,000095: 37,2016           20720                           CADR     GOFLASH                               
019190,000096: 37,2017           04106                           TC       GOTOPOOH                              #  TERM
019191,000097: 37,2020           02022                           TC       +2                                    #  PROCEED VALUES OK
019192,000098: 37,2021           02014                           TC       -5                                    #  TIME LOADED THROUGH DSKY
019193,000099: 37,2022           06006                           TC       INTPRET                               
019194,000100: 37,2023           53145                           DLOAD    BZE                                   
019195,000101: 37,2024           01046                                    DSPTEM1                               
019196,000102: 37,2025           76151                                    P21PRTM                               #  SET TO INTEG TO PRES TIME
019197,000103: 37,2026           34041        P21PROG2           STCALL   TDEC1                                 #  INTEG TO TIME SPECIFIED IN TDEC
019198,000104: 37,2027           27452                                    INTSTALL                              
019199,000105: 37,2030           43014                           BON      SET                                   
019200,000106: 37,2031           01303                                    P21FLAG                               
019201,000107: 37,2032           76050                                    P21CONT                               #  ON...RECYCLE USING BASE VECTOR
019202,000108: 37,2033           01474                                    VINTFLAG                              #  OFF..1ST PASS CALC BASE VECTOR
019203,000109: 37,2034           70535                           SLOAD    SR1                                   
019204,000110: 37,2035           01133                                    OPTION2                               
019205,000111: 37,2036           43030                           BHIZ     CLEAR                                 
019206,000112: 37,2037           76041                                    +2                                    #  ZERO..THIS VEHICLE (CM)
019207,000113: 37,2040           01674                                    VINTFLAG                              #  ONE...OTHER VEHICLE(LM)
019208,000114: 37,2041           43014                           CLEAR    CLEAR                                 
019209,000115: 37,2042           01676                                    DIM0FLAG                              
019210,000116: 37,2043           01673                                    INTYPFLG                              #  PRECISION
019211,000117: 37,2044           77624                           CALL                                           
019212,000118: 37,2045           27172                                    INTEGRV                               #  CALCULATE
019213,000119: 37,2046           77650                           GOTO                                           #  .AND
019214,000120: 37,2047           76071                                    P21VSAVE                              #  ..SAVE BASE VECTOR
019215,000121: 37,2050           77775        P21CONT            VLOAD                                          #  RECYCLE..INTEG FROM BASE VECTOR                       
019216,000122: 37,2051           03605                                    P21BASER                              
019217,000123: 37,2052           25535                           STOVL    RCV                                   #  ..POS
019218,000124: 37,2053           03613                                    P21BASEV                              
019219,000125: 37,2054           15543                           STODL    VCV                                   #  ..VEL
019220,000126: 37,2055           02316                                    P21TIME                               
019221,000127: 37,2056           01517                           STORE    TET                                   #  ..TIME
019222,000128: 37,2057           43014                           CLEAR    CLEAR                                 
019223,000129: 37,2060           01676                                    DIM0FLAG                              
019224,000130: 37,2061           00263                                    MOONFLAG                              
019225,000131: 37,2062           53135                           SLOAD    BZE                                   
019226,000132: 37,2063           03604                                    P21ORIG                               
019227,000133: 37,2064           76067                                    +3                                    #  ZERO = EARTH
019228,000134: 37,2065           77614                           SET                                            #  ...2 = MOON
019229,000135: 37,2066           00063                                    MOONFLAG                              
019230,000136: 37,2067           77624                           CALL                                           
019231,000137: 37,2070           27145                                    INTEGRVS                              
019232,000138: 37,2071           77745        P21VSAVE           DLOAD                                          #  SAVE CURRENT BASE VECTOR
019233,000139: 37,2072           00015                                    TAT                                   
019234,000140: 37,2073           26316                           STOVL    P21TIME                               #  ..TIME
019235,000141: 37,2074           00017                                    RATT1                                 
019236,000142: 37,2075           27605                           STOVL    P21BASER                              #  ..POS B-29 OR B-27
019237,000143: 37,2076           00025                                    VATT1                                 
019238,000144: 37,2077           03613                           STORE    P21BASEV                              #  ..VEL B-7  OR B-5
019239,000145: 37,2100           53646                           ABVAL    SL*                                   
019240,000146: 37,2101           57576                                    0,2                                   
019241,000147: 37,2102           27623                           STOVL    P21VEL                                #  /VEL/ FOR N73 DSP
019242,000148: 37,2103           00001                                    RATT                                  
019243,000149: 37,2104           50256                           UNIT     DOT                                   
019244,000150: 37,2105           00007                                    VATT                                  #  U(R).(V)
019245,000151: 37,2106           67471                           DDV      ASIN                                  #  U(R).U(V)
019246,000152: 37,2107           03623                                    P21VEL                                
019247,000153: 37,2110           03625                           STORE    P21GAM                                #  SIN-1 U(R).U(V), -90 TO +90
019248,000154: 37,2111           43134                           SXA,2    SET                                   
019249,000155: 37,2112           03603                                    P21ORIG                               #  0 = EARTH  2 = MOON
019250,000156: 37,2113           01063                                    P21FLAG                               
019251,000157: 37,2114           67214        P21DSP             CLEAR    SLOAD                                 #  GENERATE DISPLAY DATA
019252,000158: 37,2115           01663                                    LUNAFLAG                              
019253,000159: 37,2116           00050                                    X2                                    
019254,000160: 37,2117           43054                           BZE      SET                                   
019255,000161: 37,2120           76122                                    +2                                    #  0 = EARTH
019256,000162: 37,2121           01463                                    LUNAFLAG                              
019257,000163: 37,2122           77775                           VLOAD                                          
019258,000164: 37,2123           00001                                    RATT                                  
019259,000165: 37,2124           16152                           STODL    ALPHAV                                
019260,000166: 37,2125           00015                                    TAT                                   
019261,000167: 37,2126           45014                           CLEAR    CALL                                  
019262,000168: 37,2127           00662                                    ERADFLAG                              
019263,000169: 37,2130           26400                                    LAT-LONG                              
019264,000170: 37,2131           77605                           DMP                                            #  MPAC = ALT, METERS B-29
019265,000171: 37,2132           36163                                    K.01                                  
019266,000172: 37,2133           03621                           STORE    P21ALT                                #  ALT/100 FOR N73 DSP
019267,000173: 37,2134           77776                           EXIT                                           
019268,000174: 37,2135           32160                           CAF      V06N43                                #  DISPLAY LAT,LONG,ALT
019269,000175: 37,2136           04676                           TC       BANKCALL                              #  LAT,LONG = REVS B0 BOTH EARTH/MOON
019270,000176: 37,2137           20720                           CADR     GOFLASH                               #  ALT = METERS B-29  BOTH EARTH/MOON
019271,000177: 37,2140           04106                           TC       GOTOPOOH                              #  TERM
019272,000178: 37,2141           04106                           TC       GOTOPOOH                              
019273,000179: 37,2142           06006                           TC       INTPRET                               #  V32E RECYCLE
019274,000180: 37,2143           43345                           DLOAD    DAD                                   
019275,000181: 37,2144           02316                                    P21TIME                               
019276,000182: 37,2145           36155                                    600SEC                                #  600 SECONDS OR 10 MIN
019277,000183: 37,2146           01046                           STORE    DSPTEM1                               
019278,000184: 37,2147           77634                           RTB                                            
019279,000185: 37,2150           76014                                    P21PROG1                              
019280,000186: 37,2151           52034        P21PRTM            RTB      GOTO                                  
019281,000187: 37,2152           45510                                    LOADTIME                              
019282,000188: 37,2153           76026                                    P21PROG2                              
019283,000189: 37,2154           00003 25140  600SEC             2DEC     60000      B-28                       #  10 MIN
019284,000190: 
019285,000191: 37,2156           00001        P21ONENN           OCT      00001                                 #  NEEDED TO DETERMINE VEHICLE
019286,000192: 37,2157           00000                           OCT      00000                                 #  TO BE INTEGRATED
019287,000193: 37,2160           01453        V06N43             VN       00643                                 
019288,000194: 37,2161           01442        V6N34              VN       00634                                 
019289,000195: 37,2162           00243 32703  K.01               2DEC     .01                                   
019290,000196: 

End of include-file GROUND_TRACKING_DETERMINATION_PROGRAM_-_P21.agc.  Parent file is MAIN.agc