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. |
021305,000002: ## Copyright: Public domain.
021306,000003: ## Filename: S-BAND_ANTENNA_FOR_LM.agc
021307,000004: ## Purpose: Part of the reconstructed source code for LMY99 Rev 0,
021308,000005: ## otherwise known as Luminary Rev 99, the second release
021309,000006: ## of the Apollo Guidance Computer (AGC) software for Apollo 11.
021310,000007: ## It differs from LMY99 Rev 1 (the flown version) only in the
021311,000008: ## placement of a single label. The corrections shown here have
021312,000009: ## been verified to have the same bank checksums as AGC developer
021313,000010: ## Allan Klumpp's copy of Luminary Rev 99, and so are believed
021314,000011: ## to be accurate. This file is intended to be a faithful
021315,000012: ## recreation, except that the code format has been changed to
021316,000013: ## conform to the requirements of the yaYUL assembler rather than
021317,000014: ## the original YUL assembler.
021318,000015: ##
021319,000016: ## Assembler: yaYUL
021320,000017: ## Contact: Ron Burkey <info@sandroid.org>.
021321,000018: ## Website: www.ibiblio.org/apollo.
021322,000019: ## Pages: 486-489
021323,000020: ## Mod history: 2009-05-17 RSB Adapted from the corresponding
021324,000021: ## Luminary131 file, using page
021325,000022: ## images from Luminary 1A.
021326,000023: ## 2009-06-07 RSB Corrected a misprint.
021327,000024: ## 2016-12-14 RSB Proofed text comments with octopus/ProoferComments
021328,000025: ## and corrected the errors found.
021329,000026: ## 2017-08-01 MAS Created from LMY99 Rev 1.
021330,000027:
021331,000028: ## This source code has been transcribed or otherwise adapted from
021332,000029: ## digitized images of a hardcopy from the MIT Museum. The digitization
021333,000030: ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
021334,000031: ## the Museum. Many thanks to both. The images (with suitable reduction
021335,000032: ## in storage size and consequent reduction in image quality as well) are
021336,000033: ## available online at www.ibiblio.org/apollo. If for some reason you
021337,000034: ## find that the images are illegible, contact me at info@sandroid.org
021338,000035: ## about getting access to the (much) higher-quality images which Paul
021339,000036: ## actually created.
021340,000037: ##
021341,000038: ## The code has been modified to match LMY99 Revision 0, otherwise
021342,000039: ## known as Luminary Revision 99, the Apollo 11 software release preceeding
021343,000040: ## the listing from which it was transcribed. It has been verified to
021344,000041: ## contain the same bank checksums as AGC developer Allan Klumpp's listing
021345,000042: ## of Luminary Revision 99 (for which we do not have scans).
021346,000043: ##
021347,000044: ## Notations on Allan Klumpp's listing read, in part:
021348,000045: ##
021349,000046: ## ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
021350,000047:
![]() |
Page 486 |
021352,000049: # SUBROUTINE NAME: R05 - S-BAND ANTENNA FOR LM
021353,000050:
021354,000051: # MOD0 BY T. JAMES
021355,000052: # MOD1 BY P. SHAKIR
021356,000053:
021357,000054: # FUNCTIONAL DESCRIPTION
021358,000055:
021359,000056: # THE S-BAND ANTENNA ROUTINE, R05, COMPUTES AND DISPLAYS THE PITCH AND
021360,000057: # YAW ANTENNA GIMBAL ANGLES REQUIRED TO POINT THE LM STEERABLE ANTENNA
021361,000058: # TOWARD THE CENTER OF THE EARTH. THIS ROUTINE IS SELECTED BY THE ASTRO-
021362,000059: # NAUT VIA DSKY ENTRY DURING COASTING FLIGHT OR WHEN THE LM IS ON THE MOON
021363,000060: # SURFACE. THE EARTH OR MOON REFERENCE COORDINATE SYSTEM IS USED DEPENDING
021364,000061: # ON WHETHER THE LM IS ABOUT TO ENTER OR HAS ALREADY ENTERED THE MOON
021365,000062: # SPHERE OF INFLUENCE, RESPECTIVELY
021366,000063:
021367,000064: # TO CALL SUBROUTINE, ASTRONAUT KEYS IN V 64 E
021368,000065:
021369,000066: # SUBROUTINES CALLED -
021370,000067: # R02BOTH
021371,000068: # INTPRET
021372,000069: # LOADTIME
021373,000070: # LEMCONIC
021374,000071: # LUNPOS
021375,000072: # CDUTRIG
021376,000073: # *SMNB*
021377,000074: # BANKCALL
021378,000075: # B5OFF
021379,000076: # ENDOFJOB
021380,000077: # BLANKET
021381,000078:
021382,000079: # RETURNS WITH
021383,000080: # PITCH ANGLE IN PITCHANG REV. B0
021384,000081: # YAW ANGLE IN YAWANG REV. B0
021385,000082:
021386,000083: # ERASABLES USED
021387,000084: # PITCHANG
021388,000085: # YAWANG
021389,000086: # RLM
021390,000087: # VAC AREA
021391,000088:
021392,000089: 41,3731 BANK 41
021393,000090: 42,2000 SETLOC SBAND
021394,000091: 42,2000 BANK
021395,000092:
021396,000093: 42,3606 E7,1471 EBANK= WHOCARES
021397,000094: 42,3606 COUNT* $$/R05
021398,000095: 42,3606 04616 SBANDANT TC BANKCALL
![]() |
Page 487 |
021400,000097: 42,3607 11254 CADR R02BOTH # CHECK IF IMU IS ON AND ALIGNED
021401,000098: 42,3610 06037 TC INTPRET
021402,000099: 42,3611 47001 SETPD RTB
021403,000100: 42,3612 00001 0D
021404,000101: 42,3613 21573 LOADTIME # PICK UP CURRENT TIME
021405,000102: 42,3614 34041 STCALL TDEC1 # ADVANCE INTEGRATION TO TIME IN TDEC1
021406,000103: 42,3615 27100 LEMCONIC # USING CONIC INTEGRATION
021407,000104: 42,3616 46135 SLOAD BHIZ
021408,000105: 42,3617 00050 X2 # X2 =0 EARTH SPHERE, X2 =2 MOON SPHERE
021409,000106: 42,3620 65636 CONV4
021410,000107: 42,3621 77775 VLOAD
021411,000108: 42,3622 00001 RATT
021412,000109: 42,3623 16205 STODL RLM
021413,000110: 42,3624 00015 TAT
021414,000111: 42,3625 77624 CONV3 CALL
021415,000112: 42,3626 33664 LUNPOS # UNIT POSITION VECTOR FROM EARTH TO MOON
021416,000113: 42,3627 74375 VLOAD VXSC
021417,000114: 42,3630 02723 VMOON
021418,000115: 42,3631 24001 REMDIST # MEAN DISTANCE FROM EARTH TO MOON
021419,000116: 42,3632 53372 VSL1 VAD
021420,000117: 42,3633 02205 RLM
021421,000118: 42,3634 77650 GOTO
021422,000119: 42,3635 65640 CONV5
021423,000120: 42,3636 77775 CONV4 VLOAD
021424,000121: 42,3637 00001 RATT # UE = -UNIT(RATT) EARTH SPHERE
021425,000122: 42,3640 53401 CONV5 SETPD UNIT # UE = -UNIT((REM)(UEM) + RL) MOON SPHERE
021426,000123: 42,3641 00001 0D # SET PL POINTER TO 0
021427,000124: 42,3642 45076 VCOMP CALL
021428,000125: 42,3643 47537 CDUTRIG # COMPUTE SINES AND COSINES OF CDU ANGLES
021429,000126: 42,3644 76521 MXV VSL1 # TRANSFORM REF. COORDINATE SYSTEM TO
021430,000127: 42,3645 01734 REFSMMAT # STABLE MEMBER B-1 X B-1 X B+1 = B-1
021431,000128: 42,3646 71206 PUSH DLOAD # 8D
021432,000129: 42,3647 06522 HI6ZEROS
021433,000130: 42,3650 02201 STORE PITCHANG
021434,000131: 42,3651 26203 STOVL YAWANG # ZERO OUT ANGLES
021435,000132: 42,3652 77624 CALL
021436,000133: 42,3653 47671 *SMNB*
021437,000134: 42,3654 16205 STODL RLM # PRE-MULTIPLY RLM BY (NBSA) MATRIX(B0)
021438,000135: 42,3655 02207 RLM +2
021439,000136: 42,3656 45206 PUSH DSU
021440,000137: 42,3657 02205 RLM
021441,000138: 42,3660 77605 DMP
021442,000139: 42,3661 25771 1OVSQRT2
021443,000140: 42,3662 16207 STODL RLM +2
021444,000141: 42,3663 41215 DAD DMP
021445,000142: 42,3664 02205 RLM
021446,000143: 42,3665 25771 1OVSQRT2
021447,000144: 42,3666 26205 STOVL RLM # R B-1
021448,000145: 42,3667 02205 RLM
021449,000146: 42,3670 63256 UNIT PDVL
![]() |
Page 488 |
021451,000148: 42,3671 02205 RLM
021452,000149: 42,3672 72431 VPROJ VSL2 # PROJECTION OF R ONTO LM XZ PLANE
021453,000150: 42,3673 06516 HIUNITY
021454,000151: 42,3674 40045 BVSU BOV # CLEAR OVERFLOW INDICATOR IF ON
021455,000152: 42,3675 02205 RLM
021456,000153: 42,3676 65677 COVCNV
021457,000154: 42,3677 40056 COVCNV UNIT BOV # EXIT ON OVERFLOW
021458,000155: 42,3700 65745 SBANDEX
021459,000156: 42,3701 47206 PUSH VXV # URP VECTOR B-1
021460,000157: 42,3702 06514 HIUNITZ
021461,000158: 42,3703 57572 VSL1 VCOMP # UZ X URP = -(URP X UZ)
021462,000159: 42,3704 02205 STORE RLM # X VEC B-1
021463,000160: 42,3705 63241 DOT PDVL # SGN(X.UY) UNSCALED
021464,000161: 42,3706 06516 HIUNITY
021465,000162: 42,3707 02205 RLM
021466,000163: 42,3710 75246 ABVAL SIGN
021467,000164: 42,3711 77736 ASIN # ASIN((SGN(X.UY))ABV(X)) REV B0
021468,000165: 42,3712 26201 STOVL PITCHANG
021469,000166: 42,3713 00007 URP
021470,000167: 42,3714 51041 DOT BPL
021471,000168: 42,3715 06514 HIUNITZ
021472,000169: 42,3716 65723 NOADJUST # YES, -90 TO +90
021473,000170: 42,3717 45345 DLOAD DSU
021474,000171: 42,3720 06520 HIDPHALF
021475,000172: 42,3721 02201 PITCHANG
021476,000173: 42,3722 02201 STORE PITCHANG
021477,000174: 42,3723 47375 NOADJUST VLOAD VXV
021478,000175: 42,3724 00001 UR # Z = (UR X URP)
021479,000176: 42,3725 00007 URP
021480,000177: 42,3726 77772 VSL1
021481,000178: 42,3727 16205 STODL RLM # Z VEC B-1
021482,000179: 42,3730 02201 PITCHANG
021483,000180: 42,3731 74356 SIN VXSC
021484,000181: 42,3732 06514 HIUNITZ
021485,000182: 42,3733 71525 PDDL COS
021486,000183: 42,3734 02201 PITCHANG
021487,000184: 42,3735 52361 VXSC VSU
021488,000185: 42,3736 06520 HIUNITX # (UX COS ALPHA) - (UZ SIN ALPHA)
021489,000186: 42,3737 63241 DOT PDVL # YAW.Z
021490,000187: 42,3740 02205 RLM
021491,000188: 42,3741 02205 RLM
021492,000189: 42,3742 75246 ABVAL SIGN
021493,000190: 42,3743 77736 ASIN
021494,000191: 42,3744 02203 STORE YAWANG
021495,000192: 42,3745 77776 SBANDEX EXIT
021496,000193: 42,3746 31044 CA EXTVBACT
021497,000194: 42,3747 74747 MASK BIT5 # IS BIT5 STILL ON
021498,000195: 42,3750 00006 EXTEND
021499,000196: 42,3751 15472 BZF ENDEXT # NO
021500,000197: 42,3752 35017 CAF PRIO5
![]() |
Page 489 |
021502,000199: 42,3753 05146 TC PRIOCHNG
021503,000200: 42,3754 33767 CAF V06N51 # DISPLAY ANGLES
021504,000201: 42,3755 04616 TC BANKCALL
021505,000202: 42,3756 20353 CADR GOMARKFR
021506,000203: 42,3757 05563 TC B5OFF # TERMINATE
021507,000204: 42,3760 05563 TC B5OFF # PROCEED
021508,000205: 42,3761 05155 TC ENDOFJOB # RECYCLE
021509,000206: 42,3762 34751 CAF BIT3 # IMMEDIATE RETURN
021510,000207: 42,3763 05464 TC BLANKET # BLANK R3
021511,000208: 42,3764 34740 CAF PRIO4
021512,000209: 42,3765 05146 TC PRIOCHNG
021513,000210: 42,3766 03610 TC SBANDANT +2 # YES, CONTINUE DISPLAYING ANGLES
021514,000211: 42,3767 01463 V06N51 VN 0651
021515,000212: 42,3770 26501 07463 1OVSQRT2 2DEC .7071067815 # 1/SQRT(2)
021516,000213:
021517,000214: 42,3772 UR EQUALS 0D
021518,000215: 42,3772 URP EQUALS 6D
021519,000216: 42,3772 30,2000 SBANK= LOWSUPER
021520,000217:
End of include-file S-BAND_ANTENNA_FOR_LM.agc. Parent file is MAIN.agc