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. |
028482,000002: ## Copyright: Public domain.
028483,000003: ## Filename: LAMBERT_AIMPOINT_GUIDANCE.agc
028484,000004: ## Purpose: Part of the reconstructed source code for LMY99 Rev 0,
028485,000005: ## otherwise known as Luminary Rev 99, the second release
028486,000006: ## of the Apollo Guidance Computer (AGC) software for Apollo 11.
028487,000007: ## It differs from LMY99 Rev 1 (the flown version) only in the
028488,000008: ## placement of a single label. The corrections shown here have
028489,000009: ## been verified to have the same bank checksums as AGC developer
028490,000010: ## Allan Klumpp's copy of Luminary Rev 99, and so are believed
028491,000011: ## to be accurate. This file is intended to be a faithful
028492,000012: ## recreation, except that the code format has been changed to
028493,000013: ## conform to the requirements of the yaYUL assembler rather than
028494,000014: ## the original YUL assembler.
028495,000015: ##
028496,000016: ## Assembler: yaYUL
028497,000017: ## Contact: Ron Burkey <info@sandroid.org>.
028498,000018: ## Website: www.ibiblio.org/apollo.
028499,000019: ## Pages: 651-653
028500,000020: ## Mod history: 2009-05-18 RSB Transcribed from Luminary 099
028501,000021: ## page images.
028502,000022: ## 2009-06-05 RSB Corrected 4 typos.
028503,000023: ## 2009-06-07 RSB Fixed a typo.
028504,000024: ## 2016-12-14 RSB VNP00H -> VNPOOH.
028505,000025: ## 2016-12-14 RSB Proofed text comments with octopus/ProoferComments
028506,000026: ## and corrected the errors found.
028507,000027: ## 2017-08-01 MAS Created from LMY99 Rev 1.
028508,000028:
028509,000029: ## This source code has been transcribed or otherwise adapted from
028510,000030: ## digitized images of a hardcopy from the MIT Museum. The digitization
028511,000031: ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
028512,000032: ## the Museum. Many thanks to both. The images (with suitable reduction
028513,000033: ## in storage size and consequent reduction in image quality as well) are
028514,000034: ## available online at www.ibiblio.org/apollo. If for some reason you
028515,000035: ## find that the images are illegible, contact me at info@sandroid.org
028516,000036: ## about getting access to the (much) higher-quality images which Paul
028517,000037: ## actually created.
028518,000038: ##
028519,000039: ## The code has been modified to match LMY99 Revision 0, otherwise
028520,000040: ## known as Luminary Revision 99, the Apollo 11 software release preceeding
028521,000041: ## the listing from which it was transcribed. It has been verified to
028522,000042: ## contain the same bank checksums as AGC developer Allan Klumpp's listing
028523,000043: ## of Luminary Revision 99 (for which we do not have scans).
028524,000044: ##
028525,000045: ## Notations on Allan Klumpp's listing read, in part:
028526,000046: ##
028527,000047: ## ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
028528,000048:
![]() |
Page 651 |
028530,000050:
028531,000051: # GENERAL LAMBERT AIMPOINT GUIDANCE **
028532,000052: # WRITTEN BY RAMA M AIYAWAR
028533,000053:
028534,000054: # PROGRAM P-31 DESCRIPTION **
028535,000055:
028536,000056: # 1. TO ACCEPT TARGETING PARAMETERS OBTAINED FROM A SOURCE EXTERNAL
028537,000057: # TO THE LEM AND COMPUTE THERE FROM THE REQUIRED-VELOCITY AND
028538,000058: # OTHER INITIAL CONDITIONS REQUIRED BY LM FOR DESIRED MANEUVER.
028539,000059: # THE TARGETING PARAMETERS ARE TIG (TIME OF IGNITION), TARGET
028540,000060: # VECTOR (RTARG), AND THE TIME FROM TIG UNTIL THE TARGET IS
028541,000061: # REACHED (DELLT4), DESIRED TIME OF FLIGHT FROM RINIT TO RTARG..
028542,000062:
028543,000063: # ASSUMPTIONS **
028544,000064:
028545,000065: # 1. THE TARGET PARAMETERS MAY HAVE BEEN LOADED PRIOR TO THE
028546,000066: # EXECUTION OF THIS PROGRAM.
028547,000067: # 2. THIS PROGRAM IS APPLICABLE IN EITHER EARTH OR LUNAR ORBIT.
028548,000068: # 3. THIS PROGRAM IS DESIGNED FOR ONE-MAN OPERATION, AND SHOULD
028549,000069: # BE SELECTED BY THE ASTRONAUT BY DSKY ENTRY V37 E31.
028550,000070:
028551,000071: # SUBROUTINES USED **
028552,000072: #
028553,000073: # MANUPARM, TTG/N35, R02BOTH, MIDGIM, DISPMGA, FLAGDOWN, BANKCALL,
028554,000074: # GOTOPOOH, ENDOFJOB, PHASCHNG, GOFLASHR, GOFLASH.
028555,000075:
028556,000076: # MANUPARM CALCULATES APOGEE, PERIGEE ALTITUDES AND DELTAV DESIRED
028557,000077: # FOR THE MANEUVER.
028558,000078:
028559,000079: # TTG/N35 CLOCKTASK - UPDATES CLOCK.
028560,000080:
028561,000081: # MIDGIM CALCULATES MIDDLE GIMBAL ANGLE FOR DISPLAY.
028562,000082:
028563,000083: # R02BOTH IMU - STATUS CHECK ROUTINE.
028564,000084:
028565,000085: # DISPLAYS USED IN P-31LM **
028566,000086:
028567,000087: # V06N33 DISPLAY SOTRED TIG (IN HRS. MINS. SECS)
028568,000088: # V06N42 DISPLAY APOGEE, PERIGEE, DELTAV.
028569,000089: # V16N35 DISPLAY TIME FROM TIG.
028570,000090: # V06N45 TIME FROM IGNITION AND MIDDLE GIMBAL ANGLE.
028571,000091:
028572,000092: # ERASABLE INITIALIZATION REQUIRED **
028573,000093:
028574,000094: # TIG TIME OF IGNITION DP (B+28) CS.
028575,000095:
028576,000096: # DELLT4 DESIRED TIME OF FLIGHT DP (B+28) CS
028577,000097: # FROM RINIT TO RTARG.
028578,000098:
028579,000099: # RTARG RADIUS VECTOR OF TARGET POSITION VECTOR
028580,000100: # RADIUS VECTOR SCALED TO (B+29)METERS IF EARTH ORBIT
![]() |
Page 652 |
028582,000102: # RADIUS VECTOR SCALED TO (B+27)METERS IF MOON ORBIT
028583,000103:
028584,000104: # OUTPUT **
028585,000105:
028586,000106: # HAPO APOGEE ALTITUDE
028587,000107: # HPER PERIGEE ALTITUDE
028588,000108: # VGDISP MAG. OF DELTAV FOR DISPLAY, SCALING B+7 M/CS EARTH
028589,000109: # MAG. OF DELTAV FOR DISPLAY, SCALING B+5 M/CS MOON
028590,000110: # MIDGIM MIDDLE GIMBAL ANGLE
028591,000111: # XDELVFLG RESETS XDELVFLG FOR LAMBERT VG COMPUTATIONS
028592,000112:
028593,000113: # ALARMS OR ABORTS NONE **
028594,000114:
028595,000115: # RESTARTS ARE VIA GROUP 4 **
028596,000116:
028597,000117: 35,2000 SETLOC GLM
028598,000118: 35,2000 BANK
028599,000119:
028600,000120: 35,2450 E7,1470 EBANK= SUBEXIT
028601,000121:
028602,000122: 35,2450 COUNT* $$/P31
028603,000123: 35,2450 02361 P31 TC P20FLGON
028604,000124: 35,2451 32025 CAF V06N33 # TIG
028605,000125: 35,2452 03712 TC VNPOOH
028606,000126: 35,2453 06037 TC INTPRET
028607,000127: 35,2454 71214 CLEAR DLOAD
028608,000128: 35,2455 00670 UPDATFLG
028609,000129: 35,2456 03442 TIG
028610,000130: 35,2457 34041 STCALL TDEC1 # INTEGRATE STATE VECTORS TO TIG
028611,000131: 35,2460 27057 LEMPREC
028612,000132: 35,2461 40375 VLOAD SETPD
028613,000133: 35,2462 00001 RATT
028614,000134: 35,2463 00001 0D
028615,000135: 35,2464 03642 STORE RTIG
028616,000136: 35,2465 26323 STOVL RINIT
028617,000137: 35,2466 00007 VATT
028618,000138: 35,2467 03650 STORE VTIG
028619,000139: 35,2470 16331 STODL VINIT
028620,000140: 35,2471 32420 P30ZERO
028621,000141: 35,2472 65206 PUSH PDDL # E4 AND NUMIT = 0
028622,000142: 35,2473 03452 DELLT4
028623,000143: 35,2474 66015 DAD SXA,1
028624,000144: 35,2475 03442 TIG
028625,000145: 35,2476 02776 RTX1
028626,000146: 35,2477 03631 STORE TPASS4
028627,000147: 35,2500 45134 SXA,2 CALL
028628,000148: 35,2501 02777 RTX2
028629,000149: 35,2502 22000 INITVEL
028630,000150: 35,2503 41575 VLOAD PUSH
![]() |
Page 653 |
028632,000152: 35,2504 02366 DELVEET3
028633,000153: 35,2505 03656 STORE DELVSIN
028634,000154: 35,2506 43046 ABVAL CLEAR
028635,000155: 35,2507 01267 XDELVFLG
028636,000156: 35,2510 37664 STCALL VGDISP
028637,000157: 35,2511 15733 GET.LVC
028638,000158: 35,2512 63375 VLOAD PDVL
028639,000159: 35,2513 03642 RTIG
028640,000160: 35,2514 02337 VIPRIME
028641,000161: 35,2515 77624 CALL
028642,000162: 35,2516 46316 PERIAPO1
028643,000163: 35,2517 77624 CALL
028644,000164: 35,2520 46426 SHIFTR1
028645,000165: 35,2521 77624 CALL # LIMIT DISPLAY TO 9999.9 N. MI.
028646,000166: 35,2522 45636 MAXCHK
028647,000167: 35,2523 16321 STODL HPER
028648,000168: 35,2524 00005 4D
028649,000169: 35,2525 77624 CALL
028650,000170: 35,2526 46426 SHIFTR1
028651,000171: 35,2527 77624 CALL # LIMIT DISPLAY TO 9999.9 N. MI.
028652,000172: 35,2530 45636 MAXCHK
028653,000173: 35,2531 02317 STORE HAPO
028654,000174: 35,2532 77776 EXIT
028655,000175: 35,2533 33727 CAF V06N81 # DELVLVC
028656,000176: 35,2534 03712 TC VNPOOH
028657,000177: 35,2535 32026 CAF V06N42 # HAPO, HPER, VGDISP
028658,000178: 35,2536 03712 TC VNPOOH
028659,000179: 35,2537 06037 TC INTPRET
028660,000180: 35,2540 45014 REVN1645 SET CALL # TRKMKCNT, TTOGO, +MGA
028661,000181: 35,2541 01071 FINALFLG
028662,000182: 35,2542 73606 VN1645
028663,000183: 35,2543 77650 GOTO
028664,000184: 35,2544 72540 REVN1645
028665,000185:
End of include-file LAMBERT_AIMPOINT_GUIDANCE.agc. Parent file is MAIN.agc