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. |
021406,000002: ## Copyright: Public domain.
021407,000003: ## Filename: P76.agc
021408,000004: ## Purpose: A section of Manche72 revision 3.
021409,000005: ## It is part of the reconstructed source code for the final, flown
021410,000006: ## release of the software for the Command Module's (CM) Apollo
021411,000007: ## Guidance Computer (AGC) for Apollo 13. No original listings
021412,000008: ## of this program are available; instead, this file was recreated
021413,000009: ## from a reconstructed copy of Comanche 072. It has been adapted
021414,000010: ## such that the resulting bugger words exactly match those
021415,000011: ## specified for Manche72 revision 3 in NASA drawing 2021153G,
021416,000012: ## which gives relatively high confidence that the reconstruction
021417,000013: ## is correct.
021418,000014: ## Assembler: yaYUL
021419,000015: ## Contact: Ron Burkey <info@sandroid.org>.
021420,000016: ## Website: www.ibiblio.org/apollo/index.html
021421,000017: ## Mod history: 2024-05-19 MAS Created from Comanche 072.
021422,000018:
021423,000019: # 1) PROGRAM NAME - TARGET DELTA V PROGRAM (P76).
021424,000020: # 2) FUNCTIONAL DESCRIPTION - UPON ENTRY BY ASTRONAUT ACTION, P76 FLASHES DSKY REQUESTS TO THE ASTRONAUT
021425,000021: # TO PROVIDE VIA DSKY (1) THE DELTA V TO BE APPLIED TO THE OTHER VEHICLE STATE VECTOR AND (2) THE
021426,000022: # TIME (TIG) AT WHICH THE OTHER VEHICLE VELOCITY WAS CHANGED BY EXECUTION OF A THRUSTING MANEUVER. THE
021427,000023: # OTHER VEHICLE STATE VECTOR IS INTEGRATED TO TIG AND UPDATED BY THE ADDITION OF DELTA V (DELTA V HAVING
021428,000024: # BEEN TRANSFORMED FROM LV TO REF COSYS). USING INTEGRVS, THE PROGRAM THEN INTEGRATES THE OTHER
021429,000025: # VEHICLE STATE VECTOR TO THE STATE VECTOR OF THIS VEHICLE, THUS INSURING THAT THE W-MATRIX AND BOTH VEHICLE
021430,000026: # STATES CORRESPOND TO THE SAME TIME.
021431,000027: # 3) ERASABLE INITIALIZATION REQUIRED - NONE.
021432,000028: # 4) CALLING SEQUENCES AND EXIT MODES - CALLED BY ASTRONAUT REQUEST THRU DSKY V 37 E 76E.
021433,000029: # EXITS BY TCF ENDOFJOB.
021434,000030: # 5) OUTPUT - OTHER VEHICLE STATE VECTOR INTEGRATED TO TIG AND INCREMENTED BY DELTA V IN REF COSYS.
021435,000031: # THE PUSHLIST CONTAINS THE MATRIX BY WHICH THE INPUT DELTA V MUST BE POST-MULTIPLIED TO CONVERT FROM LV
021436,000032: # TO REF COSYS.
021437,000033: # 6) DEBRIS - OTHER VEHICLE STATE VECTOR.
021438,000034: # 7) SUBROUTINES CALLED - BANKCALL, GOXDSPF, CSMPREC (OR LEMPREC), ATOPCSM (OR ATOPLEM), INTSTALL, INTWAKE, PHASCHNG
021439,000035: # INTPRET, INTEGRVS, AND MINIRECT.
021440,000036: # 8) FLAG USE - MOONFLAG, CMOONFLAG, INTYPFLG, RASFLAG, AND MARKCTR.
021441,000037:
021442,000038: 30,2000 BANK 30
021443,000039: 13,2000 SETLOC P76LOC
021444,000040: 13,2000 BANK
021445,000041:
021446,000042: 13,2071 COUNT* $$/P76
021447,000043:
021448,000044: 13,2071 E7,1412 EBANK= TIG
021449,000045:
021450,000046: 13,2071 05562 P76 TC UPFLAG
021451,000047: 13,2072 00031 ADRES TRACKFLG
021452,000048:
021453,000049: 13,2073 32217 CAF V06N84 +1 # FLASH VERB 06 NOUN 33, DISPLAY LAST TIG,
021454,000050: 13,2074 04676 TC BANKCALL # AND WAIT FOR KEYBOARD ACTION.
021455,000051: 13,2075 20720 CADR GOFLASH
021456,000052: 13,2076 12210 TCF ENDP76
021457,000053: 13,2077 02101 TC +2 # PROCEED
021458,000054: 13,2100 02073 TC -5 # STORE DATA AND REPEAT FLASHING
021459,000055: 13,2101 32216 CAF V06N84 # FLASH LAST DELTA V,
021460,000056: 13,2102 04676 TC BANKCALL # AND WAIT FOR KEYBOARD ACTION.
021461,000057: 13,2103 20720 CADR GOFLASH
021462,000058: 13,2104 12210 TCF ENDP76
021463,000059: 13,2105 02107 TC +2
021464,000060: 13,2106 02101 TC -5
021465,000061: 13,2107 06006 TC INTPRET # RETURN TO INTERPRETIVE CODE
Reconstruction: The setting of NODOFLAG here was added to Comanche 72 as part of PCR-863.1, "Make P76 set NODO flag". |
021468,000064: 13,2110 43145 DLOAD SET # SET D(MPAC)=TIG IN CSEC B28
021469,000065: 13,2111 03413 TIG
021470,000066: 13,2112 01076 NODOFLAG # DISALLOW V37
021471,000067: 13,2113 34041 STCALL TDEC1 # SET TDEC1=TIG FOR ORBITAL INTEGRATION
021472,000068: 13,2114 27114 OTHPREC
021473,000069: 13,2115 53575 COMPMAT VLOAD UNIT
021474,000070: 13,2116 00001 RATT
021475,000071: 13,2117 77676 VCOMP # U(-R)
021476,000072: 13,2120 00031 STORE 24D # U(-R) TO 24D
021477,000073: 13,2121 53435 VXV UNIT # U(-R) X V = U(V X R)
021478,000074: 13,2122 00007 VATT
021479,000075: 13,2123 00023 STORE 18D
021480,000076: 13,2124 53435 VXV UNIT # U(V X R) X U(-R) = U((R X V) X R)
021481,000077: 13,2125 00031 24D
021482,000078: 13,2126 24015 STOVL 12D
021483,000079: 13,2127 03540 DELVOV
021484,000080: 13,2130 76505 VXM VSL1 # V(MPAC)=DELTA V IN REFCOSYS
021485,000081: 13,2131 00015 12D
021486,000082: 13,2132 77655 VAD
021487,000083: 13,2133 00007 VATT
021488,000084: 13,2134 00007 STORE 6 # V(PD6)=VATT + DELTA V
021489,000085: 13,2135 77624 CALL # PREVENT WOULD-BE USER OF ORBITAL
021490,000086: 13,2136 27446 INTSTALL # INTEG FROM INTERFERING WITH UPDATING
021491,000087: 13,2137 77624 CALL
021492,000088: 13,2140 26220 P76SUB1
021493,000089: 13,2141 53775 VLOAD VSR*
021494,000090: 13,2142 00007 6
021495,000091: 13,2143 57176 0,2
021496,000092: 13,2144 25543 STOVL VCV
021497,000093: 13,2145 00001 RATT
021498,000094: 13,2146 77657 VSR*
021499,000095: 13,2147 57176 0,2
021500,000096: 13,2150 15535 STODL RCV
021501,000097: 13,2151 03413 TIG
021502,000098: 13,2152 01517 STORE TET
021503,000099: 13,2153 71214 CLEAR DLOAD
021504,000100: 13,2154 01673 INTYPFLG
021505,000101: 13,2155 01571 TETTHIS
021506,000102: 13,2156 34041 INTOTHIS STCALL TDEC1
021507,000103: 13,2157 27144 INTEGRVS
021508,000104: 13,2160 77624 CALL
021509,000105: 13,2161 27446 INTSTALL
021510,000106: 13,2162 77624 CALL
021511,000107: 13,2163 26220 P76SUB1 # SET/CLEAR MOONFLAG
021512,000108: 13,2164 77775 VLOAD
021513,000109: 13,2165 00017 RATT1
021514,000110: 13,2166 01503 STORE RRECT
021515,000111: 13,2167 15535 STODL RCV
021516,000112: 13,2170 00015 TAT
021517,000113: 13,2171 25517 STOVL TET
021518,000114: 13,2172 00025 VATT1
021519,000115: 13,2173 77624 CALL
021520,000116: 13,2174 23417 MINIRECT
021521,000117: 13,2175 77776 EXIT
021522,000118: 13,2176 05426 TC PHASCHNG
021523,000119: 13,2177 04024 OCT 04024
Reconstruction: The code below, down to ENDP76, was rewritten for Comanche 72 as part of PCR-863.1, "Make P76 set NODO flag". The setting of REINTFLG was moved from basic to interpretive, the basic call to INTWAKE1 was changed to an interpretive call to INTWAKE0, and OUT was changed to clear NODOFLAG. |
021529,000125: 13,2200 06006 TC INTPRET
021530,000126: 13,2201 45014 SET CALL
021531,000127: 13,2202 05070 REINTFLG
021532,000128: 13,2203 26767 ATOPOTH
021533,000129: 13,2204 77624 CALL
021534,000130: 13,2205 27461 INTWAKE0 # PERMIT USE OF ORBITAL INTEGRATION
021535,000131: 13,2206 77414 OUT CLEAR EXIT # ALLOW V37, NO NEED TO CLEAR NODOFLAG AT
021536,000132: 13,2207 01276 NODOFLAG # ENDP76 SINCE FLAG NOT SET WHEN DISPLAY
021537,000133: # RESPONSES TRANSFER THERE FROM P76+.
021538,000134: 13,2210 35035 ENDP76 CAF ZERO
021539,000135: 13,2211 55126 TS MARKCTR # CLEAR RR TRACKING MARK COUNTER
021540,000136: 13,2212 55125 TS VHFCNT
021541,000137:
021542,000138: 13,2213 37716 CAF NEGONE
021543,000139: 13,2214 55734 TS MRKBUF2 # INVALIDATE MARK BUFFER
021544,000140:
021545,000141: 13,2215 14106 TCF GOTOPOOH
021546,000142:
021547,000143: 13,2216 01524 V06N84 NV 0684
021548,000144: 13,2217 01441 NV 0633
021549,000145: 13,2220 67214 P76SUB1 CLEAR SLOAD
021550,000146: 13,2221 00263 MOONFLAG
021551,000147: 13,2222 00050 X2
021552,000148: 13,2223 43030 BHIZ SET # X2=0...CLEAR MOONFLAG
021553,000149: 13,2224 26226 +2 # =2.....SET MOONFLAG
021554,000150: 13,2225 00063 MOONFLAG
021555,000151: 13,2226 77616 RVQ
021556,000152:
End of include-file P76.agc. Parent file is MAIN.agc