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. |
058833,000002: ## Copyright: Public domain.
058834,000003: ## Filename: T6-RUPT_PROGRAMS.agc
058835,000004: ## Purpose: A section of Luminary 1C, revision 131.
058836,000005: ## It is part of the source code for the Lunar Module's (LM)
058837,000006: ## Apollo Guidance Computer (AGC) for Apollo 13.
058838,000007: ## This file is intended to be a faithful transcription, except
058839,000008: ## that the code format has been changed to conform to the
058840,000009: ## requirements of the yaYUL assembler rather than the
058841,000010: ## original YUL assembler.
058842,000011: ## Reference: pp. 1395-1397
058843,000012: ## Contact: Ron Burkey <info@sandroid.org>.
058844,000013: ## Website: www.ibiblio.org/apollo/index.html
058845,000014: ## Mod history: 06/07/03 RSB. Began transcribing.
058846,000015: ## 05/14/05 RSB Corrected website reference above.
058847,000016: ## 2017-01-06 RSB Page numbers now agree with those on the
058848,000017: ## original hardcopy, as opposed to the PDF page
058849,000018: ## numbers in 1701.pdf.
058850,000019: ## 2017-02-28 RSB Proofed comment text using octopus/ProoferComments.
058851,000020:
![]() |
Page 1395 |
058853,000022: # PROGRAM NAMES: (1) T6JOBCHK MOD. NO. 5 OCTOBER 2, 1967
058854,000023: # (2) DOT6RUPT
058855,000024: # MODIFICATION BY: LOWELL G HULL (A.C.ELECTRONICS)
058856,000025:
058857,000026: # THESE PROGRAMS ENABLE THE LM DAP TO CONTROL THE THRUST TIMES OF THE REACTION CONTROL SYSTEM JETS BY USING TIME6.
058858,000027: # SINCE THE LM DAP MAINTAINS EXCLUSIVE CONTROL OVER TIME6 AND ITS INTERRUPTS, THE FOLLOWING CONVENTIONS HAVE BEEN
058859,000028: # ESTABLISHED AND MUST NOT BE TAMPERED WITH:
058860,000029: # 1. NO NUMBER IS EVER PLACED INTO TIME6 EXCEPT BY LM DAP.
058861,000030: # 2. NO PROGRAM OTHER THAN LM DAP ENABLES THE TIME6 COUNTER.
058862,000031: # 3. TO USE TIME6, THE FOLLOWING SEQUENCE IS ALWAYS EMPLOYED:
058863,000032: # A. A POSITIVE (NON-ZERO) NUMBER IS STORED IN TIME6.
058864,000033: # B. THE TIME6 CLOCK IS ENABLED.
058865,000034: # C. TIME6 IS INTERROGATED AND IS:
058866,000035: # I. NEVER FOUND NEGATIVE (NON-ZERO) OR +0.
058867,000036: # II. SOMETIMES FOUND POSITIVE (BETWEEN 1 AND 240D) INDICATING THAT IT IS ACTIVE.
058868,000037: # III. SOMETIMES FOUND POSMAX INDICATING THAT IT IS INACTIVE AND NOT ENABLED.
058869,000038: # IV. SOMETIMES FOUND NEGATIVE ZERO INDICATING THAT:
058870,000039: # A. A T6RUPT IS ABOUT TO OCCUR AT THE NEXT DINC, OR
058871,000040: # B. A T6RUPT IS WAITING IN THE PRIORITY CHAIN, OR
058872,000041: # C. A T6RUPT IS IN PROCESS NOW.
058873,000042: # 4. ALL PROGRAMS WHICH OPERATE IN EITHER INTERRUPT MODE OR WITH INTERRUPT INHIBITED MUST CALL T6JOBCHK
058874,000043: # EVERY 5 MILLISECONDS TO PROCESS A POSSIBLE WAITING T6RUPT BEFORE IT CAN BE HONORED BY THE HARDWARE.
058875,000044: # (5. PROGRAM JTLST, IN Q,R-AXES, HANDLES THE INPUT LIST.)
058876,000045:
058877,000046: # T6JOBCHK CALLING SEQUENCE:
058878,000047: # L TC T6JOBCHK
058879,000048: # L+1 (RETURN)
058880,000049:
058881,000050: # DOT6RUPT CALLING SEQUENCE:
058882,000051: # DXCH ARUPT T6RUPT LEAD IN AT LOCATION 4004.
058883,000052: # EXTEND
058884,000053: # DCA T6ADR
058885,000054: # DTCB
058886,000055:
058887,000056: # SUBROUTINES CALLED: DOT6RUPT CALLS T6JOBCHK.
058888,000057:
058889,000058: # NORMAL EXIT MODES: T6JOBCHK RETURNS TO L +1.
058890,000059: # DOT6RUPT TRANSFERS CONTROL TO RESUME.
058891,000060:
058892,000061: # ALARM/ABORT MODES: NONE.
058893,000062:
058894,000063: # INPUT: TIME6 NXT6ADR OUTPUT: TIME6 NXT6ADR CHANNEL 5
058895,000064: # T6NEXT T6NEXT +1 T6NEXT T6NEXT +1 CHANNEL 6
058896,000065: # T6FURTHA T6FURTHA +1 T6FURTHA T6FURTHA +1 BIT15/CH13
058897,000066:
058898,000067: # DEBRIS: T6JOBCHK CLOBBERS A. DOT6RUPT CLOBBERS NOTHING.
058899,000068:
058900,000069: 5743 BLOCK 02
![]() |
Page 1396 |
058902,000071: 17,2055 BANK 17
058903,000072: 17,2000 SETLOC DAPS2
058904,000073: 17,2000 BANK
058905,000074: 17,2055 E6,1466 EBANK= T6NEXT
058906,000075: 17,2055 COUNT* $$/DAPT6
058907,000076:
058908,000077: 17,2055 10031 T6JOBCHK CCS TIME6 # CHECK TIME6 FOR WAITING T6RUPT:
058909,000078: 17,2056 00002 TC Q # NONE: CLOCK COUTING DOWN.
058910,000079: 17,2057 05675 TC CCSHOLE
058911,000080: 17,2060 05675 TC CCSHOLE
058912,000081:
058913,000082: # CONTROL PASSES TO T6JOB ONLY WHEN C(TIME6) = -0 (I.E. WHEN A T6RUPT MUST BE PROCESSED).
058914,000083:
058915,000084: 17,2061 34733 T6JOB CA POSMAX
058916,000085: 17,2062 22007 ZL
058917,000086: 17,2063 53471 DXCH T6FURTHA
058918,000087: 17,2064 53467 DXCH T6NEXT
058919,000088: 17,2065 23465 LXCH NXT6ADR
058920,000089: 17,2066 54031 TS TIME6
058921,000090:
058922,000091: 17,2067 67730 AD PRIO37
058923,000092: 17,2070 54000 TS A
058924,000093: 17,2071 12075 TCF ENABLET6
058925,000094: 17,2072 34733 CA POSMAX
058926,000095: 17,2073 54031 TS TIME6
058927,000096: 17,2074 12115 TCF GOCH56
058928,000097: 17,2075 00006 ENABLET6 EXTEND
058929,000098: 17,2076 23265 QXCH C13QSAV
058930,000099: 17,2077 22070 LXCH RUPTREG1
058931,000100: 17,2100 06022 TC C13STALL
058932,000101: 17,2101 00006 EXTEND
058933,000102: 17,2102 23265 QXCH C13QSAV
058934,000103: 17,2103 22070 LXCH RUPTREG1
058935,000104: 17,2104 34735 CAF BIT15
058936,000105: 17,2105 00006 EXTEND
058937,000106: 17,2106 05013 WOR CHAN13
058938,000107: 17,2107 31466 CA T6NEXT
058939,000108: 17,2110 67730 AD PRIO37
058940,000109: 17,2111 54000 TS A
058941,000110: 17,2112 12115 TCF GOCH56
058942,000111: 17,2113 34733 CA POSMAX
058943,000112: 17,2114 55466 TS T6NEXT
058944,000113: 17,2115 50001 GOCH56 INDEX L
058945,000114: 17,2116 15743 TCF WRITEP -1
058946,000115:
058947,000116: 5743 BLOCK 02
058948,000117: 4000 SETLOC FFTAG9
058949,000118: 4000 BANK
058950,000119: 5743 E6,1634 EBANK= CDUXD
058951,000120: 5743 COUNT* $$/DAPT6
![]() |
Page 1397 |
058953,000122: 5743 31472 CA NEXTP
058954,000123: 5744 00006 WRITEP EXTEND
058955,000124: 5745 01006 WRITE CHAN6
058956,000125: 5746 00002 TC Q
058957,000126:
058958,000127: 5747 31473 CA NEXTU
058959,000128: 5750 54001 WRITEU TS L
058960,000129: 5751 45764 CS 00314OCT
058961,000130: 5752 00006 EXTEND
058962,000131: 5753 02005 RAND CHAN5
058963,000132: 5754 60001 AD L
058964,000133: 5755 00006 EXTEND
058965,000134: 5756 01005 WRITE CHAN5
058966,000135: 5757 00002 TC Q
058967,000136:
058968,000137: 5760 31474 CA NEXTV
058969,000138: 5761 54001 WRITEV TS L
058970,000139: 5762 35764 CA 00314OCT
058971,000140: 5763 15752 TCF -9D
058972,000141: 5764 00314 00314OCT OCT 00314
058973,000142:
058974,000143: 17,2117 BANK 17
058975,000144: 17,2000 SETLOC DAPS2
058976,000145: 17,2000 BANK
058977,000146:
058978,000147: 17,2117 E6,1466 EBANK= T6NEXT
058979,000148: 17,2117 COUNT* $$/DAPT6
058980,000149:
058981,000150: 17,2117 22016 DOT6RUPT LXCH BANKRUPT # (INTERRUPT LEAD INS CONTINUED)
058982,000151: 17,2120 00006 EXTEND
058983,000152: 17,2121 22012 QXCH QRUPT
058984,000153:
058985,000154: 17,2122 02055 TC T6JOBCHK # CALL T6JOBCHK.
058986,000155:
058987,000156: 17,2123 15270 TCF RESUME # END TIME6 INTERRUPT PROCESSOR.
058988,000157:
058989,000158:
End of include-file T6-RUPT_PROGRAMS.agc. Parent file is MAIN.agc