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. |
015462,000002: ## Copyright: Public domain.
015463,000003: ## Filename: SYSTEM_TEST_STANDARD_LEAD_INS.agc
015464,000004: ## Purpose: A section of Luminary 1C, revision 131.
015465,000005: ## It is part of the source code for the Lunar Module's (LM)
015466,000006: ## Apollo Guidance Computer (AGC) for Apollo 13.
015467,000007: ## This file is intended to be a faithful transcription, except
015468,000008: ## that the code format has been changed to conform to the
015469,000009: ## requirements of the yaYUL assembler rather than the
015470,000010: ## original YUL assembler.
015471,000011: ## Reference: pp. 372-374
015472,000012: ## Contact: Ron Burkey <info@sandroid.org>.
015473,000013: ## Website: www.ibiblio.org/apollo/index.html
015474,000014: ## Mod history: 05/11/03 RSB. Began transcribing.
015475,000015: ## 05/14/05 RSB Corrected website reference above.
015476,000016: ## 2017-01-06 RSB Page numbers now agree with those on the
015477,000017: ## original harcopy, as opposed to the PDF page
015478,000018: ## numbers in 1701.pdf.
015479,000019: ## 2017-02-23 RSB Proofed comment text using octopus/ProoferComments.
015480,000020:
![]() |
Page 372 |
015482,000022: 22,3242 E5,1642 EBANK= XSM
015483,000023:
015484,000024: 33,2045 BANK 33
015485,000025: 04,2000 SETLOC E/PROG
015486,000026: 04,2000 BANK
015487,000027:
015488,000028: 04,2562 COUNT* $$/P07
015489,000029:
015490,000030: # SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
015491,000031:
015492,000032: # E/BKCALL FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
015493,000033:
015494,000034: # THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED. LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
015495,000035: # IS NOT POSSIBLE.
015496,000036:
015497,000037: # THE CALLING SEQUENCE IS:
015498,000038:
015499,000039: # TC BANKCALL
015500,000040: # CADR E/BKCALL
015501,000041: # CADR ROUTINE WHERE YOU WANT TO GO IN FIXED.
015502,000042: # RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
015503,000043: # RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
015504,000044: # RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
015505,000045:
015506,000046: # THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
015507,000047: # OTHER EMEMORY PROGRAMS.
015508,000048:
015509,000049: # A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
015510,000050:
015511,000051: 04,2562 52134 E/BKCALL DXCH BUF2 # SAVE A,L AND GET DP RETURN.
015512,000052: 04,2563 53167 DXCH EBUF2 # SAVE DP RETURN.
015513,000053: 04,2564 25166 INCR EBUF2 # RETURN +1 BECAUSE DOUBLE CADR.
015514,000054: 04,2565 30006 CA BBANK
015515,000055: 04,2566 75012 MASK LOW10 # GET CURRENT EBANK. (SBANK SOMEDAY)
015516,000056: 04,2567 27167 ADS EBUF2 +1 # FORM BBCON. (WAS FBANK)
015517,000057: 04,2570 51166 NDX EBUF2
015518,000058: 04,2571 27777 CA 0 -1 # GET CADR OF ROUTINE.
015519,000059: 04,2572 04622 TC SWCALL # GO TO ROUTINE, SETTING Q TO SWRETURN
015520,000060: # AND RESTORING A + L.
015521,000061: 04,2573 02577 TC +4 # TX Q, V34, OR BAD STALL RETURN.
015522,000062: 04,2574 02576 TC +2 # PROCEED OR GOOD STALL RETURN.
015523,000063: 04,2575 25166 INCR EBUF2 # ENTER OR RECYCLE RETURN.
015524,000064: 04,2576 25166 INCR EBUF2
015525,000065: 04,2577 53167 E/SWITCH DXCH EBUF2
015526,000066: 04,2600 52006 DTCB
015527,000067:
![]() |
Page 373 |
015529,000069: # E/CALL FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
015530,000070:
015531,000071: # THE CALLING SEQUENCE IS...
015532,000072:
015533,000073: # RTB
015534,000074: # E/CALL
015535,000075: # CADR ROUTINE THE INTERPRETIVE SUBROUTINE YOU WANT.
015536,000076: # RETURNS HERE IN INTERPRETIVE.
015537,000077:
015538,000078: 04,2601 22164 E/CALL LXCH LOC # ADRES -1 OF CADR.
015539,000079: 04,2602 50001 INDEX L
015540,000080: 04,2603 30001 CA L # CADR IN A.
015541,000081: 04,2604 24001 INCR L
015542,000082: 04,2605 24001 INCR L # RETURN ADRES IN L.
015543,000083: 04,2606 53167 DXCH EBUF2 # STORE CADR AND RETURN.
015544,000084: 04,2607 06042 TC INTPRET
015545,000085: 04,2610 77624 CALL
015546,000086: 04,2611 01166 EBUF2 # INDIRECTLY EXECUTE ROUTINE. IT MUST
015547,000087: 04,2612 77776 EXIT # LEAVE VIA RVQ OR EQUIVALENT.
015548,000088: 04,2613 23167 LXCH EBUF2 +1 # PICK UP RETURN.
015549,000089: 04,2614 16044 TCF INTPRET +2 # SET LOC AND RETURN TO CALLER.
015550,000090:
![]() |
Page 374 |
015552,000092: # E/JOBWAK FOR WAKING UP ERASABLE MEMORY JOBS.
015553,000093:
015554,000094: # THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
015555,000095:
015556,000096: # THE CALLING SEQUENCE IS:
015557,000097:
015558,000098: # INHINT
015559,000099: # .
015560,000100: # .
015561,000101: # CA WAKEADR ADDRESS OF SLEEPING JOB
015562,000102: # TC IBNKCALL
015563,000103: # CADR E/JOBWAK
015564,000104: # . RETURNS HERE
015565,000105: # .
015566,000106: # .
015567,000107: # RELINT IF YOU DID AN INHINT.
015568,000108:
015569,000109: 33,2045 BANK 33
015570,000110: 04,2000 SETLOC E/PROG
015571,000111: 04,2000 BANK
015572,000112:
015573,000113: 04,2615 COUNT* $$/P07
015574,000114:
015575,000115: 04,2615 05137 E/JOBWAK TC JOBWAKE # ARRIVE IWTH ADRES IN A.
015576,000116: 04,2616 44741 CS BIT11
015577,000117: 04,2617 50064 NDX LOCCTR
015578,000118: 04,2620 26164 ADS LOC # KNOCK FIXED MEMORY BIT OUT OF ADRES.
015579,000119: 04,2621 00072 TC RUPTREG3 # RETURN
015580,000120:
End of include-file SYSTEM_TEST_STANDARD_LEAD_INS.agc. Parent file is MAIN.agc