Source Code
![]() |
These source code files are an attempted reconstruction of Sundance revision 306, the Apollo 9
LM (Lunar Module) AGC (Apollo Guidance Computer) flight software, created from binary dumps of
original core rope program modules, as follows:
|
011743,000002: ## Copyright: Public domain. 011744,000003: ## Filename: LEM_GEOMETRY.agc 011745,000004: ## Purpose: A section of an attempt to reconstruct Sundance revision 306 011746,000005: ## as closely as possible with available information. Sundance 011747,000006: ## 306 is the source code for the Lunar Module's (LM) Apollo 011748,000007: ## Guidance Computer (AGC) for Apollo 9. This program was created 011749,000008: ## using the mixed-revision SundanceXXX as a starting point, and 011750,000009: ## pulling back features from Luminary 69 believed to have been 011751,000010: ## added based on memos, checklists, observed address changes, 011752,000011: ## or the Sundance GSOPs. 011753,000012: ## Assembler: yaYUL 011754,000013: ## Contact: Ron Burkey <info@sandroid.org>. 011755,000014: ## Website: www.ibiblio.org/apollo/index.html 011756,000015: ## Mod history: 2020-07-24 MAS Created from SundanceXXX. 011757,000016: ## 2021-05-30 ABS Replaced use of ANTENBIT with BIT12 to match 011758,000017: ## Luminary 69. 011759,000018: 011760,000019: 011761,000020: 011762,000021: 23,2000 BANK 23 011763,000022: 13,2000 SETLOC LEMGEOM 011764,000023: 13,2000 BANK 011765,000024: 011766,000025: 13,2042 30,2000 SBANK= LOWSUPER 011767,000026: 13,2042 E5,1642 EBANK= XSM 011768,000027: 011769,000028: # THESE TWO ROUTINES COMPUTE THE ACTUAL STATE VECTOR FOR LM,CSM BY ADDING 011770,000029: # THE CONIC R,V AND THE DEVIATIONSR,V. THE STATE VECTORS ARE CONVERTED TO 011771,000030: # METERS B-29 AND METERS/CSEC B-7 AND STORED APPROPRIATELY IN RN,VN OR 011772,000031: # R-OTHER , V-OTHER FOR DOWNLINK. THE ROUTINES NAMES ARE SWITCHED IN THE 011773,000032: # OTHER VEHICLES COMPUTER. 011774,000033: 011775,000034: # INPUT 011776,000035: # STATE VECTOR IN TEMPORARY STORAGE AREA 011777,000036: # IF STATE VECTOR IS SCALED POS B27 AND VEL B5 011778,000037: # SET X2 TO +2 011779,000038: # IF STATE VECTOR IS SCALED POS B29 AND VEL B7 011780,000039: # SET X2 TO 0 011781,000040: 011782,000041: # OUTPUT 011783,000042: # R(T) IN RN, V(T) IN VN, T IN PIPTIME 011784,000043: # OR 011785,000044: # R(T) IN R-OTHER, V(T) IN V-OTHER (T IS DEFINED BY T-OTHER) 011786,000045: 011787,000046: 13,2042 COUNT* $$/GEOM 011788,000047: 13,2042 43414 SVDWN2 BOF RVQ # SW=1=AVETOMID DOING W-MATRIX INTEG. 011789,000048: 13,2043 04756 AVEMIDSW 011790,000049: 13,2044 26045 +1 011791,000050: 13,2045 53775 VLOAD VSL* 011792,000051: 13,2046 01521 TDELTAV 011793,000052: 13,2047 57605 0 -7,2 011794,000053: 13,2050 53655 VAD VSL* 011795,000054: 13,2051 01535 RCV 011796,000055: 13,2052 57576 0,2 011797,000056: 13,2053 25220 STOVL RN 011798,000057: 13,2054 01527 TNUV 011799,000058: 13,2055 53257 VSL* VAD 011800,000059: 13,2056 57602 0 -4,2 011801,000060: 13,2057 01543 VCV 011802,000061: 13,2060 77657 VSL* 011803,000062: 13,2061 57576 0,2 011804,000063: 13,2062 15226 STODL VN 011805,000064: 13,2063 01517 TET 011806,000065: 13,2064 01234 STORE PIPTIME 011807,000066: 13,2065 77616 RVQ 011808,000067: 13,2066 53775 SVDWN1 VLOAD VSL* 011809,000068: 13,2067 01521 TDELTAV 011810,000069: 13,2070 57605 0 -7,2 011811,000070: 13,2071 53655 VAD VSL* 011812,000071: 13,2072 01535 RCV 011813,000072: 13,2073 57576 0,2 011814,000073: 13,2074 25722 STOVL R-OTHER 011815,000074: 13,2075 01527 TNUV 011816,000075: 13,2076 53257 VSL* VAD 011817,000076: 13,2077 57602 0 -4,2 011818,000077: 13,2100 01543 VCV 011819,000078: 13,2101 77657 VSL* 011820,000079: 13,2102 57576 0,2 011821,000080: 13,2103 01730 STORE V-OTHER 011822,000081: 13,2104 77616 RVQ 011823,000082: 011824,000083: # THE FOLLOWING ROUTINE TAKES A HALF UNIT TARGET VECTOR REFERRED TO NAV BASE COORDINATES AND FINDS BOTH 011825,000084: # GIMBAL ORIENTATIONS AT WHICH THE RR MIGHT SIGHT THE TARGET. THE GIMBAL ANGLES CORRESPONDING TO THE PRESENT MODE 011826,000085: # ARE LEFT IN MODEA AND THOSE WHICH WOULD BE USED AFTER A REMODE IN MODEB. THIS ROUTINE ASSUMES MODE 1 IS TRUNNION 011827,000086: # ANGLE LESS THAN 90 DEGS IN ABS VALUE WITH ARBITRARY SHAFT, WITH A CORRESPONDING DEFINITION FOR MODE 2. MODE 011828,000087: # SELECTION AND LIMIT CHECKING ARE DONE ELSEWHERE. 011829,000088: 011830,000089: # THE MODE 1 CONFIGURATION IS CALCULATED FROM THE VECTOR AND THEN MODE 2 IS FOUND USING THE RELATIONS 011831,000090: 011832,000091: # S(2) = 180 + S(1) 011833,000092: # T(2) = 180 - T(1) 011834,000093: 011835,000094: # THE VECTOR ARRIVES IN MPAC WHERE TRG*SMNG OR *SMNB* WILL HAVE LEFT IT. 011836,000095: 011837,000096: 13,2105 00041 RRANGLES STORE 32D 011838,000097: 13,2106 57545 DLOAD DCOMP # SINCE WE WILL FIND THE MODE 1 SHAFT 011839,000098: 13,2107 00043 34D # ANGLE LATER, WE CAN FIND THE MODE 1 011840,000099: 13,2110 67401 SETPD ASIN # TRUNNION BY SIMPLY TAKING THE ARCSIN OF 011841,000100: 13,2111 00001 0 # THE Y COMPONENT, THE ASIN GIVING AN 011842,000101: 13,2112 44206 PUSH BDSU # ANSWER WHOSE ABS VAL IS LESS THAN 90 DEG 011843,000102: 13,2113 22274 LODPHALF 011844,000103: 13,2114 14005 STODL 4 # MODE 2 TRUNNION TO 4. 011845,000104: 011846,000105: 13,2115 22276 LO6ZEROS 011847,000106: 13,2116 24043 STOVL 34D # UNIT THE PROJECTION OF THE VECTOR 011848,000107: 13,2117 00041 32D # IN THE X-Z PLANE 011849,000108: 13,2120 41056 UNIT BOVB # IF OVERFLOW, TARGET VECTOR IS ALONG Y 011850,000109: 13,2121 52400 LUNDESCH # CALL FOR MANEUVER UNLESS ON LUNAR SURF 011851,000110: 13,2122 14041 STODL 32D # PROJECTION VECTOR. 011852,000111: 13,2123 00041 32D 011853,000112: 13,2124 44142 SR1 STQ 011854,000113: 13,2125 00051 S2 011855,000114: 13,2126 14023 STODL SINTH # USE ARCTRIG SINCE SHAFT COULD BE ARB. 011856,000115: 13,2127 00045 36D 011857,000116: 13,2130 77742 SR1 011858,000117: 13,2131 34021 STCALL COSTH 011859,000118: 13,2132 47114 ARCTRIG 011860,000119: 13,2133 43206 PUSH DAD # MODE 1 SHAFT TO 2. 011861,000120: 13,2134 22274 LODPHALF 011862,000121: 13,2135 24007 STOVL 6 011863,000122: 13,2136 00005 4 011864,000123: 13,2137 77634 RTB # FIND MODE 2 CDU ANGLES. 011865,000124: 13,2140 21533 2V1STO2S 011866,000125: 13,2141 25115 STOVL MODEB 011867,000126: 13,2142 00001 0 011868,000127: 13,2143 77634 RTB # MODE 1 ANGLES TO MODE A. 011869,000128: 13,2144 21533 2V1STO2S 011870,000129: 13,2145 01113 STORE MODEA 011871,000130: 13,2146 77776 EXIT 011872,000131: 011873,000132: 13,2147 41101 CS RADMODES # SWAP MODEA AND MODEB IF RR IN MODE 2. 011874,000133: 13,2150 75013 MASK BIT12 011875,000134: 13,2151 10000 CCS A 011876,000135: 13,2152 12156 TCF +4 011877,000136: 011878,000137: 13,2153 53113 DXCH MODEA 011879,000138: 13,2154 53115 DXCH MODEB 011880,000139: 13,2155 53113 DXCH MODEA 011881,000140: 011882,000141: 13,2156 06014 TC INTPRET 011883,000142: 13,2157 77650 GOTO 011884,000143: 13,2160 00051 S2 011885,000144: # GIVEN RR TRUNNION AND SHAFT (T,S) IN TANGNB,+1, FIND THE ASSOCIATED 011886,000145: # LINE OF SIGHT IN NAV BASE AXES. THE HALF UNIT VECTOR, .5(SIN(S)COS(T), 011887,000146: # -SIN(T),COS(S)COS(T)) IS LEFT IN MPAC AND 32D. 011888,000147: 011889,000148: 23,2000 SETLOC INFLIGHT 011890,000149: 23,2000 BANK 011891,000150: 011892,000151: 23,2000 COUNT* $$/GEOM 011893,000152: 011894,000153: 23,2000 47135 RRNB SLOAD RTB 011895,000154: 23,2001 03744 TANGNB 011896,000155: 23,2002 21457 CDULOGIC 011897,000156: 23,2003 41401 SETPD PUSH # TRUNNION ANGLE TO 0 011898,000157: 23,2004 00001 0 011899,000158: 23,2005 57556 SIN DCOMP 011900,000159: 23,2006 14043 STODL 34D # Y COMPONENT 011901,000160: 011902,000161: 23,2007 41546 COS PUSH # .5 COS(T) TO 0 011903,000162: 23,2010 47135 SLOAD RTB 011904,000163: 23,2011 03745 TANGNB +1 011905,000164: 23,2012 21457 CDULOGIC 011906,000165: 23,2013 71406 PUSH COS # SHAFT ANGLE TO 2 011907,000166: 23,2014 72405 DMP SL1 011908,000167: 23,2015 00001 0 011909,000168: 23,2016 14045 STODL 36D # Z COMPONENT 011910,000169: 011911,000170: 23,2017 41356 SIN DMP 011912,000171: 23,2020 77752 SL1 011913,000172: 23,2021 24041 STOVL 32D 011914,000173: 23,2022 00041 32D 011915,000174: 23,2023 77616 RVQ End of include-file LEM_GEOMETRY.agc. Parent file is MAIN.agc