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. |
014327,000002: ## Copyright: Public domain.
014328,000003: ## Filename: R63.agc
014329,000004: ## Purpose: Part of the reconstructed source code for LMY99 Rev 0,
014330,000005: ## otherwise known as Luminary Rev 99, the second release
014331,000006: ## of the Apollo Guidance Computer (AGC) software for Apollo 11.
014332,000007: ## It differs from LMY99 Rev 1 (the flown version) only in the
014333,000008: ## placement of a single label. The corrections shown here have
014334,000009: ## been verified to have the same bank checksums as AGC developer
014335,000010: ## Allan Klumpp's copy of Luminary Rev 99, and so are believed
014336,000011: ## to be accurate. This file is intended to be a faithful
014337,000012: ## recreation, except that the code format has been changed to
014338,000013: ## conform to the requirements of the yaYUL assembler rather than
014339,000014: ## the original YUL assembler.
014340,000015: ##
014341,000016: ## Assembler: yaYUL
014342,000017: ## Contact: Ron Burkey <info@sandroid.org>.
014343,000018: ## Website: www.ibiblio.org/apollo.
014344,000019: ## Pages: 338-341
014345,000020: ## Mod history: 2009-05-16 RSB Adapted from the corresponding
014346,000021: ## Luminary131 file, using page
014347,000022: ## images from Luminary 1A.
014348,000023: ## 2016-12-14 RSB Proofed text comments with octopus/ProoferComments
014349,000024: ## and corrected the errors found.
014350,000025: ## 2017-01-26 RSB Back-ported a comment-text fix from Luminary 69.
014351,000026: ## 2017-03-07 RSB Comment-text fixes noted in proofing Luminary 116.
014352,000027: ## 2017-08-01 MAS Created from LMY99 Rev 1.
014353,000028:
014354,000029: ## This source code has been transcribed or otherwise adapted from
014355,000030: ## digitized images of a hardcopy from the MIT Museum. The digitization
014356,000031: ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
014357,000032: ## the Museum. Many thanks to both. The images (with suitable reduction
014358,000033: ## in storage size and consequent reduction in image quality as well) are
014359,000034: ## available online at www.ibiblio.org/apollo. If for some reason you
014360,000035: ## find that the images are illegible, contact me at info@sandroid.org
014361,000036: ## about getting access to the (much) higher-quality images which Paul
014362,000037: ## actually created.
014363,000038: ##
014364,000039: ## The code has been modified to match LMY99 Revision 0, otherwise
014365,000040: ## known as Luminary Revision 99, the Apollo 11 software release preceeding
014366,000041: ## the listing from which it was transcribed. It has been verified to
014367,000042: ## contain the same bank checksums as AGC developer Allan Klumpp's listing
014368,000043: ## of Luminary Revision 99 (for which we do not have scans).
014369,000044: ##
014370,000045: ## Notations on Allan Klumpp's listing read, in part:
014371,000046: ##
014372,000047: ## ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
014373,000048:
![]() |
Page 338 |
014375,000050: # SUBROUTINE NAME: V89CALL
014376,000051: # MOD NO: 0 DATE: 9 JAN 1968
014377,000052: # MOD BY: DIGITAL DEVEL GROUP LOG SECTION: R63
014378,000053:
014379,000054: # FUNCTIONAL DESCRIPTION:
014380,000055:
014381,000056: # CALLED BY VERB 89 ENTER DURING P00. PRIO 10 USED. CALCULATES AND
014382,000057: # DISPLAYS FINAL FDAI BALL ANGLES TO POINT LM +X OR +Z AXIS AT CSM.
014383,000058:
014384,000059: # 1. KEY IN V 89 E ONLY IF IN PROG 00. IF NOT IN P00, OPERATOR ERROR AND
014385,000060: # EXIT R63, OTHERWISE CONTINUE.
014386,000061:
014387,000062: # 2. IF IN P00, DO IMU STATUS CHECK ROUTINE (R02BOTH). IF IMU ON AND ITS
014388,000063: # ORIENTATION KNOWN TO LGC, CONTINUE.
014389,000064:
014390,000065: # 3. FLASH DISPLAY V 04 N 06. R2 INDICATES WHICH SPACECRAFT AXIS IS TO
014391,000066: # BE POINTED AT CSM. INITIAL CHOICE IS PREFERRED (+Z) AXIS (R2=1).
014392,000067: # ASTRONAUT CAN CHANGE TO (+X) AXIS (R2 NOT =1) BY V 22 E 2 E. CONTINUE
014393,000068: # AFTER KEYING IN PROCEED.
014394,000069:
014395,000070: # 4. BOTH VEHICLE STATE VECTORS UPDATED BY CONIC EQS.
014396,000071:
014397,000072: # 5. HALF MAGNITUDE UNIT LOS VECTOR (IN STABLE MEMBER COORDINATES) AND
014398,000073: # HALF MAGNITUDE UNIT SPACECRAFT AXIS VECTOR (IN BODY COORDINATES)
014399,000074: # PREPARED FOR VECPOINT.
014400,000075:
014401,000076: # 6. GIMBAL ANGLES FROM VECPOINT TRANSFORMED INTO FDAI BALL ANGLES BY
014402,000077: # BALLANGS. FLASH DISPLAY V 06 N 18 AND AWAIT RESPONSE.
014403,000078:
014404,000079: # 7. RECYCLE - RETURN TO STEP 4.
014405,000080: # TERMINATE - EXIT R63.
014406,000081: # PROCEED - RESET 3AXISFLG AND CALL R60LEM FOR ATTITUDE MANEUVER.
014407,000082:
014408,000083: # CALLING SEQUENCE: V 89 E.
014409,000084:
014410,000085: # SUBROUTINES CALLED: CHKPOOH, R02BOTH, GOXDSPF, CSMCONIC, LEMCONIC,
014411,000086: # VECPOINT, BALLANGS, R60LEM.
014412,000087:
014413,000088: # NORMAL EXIT MODES: TC ENDEXT
014414,000089:
014415,000090: # ALARMS: 1. OPERATOR ERROR IF NOT IN P00.
014416,000091: # 2. PROGRAM ALARM IF IMU IS OFF.
014417,000092: # 3. PROGRAM ALARM IF IMU ORIENTATION IS UNKNOWN.
014418,000093:
014419,000094: # OUTPUT: NONE
014420,000095:
014421,000096: # ERASABLE INITIALIZATION REQUIRED: NONE
014422,000097:
014423,000098: # DEBRIS: OPTION1, +1, TDEC1, POINTVSM, SCAXIS, CPHI, CTHETA, CPSI,
![]() |
Page 339 |
014425,000100: # 3AXISFLG.
014426,000101:
014427,000102: 06,3715 E4,1606 EBANK= RONE
014428,000103: 32,2217 BANK 32
014429,000104: 26,2000 SETLOC BAWLANGS
014430,000105: 26,2000 BANK
014431,000106:
014432,000107: 26,2022 COUNT* $$/R63
014433,000108: 26,2022 04616 V89CALL TC BANKCALL # IMU STATUS CHECK. RETURNS IF ORIENTATION
014434,000109: 26,2023 11254 CADR R02BOTH # KNOWN. ALARMS IF NOT.
014435,000110: 26,2024 36245 CAF THREE # ALLOW ASTRONAUT TO SELECT DESIRED
014436,000111: 26,2025 55051 TS OPTIONX # TRACKING ATTITUDE AXIS.
014437,000112: 26,2026 34753 CAF ONE
014438,000113: 26,2027 55052 TS OPTIONX +1
014439,000114: 26,2030 32117 CAF VB04N12 # V 04 N 12
014440,000115: 26,2031 04616 TC BANKCALL
014441,000116: 26,2032 20476 CADR GOFLASH
014442,000117: 26,2033 05472 TC ENDEXT # TERMINATE
014443,000118: 26,2034 02036 TC +2 # PROCEED
014444,000119: 26,2035 02030 TC -5 # DATA IN. OPTION1+1 = 1 FOR Z AXIS
014445,000120: 26,2036 06037 V89RECL TC INTPRET # = 2 FOR X AXIS
014446,000121: 26,2037 43234 RTB DAD
014447,000122: 26,2040 21573 LOADTIME # READ PRESENT TIME
014448,000123: 26,2041 14122 DP1MIN
014449,000124: 26,2042 02205 STORE TSTART82 # SAVE TIME FOR LEMCONIC CALL
014450,000125: 26,2043 34041 STCALL TDEC1 # STORE TIME FOR CSMCONIC CALL
014451,000126: 26,2044 27066 CSMCONIC # CSM STATE VECTOR UPDATE
014452,000127: 26,2045 77775 VLOAD # CSMCONIC LEFT R VECTOR IN RATT
014453,000128: 26,2046 00001 RATT
014454,000129: 26,2047 16207 STODL RONE # SAVE FOR LINE OF SIGHT (LOS) COMPUTATION
014455,000130: 26,2050 02205 TSTART82
014456,000131: 26,2051 34041 STCALL TDEC1 # STORE TIME FOR LEMCONIC CALL
014457,000132: 26,2052 27100 LEMCONIC # LEM STATE VECTOR UPDATE
014458,000133: 26,2053 52375 VLOAD VSU # CSM POSITION - LEM POSITION = LOS
014459,000134: 26,2054 02207 RONE # LOS VECTOR LEFT IN MPAC
014460,000135: 26,2055 00001 RATT
014461,000136: 26,2056 47121 MXV RTB # (REFSMMAT X LOS). TRANSFORMS LOS FROM
014462,000137: 26,2057 01734 REFSMMAT # REFERENCE COORD TO STAB MEMB COORD.
014463,000138: 26,2060 21726 NORMUNIT
014464,000139: 26,2061 03773 STORE POINTVSM # STORE LOS FOR VECPOINT CALL
014465,000140: 26,2062 77776 EXIT
014466,000141: 26,2063 41052 CS OPTIONX +1 # 1 FOR Z AXIS. 2 FOR X AXIS.
014467,000142: 26,2064 64753 AD ONE
014468,000143: 26,2065 00006 EXTEND
014469,000144: 26,2066 12113 BZF ALINEZ
014470,000145: 26,2067 06037 ALINEX TC INTPRET # X AXIS ALIGNMENT
014471,000146: 26,2070 77775 VLOAD
014472,000147: 26,2071 06520 UNITX # READ (.5, 0, 0)
![]() |
Page 340 |
014474,000149: 26,2072 37765 V89CALL1 STCALL SCAXIS # STORE SELECTED ALIGNMENT AXIS
014475,000150: 26,2073 56040 VECPOINT # PUTS DESIRED GIM ANG (OG,IG,MG) IN TMPAC
014476,000151: 26,2074 00322 STORE CPHI # STORE GIMBAL ANGLES FOR BALLANGS CALL.
014477,000152: 26,2075 77776 EXIT
014478,000153: 26,2076 04616 TC BANKCALL
014479,000154: 26,2077 54266 CADR BALLANGS # PUTS DESIRED BALL ANGLES IN FDAIX,Y,Z
014480,000155: 26,2100 32120 CAF VB06N18 # V 06 N 18
014481,000156: 26,2101 04616 TC BANKCALL # NOUN 18 REFERS TO FDAIX,Y,Z
014482,000157: 26,2102 20476 CADR GOFLASH
014483,000158: 26,2103 05472 TC ENDEXT # TERMINATE
014484,000159: 26,2104 02106 TC +2 # PROCEED
014485,000160: 26,2105 02036 TC V89RECL # RECYCLE
014486,000161: 26,2106 05516 TC DOWNFLAG # RESET 3 AXIS FLAG
014487,000162: 26,2107 00124 ADRES 3AXISFLG # RESET BIT6 FLAG WORD 5
014488,000163: 26,2110 04616 TC BANKCALL # PERFORMS LEM MANEUVER TO ALIGN SELECTED
014489,000164: 26,2111 54123 CADR R60LEM # SPACECRAFT AXIS TO CSM.
014490,000165: 26,2112 15472 TCF ENDEXT # TERMINATE R63
014491,000166:
014492,000167: 26,2113 06037 ALINEZ TC INTPRET # Z AXIS ALIGNMENT
014493,000168: 26,2114 52175 VLOAD GOTO
014494,000169: 26,2115 06514 UNITZ # READ (0, 0, .5)
014495,000170: 26,2116 54072 V89CALL1
014496,000171:
014497,000172: 26,2117 01014 VB04N12 VN 412
014498,000173: 26,2120 01422 VB06N18 VN 0618
![]() |
Page 341 |
014500,000175: 26,2121 00000 13560 DP1MIN 2DEC 6000 B-28
014501,000176:
End of include-file R63.agc. Parent file is MAIN.agc