Source Code

These source-code files are part of a reconstructed copy of Comanche 72/3 (AKA Manche72 revision 3), the final, flown mission release of the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 13.

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

019238,000002:                                                                                                  ## Copyright:   Public domain.
019239,000003:                                                                                                  ## Filename:    GROUND_TRACKING_DETERMINATION_PROGRAM_-_P21.agc
019240,000004:                                                                                                  ## Purpose:     A section of Manche72 revision 3.
019241,000005:                                                                                                  ##              It is part of the reconstructed source code for the final, flown
019242,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
019243,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
019244,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
019245,000009:                                                                                                  ##              from a reconstructed copy of Comanche 072. It has been adapted
019246,000010:                                                                                                  ##              such that the resulting bugger words exactly match those
019247,000011:                                                                                                  ##              specified for Manche72 revision 3 in NASA drawing 2021153G,
019248,000012:                                                                                                  ##              which gives relatively high confidence that the reconstruction
019249,000013:                                                                                                  ##              is correct.
019250,000014:                                                                                                  ## Assembler:   yaYUL
019251,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
019252,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
019253,000017:                                                                                                  ## Mod history: 2024-05-19 MAS  Created from Comanche 072.
019254,000018: 
019255,000019:                                                                                                  #  GROUND TRACKING DETERMINATION PROGRAM P21
019256,000020: 
019257,000021:                                                                                                  #  PROGRAM DESCRIPTION
019258,000022:                                                                                                  #  MOD NO - 1
019259,000023:                                                                                                  #  MOD BY - N. M. NEVILLE
019260,000024:                                                                                                  #  FUNCTIONAL DECRIPTION-
019261,000025: 
019262,000026:                                                                                                  #  TO PROVIDE THE ASTRONAUT DETAILS OF THE LM OR CSM GROUND TRACK WITHOUT
019263,000027:                                                                                                  #  THE NEED FOR GROUND COMMUNICATION (REQUESTED BY DSKY).
019264,000028:                                                                                                  #  CALLING SEQUENCE-
019265,000029: 
019266,000030:                                                                                                  #  ASTRONAUT REQUEST THROUGH DSKY V37E21E
019267,000031:                                                                                                  #  SUBROUTINES CALLED-
019268,000032: 
019269,000033:                                                                                                  #  GOPERF4
019270,000034:                                                                                                  #  GOFLASH
019271,000035:                                                                                                  #  THISPREC
019272,000036:                                                                                                  #  OTHPREC
019273,000037:                                                                                                  #  LAT-LONG
019274,000038:                                                                                                  #  NORMAL EXIT MODES-
019275,000039: 
019276,000040:                                                                                                  #  ASTRONAUT REQUEST TROUGH DSKY TO TERMINATE PROGRAM V34E
019277,000041:                                                                                                  #  ALARM OR ABORT EXIT MODES-
019278,000042: 
019279,000043:                                                                                                  #  NONE
019280,000044:                                                                                                  #  OUTPUT-
019281,000045: 
019282,000046:                                                                                                  #  OCTAL DISPLAY OF OPTION CODE AND VEHICLE WHOSE GROUND TRACK IS TO BE
019283,000047:                                                                                                  #  COMPUTED
019284,000048:                                                                                                  #           OPTION CODE  00002
019285,000049:                                                                                                  #           THIS         00001
019286,000050:                                                                                                  #           OTHER                00002
019287,000051:                                                                                                  #  DECIMAL DISPLAY OF TIME TO BE INTEGRATED TO HOURS , MINUTES , SECONDS
019288,000052:                                                                                                  #  DECIMAL DISPLAY OF LAT,LONG,ALT
019289,000053:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
019290,000054: 
019291,000055:                                                                                                  #  AX0    2DEC   4.652459653 E-5   RADIANS       %68-69 CONSTANTS"
019292,000056: 
019293,000057:                                                                                                  #  -AY0   2DEC   2.147535898 E-5   RADIANS
019294,000058: 
019295,000059:                                                                                                  #  AZ0    2DEC   .7753206164       REVOLUTIONS
019296,000060:                                                                                                  #  FOR LUNAR ORBITS 504LM VECTOR IS NEEDED
019297,000061: 
019298,000062:                                                                                                  #  504LM  2DEC   -2.700340600 E-5  RADIANS
019299,000063: 
019300,000064:                                                                                                  #  504LM _2 2DEC -7.514128400 E-4  RADIANS
019301,000065: 
019302,000066:                                                                                                  #  504LM _4 2DEC _2.553198641 E-4  RADIANS
019303,000067: 
019304,000068:                                                                                                  #  NONE
019305,000069:                                                                                                  #  DEBRIS
019306,000070: 
019307,000071:                                                                                                  #  CENTRALS-A,Q,L
019308,000072:                                                                                                  #  OTHER-THOSE USED BY THE ABOVE LISTED SUBROUTINES
019309,000073:                                                                                                  #  SEE LEMPREC, LAT-LONG
019310,000074: 
019311,000075: 33,3776  30,2000                                  SBANK=   LOWSUPER                              #  FOR LOW 2CADR'S.
019312,000076: 
019313,000077: 33,3776                                           BANK     33                                    
019314,000078: 37,2000                                           SETLOC   P20S                                  
019315,000079: 37,2000                                           BANK                                           
019316,000080: 
019317,000081: 37,2001  E4,1715                                  EBANK=   P21TIME                               
019318,000082: 37,2001                                           COUNT    24/P21                                
019319,000083: 
019320,000084: 37,2001           35033        PROG21             CAF      ONE                                   
019321,000085: 37,2002           55132                           TS       OPTION2                               #  ASSUMED VEHICLE IS LM, R2 = 00001
019322,000086: 37,2003           35032                           CAF      BIT2                                  #   OPTION 2
019323,000087: 37,2004           04676                           TC       BANKCALL                              
019324,000088: 37,2005           21055                           CADR     GOPERF4                               
019325,000089: 37,2006           04106                           TC       GOTOPOOH                              #  TERMINATE
019326,000090: 37,2007           02011                           TC       +2                                    #  PROCEED VALUE OF ASSUMED VEHICLE OK
019327,000091: 37,2010           02003                           TC       -5                                    #  R2 LOADED THROUGH DSKY
019328,000092: 37,2011           32157                           CAF      P21ONENN   +1                         #  ZERO DSPTEM
019329,000093: 37,2012           55045                           TS       DSPTEM1                               
019330,000094: 37,2013           55046                           TS       DSPTEM1    +1                         
019331,000095: 37,2014           32161        P21PROG1           CAF      V6N34                                 #  LOAD DESIRED TIME OF LAT-LONG.
019332,000096: 37,2015           04676                           TC       BANKCALL                              
019333,000097: 37,2016           20720                           CADR     GOFLASH                               
019334,000098: 37,2017           04106                           TC       GOTOPOOH                              #  TERM
019335,000099: 37,2020           02022                           TC       +2                                    #  PROCEED VALUES OK
019336,000100: 37,2021           02014                           TC       -5                                    #  TIME LOADED THROUGH DSKY
019337,000101: 37,2022           06006                           TC       INTPRET                               
019338,000102: 37,2023           53145                           DLOAD    BZE                                   
019339,000103: 37,2024           01046                                    DSPTEM1                               
019340,000104: 37,2025           76151                                    P21PRTM                               #  SET TO INTEG TO PRES TIME
019341,000105: 37,2026           34041        P21PROG2           STCALL   TDEC1                                 #  INTEG TO TIME SPECIFIED IN TDEC
019342,000106: 37,2027           27446                                    INTSTALL                              
019343,000107: 37,2030           43014                           BON      SET                                   
019344,000108: 37,2031           01303                                    P21FLAG                               
019345,000109: 37,2032           76050                                    P21CONT                               #  ON...RECYCLE USING BASE VECTOR
019346,000110: 37,2033           01474                                    VINTFLAG                              #  OFF..1ST PASS CALC BASE VECTOR
019347,000111: 37,2034           70535                           SLOAD    SR1                                   
019348,000112: 37,2035           01133                                    OPTION2                               
019349,000113: 37,2036           43030                           BHIZ     CLEAR                                 
019350,000114: 37,2037           76041                                    +2                                    #  ZERO..THIS VEHICLE (CM)
019351,000115: 37,2040           01674                                    VINTFLAG                              #  ONE...OTHER VEHICLE(LM)
019352,000116: 37,2041           43014                           CLEAR    CLEAR                                 
019353,000117: 37,2042           01676                                    DIM0FLAG                              
019354,000118: 37,2043           01673                                    INTYPFLG                              #  PRECISION
019355,000119: 37,2044           77624                           CALL                                           
019356,000120: 37,2045           27171                                    INTEGRV                               #  CALCULATE
019357,000121: 37,2046           77650                           GOTO                                           #  .AND
019358,000122: 37,2047           76071                                    P21VSAVE                              #  ..SAVE BASE VECTOR
019359,000123: 37,2050           77775        P21CONT            VLOAD                                          #  RECYCLE..INTEG FROM BASE VECTOR                       
019360,000124: 37,2051           03605                                    P21BASER                              
019361,000125: 37,2052           25535                           STOVL    RCV                                   #  ..POS
019362,000126: 37,2053           03613                                    P21BASEV                              
019363,000127: 37,2054           15543                           STODL    VCV                                   #  ..VEL
019364,000128: 37,2055           02316                                    P21TIME                               
019365,000129: 37,2056           01517                           STORE    TET                                   #  ..TIME
019366,000130: 37,2057           43014                           CLEAR    CLEAR                                 
019367,000131: 37,2060           01676                                    DIM0FLAG                              
019368,000132: 37,2061           00263                                    MOONFLAG                              
019369,000133: 37,2062           53135                           SLOAD    BZE                                   
019370,000134: 37,2063           03604                                    P21ORIG                               
019371,000135: 37,2064           76067                                    +3                                    #  ZERO = EARTH
019372,000136: 37,2065           77614                           SET                                            #  ...2 = MOON
019373,000137: 37,2066           00063                                    MOONFLAG                              
019374,000138: 37,2067           77624                           CALL                                           
019375,000139: 37,2070           27144                                    INTEGRVS                              
019376,000140: 37,2071           77745        P21VSAVE           DLOAD                                          #  SAVE CURRENT BASE VECTOR
019377,000141: 37,2072           00015                                    TAT                                   
019378,000142: 37,2073           26316                           STOVL    P21TIME                               #  ..TIME
019379,000143: 37,2074           00017                                    RATT1                                 
019380,000144: 37,2075           27605                           STOVL    P21BASER                              #  ..POS B-29 OR B-27
019381,000145: 37,2076           00025                                    VATT1                                 
019382,000146: 37,2077           03613                           STORE    P21BASEV                              #  ..VEL B-7  OR B-5
019383,000147: 37,2100           53646                           ABVAL    SL*                                   
019384,000148: 37,2101           57576                                    0,2                                   
019385,000149: 37,2102           27623                           STOVL    P21VEL                                #  /VEL/ FOR N73 DSP
019386,000150: 37,2103           00001                                    RATT                                  
019387,000151: 37,2104           50256                           UNIT     DOT                                   
019388,000152: 37,2105           00007                                    VATT                                  #  U(R).(V)
019389,000153: 37,2106           67471                           DDV      ASIN                                  #  U(R).U(V)
019390,000154: 37,2107           03623                                    P21VEL                                
019391,000155: 37,2110           03625                           STORE    P21GAM                                #  SIN-1 U(R).U(V), -90 TO +90
019392,000156: 37,2111           43134                           SXA,2    SET                                   
019393,000157: 37,2112           03603                                    P21ORIG                               #  0 = EARTH  2 = MOON
019394,000158: 37,2113           01063                                    P21FLAG                               
019395,000159: 37,2114           67214        P21DSP             CLEAR    SLOAD                                 #  GENERATE DISPLAY DATA
019396,000160: 37,2115           01663                                    LUNAFLAG                              
019397,000161: 37,2116           00050                                    X2                                    
019398,000162: 37,2117           43054                           BZE      SET                                   
019399,000163: 37,2120           76122                                    +2                                    #  0 = EARTH
019400,000164: 37,2121           01463                                    LUNAFLAG                              
019401,000165: 37,2122           77775                           VLOAD                                          
019402,000166: 37,2123           00001                                    RATT                                  
019403,000167: 37,2124           16152                           STODL    ALPHAV                                
019404,000168: 37,2125           00015                                    TAT                                   
019405,000169: 37,2126           45014                           CLEAR    CALL                                  
019406,000170: 37,2127           00662                                    ERADFLAG                              
019407,000171: 37,2130           26376                                    LAT-LONG                              
019408,000172: 37,2131           77605                           DMP                                            #  MPAC = ALT, METERS B-29
019409,000173: 37,2132           36163                                    K.01                                  
019410,000174: 37,2133           03621                           STORE    P21ALT                                #  ALT/100 FOR N73 DSP
019411,000175: 37,2134           77776                           EXIT                                           
019412,000176: 37,2135           32160                           CAF      V06N43                                #  DISPLAY LAT,LONG,ALT
019413,000177: 37,2136           04676                           TC       BANKCALL                              #  LAT,LONG = REVS B0 BOTH EARTH/MOON
019414,000178: 37,2137           20720                           CADR     GOFLASH                               #  ALT = METERS B-29  BOTH EARTH/MOON
019415,000179: 37,2140           04106                           TC       GOTOPOOH                              #  TERM
019416,000180: 37,2141           04106                           TC       GOTOPOOH                              
019417,000181: 37,2142           06006                           TC       INTPRET                               #  V32E RECYCLE
019418,000182: 37,2143           43345                           DLOAD    DAD                                   
019419,000183: 37,2144           02316                                    P21TIME                               
019420,000184: 37,2145           36155                                    600SEC                                #  600 SECONDS OR 10 MIN
019421,000185: 37,2146           01046                           STORE    DSPTEM1                               
019422,000186: 37,2147           77634                           RTB                                            
019423,000187: 37,2150           76014                                    P21PROG1                              
019424,000188: 37,2151           52034        P21PRTM            RTB      GOTO                                  
019425,000189: 37,2152           45510                                    LOADTIME                              
019426,000190: 37,2153           76026                                    P21PROG2                              
019427,000191: 37,2154           00003 25140  600SEC             2DEC     60000      B-28                       #  10 MIN
019428,000192: 
019429,000193: 37,2156           00001        P21ONENN           OCT      00001                                 #  NEEDED TO DETERMINE VEHICLE
019430,000194: 37,2157           00000                           OCT      00000                                 #  TO BE INTEGRATED
019431,000195: 37,2160           01453        V06N43             VN       00643                                 
019432,000196: 37,2161           01442        V6N34              VN       00634                                 
019433,000197: 37,2162           00243 32703  K.01               2DEC     .01                                   
019434,000198: 

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