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