Source Code
![]() |
This source code is very close to the Apollo Guidance Computer software for the
Apollo 13 Lunar module. This revision of the Luminary 131 program is from December
of 1969, whereas there was a later revision in January of 1970, and still another
revision in February, which is the code that flew on the mission.
As far as this transcription is concerned, it was originally from a copy made in 1991 of
a printout from the collection of AGC developer Don Eyles for collector David Craig.
It was subsequently scanned by Gary Neff, reprocessed for online
presentation at the now-discontinued History of Recent Science and Technology (HRST) website
of MIT's Dibner Institute (the full-quality scans being discarded in the process),
and finally transcribed by Ron Burkey for the Virtual AGC Project. Although a
high-quality replacement scan for a completely illegible page was later provided by Gary
Neff, the reduced legibility of the reprocessed HRST posting nevertheless caused many
errors to be introduced into the transcription. Accordingly, a second scan of the same physical
printout was made in 2017 for the Virtual AGC Project's collection at the Internet Archive,
and used to correct the transcription errors. All of the scanned materials mentioned,
as well as other Luminary 131 related material, are available online.
Don Eyles apprently made additional hand-written notes in printout between 1991 and 2017,
so the two scans are not identical in that respect. The page-headings in the printout read, in part:GAP: ASSEMBLE REVISION 131 OF AGC PROGRAM LUMINARY BY NASA 2021112-091 17:53 DEC. 19, 1969Note that the date is the date the printout was made, not the date on which the program revision was released, although these happen to be very close together. |
030009,000002: ## Copyright: Public domain.
030010,000003: ## Filename: P76.agc
030011,000004: ## Purpose: A section of Luminary 1C, revision 131.
030012,000005: ## It is part of the source code for the Lunar Module's (LM)
030013,000006: ## Apollo Guidance Computer (AGC) for Apollo 13.
030014,000007: ## This file is intended to be a faithful transcription, except
030015,000008: ## that the code format has been changed to conform to the
030016,000009: ## requirements of the yaYUL assembler rather than the
030017,000010: ## original YUL assembler.
030018,000011: ## Reference: pp. 711-713
030019,000012: ## Contact: Ron Burkey <info@sandroid.org>.
030020,000013: ## Website: www.ibiblio.org/apollo
030021,000014: ## Mod history: 05/24/03 RSB. Began transcribing.
030022,000015: ## 2017-01-06 RSB Page numbers now agree with those on the
030023,000016: ## original harcopy, as opposed to the PDF page
030024,000017: ## numbers in 1701.pdf.
030025,000018: ## 2017-02-24 RSB Proofed comment text using octopus/ProoferComments.
030026,000019:
![]() |
Page 711 |
030028,000021: # 1) PROGRAM NAME - TARGET DELTA V PROGRAM (P76).
030029,000022: # 2) FUNCTIONAL DESCRIPTION - UPON ENTRY BY ASTRONAUT ACTION, P76 FLASHES DSKY REQUESTS TO THE ASTRONAUT
030030,000023: # TO PROVIDE VIA DSKY (1) THE DELTA V TO BE APPLIED TO THE OTHER VEHICLE STATE VECTOR AND (2) THE
030031,000024: # TIME (TIG) AT WHICH THE OTHER VEHICLE VELOCITY WAS CHANGED BY EXECUTION OF A THRUSTING MANEUVER. THE
030032,000025: # OTHER VEHICLE STATE VECTOR IS INTEGRATED TO TIG AND UPDATED BY THE ADDITION OF DELTA V (DELTA V HAVING
030033,000026: # BEEN TRANSFORMED FROM LV TO REF COSYS). USING INTEGRVS, THE PROGRAM THEN INTEGRATES THE OTHER
030034,000027: # VEHICLE STATE VECTOR TO THE STATE VECTOR OF THIS VEHICLE, THUS INSURING THAT THE W-MATRIX AND BOTH VEHICLE
030035,000028: # STATES CORRESPOND TO THE SAME TIME.
030036,000029: # 3) ERASABLE INITIALIZATION REQUIRED - NONE.
030037,000030: # 4) CALLING SEQUENCES AND EXIT MODES - CALLED BY ASTRONAUT REQUEST THRU DSKY V 37 E 76E.
030038,000031: # EXITS BY TCF ENDOFJOB.
030039,000032: # 5) OUTPUT - OTHER VEHICLE STATE VECTOR INTEGRATED TO TIG AND INCREMENTED BY DELTA V IN REF COSYS.
030040,000033: # THE PUSHLIST CONTAINS THE MATRIX BY WHICH THE INPUT DELTA V MUST BE POST-MULTIPLIED TO CONVERT FROM LV
030041,000034: # TO REF COSYS.
030042,000035: # 6) DEBRIS - OTHER VEHICLE STATE VECTOR.
030043,000036: # 7) SUBROUTINES CALLED - BANKCALL, GOXDSPF, CSMPREC (OR LEMPREC), ATOPCSM (OR ATOPLEM), INTSTALL, INTWAKE, PHASCHNG
030044,000037: # INTPRET, INTEGRVS, AND MINIRECT.
030045,000038: # 8) FLAG USE - MOONFLAG, CMOONFLAG, INTYPFLG, RASFLAG, AND MARKCTR.
030046,000039:
030047,000040: 30,2061 BANK 30
030048,000041: 13,2000 SETLOC P76LOC
030049,000042: 13,2000 BANK
030050,000043:
030051,000044: 13,2207 COUNT* $$/P76
030052,000045:
030053,000046: 13,2207 E7,1441 EBANK= TIG
030054,000047:
030055,000048: 13,2207 05504 P76 TC UPFLAG
030056,000049: 13,2210 00031 ADRES TRACKFLG
030057,000050:
030058,000051: 13,2211 06042 TC INTPRET
030059,000052: 13,2212 77775 VLOAD
030060,000053: 13,2213 03434 DELVLVC
030061,000054: 13,2214 02223 STORE DELVOV
030062,000055: 13,2215 77776 EXIT
030063,000056:
030064,000057: 13,2216 32335 CAF V06N84 +1 # FLASH VERB 06 NOUN 33, DISPLAY LAST TIG,
030065,000058: 13,2217 04616 TC BANKCALL # AND WAIT FOR KEYBOARD ACTION.
030066,000059: 13,2220 20477 CADR GOFLASH
030067,000060: 13,2221 12331 TCF ENDP76
030068,000061: 13,2222 02224 TC +2 # PROCEED
030069,000062: 13,2223 02216 TC -5 # STORE DATA AND REPEAT FLASHING
030070,000063: 13,2224 32334 CAF V06N84 # FLASH LAST DELTA V,
030071,000064: 13,2225 04616 TC BANKCALL # AND WAIT FOR KEYBOARD ACTION.
030072,000065: 13,2226 20477 CADR GOFLASH
030073,000066: 13,2227 12331 TCF ENDP76
030074,000067: 13,2230 02232 TC +2
030075,000068: 13,2231 02224 TC -5
030076,000069: 13,2232 06042 TC INTPRET # RETURN TO INTERPRETIVE CODE
![]() |
Page 712 |
030078,000071: 13,2233 43145 DLOAD SET
030079,000072: 13,2234 03442 TIG
030080,000073: 13,2235 01076 NODOFLAG
030081,000074: 13,2236 34041 STCALL TDEC1 # SET TDEC1=TIG FOR ORBITAL INTEGRATION
030082,000075: 13,2237 27042 OTHPREC
030083,000076: 13,2240 53575 COMPMAT VLOAD UNIT
030084,000077: 13,2241 00001 RATT
030085,000078: 13,2242 77676 VCOMP # U(-R)
030086,000079: 13,2243 00031 STORE 24D # U(-R) TO 24D
030087,000080: 13,2244 53435 VXV UNIT # U(-R) X V = U(V X R)
030088,000081: 13,2245 00007 VATT
030089,000082: 13,2246 00023 STORE 18D
030090,000083: 13,2247 53435 VXV UNIT # U(V X R) X U(-R) = U((R X V) X R)
030091,000084: 13,2250 00031 24D
030092,000085: 13,2251 24015 STOVL 12D
030093,000086: 13,2252 02223 DELVOV
030094,000087: 13,2253 76505 VXM VSL1 # V(MPAC)=DELTA V IN REFCOSYS
030095,000088: 13,2254 00015 12D
030096,000089: 13,2255 77655 VAD
030097,000090: 13,2256 00007 VATT
030098,000091: 13,2257 00007 STORE 6 # V(PD6)=VATT + DELTA V
030099,000092: 13,2260 77624 CALL # PREVENT WOULD-BE USER OF ORBITAL
030100,000093: 13,2261 27410 INTSTALL # INTEG FROM INTERFERING WITH UPDATING
030101,000094: 13,2262 77624 CALL
030102,000095: 13,2263 26336 P76SUB1
030103,000096: 13,2264 53775 VLOAD VSR*
030104,000097: 13,2265 00007 6
030105,000098: 13,2266 57176 0,2
030106,000099: 13,2267 25543 STOVL VCV
030107,000100: 13,2270 00001 RATT
030108,000101: 13,2271 77657 VSR*
030109,000102: 13,2272 57176 0,2
030110,000103: 13,2273 15535 STODL RCV
030111,000104: 13,2274 03442 TIG
030112,000105: 13,2275 01517 STORE TET
030113,000106: 13,2276 71214 CLEAR DLOAD
030114,000107: 13,2277 01673 INTYPFLG
030115,000108: 13,2300 01643 TETTHIS
030116,000109: 13,2301 34041 INTOTHIS STCALL TDEC1
030117,000110: 13,2302 27106 INTEGRVS
030118,000111: 13,2303 77624 CALL
030119,000112: 13,2304 27410 INTSTALL
030120,000113: 13,2305 77775 VLOAD
030121,000114: 13,2306 00017 RATT1
030122,000115: 13,2307 01503 STORE RRECT
030123,000116: 13,2310 15535 STODL RCV
030124,000117: 13,2311 00015 TAT
030125,000118: 13,2312 25517 STOVL TET
030126,000119: 13,2313 00025 VATT1
030127,000120: 13,2314 77624 CALL
![]() |
Page 713 |
030129,000122: 13,2315 27705 MINIRECT
030130,000123: 13,2316 77776 EXIT
030131,000124: 13,2317 05353 TC PHASCHNG
030132,000125: 13,2320 04024 OCT 04024
030133,000126:
030134,000127: 13,2321 06042 TC INTPRET
030135,000128: 13,2322 45014 SET CALL
030136,000129: 13,2323 05070 REINTFLG
030137,000130: 13,2324 26660 ATOPOTH
030138,000131: 13,2325 77624 CALL
030139,000132: 13,2326 27417 INTWAKE0
030140,000133: 13,2327 77414 OUT CLEAR EXIT # ALLOW V37. NO NEED TO CLEAR NODOFLAG AT
030141,000134: 13,2330 01276 NODOFLAG # ENDP76 SINCE FLAG NOT SET WHEN DISPLAY
030142,000135: # RESPONSES TRANSFER THERE FROM P76+.
030143,000136: 13,2331 34755 ENDP76 CAF ZERO
030144,000137: 13,2332 55462 TS MARKCTR # CLEAR RR TRACKING MARK COUNTER
030145,000138: 13,2333 16001 TCF GOTOPOOH
030146,000139:
030147,000140: 13,2334 01524 V06N84 NV 0684
030148,000141: 13,2335 01441 NV 0633
030149,000142: 13,2336 43174 P76SUB1 AXT,2 SET
030150,000143: 13,2337 00002 2
030151,000144: 13,2340 00063 MOONFLAG # SET MEANS MOON IS SPHERE OF INFLUENCE.
030152,000145: 13,2341 77014 BON AXT,2
030153,000146: 13,2342 04303 CMOONFLG # SET MEANS PERM CM STATE IN LUNAR SPHERE.
030154,000147: 13,2343 00052 QPRET
030155,000148: 13,2344 00000 0
030156,000149: 13,2345 43414 CLEAR RVQ
030157,000150: 13,2346 00263 MOONFLAG
030158,000151:
030159,000152:
030160,000153:
End of include-file P76.agc. Parent file is MAIN.agc