Source Code
This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the third release
of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 96 and 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. |
026858,000002: ## Copyright: Public domain.
026859,000003: ## Filename: P30,P37.agc
026860,000004: ## Purpose: Part of the reconstructed source code for LMY99 Rev 0,
026861,000005: ## otherwise known as Luminary Rev 99, the third release
026862,000006: ## of the Apollo Guidance Computer (AGC) software for Apollo 11.
026863,000007: ## It differs from LMY99 Rev 1 (the flown version) only in the
026864,000008: ## placement of a single label. The corrections shown here have
026865,000009: ## been verified to have the same bank checksums as AGC developer
026866,000010: ## Allan Klumpp's copy of Luminary Rev 99, and so are believed
026867,000011: ## to be accurate. This file is intended to be a faithful
026868,000012: ## recreation, except that the code format has been changed to
026869,000013: ## conform to the requirements of the yaYUL assembler rather than
026870,000014: ## the original YUL assembler.
026871,000015: ##
026872,000016: ## Assembler: yaYUL
026873,000017: ## Contact: Ron Burkey <info@sandroid.org>.
026874,000018: ## Website: www.ibiblio.org/apollo.
026875,000019: ## Pages: 614-617
026876,000020: ## Mod history: 2009-05-17 RSB Adapted from the corresponding
026877,000021: ## Luminary131 file, using page
026878,000022: ## images from Luminary 1A.
026879,000023: ## 2009-06-05 RSB Removed 4 lines of code that shouldn't
026880,000024: ## have survived from Luminary 131.
026881,000025: ## 2016-12-13 RSB GOTOP00H -> GOTOPOOH
026882,000026: ## 2016-12-14 RSB VNP00H -> VNPOOH.
026883,000027: ## 2016-12-14 RSB Proofed text comments with octopus/ProoferComments
026884,000028: ## and corrected the errors found.
026885,000029: ## 2017-08-01 MAS Created from LMY99 Rev 1.
026886,000030:
026887,000031: ## This source code has been transcribed or otherwise adapted from
026888,000032: ## digitized images of a hardcopy from the MIT Museum. The digitization
026889,000033: ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
026890,000034: ## the Museum. Many thanks to both. The images (with suitable reduction
026891,000035: ## in storage size and consequent reduction in image quality as well) are
026892,000036: ## available online at www.ibiblio.org/apollo. If for some reason you
026893,000037: ## find that the images are illegible, contact me at info@sandroid.org
026894,000038: ## about getting access to the (much) higher-quality images which Paul
026895,000039: ## actually created.
026896,000040: ##
026897,000041: ## The code has been modified to match LMY99 Revision 0, otherwise
026898,000042: ## known as Luminary Revision 99, the Apollo 11 software release preceeding
026899,000043: ## the listing from which it was transcribed. It has been verified to
026900,000044: ## contain the same bank checksums as AGC developer Allan Klumpp's listing
026901,000045: ## of Luminary Revision 99 (for which we do not have scans).
026902,000046: ##
026903,000047: ## Notations on Allan Klumpp's listing read, in part:
026904,000048: ##
026905,000049: ## ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
026906,000050:
Page 614 |
026908,000052: # PROGRAM DESCRIPTION P30 DATE 3-6-67
026909,000053:
026910,000054: # MOD.1 BY RAMA AIYAWAR
026911,000055:
026912,000056: # FUNCTIONAL DESCRIPTION
026913,000057: # ACCEPT ASTRONAUT INPUTS OF TIG,DELV(LV)
026914,000058: # CALL IMU STATUS CHECK ROUTINE (R02)
026915,000059: # DISPLAY TIME TO GO, APOGEE, PERIGEE, DELV(MAG), MGA AT IGN
026916,000060: # REQUEST BURN PROGRAM
026917,000061:
026918,000062: # CALLING SEQUENCE VIA JOB FROM V37
026919,000063:
026920,000064: # EXIT VIA V37 CALL OR TO GOTOPOOH (V34E)
026921,000065:
026922,000066: # SUBROUTINE CALLS - FLAGUP, PHASCHNG, BANKCALL, ENDOFJOB, GOFLASH, GOFLASHR
026923,000067: # GOPERF3R, INTPRET, BLANKET, GOTOPOOH, R02BOTH, S30.1,
026924,000068: # TTG/N35, MIDGIM, DISPMGA
026925,000069:
026926,000070: # ERASABLE INITIALIZATION - STATE VECTOR
026927,000071:
026928,000072: # OUTPUT - RINIT, VINIT, +MGA, VTIG, RTIG, DELVSIN, DELVSAB, DELVSLV, HAPO,
026929,000073: # HPER, TTOGO
026930,000074:
026931,000075: # DEBRIS - A, L, MPAC, PUSHLIST
026932,000076:
026933,000077: 32,2776 BANK 32
026934,000078: 35,2000 SETLOC P30S
026935,000079: 35,2000 BANK
026936,000080: 35,2000 E4,1652 EBANK= +MGA
026937,000081: 35,2000 COUNT* $$/P30
026938,000082: 35,2000 05504 P30 TC UPFLAG # SET UPDATE FLAG
026939,000083: 35,2001 00027 ADRES UPDATFLG
026940,000084: 35,2002 05504 TC UPFLAG # SET TRACK FLAG
026941,000085: 35,2003 00031 ADRES TRACKFLG
026942,000086:
026943,000087: 35,2004 32025 P30N33 CAF V06N33 # T OF IGN
026944,000088: 35,2005 03712 TC VNPOOH # RETURNS ON PROCEED, POOH ON TERMINATE
026945,000089:
026946,000090: 35,2006 33727 CAF V06N81 # DISPLAY DELTA V (LV)
026947,000091: 35,2007 03712 TC VNPOOH # REDISPLAY ON RECYCLE
026948,000092:
026949,000093: 35,2010 05516 TC DOWNFLAG # RESET UPDATE FLAG
026950,000094: 35,2011 00027 ADRES UPDATFLG
026951,000095: 35,2012 06037 TC INTPRET
026952,000096: 35,2013 77624 CALL
026953,000097: 35,2014 70000 S30.1
026954,000098: 35,2015 77414 SET EXIT
026955,000099: 35,2016 00470 UPDATFLG
026956,000100: 35,2017 32026 PARAM30 CAF V06N42 # DISPLAY APOGEE,PERIGEE,DELTA V
026957,000101: 35,2020 03712 TC VNPOOH
Page 615 |
026959,000103:
026960,000104: 35,2021 06037 TC INTPRET
026961,000105: 35,2022 77614 SETGO
026962,000106: 35,2023 01027 XDELVFLG # FOR P40'S: EXTERNAL DELTA-V GUIDANCE.
026963,000107: 35,2024 72540 REVN1645 # TRKMKCNT, TGO, +MGA DISPLAY
026964,000108:
026965,000109: 35,2025 01441 V06N33 VN 0633
026966,000110: 35,2026 01452 V06N42 VN 0642
026967,000111:
Page 616 |
026969,000113: # PROGRAM DESCRIPTION S30.1 DATE 9NOV66
026970,000114: # MOD NO 1 LOG SECTION P30,P37
026971,000115: # MOD BY RAMA AIYAWAR **
026972,000116:
026973,000117: # FUNCTIONAL DESCRIPTION
026974,000118: # BASED ON STORED TARGET PARAMETERS (R OF IGNITION (RTIG), V OF
026975,000119: # IGNITION (VTIG), TIME OF IGNITION (TIG)), COMPUTE PERIGEE ALTITUDE
026976,000120: # APOGEE ALTITUDE AND DELTAV REQUIRED (DELVSIN).
026977,000121:
026978,000122: # CALLING SEQUENCE
026979,000123: # L CALL
026980,000124: # L+1 S30.1
026981,000125:
026982,000126: # NORMAL EXIT MODE
026983,000127: # AT L+2 OR CALLING SEQUENCE (GOTO L+2)
026984,000128:
026985,000129: # SUBROUTINES CALLED
026986,000130: # LEMPREC
026987,000131: # PERIAPO
026988,000132:
026989,000133: # ALARM OR ABORT EXIT MODES
026990,000134: # NONE
026991,000135:
026992,000136: # ERASABLE INITIALIZATION REQUIRED
026993,000137: # TIG TIME OF IGNITION DP B28CS
026994,000138: # DELVSLV SPECIFIED DELTA-V IN LOCAL VERT.
026995,000139: # COORDS. OF ACTIVE VEHICLE AT
026996,000140: # TIME OF IGNITION VECTOR B+7 METERS/CS
026997,000141:
026998,000142: # OUTPUT
026999,000143: # RTIG POSITION AT TIG VECTOR B+29 METERS
027000,000144: # VTIG VELOCITY AT TIG VECTOR B+29 METERS/CS
027001,000145: # PDL 4D APOGEE ALTITUDE DP B+29 M, B+27 METERS.
027002,000146: # HAPO APOGEE ALTITUDE DP B+29 METERS
027003,000147: # PDL 8D PERIGEE ALTITUDE DP B+29 M, B+27 METERS.
027004,000148: # HPER PERIGEE ALTITUDE DP B+29 METERS
027005,000149: # DELVSIN SPECIFIED DELTA-V IN INERTIAL
027006,000150: # COORD. OF ACTIVE VEHICLE AT
027007,000151: # TIME OF IGNITION VECTOR B+7 METERS/CS
027008,000152: # DELVSAB MAG. OF DELVSIN VECTOR B+7 METERS/CS
027009,000153:
027010,000154: # DEBRIS QTEMP TEMP.ERASABLE
027011,000155: # QPRET, MPAC
027012,000156: # PUSHLIST
027013,000157:
027014,000158: 34,2000 SETLOC P30S1
027015,000159: 34,2000 BANK
027016,000160:
027017,000161: 34,2000 COUNT* $$/S30S
027018,000162:
027019,000163: 34,2000 71220 S30.1 STQ DLOAD
027020,000164: 34,2001 03632 QTEMP
027021,000165: 34,2002 03442 TIG # TIME IGNITION SCALED AT 2(+28)CS
027022,000166: 34,2003 34041 STCALL TDEC1
027023,000167: 34,2004 27057 LEMPREC # ENCKE ROUTINE FOR LEM
027024,000168:
027025,000169: 34,2005 67175 VLOAD SXA,2
Page 617 |
027027,000171: 34,2006 00001 RATT
027028,000172: 34,2007 02777 RTX2
027029,000173: 34,2010 03642 STORE RTIG # RADIUS VECTOR AT IGNITION TIME
027030,000174: 34,2011 57456 UNIT VCOMP
027031,000175: 34,2012 27656 STOVL DELVSIN # ZRF/LV IN DELVSIN SCALED AT 2
027032,000176: 34,2013 00007 VATT # VELOCITY VECTOR AT TIG, SCALED 2(7) M/CS
027033,000177: 34,2014 03650 STORE VTIG
027034,000178: 34,2015 53435 VXV UNIT
027035,000179: 34,2016 03642 RTIG
027036,000180: 34,2017 66001 SETPD SXA,1
027037,000181: 34,2020 00001 0
027038,000182: 34,2021 02776 RTX1
027039,000183: 34,2022 47206 PUSH VXV # YRF/LV PDL 0 SCALED AT 2
027040,000184: 34,2023 03656 DELVSIN
027041,000185: 34,2024 63372 VSL1 PDVL
027042,000186: 34,2025 63315 PDVL PDVL # YRF/LV PDL 6 SCALED AT 2
027043,000187: 34,2026 03656 DELVSIN # ZRF/LV PDL 12D SCALED AT 2
027044,000188: 34,2027 03434 DELVSLV
027045,000189: 34,2030 76505 VXM VSL1
027046,000190: 34,2031 00001 0
027047,000191: 34,2032 03656 STORE DELVSIN # DELTAV IN INERT. COOR. SCALED TO B+7M/CS
027048,000192: 34,2033 77646 ABVAL
027049,000193: 34,2034 27664 STOVL DELVSAB # DELTA V MAG.
027050,000194: 34,2035 03642 RTIG # (FOR PERIAPO)
027051,000195: 34,2036 53315 PDVL VAD # VREQUIRED = VTIG + DELVSIN (FOR PERIAPO)
027052,000196: 34,2037 03650 VTIG
027053,000197: 34,2040 03656 DELVSIN
027054,000198: 34,2041 77624 CALL
027055,000199: 34,2042 46316 PERIAPO1
027056,000200: 34,2043 77624 CALL
027057,000201: 34,2044 46426 SHIFTR1 # RESCALE IF NEEDED
027058,000202: 34,2045 77624 CALL # LIMIT DISPLAY TO 9999.9 N. MI.
027059,000203: 34,2046 45636 MAXCHK
027060,000204: 34,2047 16321 STODL HPER # PERIGEE ALT 2(29) METERS, FOR DISPLAY
027061,000205: 34,2050 00005 4D
027062,000206: 34,2051 77624 CALL
027063,000207: 34,2052 46426 SHIFTR1 # RESCALE IF NEEDED
027064,000208: 34,2053 77624 CALL # LIMIT DISPLAY TO 9999.9 N. MI.
027065,000209: 34,2054 45636 MAXCHK
027066,000210: 34,2055 36317 STCALL HAPO # APOGEE ALT 2(29) METERS, FOR DISPLAY
027067,000211: 34,2056 03632 QTEMP
027068,000212:
027069,000213:
End of include-file P30,P37.agc. Parent file is MAIN.agc