Source Code
![]() |
These source-code files derive from a printout of Luminary 210 (Apollo 15-17
Lunar Module guidance computer program), from the personal library of
original AGC developer Don Eyles, digitally photographed at archive.org,
financially sponsored by Jim Lawton, and transcribed to source code by a
team of volunteers. This colorized, syntax-highlighted form was created
by assembling that transcribed source code. Note that the full page images
are available on the
Virtual AGC project page at archive.org, while reduced-size images
are presented at the VirtualAGC project website. Report or fix any
transcription errors at
the Virtual AGC project code repository. Notations on the program listing read, in part: GAP: ASSEMBLE REVISION 210 OF AGC PROGRAM LUMINARY BY NASA 2021112-161 17:11 MAR. 19,1971Note that the date is the date of the printout, not the date of the program revision. |
037065,000002: ## Copyright: Public domain.
037066,000003: ## Filename: P12.agc
037067,000004: ## Purpose: A section of Luminary revision 210.
037068,000005: ## It is part of the source code for the Lunar Module's (LM)
037069,000006: ## Apollo Guidance Computer (AGC) for Apollo 15-17.
037070,000007: ## This file is intended to be a faithful transcription, except
037071,000008: ## that the code format has been changed to conform to the
037072,000009: ## requirements of the yaYUL assembler rather than the
037073,000010: ## original YUL assembler.
037074,000011: ## Reference: pp. 839-843
037075,000012: ## Assembler: yaYUL
037076,000013: ## Contact: Ron Burkey <info@sandroid.org>.
037077,000014: ## Website: www.ibiblio.org/apollo/index.html
037078,000015: ## Mod history: 2016-11-17 JL Created from Luminary131 version.
037079,000016: ## 2016-12-01 RSB Completed transcription
037080,000017: ## 2016-12-10 HG Fix constant VINJNOM -> 16.79299
037081,000018: ## 2016-12-12 hg Fix interpretive operator STOVL -> STCALL
037082,000019: ## 2016-12-25 RSB Comment-text proofed using ProoferComments
037083,000020: ## and corrected errors found.
037084,000021: ## 2017-01-28 RSB Proofed comment text using octopus/prooferComments
037085,000022: ## and fixed errors found.
037086,000023: ## 2017-08-26 MAS Fixed a comment-text error found while transcribing
037087,000024: ## Zerlina 56.
037088,000025:
![]() |
Page 839 |
037090,000027: 24,3644 BANK 24
037091,000028: 30,2000 SETLOC P12
037092,000029: 30,2000 BANK
037093,000030:
037094,000031: 30,2061 E7,1515 EBANK= DVCNTR
037095,000032: 30,2061 COUNT* $$/P12
037096,000033:
037097,000034: 30,2061 05355 P12LM TC PHASCHNG
037098,000035: 30,2062 04024 OCT 04024
037099,000036:
037100,000037: 30,2063 04607 TC BANKCALL
037101,000038: 30,2064 33757 CADR R02BOTH # CHECK THE STATUS OF THE IMU.
037102,000039:
037103,000040: 30,2065 36000 CAF THRESH2 # INITIALIZE DVMON
037104,000041: 30,2066 55250 TS DVTHRUSH
037105,000042: 30,2067 34742 CAF FOUR
037106,000043: 30,2070 55515 TS DVCNTR
037107,000044:
037108,000045: 30,2071 33014 CAF V06N33A
037109,000046: 30,2072 04607 TC BANKCALL # FLASH TIG
037110,000047: 30,2073 20471 CADR GOFLASH
037111,000048: 30,2074 16001 TCF GOTOPOOH
037112,000049: 30,2075 12077 TCF +2 # PROCEED
037113,000050: 30,2076 12071 TCF -5 # ENTER
037114,000051:
037115,000052: 30,2077 05355 TC PHASCHNG
037116,000053: 30,2100 04024 OCT 04024
037117,000054:
037118,000055: 30,2101 06060 TC INTPRET
037119,000056: 30,2102 43014 SET SET
037120,000057: 30,2103 03067 MUNFLAG
037121,000058: 30,2104 06464 ACC4-2FL
037122,000059: 30,2105 43014 SET CLEAR
037123,000060: 30,2106 00075 R10FLAG
037124,000061: 30,2107 00270 RNDVZFLG
037125,000062: 30,2110 43014 SET SET
037126,000063: 30,2111 04464 FLPI
037127,000064: 30,2112 04461 FLVR
037128,000065: 30,2113 45014 CLEAR CALL
037129,000066: 30,2114 04665 FLRCS
037130,000067: 30,2115 71346 GUIDINIT
037131,000068: 30,2116 77624 CALL
037132,000069: 30,2117 60243 P12INIT
037133,000070: 30,2120 77745 P12LMB DLOAD
037134,000071: 30,2121 25650 (TGO)A # SET TGO TO AN INITIAL NOMINAL VALUE.
037135,000072: 30,2122 17517 STODL TGO
037136,000073: 30,2123 03442 TIG
037137,000074: 30,2124 34041 STCALL TDEC1
037138,000075: 30,2125 27115 LEMPREC # ROTATE THE STATE VECTORS TO THE
037139,000076: 30,2126 64375 VLOAD MXV # IGNITION TIME.
![]() |
Page 840 |
037141,000078: 30,2127 00007 VATT
037142,000079: 30,2130 01732 REFSMMAT
037143,000080: 30,2131 77772 VSL1
037144,000081: 30,2132 27601 STOVL V1S # COMPUTE V1S = VEL(TIG)*2(-7) M/CS.
037145,000082: 30,2133 00001 RATT
037146,000083: 30,2134 52521 MXV VSL6
037147,000084: 30,2135 01732 REFSMMAT
037148,000085: 30,2136 37521 STCALL R # COMPUTE R = POS(TIG)*2(-24) M.
037149,000086: 30,2137 67037 MUNGRAV # COMPUTE GDT1/2(TIG)*2(-7)M/CS.
037150,000087: 30,2140 53575 VLOAD UNIT
037151,000088: 30,2141 03521 R
037152,000089: 30,2142 37537 STCALL UNIT/R/ # COMPUTE UNIT/R/ FOR YCOMP.
037153,000090: 30,2143 57315 YCOMP
037154,000091: 30,2144 57461 SR DCOMP
037155,000092: 30,2145 20606 5D
037156,000093: 30,2146 17643 STODL XRANGE # INITIALIZE XRANGE FOR NOUN 76.
037157,000094: 30,2147 31372 VINJNOM
037158,000095: 30,2150 16270 STODL ZDOTD
037159,000096: 30,2151 31374 RDOTDNOM
037160,000097: 30,2152 02264 STORE RDOTD
037161,000098: 30,2153 77776 EXIT
037162,000099:
037163,000100: 30,2154 05355 TC PHASCHNG
037164,000101: 30,2155 04024 OCT 04024
037165,000102:
037166,000103: 30,2156 33013 NEWLOAD CAF V06N76 # FLASH CROSS-RANGE AND APOLUNE VALUES.
037167,000104: 30,2157 04607 TC BANKCALL
037168,000105: 30,2160 20471 CADR GOFLASH
037169,000106: 30,2161 16001 TCF GOTOPOOH
037170,000107: 30,2162 12164 TCF +2 # PROCEED
037171,000108: 30,2163 12156 TCF NEWLOAD # ENTER NEW DATA.
037172,000109:
037173,000110: 30,2164 32306 CAF P12ADRES
037174,000111: 30,2165 55455 TS WHICH
037175,000112:
037176,000113: 30,2166 05355 TC PHASCHNG
037177,000114: 30,2167 04024 OCT 04024
037178,000115:
037179,000116: 30,2170 06060 TC INTPRET
037180,000117: 30,2171 54345 DLOAD SL
037181,000118: 30,2172 03643 XRANGE
037182,000119: 30,2173 20206 5D
037183,000120: 30,2174 77615 DAD
037184,000121: 30,2175 02326 Y
037185,000122: 30,2176 27633 STOVL YCO
037186,000123: 30,2177 03537 UNIT/R/
037187,000124: 30,2200 53361 VXSC VAD
037188,000125: 30,2201 31370 49FPS
037189,000126: 30,2202 03601 V1S
037190,000127: 30,2203 03527 STORE V # V(TIPOVER) = V(IGN) + 57FPS (UNIT/R/)
![]() |
Page 841 |
037192,000129: 30,2204 72441 DOT SL1
037193,000130: 30,2205 03537 UNIT/R/
037194,000131: 30,2206 37474 STCALL RDOT # RDOT * 2(-7)
037195,000132: 30,2207 60307 ASCENT
037196,000133: 30,2210 77745 P12RET DLOAD
037197,000134: 30,2211 02352 ATP # ATP(2)*2(18)
037198,000135: 30,2212 65316 DSQ PDDL
037199,000136: 30,2213 02346 ATY # ATY(2)*2(18)
037200,000137: 30,2214 43316 DSQ DAD
037201,000138: 30,2215 75454 BZE SQRT
037202,000139: 30,2216 60222 YAWDUN
037203,000140: 30,2217 55352 SL1 BDDV
037204,000141: 30,2220 02346 ATY
037205,000142: 30,2221 77736 ARCSIN
037206,000143: 30,2222 26354 YAWDUN STOVL YAW
037207,000144: 30,2223 03252 UNFC/2
037208,000145: 30,2224 50256 UNIT DOT
037209,000146: 30,2225 03537 UNIT/R/
037210,000147: 30,2226 65552 SL1 ARCCOS
037211,000148: 30,2227 77676 DCOMP
037212,000149: 30,2230 02356 STORE PITCH
037213,000150: 30,2231 77776 EXIT
037214,000151: 30,2232 05355 TC PHASCHNG
037215,000152: 30,2233 04024 OCT 04024
037216,000153:
037217,000154: 30,2234 00004 INHINT
037218,000155: 30,2235 04665 TC IBNKCALL
037219,000156: 30,2236 40143 CADR PFLITEDB
037220,000157: 30,2237 05520 TC DOWNFLAG
037221,000158: 30,2240 00213 ADRES FLPI
037222,000159:
037223,000160: 30,2241 04626 TC POSTJUMP
037224,000161: 30,2242 74130 CADR BURNBABY
037225,000162:
037226,000163: 30,2243 77745 P12INIT DLOAD # INITIALIZE ENGINE DATA. USED FOR P12 AND
037227,000164: 30,2244 16013 (1/DV)A # P71.
037228,000165: 30,2245 03641 STORE 1/DV3
037229,000166: 30,2246 03637 STORE 1/DV2
037230,000167: 30,2247 17635 STODL 1/DV1
037231,000168: 30,2250 16017 (AT)A
037232,000169: 30,2251 16254 STODL AT
037233,000170: 30,2252 16021 (TBUP)A
037234,000171: 30,2253 16262 STODL TBUP
037235,000172: 30,2254 34013 ATDECAY
037236,000173: 30,2255 54276 DCOMP SL
037237,000174: 30,2256 20214 11D
037238,000175: 30,2257 02260 STORE TTO
037239,000176: 30,2260 57535 SLOAD DCOMP
037240,000177: 30,2261 26001 APSVEX
037241,000178: 30,2262 77702 SR2
![]() |
Page 842 |
037243,000180: 30,2263 02256 STORE VE
037244,000181: 30,2264 43414 BOFF RVQ
037245,000182: 30,2265 04747 FLAP
037246,000183: 30,2266 60267 COMMINIT
037247,000184: 30,2267 43345 COMMINIT DLOAD DAD # INITIALIZE TARGET DATA. USED BY P12, P70
037248,000185: 30,2270 25646 HINJECT # AND P71 IF IT DOES NOT FOLLOW P70.
037249,000186: 30,2271 02324 /LAND/
037250,000187: 30,2272 17631 STODL RCO
037251,000188: 30,2273 06505 HI6ZEROS
037252,000189: 30,2274 03654 STORE TXO
037253,000190: 30,2275 03633 STORE YCO
037254,000191: 30,2276 26266 STOVL YDOTD
037255,000192: 30,2277 01563 VRECTCSM
037256,000193: 30,2300 64235 VXV MXV
037257,000194: 30,2301 01555 RRECTCSM
037258,000195: 30,2302 01732 REFSMMAT
037259,000196: 30,2303 77656 UNIT
037260,000197: 30,2304 02600 STORE QAXIS
037261,000198: 30,2305 77616 RVQ
037262,000199:
037263,000200: 30,2306 02024 P12ADRES REMADR P12TABLE
037264,000201:
037265,000202: 34,2000 SETLOC ASENT8
037266,000203: 34,2000 BANK
037267,000204: 34,3346 COUNT* $$/P12
037268,000205:
037269,000206: 34,3346 40220 GUIDINIT STQ SETPD
037270,000207: 34,3347 01163 TEMPR60
037271,000208: 34,3350 00001 0D
037272,000209: 34,3351 41575 VLOAD PUSH
037273,000210: 34,3352 06477 UNITZ
037274,000211: 34,3353 41434 RTB PUSH
037275,000212: 34,3354 21603 LOADTIME
037276,000213: 34,3355 77624 CALL
037277,000214: 34,3356 55716 RP-TO-R
037278,000215: 34,3357 74321 MXV VXSC
037279,000216: 34,3360 01732 REFSMMAT
037280,000217: 34,3361 16027 MOONRATE
037281,000218: 34,3362 26316 STOVL WM
037282,000219: 34,3363 02021 RLS
037283,000220: 34,3364 52446 ABVAL SL3
037284,000221: 34,3365 36324 STCALL /LAND/
037285,000222: 34,3366 01163 TEMPR60
037286,000223:
037287,000224: 34,3367 00046 07374 49FPS 2DEC .149352 B-6 # EXPECTED RDOT AT TIPOVER
037288,000225:
037289,000226: 34,3371 04145 20055 VINJNOM 2DEC 16.79299 B-7 # 5509.5 FPS(APO=30NM WITH RDOT=19.5FPS)
037290,000227:
037291,000228: 34,3373 00007 23346 RDOTDNOM 2DEC .059436 B-7 # 19.5 FPS
037292,000229:
![]() |
Page 843 This page is empty in the hardcopy of the original assembly listing. |
End of include-file P12.agc. Parent file is MAIN.agc