Source Code
![]() |
This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the
second release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 97.
A bug (which had been around since at least Apollo 10, Luminary 69) was
discovered in Rev 0 shortly before the Apollo 11 flight, resulting in a last minute
revision into Rev 1,
which is what actually flew rather than
the Rev 0 presented here. A hardcopy of Rev 0 is known to
exist — it belonged to AGC developer Allan Klumpp for many years — but
unfortunately the Virtual AGC Project has not had access to that hardcopy. Thus
the code you see here had been reconstructed (we believe accurately) rather than
transcribed. The first step of the reconstruction of the Rev 0 source code was
the transcription of the Rev 1 source code from a hardcopy in the MIT Museum collection.
The process of reverting the active portion of the source code (i.e., other than
program comments) from Rev 1 to Rev 0 was very minor, consisting
only of moving the position of the STARTSB1 label in
FRESH START AND RESTART. Allan had previously given
us the checksums of the memory banks of Rev 0, and we have verified the program presented here has checksums
identical to all banks of Allan's listing of Rev 0. The notations on Allan's Rev 0 program listing read,
in part:GAP: ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-051 A single program comment is known to differ between Rev 0 and Rev 1, but these are harder to reconstruct and verify than changes to the active portion of the code. Thus it is possible that there are additional differences between the program comments in Rev 0 and Rev 1 that are unknown to us, and therefore are not reflected in the code presented here. |
016485,000002: ## Copyright: Public domain.
016486,000003: ## Filename: IMU_PERFORMANCE_TESTS_4.agc
016487,000004: ## Purpose: Part of the reconstructed source code for LMY99 Rev 0,
016488,000005: ## otherwise known as Luminary Rev 99, the second release
016489,000006: ## of the Apollo Guidance Computer (AGC) software for Apollo 11.
016490,000007: ## It differs from LMY99 Rev 1 (the flown version) only in the
016491,000008: ## placement of a single label. The corrections shown here have
016492,000009: ## been verified to have the same bank checksums as AGC developer
016493,000010: ## Allan Klumpp's copy of Luminary Rev 99, and so are believed
016494,000011: ## to be accurate. This file is intended to be a faithful
016495,000012: ## recreation, except that the code format has been changed to
016496,000013: ## conform to the requirements of the yaYUL assembler rather than
016497,000014: ## the original YUL assembler.
016498,000015: ##
016499,000016: ## Assembler: yaYUL
016500,000017: ## Contact: Ron Burkey <info@sandroid.org>.
016501,000018: ## Website: www.ibiblio.org/apollo.
016502,000019: ## Pages: 382-389
016503,000020: ## Mod history: 2009-05-17 RSB Adapted from the corresponding
016504,000021: ## Luminary131 file, using page
016505,000022: ## images from Luminary 1A.
016506,000023: ## 2016-12-14 RSB Proofed text comments with octopus/ProoferComments
016507,000024: ## and corrected the errors found.
016508,000025: ## 2017-03-07 RSB Comment-text error-fixes noted in proofing Luminary 116.
016509,000026: ## 2017-08-01 MAS Created from LMY99 Rev 1.
016510,000027:
016511,000028: ## This source code has been transcribed or otherwise adapted from
016512,000029: ## digitized images of a hardcopy from the MIT Museum. The digitization
016513,000030: ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
016514,000031: ## the Museum. Many thanks to both. The images (with suitable reduction
016515,000032: ## in storage size and consequent reduction in image quality as well) are
016516,000033: ## available online at www.ibiblio.org/apollo. If for some reason you
016517,000034: ## find that the images are illegible, contact me at info@sandroid.org
016518,000035: ## about getting access to the (much) higher-quality images which Paul
016519,000036: ## actually created.
016520,000037: ##
016521,000038: ## The code has been modified to match LMY99 Revision 0, otherwise
016522,000039: ## known as Luminary Revision 99, the Apollo 11 software release preceeding
016523,000040: ## the listing from which it was transcribed. It has been verified to
016524,000041: ## contain the same bank checksums as AGC developer Allan Klumpp's listing
016525,000042: ## of Luminary Revision 99 (for which we do not have scans).
016526,000043: ##
016527,000044: ## Notations on Allan Klumpp's listing read, in part:
016528,000045: ##
016529,000046: ## ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
016530,000047:
![]() |
Page 382 |
016532,000049: # PROGRAM - IMU PERFORMANCE TESTS 4
016533,000050: # DATE - NOV 15, 1966
016534,000051: # BY - GEORGE SCHMIDT IL7-146 EXT 1126
016535,000052: # MOD NO-ZERO
016536,000053:
016537,000054: # FUNCTIONAL DESCRIPTION
016538,000055:
016539,000056: # THIS SECTION CONSISTS OF THE FILTER FOR THE GYRO DRIFT TESTS. NO COMPASS
016540,000057: # IS DONE IN LEM. FOR A DESCRIPTION OF THE FILTER SEE E-1973. THIS
016541,000058: # SECTION IS ENTERED FROM IMU 2. IT RETURNS THERE AT END OF TEST.
016542,000059:
016543,000060: # EARTHR,OGC ZERO,ERTHRVSE
016544,000061:
016545,000062: # NORMAL EXIT
016546,000063:
016547,000064: # LENGTHOT GOES TO ZERO - RETURN TO IMU PERF TESTS 2 CONTROL
016548,000065:
016549,000066: # ALARMS
016550,000067:
016551,000068: # 1600 OVERFLOW IN DRIFT TEST
016552,000069: # 1601 BAD IMU MODING IN ANY ROUTINE THAT USES IMUSTALL
016553,000070: # OUTPUT
016554,000071:
016555,000072: # FLASHING DISPLAY OF RESULTS - CONTROLLED IN IMU PERF TESTS 2
016556,000073:
016557,000074: # DEBRIS
016558,000075:
016559,000076: # ALL CENTRALS - ALL OF EBANK XSM
016560,000077:
![]() |
Page 383 |
016562,000079: 33,2045 BANK 33
016563,000080: 37,2000 SETLOC IMU4
016564,000081: 37,2000 BANK
016565,000082: 37,2500 COUNT* $$/P07
016566,000083:
016567,000084: 37,2500 E5,1642 EBANK= XSM
016568,000085:
016569,000086: 37,2500 00004 ESTIMS INHINT
016570,000087: 37,2501 31572 CAE 1SECXT
016571,000088: 37,2502 05173 TC TWIDDLE
016572,000089: 37,2503 E5,1642 EBANK= XSM
016573,000090: 37,2503 02536 ADRES ALLOOP
016574,000091: 37,2504 34755 CAF ZERO # ZERO THE PIPAS
016575,000092: 37,2505 54037 TS PIPAX
016576,000093: 37,2506 54040 TS PIPAY
016577,000094: 37,2507 54041 TS PIPAZ
016578,000095: 37,2510 00003 RELINT
016579,000096: 37,2511 33075 CA 77DECML
016580,000097: 37,2512 55571 TS ZERONDX
016581,000098: 37,2513 33076 CA ALXXXZ
016582,000099: 37,2514 02367 TC ZEROING
016583,000100: 37,2515 06037 TC INTPRET
016584,000101: 37,2516 77735 SLOAD
016585,000102: 37,2517 37057 SCHZEROS
016586,000103: 37,2520 25477 STOVL GCOMPSW -1
016587,000104: 37,2521 37070 INTVAL +2
016588,000105: 37,2522 26445 STOVL ALX1S
016589,000106: 37,2523 37057 SCHZEROS
016590,000107: 37,2524 00325 STORE DELVX
016591,000108: 37,2525 01472 STORE GCOMP
016592,000109: 37,2526 77735 SLOAD
016593,000110: 37,2527 02441 TORQNDX
016594,000111: 37,2530 50076 DCOMP BMN
016595,000112: 37,2531 76534 VERTSKIP
016596,000113: 37,2532 77624 CALL
016597,000114: 37,2533 76401 ERTHRVSE
016598,000115: 37,2534 77776 VERTSKIP EXIT
016599,000116: 37,2535 03035 TC SLEEPIE +1
016600,000117:
![]() |
Page 384 |
016602,000119: 37,2536 31576 ALLOOP CA OVFLOWCK
016603,000120: 37,2537 00006 EXTEND
016604,000121: 37,2540 12542 BZF +2
016605,000122: 37,2541 05261 TC TASKOVER
016606,000123: 37,2542 11530 CCS ALTIM
016607,000124: 37,2543 30000 CA A # SHOULD NEVER HIT THIS LOCATION
016608,000125: 37,2544 55531 TS ALTIMS
016609,000126: 37,2545 40000 CS A
016610,000127: 37,2546 55530 TS ALTIM
016611,000128: 37,2547 44753 CS ONE
016612,000129: 37,2550 61562 AD GEOCOMPS
016613,000130: 37,2551 00006 EXTEND
016614,000131: 37,2552 12556 BZF +4
016615,000132: 37,2553 31412 CA LENGTHOT
016616,000133: 37,2554 00006 EXTEND
016617,000134: 37,2555 62562 BZMF +5
016618,000135: 37,2556 31572 CAE 1SECXT
016619,000136: 37,2557 05173 TC TWIDDLE
016620,000137: 37,2560 E5,1642 EBANK= XSM
016621,000138: 37,2560 02536 ADRES ALLOOP
016622,000139: 37,2561 34755 CAF ZERO
016623,000140: 37,2562 56037 XCH PIPAX
016624,000141: 37,2563 54324 TS DELVX
016625,000142: 37,2564 34755 CAF ZERO
016626,000143: 37,2565 56040 XCH PIPAY
016627,000144: 37,2566 54326 TS DELVY
016628,000145: 37,2567 34755 CAF ZERO
016629,000146: 37,2570 56041 XCH PIPAZ
016630,000147: 37,2571 54330 TS DELVZ
016631,000148: 37,2572 34736 SPECSTS CAF PRIO20
016632,000149: 37,2573 05105 TC FINDVAC
016633,000150: 37,2574 E5,1642 EBANK= XSM
016634,000151: 37,2574 02577 76065 2CADR ALFLT # START THE JOB
016635,000152:
016636,000153: 37,2576 05261 TC TASKOVER
016637,000154:
![]() |
Page 385 |
016639,000156: 37,2577 11562 ALFLT CCS GEOCOMPS
016640,000157: 37,2600 02602 TC +2
016641,000158: 37,2601 02604 TC NORMLOP
016642,000159: 37,2602 04616 TC BANKCALL
016643,000160: 37,2603 15263 CADR 1/PIPA
016644,000161: 37,2604 06037 NORMLOP TC INTPRET
016645,000162: 37,2605 77745 DLOAD
016646,000163: 37,2606 37066 INTVAL
016647,000164: 37,2607 24051 STOVL S1
016648,000165: 37,2610 00325 DELVX
016649,000166: 37,2611 76505 VXM VSL1
016650,000167: 37,2612 02643 XSM
016651,000168: 37,2613 57545 DLOAD DCOMP
016652,000169: 37,2614 00160 MPAC +3
016653,000170: 37,2615 16523 STODL DPIPAY
016654,000171: 37,2616 00162 MPAC +5
016655,000172: 37,2617 02527 STORE DPIPAZ
016656,000173:
016657,000174: 37,2620 76001 SETPD AXT,1
016658,000175: 37,2621 00001 0
016659,000176: 37,2622 00010 8D
016660,000177: 37,2623 57535 SLOAD DCOMP
016661,000178: 37,2624 02563 GEOCOMPS
016662,000179: 37,2625 77640 BMN
016663,000180: 37,2626 76772 PERFERAS
016664,000181: 37,2627 50135 ALCGKK SLOAD BMN
016665,000182: 37,2630 02532 ALTIMS
016666,000183: 37,2631 76644 ALFLT3
016667,000184: 37,2632 72174 ALKCG AXT,2 LXA,1 # LOADS SLOPES AND TIME CONSTANTS AT RQST
016668,000185: 37,2633 00014 12D
016669,000186: 37,2634 02444 ALX1S
016670,000187: 37,2635 62143 ALKCG2 DLOAD* INCR,1
016671,000188: 37,2636 02243 ALFDK +144D,1
016672,000189: 37,2637 77775 DEC -2 B-14
016673,000190: 37,2640 12545 STORE ALDK +10D,2
016674,000191: 37,2641 66104 TIX,2 SXA,1
016675,000192: 37,2642 76635 ALKCG2
016676,000193: 37,2643 02444 ALX1S
016677,000194:
016678,000195: 37,2644 77770 ALFLT3 AXT,1
016679,000196: 37,2645 00010 8D
016680,000197: 37,2646 41343 DELMLP DLOAD* DMP
016681,000198: 37,2647 02533 DPIPAY +8D,1
016682,000199: 37,2650 37100 PIPASC
016683,000200: 37,2651 43661 SLR BDSU*
016684,000201: 37,2652 21212 9D
016685,000202: 37,2653 02501 INTY +8D,1
016686,000203: 37,2654 06501 STORE INTY +8D,1
016687,000204: 37,2655 40725 PDDL DMP*
016688,000205: 37,2656 37102 VELSC
![]() |
Page 386 |
016690,000207: 37,2657 02521 VLAUN +8D,1
016691,000208: 37,2660 77732 SL2R
016692,000209: 37,2661 45425 DSU STADR
016693,000210: 37,2662 71216 STORE DELM +8D,1
016694,000211: 37,2663 06563 STORE DELM +10D,1
016695,000212: 37,2664 77100 TIX,1 AXT,2
016696,000213: 37,2665 76646 DELMLP
016697,000214: 37,2666 00004 4
016698,000215: 37,2667 56743 ALILP DLOAD* DMPR*
016699,000216: 37,2670 75324 ALK +4,2
016700,000217: 37,2671 75240 ALDK +4,2
016701,000218: 37,2672 12453 STORE ALK +4,2
016702,000219: 37,2673 77104 TIX,2 AXT,2
016703,000220: 37,2674 76667 ALILP
016704,000221: 37,2675 00010 8D
016705,000222: 37,2676 66140 ALKLP LXC,1 SXA,1
016706,000223: 37,2677 02445 CMPX1
016707,000224: 37,2700 02445 CMPX1
016708,000225: 37,2701 56743 DLOAD* DMPR*
016709,000226: 37,2702 02450 ALK +1,1
016710,000227: 37,2703 75216 DELM +8D,2
016711,000228: 37,2704 77613 DAD*
016712,000229: 37,2705 75276 INTY +8D,2
016713,000230: 37,2706 12501 STORE INTY +8D,2
016714,000231: 37,2707 42743 DLOAD* DAD*
016715,000232: 37,2710 75314 ALK +12D,2
016716,000233: 37,2711 75230 ALDK +12D,2
016717,000234: 37,2712 12463 STORE ALK +12D,2
016718,000235: 37,2713 42673 DMPR* DAD*
016719,000236: 37,2714 75216 DELM +8D,2
016720,000237: 37,2715 75266 INTY +16D,2
016721,000238: 37,2716 12511 STORE INTY +16D,2
016722,000239: 37,2717 40743 DLOAD* DMP*
016723,000240: 37,2720 37105 ALSK +1,1
016724,000241: 37,2721 75216 DELM +8D,2
016725,000242: 37,2722 42772 SL1R DAD*
016726,000243: 37,2723 75256 VLAUN +8D,2
016727,000244: 37,2724 12521 STORE VLAUN +8D,2
016728,000245: 37,2725 76104 TIX,2 AXT,1
016729,000246: 37,2726 76676 ALKLP
016730,000247: 37,2727 00010 8D
016731,000248:
016732,000249: 37,2730 64743 LOOSE DLOAD* PDDL*
016733,000250: 37,2731 02523 ACCWD +8D,1
016734,000251: 37,2732 02521 VLAUN +8D,1
016735,000252: 37,2733 55523 PDDL* VDEF
016736,000253: 37,2734 02531 POSNV +8D,1
016737,000254: 37,2735 76521 MXV VSL1
016738,000255: 37,2736 02001 TRANSM1
![]() |
Page 387 |
016740,000257: 37,2737 77745 DLOAD
016741,000258: 37,2740 00155 MPAC
016742,000259: 37,2741 06531 STORE POSNV +8D,1
016743,000260: 37,2742 77745 DLOAD
016744,000261: 37,2743 00160 MPAC +3
016745,000262: 37,2744 06521 STORE VLAUN +8D,1
016746,000263: 37,2745 77745 DLOAD
016747,000264: 37,2746 00162 MPAC +5
016748,000265: 37,2747 06523 STORE ACCWD +8D,1
016749,000266: 37,2750 77700 TIX,1
016750,000267: 37,2751 76730 LOOSE
016751,000268:
016752,000269: 37,2752 76174 AXT,2 AXT,1 # EVALUATE SINES AND COSINES
016753,000270: 37,2753 00006 6
016754,000271: 37,2754 00002 2
016755,000272: 37,2755 57343 BOOP DLOAD* DMPR
016756,000273: 37,2756 02503 ANGX +2,1
016757,000274: 37,2757 37110 GEORGEJ
016758,000275: 37,2760 77722 SR2R
016759,000276: 37,2761 73406 PUSH SIN
016760,000277: 37,2762 56072 SL3R XAD,1
016761,000278: 37,2763 00046 X1
016762,000279: 37,2764 10021 STORE 16D,2
016763,000280: 37,2765 77745 DLOAD
016764,000281: 37,2766 77746 COS
016765,000282: 37,2767 10027 STORE 22D,2 # COSINES
016766,000283: 37,2770 77704 TIX,2
016767,000284: 37,2771 76755 BOOP
016768,000285:
016769,000286: 37,2772 77776 PERFERAS EXIT
016770,000287: 37,2773 35016 CA EBANK7
016771,000288: 37,2774 54003 TS EBANK
016772,000289: 37,2775 E7,1400 EBANK= ATIGINC
016773,000290: 37,2775 01400 TC ATIGINC # GOTO ERASABLE TO CALCULATE ONLY TO RETN
016774,000291:
016775,000292: # CAUTION
016776,000293:
016777,000294: # THE ERASABLE PROGRAM THAT DOES THE CALCULATIONS MUST BE LOADED
016778,000295: # BEFORE ANY ATTEMPT IS MADE TO RUN THE IMU PERFORMANCE TEST
016779,000296:
016780,000297: 37,2776 E5,1400 EBANK= AZIMUTH
016781,000298: 37,2776 11412 CCS LENGTHOT
016782,000299: 37,2777 03034 TC SLEEPIE
016783,000300: 37,3000 11440 CCS TORQNDX
016784,000301: 37,3001 13003 TCF +2
016785,000302: 37,3002 03005 TC SETUPER1
016786,000303: 37,3003 30032 CA CDUX
016787,000304: 37,3004 55414 TS LOSVEC +1 # FOR TROUBLESHOOTING VD POSNS 2$4
016788,000305:
![]() |
Page 388 |
016790,000307: 37,3005 06037 SETUPER1 TC INTPRET
016791,000308: 37,3006 65345 DLOAD PDDL # ANGLES FROM DRIFT TEST ONLY
016792,000309: 37,3007 02473 ANGZ
016793,000310: 37,3010 02477 ANGY
016794,000311: 37,3011 55525 PDDL VDEF
016795,000312: 37,3012 02501 ANGX
016796,000313: 37,3013 74276 VCOMP VXSC
016797,000314: 37,3014 37110 GEORGEJ
016798,000315: 37,3015 74521 MXV VSR1
016799,000316: 37,3016 02643 XSM
016800,000317: 37,3017 02740 STORE OGC
016801,000318: 37,3020 77776 EXIT
016802,000319:
016803,000320: 37,3021 32475 CA OGCPL
016804,000321: 37,3022 04616 TC BANKCALL
016805,000322: 37,3023 17323 CADR IMUPULSE
016806,000323: 37,3024 02315 TC IMUSLLLG
016807,000324: 37,3025 11440 GEOSTRT4 CCS TORQNDX # ONLY POSITIVE IF IN VERTICAL DRIFT TEST
016808,000325: 37,3026 02263 TC VALMIS
016809,000326: 37,3027 06037 TC INTPRET
016810,000327: 37,3030 77624 CALL
016811,000328: 37,3031 76401 ERTHRVSE
016812,000329: 37,3032 77776 EXIT
016813,000330: 37,3033 02117 TC TORQUE
016814,000331:
016815,000332: 37,3034 55412 SLEEPIE TS LENGTHOT # TEST NOT OVER-DECREMENT LENGTHOT
016816,000333: 37,3035 11440 CCS TORQNDX # ARE WE DOING VERTDRIFT
016817,000334: 37,3036 02447 TC EARTHR*
016818,000335: 37,3037 05155 TC ENDOFJOB
016819,000336:
016820,000337: 37,3040 35014 SOMEERRR CA EBANK5
016821,000338: 37,3041 54003 TS EBANK
016822,000339: 37,3042 34753 CA ONE
016823,000340: 37,3043 55576 TS OVFLOWCK # STOP ALLOOP FROM CALLING ITSELF
016824,000341: 37,3044 05567 TC ALARM
016825,000342: 37,3045 01600 OCT 1600
016826,000343: 37,3046 02270 TC ENDTEST1
016827,000344: 37,3047 33054 SOMERR2 CAF OCT1601
016828,000345: 37,3050 05744 TC VARALARM
016829,000346: 37,3051 05516 TC DOWNFLAG
016830,000347: 37,3052 00007 ADRES IMUSE
016831,000348: 37,3053 05155 TC ENDOFJOB
016832,000349:
016833,000350: 37,3054 01601 OCT1601 OCT 01601
016834,000351: 37,3055 06200 DEC585 OCT 06200 # 3200 B+14 ORDER IS IMPORTANT
016835,000352: 37,3056 00000 00000 SCHZEROS 2DEC .00000000
![]() |
Page 389 |
016837,000354: 37,3060 00000 00000 2DEC .00000000
016838,000355:
016839,000356: 37,3062 00000 OCT 00000
016840,000357: 37,3063 00000 ONEDPP OCT 00000 # ORDER IS IMPORTANT
016841,000358: 37,3064 00001 OCT 00001
016842,000359:
016843,000360: 37,3065 00004 INTVAL OCT 4
016844,000361: 37,3066 00002 OCT 2
016845,000362: 37,3067 00220 DEC 144 B-14
016846,000363: 37,3070 77776 DEC -1 B-14
016847,000364: 37,3071 35730 00035 SOUPLY 2DEC .93505870 # INITIAL GAINS FOR PIP OUTPUTS
016848,000365:
016849,000366: 37,3073 10317 17550 2DEC .26266423 # INITIAL GAINS/4 FOR ERECTION ANGLES
016850,000367:
016851,000368: 37,3075 00115 77DECML DEC 77 B-14
016852,000369: 37,3076 01443 ALXXXZ GENADR ALX1S -1
016853,000370: 37,3077 04133 02265 PIPASC 2DEC .13055869
016854,000371:
016855,000372: 37,3101 57223 66451 VELSC 2DEC -.52223476 # 512/980.402
016856,000373:
016857,000374: 37,3103 05427 12577 ALSK 2DEC .17329931 # SSWAY VEL GAIN X 980.402/4096
016858,000375:
016859,000376: 37,3105 77567 44202 2DEC -.00835370 # SSWAY ACCEL GAIN X 980.402/4096
016860,000377:
016861,000378: 37,3107 24276 14066 GEORGEJ 2DEC .63661977
016862,000379:
016863,000380: 37,3111 23073 11773 GEORGEK 2DEC .59737013
016864,000381:
End of include-file IMU_PERFORMANCE_TESTS_4.agc. Parent file is MAIN.agc