Source Code
These source-code files are part of a reconstructed copy of Luminary 96, the
original release of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer
(AGC) software.
The reconstruction began with reconstructed source code for Luminary 97. Changes between revisions 96 and 97 were backed out, as described by anomal report LNY-59. transcribed from a digitized copy of that program. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152D. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 96 listing. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. |
020427,000002: ## Copyright: Public domain.
020428,000003: ## Filename: S-BAND_ANTENNA_FOR_LM.agc
020429,000004: ## Purpose: A section of Luminary revision 96.
020430,000005: ## It is part of the reconstructed source code for the
020431,000006: ## original release of the flight software for the Lunar
020432,000007: ## Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
020433,000008: ## The code has been recreated from a previously reconstructed
020434,000009: ## copy of Luminary 97 by undoing changes described in anomaly
020435,000010: ## report LNY-59. The code has been adapted such that the
020436,000011: ## resulting bugger words exactly match those specified for
020437,000012: ## Luminary 96 in NASA drawing 2021152D, which gives relatively
020438,000013: ## high confidence that the reconstruction is correct.
020439,000014: ## Reference: pp. 486-489
020440,000015: ## Assembler: yaYUL
020441,000016: ## Contact: Ron Burkey <info@sandroid.org>.
020442,000017: ## Website: www.ibiblio.org/apollo/index.html
020443,000018: ## Mod history: 2019-08-04 MAS Created from Luminary 97.
020444,000019:
Page 486 |
020446,000021: # SUBROUTINE NAME: R05 - S-BAND ANTENNA FOR LM
020447,000022:
020448,000023: # MOD0 BY T. JAMES
020449,000024: # MOD1 BY P. SHAKIR
020450,000025:
020451,000026: # FUNCTIONAL DESCRIPTION
020452,000027:
020453,000028: # THE S-BAND ANTENNA ROUTINE, R05, COMPUTES AND DISPLAYS THE PITCH AND
020454,000029: # YAW ANTENNA GIMBAL ANGLES REQUIRED TO POINT THE LM STEERABLE ANTENNA
020455,000030: # TOWARD THE CENTER OF THE EARTH. THIS ROUTINE IS SELECTED BY THE ASTRO-
020456,000031: # NAUT VIA DSKY ENTRY DURING COASTING FLIGHT OR WHEN THE LM IS ON THE MOON
020457,000032: # SURFACE. THE EARTH OR MOON REFERENCE COORDINATE SYSTEM IS USED DEPENDING
020458,000033: # ON WHETHER THE LM IS ABOUT TO ENTER OR HAS ALREADY ENTERED THE MOON
020459,000034: # SPHERE OF INFLUENCE, RESPECTIVELY
020460,000035:
020461,000036: # TO CALL SUBROUTINE, ASTRONAUT KEYS IN V 64 E
020462,000037:
020463,000038: # SUBROUTINES CALLED -
020464,000039: # R02BOTH
020465,000040: # INTPRET
020466,000041: # LOADTIME
020467,000042: # LEMCONIC
020468,000043: # LUNPOS
020469,000044: # CDUTRIG
020470,000045: # *SMNB*
020471,000046: # BANKCALL
020472,000047: # B5OFF
020473,000048: # ENDOFJOB
020474,000049: # BLANKET
020475,000050:
020476,000051: # RETURNS WITH
020477,000052: # PITCH ANGLE IN PITCHANG REV. B0
020478,000053: # YAW ANGLE IN YAWANG REV. B0
020479,000054:
020480,000055: # ERASABLES USED
020481,000056: # PITCHANG
020482,000057: # YAWANG
020483,000058: # RLM
020484,000059: # VAC AREA
020485,000060:
020486,000061: 41,3731 BANK 41
020487,000062: 42,2000 SETLOC SBAND
020488,000063: 42,2000 BANK
020489,000064:
020490,000065: 42,3606 E7,1471 EBANK= WHOCARES
020491,000066: 42,3606 COUNT* $$/R05
020492,000067: 42,3606 04616 SBANDANT TC BANKCALL
Page 487 |
020494,000069: 42,3607 11254 CADR R02BOTH # CHECK IF IMU IS ON AND ALIGNED
020495,000070: 42,3610 06037 TC INTPRET
020496,000071: 42,3611 47001 SETPD RTB
020497,000072: 42,3612 00001 0D
020498,000073: 42,3613 21573 LOADTIME # PICK UP CURRENT TIME
020499,000074: 42,3614 34041 STCALL TDEC1 # ADVANCE INTEGRATION TO TIME IN TDEC1
020500,000075: 42,3615 27100 LEMCONIC # USING CONIC INTEGRATION
020501,000076: 42,3616 46135 SLOAD BHIZ
020502,000077: 42,3617 00050 X2 # X2 =0 EARTH SPHERE, X2 =2 MOON SPHERE
020503,000078: 42,3620 65636 CONV4
020504,000079: 42,3621 77775 VLOAD
020505,000080: 42,3622 00001 RATT
020506,000081: 42,3623 16205 STODL RLM
020507,000082: 42,3624 00015 TAT
020508,000083: 42,3625 77624 CONV3 CALL
020509,000084: 42,3626 33664 LUNPOS # UNIT POSITION VECTOR FROM EARTH TO MOON
020510,000085: 42,3627 74375 VLOAD VXSC
020511,000086: 42,3630 02723 VMOON
020512,000087: 42,3631 24001 REMDIST # MEAN DISTANCE FROM EARTH TO MOON
020513,000088: 42,3632 53372 VSL1 VAD
020514,000089: 42,3633 02205 RLM
020515,000090: 42,3634 77650 GOTO
020516,000091: 42,3635 65640 CONV5
020517,000092: 42,3636 77775 CONV4 VLOAD
020518,000093: 42,3637 00001 RATT # UE = -UNIT(RATT) EARTH SPHERE
020519,000094: 42,3640 53401 CONV5 SETPD UNIT # UE = -UNIT((REM)(UEM) + RL) MOON SPHERE
020520,000095: 42,3641 00001 0D # SET PL POINTER TO 0
020521,000096: 42,3642 45076 VCOMP CALL
020522,000097: 42,3643 47537 CDUTRIG # COMPUTE SINES AND COSINES OF CDU ANGLES
020523,000098: 42,3644 76521 MXV VSL1 # TRANSFORM REF. COORDINATE SYSTEM TO
020524,000099: 42,3645 01734 REFSMMAT # STABLE MEMBER B-1 X B-1 X B+1 = B-1
020525,000100: 42,3646 71206 PUSH DLOAD # 8D
020526,000101: 42,3647 06522 HI6ZEROS
020527,000102: 42,3650 02201 STORE PITCHANG
020528,000103: 42,3651 26203 STOVL YAWANG # ZERO OUT ANGLES
020529,000104: 42,3652 77624 CALL
020530,000105: 42,3653 47671 *SMNB*
020531,000106: 42,3654 16205 STODL RLM # PRE-MULTIPLY RLM BY (NBSA) MATRIX(B0)
020532,000107: 42,3655 02207 RLM +2
020533,000108: 42,3656 45206 PUSH DSU
020534,000109: 42,3657 02205 RLM
020535,000110: 42,3660 77605 DMP
020536,000111: 42,3661 25771 1OVSQRT2
020537,000112: 42,3662 16207 STODL RLM +2
020538,000113: 42,3663 41215 DAD DMP
020539,000114: 42,3664 02205 RLM
020540,000115: 42,3665 25771 1OVSQRT2
020541,000116: 42,3666 26205 STOVL RLM # R B-1
020542,000117: 42,3667 02205 RLM
020543,000118: 42,3670 63256 UNIT PDVL
Page 488 |
020545,000120: 42,3671 02205 RLM
020546,000121: 42,3672 72431 VPROJ VSL2 # PROJECTION OF R ONTO LM XZ PLANE
020547,000122: 42,3673 06516 HIUNITY
020548,000123: 42,3674 40045 BVSU BOV # CLEAR OVERFLOW INDICATOR IF ON
020549,000124: 42,3675 02205 RLM
020550,000125: 42,3676 65677 COVCNV
020551,000126: 42,3677 40056 COVCNV UNIT BOV # EXIT ON OVERFLOW
020552,000127: 42,3700 65745 SBANDEX
020553,000128: 42,3701 47206 PUSH VXV # URP VECTOR B-1
020554,000129: 42,3702 06514 HIUNITZ
020555,000130: 42,3703 57572 VSL1 VCOMP # UZ X URP = -(URP X UZ)
020556,000131: 42,3704 02205 STORE RLM # X VEC B-1
020557,000132: 42,3705 63241 DOT PDVL # SGN(X.UY) UNSCALED
020558,000133: 42,3706 06516 HIUNITY
020559,000134: 42,3707 02205 RLM
020560,000135: 42,3710 75246 ABVAL SIGN
020561,000136: 42,3711 77736 ASIN # ASIN((SGN(X.UY))ABV(X)) REV B0
020562,000137: 42,3712 26201 STOVL PITCHANG
020563,000138: 42,3713 00007 URP
020564,000139: 42,3714 51041 DOT BPL
020565,000140: 42,3715 06514 HIUNITZ
020566,000141: 42,3716 65723 NOADJUST # YES, -90 TO +90
020567,000142: 42,3717 45345 DLOAD DSU
020568,000143: 42,3720 06520 HIDPHALF
020569,000144: 42,3721 02201 PITCHANG
020570,000145: 42,3722 02201 STORE PITCHANG
020571,000146: 42,3723 47375 NOADJUST VLOAD VXV
020572,000147: 42,3724 00001 UR # Z = (UR X URP)
020573,000148: 42,3725 00007 URP
020574,000149: 42,3726 77772 VSL1
020575,000150: 42,3727 16205 STODL RLM # Z VEC B-1
020576,000151: 42,3730 02201 PITCHANG
020577,000152: 42,3731 74356 SIN VXSC
020578,000153: 42,3732 06514 HIUNITZ
020579,000154: 42,3733 71525 PDDL COS
020580,000155: 42,3734 02201 PITCHANG
020581,000156: 42,3735 52361 VXSC VSU
020582,000157: 42,3736 06520 HIUNITX # (UX COS ALPHA) - (UZ SIN ALPHA)
020583,000158: 42,3737 63241 DOT PDVL # YAW.Z
020584,000159: 42,3740 02205 RLM
020585,000160: 42,3741 02205 RLM
020586,000161: 42,3742 75246 ABVAL SIGN
020587,000162: 42,3743 77736 ASIN
020588,000163: 42,3744 02203 STORE YAWANG
020589,000164: 42,3745 77776 SBANDEX EXIT
020590,000165: 42,3746 31044 CA EXTVBACT
020591,000166: 42,3747 74747 MASK BIT5 # IS BIT5 STILL ON
020592,000167: 42,3750 00006 EXTEND
020593,000168: 42,3751 15472 BZF ENDEXT # NO
020594,000169: 42,3752 35017 CAF PRIO5
Page 489 |
020596,000171: 42,3753 05146 TC PRIOCHNG
020597,000172: 42,3754 33767 CAF V06N51 # DISPLAY ANGLES
020598,000173: 42,3755 04616 TC BANKCALL
020599,000174: 42,3756 20353 CADR GOMARKFR
020600,000175: 42,3757 05563 TC B5OFF # TERMINATE
020601,000176: 42,3760 05563 TC B5OFF # PROCEED
020602,000177: 42,3761 05155 TC ENDOFJOB # RECYCLE
020603,000178: 42,3762 34751 CAF BIT3 # IMMEDIATE RETURN
020604,000179: 42,3763 05464 TC BLANKET # BLANK R3
020605,000180: 42,3764 34740 CAF PRIO4
020606,000181: 42,3765 05146 TC PRIOCHNG
020607,000182: 42,3766 03610 TC SBANDANT +2 # YES, CONTINUE DISPLAYING ANGLES
020608,000183: 42,3767 01463 V06N51 VN 0651
020609,000184: 42,3770 26501 07463 1OVSQRT2 2DEC .7071067815 # 1/SQRT(2)
020610,000185:
020611,000186: 42,3772 UR EQUALS 0D
020612,000187: 42,3772 URP EQUALS 6D
020613,000188: 42,3772 30,2000 SBANK= LOWSUPER
020614,000189:
End of include-file S-BAND_ANTENNA_FOR_LM.agc. Parent file is MAIN.agc