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. |
016006,000002: ## Copyright: Public domain.
016007,000003: ## Filename: IMU_PERFORMANCE_TESTS.agc
016008,000004: ## Purpose: A section of Luminary 1C, revision 131.
016009,000005: ## It is part of the source code for the Lunar Module's (LM)
016010,000006: ## Apollo Guidance Computer (AGC) for Apollo 13.
016011,000007: ## This file is intended to be a faithful transcription, except
016012,000008: ## that the code format has been changed to conform to the
016013,000009: ## requirements of the yaYUL assembler rather than the
016014,000010: ## original YUL assembler.
016015,000011: ## Reference: pp. 384-391
016016,000012: ## Contact: Ron Burkey <info@sandroid.org>.
016017,000013: ## Website: www.ibiblio.org/apollo/index.html
016018,000014: ## Mod history: 05/11/03 RSB. Began transcribing.
016019,000015: ## 05/14/05 RSB. Corrected website reference above.
016020,000016: ## 2017-01-06 RSB Page numbers now agree with those on the
016021,000017: ## original harcopy, as opposed to the PDF page
016022,000018: ## numbers in 1701.pdf.
016023,000019: ## 2017-02-23 RSB Proofed comment text using octopus/ProoferComments.
016024,000020: ## 2017-03-07 RSB Comment-text error-fixes noted in proofing Luminary 116.
016025,000021:
![]() |
Page 384 |
016027,000023: # PROGRAM - IMU PERFORMANCE TESTS 4
016028,000024: # DATE - NOV 15, 1966
016029,000025: # BY - GEORGE SCHMIDT IL7-146 EXT 1126
016030,000026: # MOD NO-ZERO
016031,000027:
016032,000028: # FUNCTIONAL DESCRIPTION
016033,000029:
016034,000030: # THIS SECTION CONSISTSOF THE FILTER FOR THE GYRO DRIFT TESTS. NO COMPASS
016035,000031: # IS DONE IN LEM. FOR A DESCRIPTION OF THE FILTER SEE E-1973. THIS
016036,000032: # SECTION IS ENTERED FROM IMU 2. IT RETURNS THERE AT END OF TEST.
016037,000033:
016038,000034: # EARTHR,OGC ZERO,ERTHRVSE
016039,000035:
016040,000036: # NORMAL EXIT
016041,000037:
016042,000038: # LENGTHOT GOES TO ZERO - RETURN TO IMU PERF TESTS 2 CONTROL
016043,000039:
016044,000040: # ALARMS
016045,000041:
016046,000042: # 1600 OVERFLOW IN DRIFT TEST
016047,000043: # 1601 BAD IMU MODING IN ANY ROUTINE THAT USES IMUSTALL
016048,000044: # OUTPUT
016049,000045:
016050,000046: # FLASHING DISPLAY OF RESULTS - CONTROLLED IN IMU PERF TESTS 2
016051,000047:
016052,000048: # DEBRIS
016053,000049:
016054,000050: # ALL CENTRALS - ALL OF EBANK XSM
016055,000051:
![]() |
Page 385 |
016057,000053: 33,2045 BANK 33
016058,000054: 37,2000 SETLOC IMU4
016059,000055: 37,2000 BANK
016060,000056: 37,2500 COUNT* $$/P07
016061,000057:
016062,000058: 37,2500 E5,1642 EBANK= XSM
016063,000059:
016064,000060: 37,2500 00004 ESTIMS INHINT
016065,000061: 37,2501 31572 CAE 1SECXT
016066,000062: 37,2502 05173 TC TWIDDLE
016067,000063: 37,2503 E5,1642 EBANK= XSM
016068,000064: 37,2503 02536 ADRES ALLOOP
016069,000065: 37,2504 34755 CAF ZERO # ZERO THE PIPAS
016070,000066: 37,2505 54037 TS PIPAX
016071,000067: 37,2506 54040 TS PIPAY
016072,000068: 37,2507 54041 TS PIPAZ
016073,000069: 37,2510 00003 RELINT
016074,000070: 37,2511 33075 CA 77DECML
016075,000071: 37,2512 55571 TS ZERONDX
016076,000072: 37,2513 33076 CA ALXXXZ
016077,000073: 37,2514 02367 TC ZEROING
016078,000074: 37,2515 06042 TC INTPRET
016079,000075: 37,2516 77735 SLOAD
016080,000076: 37,2517 37057 SCHZEROS
016081,000077: 37,2520 25477 STOVL GCOMPSW -1
016082,000078: 37,2521 37070 INTVAL +2
016083,000079: 37,2522 26445 STOVL ALX1S
016084,000080: 37,2523 37057 SCHZEROS
016085,000081: 37,2524 00325 STORE DELVX
016086,000082: 37,2525 01472 STORE GCOMP
016087,000083: 37,2526 77735 SLOAD
016088,000084: 37,2527 02441 TORQNDX
016089,000085: 37,2530 50076 DCOMP BMN
016090,000086: 37,2531 76534 VERTSKIP
016091,000087: 37,2532 77624 CALL
016092,000088: 37,2533 76401 ERTHRVSE
016093,000089: 37,2534 77776 VERTSKIP EXIT
016094,000090: 37,2535 03035 TC SLEEPIE +1
016095,000091:
![]() |
Page 386 |
016097,000093: 37,2536 31576 ALLOOP CA OVFLOWCK
016098,000094: 37,2537 00006 EXTEND
016099,000095: 37,2540 12542 BZF +2
016100,000096: 37,2541 05261 TC TASKOVER
016101,000097: 37,2542 11530 CCS ALTIM
016102,000098: 37,2543 30000 CA A # SHOULD NEVER HIT THIS LOCATION
016103,000099: 37,2544 55531 TS ALTIMS
016104,000100: 37,2545 40000 CS A
016105,000101: 37,2546 55530 TS ALTIM
016106,000102: 37,2547 44753 CS ONE
016107,000103: 37,2550 61562 AD GEOCOMPS
016108,000104: 37,2551 00006 EXTEND
016109,000105: 37,2552 12556 BZF +4
016110,000106: 37,2553 31412 CA LENGTHOT
016111,000107: 37,2554 00006 EXTEND
016112,000108: 37,2555 62562 BZMF +5
016113,000109: 37,2556 31572 CAE 1SECXT
016114,000110: 37,2557 05173 TC TWIDDLE
016115,000111: 37,2560 E5,1642 EBANK= XSM
016116,000112: 37,2560 02536 ADRES ALLOOP
016117,000113: 37,2561 34755 CAF ZERO
016118,000114: 37,2562 56037 XCH PIPAX
016119,000115: 37,2563 54324 TS DELVX
016120,000116: 37,2564 34755 CAF ZERO
016121,000117: 37,2565 56040 XCH PIPAY
016122,000118: 37,2566 54326 TS DELVY
016123,000119: 37,2567 34755 CAF ZERO
016124,000120: 37,2570 56041 XCH PIPAZ
016125,000121: 37,2571 54330 TS DELVZ
016126,000122: 37,2572 34736 SPECSTS CAF PRIO20
016127,000123: 37,2573 05105 TC FINDVAC
016128,000124: 37,2574 E5,1642 EBANK= XSM
016129,000125: 37,2574 02577 76065 2CADR ALFLT # START THE JOB
016130,000126:
016131,000127: 37,2576 05261 TC TASKOVER
016132,000128:
![]() |
Page 387 |
016134,000130: 37,2577 11562 ALFLT CCS GEOCOMPS
016135,000131: 37,2600 02602 TC +2
016136,000132: 37,2601 02604 TC NORMLOP
016137,000133: 37,2602 04616 TC BANKCALL
016138,000134: 37,2603 15271 CADR 1/PIPA
016139,000135: 37,2604 06042 NORMLOP TC INTPRET
016140,000136: 37,2605 77745 DLOAD
016141,000137: 37,2606 37066 INTVAL
016142,000138: 37,2607 24051 STOVL S1
016143,000139: 37,2610 00325 DELVX
016144,000140: 37,2611 76505 VXM VSL1
016145,000141: 37,2612 02643 XSM
016146,000142: 37,2613 57545 DLOAD DCOMP
016147,000143: 37,2614 00160 MPAC +3
016148,000144: 37,2615 16523 STODL DPIPAY
016149,000145: 37,2616 00162 MPAC +5
016150,000146: 37,2617 02527 STORE DPIPAZ
016151,000147:
016152,000148: 37,2620 76001 SETPD AXT,1
016153,000149: 37,2621 00001 0
016154,000150: 37,2622 00010 8D
016155,000151: 37,2623 57535 SLOAD DCOMP
016156,000152: 37,2624 02563 GEOCOMPS
016157,000153: 37,2625 77640 BMN
016158,000154: 37,2626 76772 PERFERAS
016159,000155: 37,2627 50135 ALCGKK SLOAD BMN
016160,000156: 37,2630 02532 ALTIMS
016161,000157: 37,2631 76644 ALFLT3
016162,000158: 37,2632 72174 ALKCG AXT,2 LXA,1 # LOADS SLOPES AND TIME CONSTANTS AT RQST
016163,000159: 37,2633 00014 12D
016164,000160: 37,2634 02444 ALX1S
016165,000161: 37,2635 62143 ALKCG2 DLOAD* INCR,1
016166,000162: 37,2636 02243 ALFDK +144D,1
016167,000163: 37,2637 77775 DEC -2 B-14
016168,000164: 37,2640 12545 STORE ALDK +10D,2
016169,000165: 37,2641 66104 TIX,2 SXA,1
016170,000166: 37,2642 76635 ALKCG2
016171,000167: 37,2643 02444 ALX1S
016172,000168:
016173,000169: 37,2644 77770 ALFLT3 AXT,1
016174,000170: 37,2645 00010 8D
016175,000171: 37,2646 41343 DELMLP DLOAD* DMP
016176,000172: 37,2647 02533 DPIPAY +8D,1
016177,000173: 37,2650 37100 PIPASC
016178,000174: 37,2651 43661 SLR BDSU*
016179,000175: 37,2652 21212 9D
016180,000176: 37,2653 02501 INTY +8D,1
016181,000177: 37,2654 06501 STORE INTY +8D,1
016182,000178: 37,2655 40725 PDDL DMP*
016183,000179: 37,2656 37102 VELSC
![]() |
Page 388 |
016185,000181: 37,2657 02521 VLAUN +8D,1
016186,000182: 37,2660 77732 SL2R
016187,000183: 37,2661 45425 DSU STADR
016188,000184: 37,2662 71216 STORE DELM +8D,1
016189,000185: 37,2663 06563 STORE DELM +10D,1
016190,000186: 37,2664 77100 TIX,1 AXT,2
016191,000187: 37,2665 76646 DELMLP
016192,000188: 37,2666 00004 4
016193,000189: 37,2667 56743 ALILP DLOAD* DMPR*
016194,000190: 37,2670 75324 ALK +4,2
016195,000191: 37,2671 75240 ALDK +4,2
016196,000192: 37,2672 12453 STORE ALK +4,2
016197,000193: 37,2673 77104 TIX,2 AXT,2
016198,000194: 37,2674 76667 ALILP
016199,000195: 37,2675 00010 8D
016200,000196: 37,2676 66140 ALKLP LXC,1 SXA,1
016201,000197: 37,2677 02445 CMPX1
016202,000198: 37,2700 02445 CMPX1
016203,000199: 37,2701 56743 DLOAD* DMPR*
016204,000200: 37,2702 02450 ALK +1,1
016205,000201: 37,2703 75216 DELM +8D,2
016206,000202: 37,2704 77613 DAD*
016207,000203: 37,2705 75276 INTY +8D,2
016208,000204: 37,2706 12501 STORE INTY +8D,2
016209,000205: 37,2707 42743 DLOAD* DAD*
016210,000206: 37,2710 75314 ALK +12D,2
016211,000207: 37,2711 75230 ALDK +12D,2
016212,000208: 37,2712 12463 STORE ALK +12D,2
016213,000209: 37,2713 42673 DMPR* DAD*
016214,000210: 37,2714 75216 DELM +8D,2
016215,000211: 37,2715 75266 INTY +16D,2
016216,000212: 37,2716 12511 STORE INTY +16D,2
016217,000213: 37,2717 40743 DLOAD* DMP*
016218,000214: 37,2720 37105 ALSK +1,1
016219,000215: 37,2721 75216 DELM +8D,2
016220,000216: 37,2722 42772 SL1R DAD*
016221,000217: 37,2723 75256 VLAUN +8D,2
016222,000218: 37,2724 12521 STORE VLAUN +8D,2
016223,000219: 37,2725 76104 TIX,2 AXT,1
016224,000220: 37,2726 76676 ALKLP
016225,000221: 37,2727 00010 8D
016226,000222:
016227,000223: 37,2730 64743 LOOSE DLOAD* PDDL*
016228,000224: 37,2731 02523 ACCWD +8D,1
016229,000225: 37,2732 02521 VLAUN +8D,1
016230,000226: 37,2733 55523 PDDL* VDEF
016231,000227: 37,2734 02531 POSNV +8D,1
016232,000228: 37,2735 76521 MXV VSL1
016233,000229: 37,2736 02001 TRANSM1
![]() |
Page 389 |
016235,000231: 37,2737 77745 DLOAD
016236,000232: 37,2740 00155 MPAC
016237,000233: 37,2741 06531 STORE POSNV +8D,1
016238,000234: 37,2742 77745 DLOAD
016239,000235: 37,2743 00160 MPAC +3
016240,000236: 37,2744 06521 STORE VLAUN +8D,1
016241,000237: 37,2745 77745 DLOAD
016242,000238: 37,2746 00162 MPAC +5
016243,000239: 37,2747 06523 STORE ACCWD +8D,1
016244,000240: 37,2750 77700 TIX,1
016245,000241: 37,2751 76730 LOOSE
016246,000242:
016247,000243: 37,2752 76174 AXT,2 AXT,1 # EVALUATE SINES AND COSINES
016248,000244: 37,2753 00006 6
016249,000245: 37,2754 00002 2
016250,000246: 37,2755 57343 BOOP DLOAD* DMPR
016251,000247: 37,2756 02503 ANGX +2,1
016252,000248: 37,2757 37110 GEORGEJ
016253,000249: 37,2760 77722 SR2R
016254,000250: 37,2761 73406 PUSH SIN
016255,000251: 37,2762 56072 SL3R XAD,1
016256,000252: 37,2763 00046 X1
016257,000253: 37,2764 10021 STORE 16D,2
016258,000254: 37,2765 77745 DLOAD
016259,000255: 37,2766 77746 COS
016260,000256: 37,2767 10027 STORE 22D,2 # COSINES
016261,000257: 37,2770 77704 TIX,2
016262,000258: 37,2771 76755 BOOP
016263,000259:
016264,000260: 37,2772 77776 PERFERAS EXIT
016265,000261: 37,2773 35016 CA EBANK7
016266,000262: 37,2774 54003 TS EBANK
016267,000263: 37,2775 E7,1400 EBANK= ATIGINC
016268,000264: 37,2775 01400 TC ATIGINC # GOTO ERASABLE TO CALCULATE ONLY TO RETN
016269,000265:
016270,000266: # CAUTION
016271,000267:
016272,000268: # THE ERASABLE PROGRAM THAT DOES THE CALCULATIONS MUST BE LOADED
016273,000269: # BEFORE ANY ATTEMPT IS MADE TO RUN THE IMU PERFORMANCE TEST
016274,000270:
016275,000271: 37,2776 E5,1400 EBANK= AZIMUTH
016276,000272: 37,2776 11412 CCS LENGTHOT
016277,000273: 37,2777 03034 TC SLEEPIE
016278,000274: 37,3000 11440 CCS TORQNDX
016279,000275: 37,3001 13003 TCF +2
016280,000276: 37,3002 03005 TC SETUPER1
016281,000277: 37,3003 30032 CA CDUX
016282,000278: 37,3004 55414 TS LOSVEC +1 # FOR TROUBLESHOOTING VD POSNS 2$4
016283,000279:
![]() |
Page 390 |
016285,000281: 37,3005 06042 SETUPER1 TC INTPRET
016286,000282: 37,3006 65345 DLOAD PDDL # ANGLES FROM DRIFT TEST ONLY
016287,000283: 37,3007 02473 ANGZ
016288,000284: 37,3010 02477 ANGY
016289,000285: 37,3011 55525 PDDL VDEF
016290,000286: 37,3012 02501 ANGX
016291,000287: 37,3013 74276 VCOMP VXSC
016292,000288: 37,3014 37110 GEORGEJ
016293,000289: 37,3015 74521 MXV VSR1
016294,000290: 37,3016 02643 XSM
016295,000291: 37,3017 02740 STORE OGC
016296,000292: 37,3020 77776 EXIT
016297,000293:
016298,000294: 37,3021 32475 CA OGCPL
016299,000295: 37,3022 04616 TC BANKCALL
016300,000296: 37,3023 17314 CADR IMUPULSE
016301,000297: 37,3024 02315 TC IMUSLLLG
016302,000298: 37,3025 11440 GEOSTRT4 CCS TORQNDX # ONLY POSITIVE IF IN VERTICAL DRIFT TEST
016303,000299: 37,3026 02263 TC VALMIS
016304,000300: 37,3027 06042 TC INTPRET
016305,000301: 37,3030 77624 CALL
016306,000302: 37,3031 76401 ERTHRVSE
016307,000303: 37,3032 77776 EXIT
016308,000304: 37,3033 02117 TC TORQUE
016309,000305:
016310,000306: 37,3034 55412 SLEEPIE TS LENGTHOT # TEST NOT OVER-DECREMENT LENGTHOT
016311,000307: 37,3035 11440 CCS TORQNDX # ARE WE DOING VERTDRIFT
016312,000308: 37,3036 02447 TC EARTHR*
016313,000309: 37,3037 05155 TC ENDOFJOB
016314,000310:
016315,000311: 37,3040 35014 SOMEERRR CA EBANK5
016316,000312: 37,3041 54003 TS EBANK
016317,000313: 37,3042 34753 CA ONE
016318,000314: 37,3043 55576 TS OVFLOWCK # STOP ALLOOP FROM CALLING ITSELF
016319,000315: 37,3044 05567 TC ALARM
016320,000316: 37,3045 01600 OCT 1600
016321,000317: 37,3046 02270 TC ENDTEST1
016322,000318: 37,3047 33054 SOMERR2 CAF OCT1601
016323,000319: 37,3050 05734 TC VARALARM
016324,000320: 37,3051 05516 TC DOWNFLAG
016325,000321: 37,3052 00007 ADRES IMUSE
016326,000322: 37,3053 05155 TC ENDOFJOB
016327,000323:
016328,000324: 37,3054 01601 OCT1601 OCT 01601
016329,000325: 37,3055 06200 DEC585 OCT 06200 # 3200 B+14 ORDER IS IMPORTANT
016330,000326: 37,3056 00000 00000 SCHZEROS 2DEC .00000000
![]() |
Page 391 |
016332,000328: 37,3060 00000 00000 2DEC .00000000
016333,000329: 37,3062 00000 OCT 00000
016334,000330: 37,3063 00000 ONEDPP OCT 00000 # ORDER IS IMPORTANT
016335,000331: 37,3064 00001 OCT 00001
016336,000332:
016337,000333: 37,3065 00004 INTVAL OCT 4
016338,000334: 37,3066 00002 OCT 2
016339,000335: 37,3067 00220 DEC 144 B-14
016340,000336: 37,3070 77776 DEC -1 B-14
016341,000337: 37,3071 35730 00035 SOUPLY 2DEC .93505870 # INITIAL GAINS FOR PIP OUTPUTS
016342,000338: 37,3073 10317 17550 2DEC .26266423 # INITIAL GAINS/4 FOR ERECTION ANGLES
016343,000339:
016344,000340: 37,3075 00115 77DECML DEC 77 B-14
016345,000341: 37,3076 01443 ALXXXZ GENADR ALX1S -1
016346,000342: 37,3077 04133 02265 PIPASC 2DEC .13055869
016347,000343: 37,3101 57223 66451 VELSC 2DEC -.52223476 # 512/980.402
016348,000344: 37,3103 05427 12577 ALSK 2DEC .17329931 # SSWAY VEL GAIN X 980.402/4096
016349,000345: 37,3105 77567 44202 2DEC -.00835370 # SSWAY ACCEL GAIN X 980.402/4096
016350,000346:
016351,000347: 37,3107 24276 14066 GEORGEJ 2DEC .63661977
016352,000348: 37,3111 23073 11773 GEORGEK 2DEC .59737013
016353,000349:
End of include-file IMU_PERFORMANCE_TESTS_4.agc. Parent file is MAIN.agc