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