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. |
015176,000002: ## Copyright: Public domain.
015177,000003: ## Filename: GIMBAL_LOCK_AVOIDANCE.agc
015178,000004: ## Purpose: A section of Luminary 1C, revision 131.
015179,000005: ## It is part of the source code for the Lunar Module's (LM)
015180,000006: ## Apollo Guidance Computer (AGC) for Apollo 13.
015181,000007: ## This file is intended to be a faithful transcription, except
015182,000008: ## that the code format has been changed to conform to the
015183,000009: ## requirements of the yaYUL assembler rather than the
015184,000010: ## original YUL assembler.
015185,000011: ## Reference: p. 366
015186,000012: ## Contact: Ron Burkey <info@sandroid.org>.
015187,000013: ## Website: www.ibiblio.org/apollo/index.html
015188,000014: ## Mod history: 05/11/03 RSB. Began transcribing.
015189,000015: ## 05/14/05 RSB Corrected website reference above.
015190,000016: ## 2017-01-06 RSB Page numbers now agree with those on the
015191,000017: ## original harcopy, as opposed to the PDF page
015192,000018: ## numbers in 1701.pdf.
015193,000019: ## 2017-02-23 RSB Proofed comment text using octopus/ProoferComments.
015194,000020:
![]() |
Page 366 |
015196,000022: 15,2050 BANK 15
015197,000023:
015198,000024: 22,2000 SETLOC KALCMON1
015199,000025: 22,2000 BANK
015200,000026:
015201,000027: # DETECTING GIMBAL LOCK
015202,000028: 22,2744 22,2744 LOCSKIRT EQUALS NOGIMLOC
015203,000029:
015204,000030: 22,2744 77614 NOGIMLOC SET
015205,000031: 22,2745 01074 CALCMAN3
015206,000032: 22,2746 70740 WCALC LXC,1 DLOAD*
015207,000033: 22,2747 01322 RATEINDX # CHOOSE THE DESIRED MANEUVER RATE
015208,000034: 22,2750 04772 ARATE,1 # FROM A LIST OF FOUR
015209,000035: 22,2751 45002 SR4 CALL # COMPUTE THE INCREMENTAL ROTATION MATRIX
015210,000036: 22,2752 44527 DELCOMP # DEL CORRESPONDING TO A 1 SEC ROTATION
015211,000037: # ABOUT COF
015212,000038: 22,2753 74343 DLOAD* VXSC
015213,000039: 22,2754 04772 ARATE,1
015214,000040: 22,2755 03270 COF
015215,000041: 22,2756 17325 STODL BRATE # COMPONENT MANEUVER RATES 45 DEG/SEC
015216,000042: 22,2757 03335 AM
015217,000043: 22,2760 55605 DMP DDV*
015218,000044: 22,2761 05002 ANGLTIME
015219,000045: 22,2762 04772 ARATE,1
015220,000046: 22,2763 77661 SR
015221,000047: 22,2764 20606 5
015222,000048: 22,2765 03333 STORE TM # MANEUVER EXECUTION TIME SCALED AS T2
015223,000049: 22,2766 77614 SETGO
015224,000050: 22,2767 01035 CALCMAN2 # D(OFF) = CONTINUE MANEUVER
015225,000051: 22,2770 45010 NEWANGL +1 # 1(ON) = START MANEUVER
015226,000052:
015227,000053: # THE FOUR SELECTABLE FREE FALL MANEUVER RATES SELECTED BY
015228,000054: # LOADING RATEINDX WITH 0, 2, 4, 6, RESPECTIVELY
015229,000055:
015230,000056: 22,2771 00221 24255 ARATE 2DEC .0088888888 # = 0.2 DEG/SEC $ 22.5 DEG/SEC
015231,000057: 22,2773 00554 02660 2DEC .0222222222 # = 0.5 DEG/SEC $ 22.5 DEG/SEC
015232,000058: 22,2775 02660 13301 2DEC .0888888888 # = 2.0 DEG/SEC $ 22.5 DEG/SEC
015233,000059: 22,2777 16161 30707 2DEC .4444444444 # = 10.0 DEG/SEC $ 22.5 DEG/SEC
015234,000060:
015235,000061: 22,3001 00003 04000 ANGLTIME 2DEC .0001907349 # = 100B-19 FUDGE FACTOR TO CONVERT
015236,000062: # MANEUVER ANGLE TO MANEUVER TIME
015237,000063:
015238,000064:
End of include-file GIMBAL_LOCK_AVOIDANCE.agc. Parent file is MAIN.agc