Source Code
These source-code files were transcribed from scans made from Don Eyles's personal
copy of Luminary 069. They were scanned at archive.org's Boston
facility, and the scanning was sponsored by Onno Hommes. The code was transcribed
from these scans by a team of volunteers who are referenced in the program
comments. Comments from the original source code are prefixed with a single '#' symbol,
whereas comments added later are prefixed by "##" or "###". In some cases, where
similar code blocks exist in previously-transcribed AGC programs (primarily
Luminary 99, from Apollo 11) those code blocks were used as a starting point and
then corrected to agree with the Luminary 69 scans. The full scans are available
at the Virtual AGC
project's collection at archive.org, while more-convenient reduced-size (but reduced-quality)
images are available at
the main Virtual AGC website. Report any errors noted by creating an
issue report at the Virtual AGC
project's GitHub repository. Notations on the program listing read, in part:GAP: ASSEMBLE REVISION 069 OF AGC PROGRAM LUMINARY BY NASA 2021112-011 19:02 NOV. 25,1968Note that the date is the date of the printout, not the date of the program revision. |
037161,000002: ## Copyright: Public domain.
037162,000003: ## Filename: P12.agc
037163,000004: ## Purpose: The main source file for Luminary revision 069.
037164,000005: ## It is part of the source code for the original release
037165,000006: ## of the flight software for the Lunar Module's (LM) Apollo
037166,000007: ## Guidance Computer (AGC) for Apollo 10. The actual flown
037167,000008: ## version was Luminary 69 revision 2, which included a
037168,000009: ## newer lunar gravity model and only affected module 2.
037169,000010: ## This file is intended to be a faithful transcription, except
037170,000011: ## that the code format has been changed to conform to the
037171,000012: ## requirements of the yaYUL assembler rather than the
037172,000013: ## original YUL assembler.
037173,000014: ## Reference: pp. 839-843
037174,000015: ## Assembler: yaYUL
037175,000016: ## Contact: Ron Burkey <info@sandroid.org>.
037176,000017: ## Website: www.ibiblio.org/apollo/index.html
037177,000018: ## Mod history: 2016-12-13 MAS Created from Luminary 99.
037178,000019: ## 2016-12-18 MAS Updated from comment-proofed Luminary 99 version.
037179,000020: ## 2017-01-06 RRB Updated for Luminary 69.
037180,000021: ## 2017-01-07 HG Fix interpretive operation STORE -> STODL
037181,000022: ## operand FLP1 -> FLPI
037182,000023: ## 2017-01-23 HG Fix interpretive operation STOVL -> STODL
037183,000024: ## 2017-01-28 RSB Proofed comment text using octopus/prooferComments
037184,000025: ## and fixed errors found.
037185,000026:
Page 839 |
037187,000028: 24,3504 BANK 24
037188,000029: 30,2000 SETLOC P12
037189,000030: 30,2000 BANK
037190,000031:
037191,000032: 30,2006 E7,1513 EBANK= DVCNTR
037192,000033: 30,2006 COUNT* $$/P12
037193,000034:
037194,000035: 30,2006 05353 P12LM TC PHASCHNG
037195,000036: 30,2007 04024 OCT 04024
037196,000037:
037197,000038: 30,2010 04616 TC BANKCALL
037198,000039: 30,2011 11175 CADR R02BOTH # CHECK THE STATUS OF THE IMU.
037199,000040:
037200,000041: 30,2012 05504 TC UPFLAG
037201,000042: 30,2013 00141 ADRES MUNFLAG
037202,000043:
037203,000044: 30,2014 05504 TC UPFLAG # INSURE 4-JET TRANSLATION CAPABILITY.
037204,000045: 30,2015 00307 ADRES ACC4-2FL
037205,000046:
037206,000047: 30,2016 05504 TC UPFLAG # PREVENT R10 FROM ISSUING CROSS-POINTER
037207,000048: 30,2017 00015 ADRES R10FLAG # OUTPUTS.
037208,000049:
037209,000050: 30,2020 05516 TC DOWNFLAG # CLEAR RENDEZVOUS FLAG FOR P22
037210,000051: 30,2021 00010 ADRES RNDVZFLG
037211,000052:
037212,000053: 30,2022 36000 CAF THRESH2 # INITIALIZE DVMON
037213,000054: 30,2023 55251 TS DVTHRUSH
037214,000055: 30,2024 34751 CAF FOUR
037215,000056: 30,2025 55513 TS DVCNTR
037216,000057:
037217,000058: 30,2026 34755 CA ZERO
037218,000059: 30,2027 55460 TS TRKMKCNT # SHOW THAT R29 DOWNLINK DATA ISN'T READY.
037219,000060: 30,2030 33044 CAF V06N33A
037220,000061: 30,2031 04616 TC BANKCALL # FLASH TIG
037221,000062: 30,2032 20351 CADR GOFLASH
037222,000063: 30,2033 16001 TCF GOTOPOOH
037223,000064: 30,2034 12036 TCF +2 # PROCEED
037224,000065: 30,2035 12030 TCF -5 # ENTER
037225,000066:
037226,000067: 30,2036 05353 TC PHASCHNG
037227,000068: 30,2037 04024 OCT 04024
037228,000069:
037229,000070: 30,2040 06036 TC INTPRET
037230,000071: 30,2041 77624 CALL # INITIALIZE WM AND /LAND/
037231,000072: 30,2042 60264 GUIDINIT
037232,000073: 30,2043 45014 SET CALL
037233,000074: 30,2044 04464 FLPI
037234,000075: 30,2045 60204 P12INIT
037235,000076:
037236,000077: 30,2046 77745 P12LMB DLOAD
037237,000078: 30,2047 25604 (TGO)A # SET TGO TO AN INITIAL NOMINAL VALUE.
Page 840 |
037239,000080: 30,2050 17515 STODL TGO
037240,000081: 30,2051 03440 TIG
037241,000082: 30,2052 34041 STCALL TDEC1
037242,000083: 30,2053 27057 LEMPREC # ROTATE THE STATE VECTORS TO THE
037243,000084: 30,2054 64375 VLOAD MXV # IGNITION TIME.
037244,000085: 30,2055 00007 VATT
037245,000086: 30,2056 01734 REFSMMAT
037246,000087: 30,2057 77772 VSL1
037247,000088: 30,2060 27577 STOVL V1S # COMPUTE V1S = VEL(TIG)*2(-7) M/CS.
037248,000089: 30,2061 00001 RATT
037249,000090: 30,2062 52521 MXV VSL6
037250,000091: 30,2063 01734 REFSMMAT
037251,000092: 30,2064 37517 STCALL R # COMPUTE R = POS(TIG)*2(-24) M.
037252,000093: 30,2065 67162 MUNGRAV # COMPUTE GDT1/2(TIG)*2(-7)M/CS.
037253,000094: 30,2066 53575 VLOAD UNIT
037254,000095: 30,2067 03517 R
037255,000096: 30,2070 37535 STCALL UNIT/R/ # COMPUTE UNIT/R/ FOR YCOMP.
037256,000097: 30,2071 57316 YCOMP
037257,000098: 30,2072 57461 SR DCOMP
037258,000099: 30,2073 20606 5D
037259,000100: 30,2074 17641 STODL XRANGE # INITIALIZE XRANGE FOR NOUN 76.
037260,000101: 30,2075 20312 (APO)
037261,000102: 30,2076 03643 STORE APO # INITIALIZE APO FOR NOUN 76.
037262,000103: 30,2077 77776 EXIT
037263,000104:
037264,000105: 30,2100 05353 TC PHASCHNG
037265,000106: 30,2101 04024 OCT 04024
037266,000107:
037267,000108: 30,2102 33043 NEWLOAD CAF V06N76 # FLASH CROSS-RANGE AND APOLUNE VALUES.
037268,000109: 30,2103 04616 TC BANKCALL
037269,000110: 30,2104 20351 CADR GOFLASH
037270,000111: 30,2105 16001 TCF GOTOPOOH
037271,000112: 30,2106 12110 TCF +2 # PROCEED
037272,000113: 30,2107 12102 TCF NEWLOAD # ENTER NEW DATA.
037273,000114:
037274,000115: 30,2110 32306 CAF P12ADRES
037275,000116: 30,2111 55453 TS WHICH
037276,000117:
037277,000118: 30,2112 05353 TC PHASCHNG
037278,000119: 30,2113 04024 OCT 04024
037279,000120:
037280,000121: 30,2114 06036 TC INTPRET
037281,000122: 30,2115 54345 DLOAD SL
037282,000123: 30,2116 03641 XRANGE
037283,000124: 30,2117 20206 5D
037284,000125: 30,2120 77615 DAD
037285,000126: 30,2121 02341 Y
037286,000127: 30,2122 17631 STODL YCO
037287,000128: 30,2123 03643 APO # RA = APO + /LAND/
037288,000129: 30,2124 77661 SL
Page 841 |
037290,000131: 30,2125 20206 5D
037291,000132: 30,2126 41415 DAD PUSH # RA*2(-24) IN MPAC AND PDL
037292,000133: 30,2127 02337 /LAND/
037293,000134: 30,2130 65205 DMP PDDL # 2 RA MU*2(-62) IN PDL, LOAD RA
037294,000135: 30,2131 20003 MUM(-37)
037295,000136: 30,2132 41215 DAD DMP # (RA+RP)*2(-24)
037296,000137: 30,2133 03627 RCO # RP(RA+RP)*2(-48)
037297,000138: 30,2134 03627 RCO
037298,000139: 30,2135 75465 BDDV SQRT # 2 MU RA/RP(RA+RP)*2(-14)=ZDOTD(2)
037299,000140: 30,2136 77626 STADR
037300,000141: 30,2137 51504 STOVL ZDOTD
037301,000142: 30,2140 03535 UNIT/R/
037302,000143: 30,2141 53361 VXSC VAD
037303,000144: 30,2142 20310 49FPS
037304,000145: 30,2143 03577 V1S
037305,000146: 30,2144 03525 STORE V # V(TIPOVER) = V(IGN) + 57FPS (UNIT/R/)
037306,000147: 30,2145 77614 SETGO
037307,000148: 30,2146 04421 FLVR
037308,000149: 30,2147 60313 ASCENT
037309,000150: 30,2150 77745 P12RET DLOAD
037310,000151: 30,2151 02365 ATP # ATP(2)*2(18)
037311,000152: 30,2152 65316 DSQ PDDL
037312,000153: 30,2153 02361 ATY # ATY(2)*2(18)
037313,000154: 30,2154 43316 DSQ DAD
037314,000155: 30,2155 75454 BZE SQRT
037315,000156: 30,2156 60162 YAWDUN
037316,000157: 30,2157 55352 SL1 BDDV
037317,000158: 30,2160 02361 ATY
037318,000159: 30,2161 77736 ARCSIN
037319,000160: 30,2162 26367 YAWDUN STOVL YAW
037320,000161: 30,2163 03252 UNFC/2
037321,000162: 30,2164 50256 UNIT DOT
037322,000163: 30,2165 03535 UNIT/R/
037323,000164: 30,2166 65552 SL1 ARCCOS
037324,000165: 30,2167 77676 DCOMP
037325,000166: 30,2170 02371 STORE PITCH
037326,000167: 30,2171 77776 EXIT
037327,000168: 30,2172 05353 TC PHASCHNG
037328,000169: 30,2173 04024 OCT 04024
037329,000170:
037330,000171: 30,2174 05516 TC DOWNFLAG
037331,000172: 30,2175 00213 ADRES FLPI
037332,000173:
037333,000174: 30,2176 00004 INHINT
037334,000175: 30,2177 04674 TC IBNKCALL
037335,000176: 30,2200 40142 CADR PFLITEDB
037336,000177: 30,2201 00003 RELINT
037337,000178:
037338,000179: 30,2202 04635 TC POSTJUMP
037339,000180: 30,2203 74124 CADR BURNBABY
Page 842 |
037341,000182: 30,2204 77745 P12INIT DLOAD # INITIALIZE ENGINE DATA. USED FOR P12 AND
037342,000183: 30,2205 24001 (1/DV)A # P71.
037343,000184: 30,2206 03637 STORE 1/DV3
037344,000185: 30,2207 03635 STORE 1/DV2
037345,000186: 30,2210 17633 STODL 1/DV1
037346,000187: 30,2211 24005 (AT)A
037347,000188: 30,2212 16257 STODL AT
037348,000189: 30,2213 24007 (TBUP)A
037349,000190: 30,2214 16265 STODL TBUP
037350,000191: 30,2215 34013 ATDECAY
037351,000192: 30,2216 54276 DCOMP SL
037352,000193: 30,2217 20214 11D
037353,000194: 30,2220 02263 STORE TTO
037354,000195: 30,2221 57535 SLOAD DCOMP
037355,000196: 30,2222 26001 APSVEX
037356,000197: 30,2223 77702 SR2
037357,000198: 30,2224 02261 STORE VE
037358,000199: 30,2225 43414 BOFF RVQ
037359,000200: 30,2226 04747 FLAP
037360,000201: 30,2227 60230 COMMINIT
037361,000202: 30,2230 43345 COMMINIT DLOAD DAD # INITIALIZE TARGET DATA. USED BY P12, P70
037362,000203: 30,2231 25602 HINJECT # AND P71 IF IT DOES NOT FOLLOW P70.
037363,000204: 30,2232 02337 /LAND/
037364,000205: 30,2233 17627 STODL RCO
037365,000206: 30,2234 06424 HI6ZEROS
037366,000207: 30,2235 03654 STORE TXO
037367,000208: 30,2236 03631 STORE YCO
037368,000209: 30,2237 02267 STORE RDOTD
037369,000210: 30,2240 26271 STOVL YDOTD
037370,000211: 30,2241 01563 VRECTCSM
037371,000212: 30,2242 64235 VXV MXV
037372,000213: 30,2243 01555 RRECTCSM
037373,000214: 30,2244 01734 REFSMMAT
037374,000215: 30,2245 77656 UNIT
037375,000216: 30,2246 17716 STODL QAXIS
037376,000217: 30,2247 02506 ABTVINJ2 # TENTATIVELY STORE LOW INJECTION VELOCITY
037377,000218: 30,2250 02273 STORE ZDOTD
037378,000219: 30,2251 77614 BON
037379,000220: 30,2252 04704 FLPI
037380,000221: 30,2253 60263 LOVEL
037381,000222: 30,2254 45335 SLOAD DSU
037382,000223: 30,2255 02503 TBRKPNT # TBRKPNT-TGO
037383,000224: 30,2256 03515 TGO
037384,000225: 30,2257 71240 BMN DLOAD # IF TGO>TBRKPNT,LOW VINJECT IS OK;RETURN
037385,000226: 30,2260 60263 LOVEL
037386,000227: 30,2261 02504 ABTVINJ1 # FOR TGO.TBRKPNT USE HI VELOCITY.
037387,000228: 30,2262 02273 STORE ZDOTD
037388,000229: 30,2263 77616 LOVEL RVQ
037389,000230: 30,2264 40220 GUIDINIT STQ SETPD
037390,000231: 30,2265 01164 TEMPR60
Page 843 |
037392,000233: 30,2266 00001 0D
037393,000234: 30,2267 41575 VLOAD PUSH
037394,000235: 30,2270 06416 UNITZ
037395,000236: 30,2271 41434 RTB PUSH
037396,000237: 30,2272 21462 LOADTIME
037397,000238: 30,2273 45135 SLOAD CALL
037398,000239: 30,2274 20312 (APO)
037399,000240: 30,2275 51504 RP-TO-R
037400,000241: 30,2276 74321 MXV VXSC
037401,000242: 30,2277 01734 REFSMMAT
037402,000243: 30,2300 20005 MOONRATE
037403,000244: 30,2301 26331 STOVL WM
037404,000245: 30,2302 02023 RLS
037405,000246: 30,2303 52446 ABVAL SL3
037406,000247: 30,2304 36337 STCALL /LAND/
037407,000248: 30,2305 01164 TEMPR60
037408,000249:
037409,000250: 30,2306 02022 P12ADRES REMADR P12TABLE # NOT IN SAME BANK.
037410,000251: 30,2307 00046 07374 49FPS 2DEC .149352 B-6 # EXPECTED RDOT AT TIPOVER
037411,000252:
037412,000253: 30,2311 00001 26227 (APO) 2DEC 55597.5 B-29 # 30 N.M. EXPRESSED IN METERS.
End of include-file P12.agc. Parent file is MAIN.agc