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. |
030958,000002: ## Copyright: Public domain.
030959,000003: ## Filename: R31.agc
030960,000004: ## Purpose: The main source file for Luminary revision 069.
030961,000005: ## It is part of the source code for the original release
030962,000006: ## of the flight software for the Lunar Module's (LM) Apollo
030963,000007: ## Guidance Computer (AGC) for Apollo 10. The actual flown
030964,000008: ## version was Luminary 69 revision 2, which included a
030965,000009: ## newer lunar gravity model and only affected module 2.
030966,000010: ## This file is intended to be a faithful transcription, except
030967,000011: ## that the code format has been changed to conform to the
030968,000012: ## requirements of the yaYUL assembler rather than the
030969,000013: ## original YUL assembler.
030970,000014: ## Reference: pp. 712-716
030971,000015: ## Assembler: yaYUL
030972,000016: ## Contact: Ron Burkey <info@sandroid.org>.
030973,000017: ## Website: www.ibiblio.org/apollo/index.html
030974,000018: ## Mod history: 2016-12-13 MAS Created from Luminary 99.
030975,000019: ## 2016-12-14 MAS Updated from comment-proofed Luminary 99 version.
030976,000020: ## 2016-12-15 RRB Updated for Luminary 69.
030977,000021: ## 2017-01-20 HG add label V16N54
030978,000022: ## fix label REDOEXPT -> REDOEXTP
030979,000023: ## GETRVN -> GETRVN2
030980,000024: ## fix operand RRONE -> RONE
030981,000025: ## REFSMAT -> REFSMMAT
030982,000026: ## RHTETA -> RTHETA
030983,000027: ## EDNEXT -> ENDEXT
030984,000028: ## 2017-01-22 HG Add missing segemnt of interpretive statements
030985,000029: ## Fix some comments, remove tabs
030986,000030: ## 2017-01-28 RSB Proofed comment text using octopus/prooferComments
030987,000031: ## and fixed errors found.
030988,000032:
![]() |
Page 712 |
030990,000034: 34,3271 BANK 34
030991,000035: 37,2000 SETLOC R31
030992,000036: 37,2000 BANK
030993,000037:
030994,000038: 37,3113 COUNT* $$/R31
030995,000039:
030996,000040: 37,3113 35015 R31CALL CAF PRIO3
030997,000041: 37,3114 05105 TC FINDVAC
030998,000042: 37,3115 E7,1466 EBANK= SUBEXIT
030999,000043: 37,3115 03145 76067 2CADR V83CALL
031000,000044:
031001,000045: 37,3117 05221 DSPDELAY TC FIXDELAY
031002,000046: 37,3120 00144 DEC 100 B-14
031003,000047: 37,3121 31044 CA EXTVBACT
031004,000048: 37,3122 74740 MASK BIT12
031005,000049: 37,3123 00006 EXTEND
031006,000050: 37,3124 13117 BZF DSPDELAY
031007,000051:
031008,000052: 37,3125 35017 CAF PRIO5
031009,000053: 37,3126 05072 TC NOVAC
031010,000054: 37,3127 E7,1607 EBANK= TSTRT
031011,000055: 37,3127 03132 76067 2CADR DISPN5X
031012,000056:
031013,000057: 37,3131 15261 TCF TASKOVER
031014,000058:
031015,000059: 37,3132 33240 DISPN5X CAF V16N54
031016,000060: 37,3133 04616 TC BANKCALL
031017,000061: 37,3134 20212 CADR GOMARKF
031018,000062: 37,3135 05563 TC B5OFF
031019,000063: 37,3136 05563 TC B5OFF
031020,000064: 37,3137 13132 TCF DISPN5X
031021,000065:
031022,000066: 37,3140 06036 V83 TC INTPRET
031023,000067: 37,3141 77624 CALL
031024,000068: 37,3142 77371 REDOEXTP
031025,000069: 37,3143 77650 GOTO
031026,000070: 37,3144 77150 COMPDISP
031027,000071: 37,3145 06036 V83CALL TC INTPRET
031028,000072: 37,3146 77624 CALL
031029,000073: 37,3147 77241 STATEXTP # EXTRAPOLATE STATE VECTORS
031030,000074: 37,3150 52375 COMPDISP VLOAD VSU
031031,000075: 37,3151 00001 RATT
031032,000076: 37,3152 02213 RONE
031033,000077: 37,3153 51406 PUSH ABVAL # RATT-RONE TO 0D PD = 6
031034,000078: 37,3154 02205 STORE RANGE # METERS B-29
031035,000079: 37,3155 77301 NORM VLOAD
031036,000080: 37,3156 00047 X1 # RATT-RONE PD = 0
031037,000081: 37,3157 53457 VSL* UNIT
031038,000082: 37,3160 20201 0,1
![]() |
Page 713 |
031040,000084: 37,3161 52315 PDVL VSU # UNIT(LOS) TO 0D PD = 6
031041,000085: 37,3162 00007 VATT
031042,000086: 37,3163 02221 VONE
031043,000087: 37,3164 77641 DOT # (VATT-VONE).UNIT(LOS) PD = 0
031044,000088: 37,3165 77752 SL1
031045,000089: 37,3166 26207 STOVL RRATE # RANGE RATE M/CS B-7
031046,000090: 37,3167 02213 RONE
031047,000091: 37,3170 63256 UNIT PDVL # UR TO 0D PD = 6
031048,000092: 37,3171 06416 THISAXIS # UNITX FOR CM, UNTIZ FOR LM
031049,000093: 37,3172 77624 CALL
031050,000094: 37,3173 47565 CDU*NBSM
031051,000095: 37,3174 41505 VXM PUSH # UXORZ TO 6D PD=12D
031052,000096: 37,3175 01734 REFSMMAT
031053,000097: 37,3176 72431 VPROJ VSL2
031054,000098: 37,3177 00001 0D
031055,000099: 37,3200 53445 BVSU UNIT
031056,000100: 37,3201 00007 6D
031057,000101: 37,3202 47315 PDVL VXV # UP/2 TO 12D PD=18D
031058,000102: 37,3203 02213 RONE
031059,000103: 37,3204 02221 VONE
031060,000104: 37,3205 47256 UNIT VXV
031061,000105: 37,3206 02213 RONE
031062,000106: 37,3207 63241 DOT PDVL # SIGN TO 12D, UP/2 TO MPAC PD=18D
031063,000107: 37,3210 00015 12D
031064,000108: 37,3211 50372 VSL1 DOT # UP.UXORZ
031065,000109: 37,3212 00007 6D
031066,000110: 37,3213 72565 SIGN SL1
031067,000111: 37,3214 00015 12D
031068,000112: 37,3215 77726 ACOS
031069,000113: 37,3216 26211 STOVL RTHETA
031070,000114: 37,3217 02213 RONE
031071,000115: 37,3220 51041 DOT BPL
031072,000116: 37,3221 00007 6D
031073,000117: 37,3222 77227 +5
031074,000118: 37,3223 44345 DLOAD BDSU # IF UXORZ.R NEG, RTHETA = 1 - RTHETA
031075,000119: 37,3224 02211 RTHETA
031076,000120: 37,3225 06432 DPPOSMAX
031077,000121: 37,3226 02211 STORE RTHETA # RTHETA BETWEEN 0 AND 1 REV.
031078,000122: 37,3227 77776 EXIT
031079,000123: 37,3230 34747 CAF BIT5 # HAVE WE BEEN ANSWERED
031080,000124: 37,3231 71044 MASK EXTVBACT
031081,000125: 37,3232 00006 EXTEND
031082,000126: 37,3233 15472 BZF ENDEXT # YES, DIE
031083,000127:
031084,000128: 37,3234 41044 CS EXTVBACT
031085,000129: 37,3235 74740 MASK BIT12
031086,000130: 37,3236 27044 ADS EXTVBACT
031087,000131:
031088,000132: 37,3237 13140 TCF V83
031089,000133: 37,3240 04066 V16N54 VN 1654
031090,000134:
![]() |
Page 714 |
031092,000136: # THE STATEXTP SUBROUTINE DOES A PRECISION EXTRAPOLATION OF BOTH VEHICLES
031093,000137: # STATE VECTORS TO PRESENT TIME AND SAVES THEM AS BASE VECTORS.
031094,000138: # IF SERVICER IS OFF ---
031095,000139: # THIS VEHICLES BASE VECTOR IS CONIC EXTRAPOLATED TO
031096,000140: # PRESENT TIME AND SAVED AS RONE, VONE.
031097,000141: # THE OTHER VEHICLES BASE VECTOR IS CONIC EXTRAPOLATED
031098,000142: # TO THE SAME TIME, THE OUTPUT BEING LEFT IN RATT, VATT.
031099,000143: # IF SERVICER IS ON ---
031100,000144: # RONE, VONE ARE SET EQUAL TO RN, VN AND THE OTHER
031101,000145: # VEHICLES STATE VECTOR IS PREC. EXTRAPOLATED TO PIPTIME.
031102,000146:
031103,000147: 37,3241 47020 STATEXTP STQ RTB
031104,000148: 37,3242 02116 STATEXIT
031105,000149: 37,3243 21462 LOADTIME
031106,000150: 37,3244 34041 STCALL TDEC1
031107,000151: 37,3245 27043 OTHPREC # GET BASE VECTORS
031108,000152: 37,3246 77775 VLOAD
031109,000153: 37,3247 00017 RATT1
031110,000154: 37,3250 26140 STOVL BASEOTP # OTHER POS.
031111,000155: 37,3251 00025 VATT1
031112,000156: 37,3252 16120 STODL BASEOTV # OTHER VEL.
031113,000157: 37,3253 00015 TAT
031114,000158: 37,3254 02114 STORE BASETIME
031115,000159: 37,3255 34041 STCALL TDEC1
031116,000160: 37,3256 27057 THISPREC
031117,000161: 37,3257 77775 VLOAD
031118,000162: 37,3260 00017 RATT1
031119,000163: 37,3261 26170 STOVL BASETHP # THIS POS.
031120,000164: 37,3262 00025 VATT1
031121,000165: 37,3263 02105 STORE BASETHV # THIS VEL
031122,000166: 37,3264 47014 HAVEBASE BON RTB
031123,000167: 37,3265 03712 AVEGFLAG
031124,000168: 37,3266 77346 GETRVN # IF AVG ON ,GET RN ETC.
031125,000169: 37,3267 21462 LOADTIME
031126,000170: 37,3270 52014 BON GOTO # TEST FOR LM ON SURFACE.
031127,000171: 37,3271 04307 SURFFLAG
031128,000172: 37,3272 77365 R31SURF
031129,000173: 37,3273 77274 +1
031130,000174: 37,3274 34041 STCALL TDEC1 # BEGIN SET UP FOR CONIC EXTRAP. FOR THIS.
031131,000175: 37,3275 27412 INTSTALL
031132,000176: 37,3276 43175 VLOAD CLEAR
031133,000177: 37,3277 02170 BASETHP
031134,000178: 37,3300 00263 MOONFLAG
031135,000179: 37,3301 25535 STOVL RCV
031136,000180: 37,3302 02105 BASETHV
031137,000181: 37,3303 15543 STODL VCV
031138,000182: 37,3304 02114 BASETIME
031139,000183: 37,3305 43014 BOF SET # GET APPROPRIATE MOONFLAG SETTING
031140,000184: 37,3306 04344 MOONTHIS
031141,000185: 37,3307 77311 +2
031142,000186: 37,3310 00063 MOONFLAG
![]() |
Page 715 |
031144,000188: 37,3311 77614 SET
031145,000189: 37,3312 01473 INTYPFLG # CONIC EXTRAP.
031146,000190: 37,3313 35517 STCALL TET
031147,000191: 37,3314 27107 INTEGRVS # INTEGRATION --- AT LAST---
031148,000192: 37,3315 77775 OTHCONIC VLOAD
031149,000193: 37,3316 00001 RATT
031150,000194: 37,3317 26213 STOVL RONE
031151,000195: 37,3320 00007 VATT
031152,000196: 37,3321 36221 STCALL VONE # GET SET FOR CONIC EXTRAP.,OTHER.
031153,000197: 37,3322 27412 INTSTALL
031154,000198: 37,3323 71214 SET DLOAD
031155,000199: 37,3324 01473 INTYPFLG
031156,000200: 37,3325 00015 TAT
031157,000201: 37,3326 00041 OTHINT STORE TDEC1
031158,000202: 37,3327 43175 VLOAD CLEAR
031159,000203: 37,3330 02140 BASEOTP
031160,000204: 37,3331 00263 MOONFLAG
031161,000205: 37,3332 25535 STOVL RCV
031162,000206: 37,3333 02120 BASEOTV
031163,000207: 37,3334 15543 STODL VCV
031164,000208: 37,3335 02114 BASETIME
031165,000209: 37,3336 43014 BOF SET
031166,000210: 37,3337 04344 MOONTHIS
031167,000211: 37,3340 77342 +2
031168,000212: 37,3341 00063 MOONFLAG
031169,000213: 37,3342 35517 STCALL TET
031170,000214: 37,3343 27107 INTEGRVS
031171,000215: 37,3344 77650 GOTO
031172,000216: 37,3345 02116 STATEXIT # THIS VEHICLES POS.,VEL. IN PUSHLIST.
031173,000217: 37,3346 52175 GETRVN VLOAD GOTO
031174,000218: 37,3347 01221 RN
031175,000219: 37,3350 77351 +1
031176,000220: 37,3351 36213 STCALL RONE
031177,000221: 37,3352 77353 +1
031178,000222: 37,3353 52175 VLOAD GOTO
031179,000223: 37,3354 01227 VN
031180,000224: 37,3355 77356 +1
031181,000225: 37,3356 16221 STODL VONE
031182,000226: 37,3357 01235 PIPTIME
031183,000227: 37,3360 77624 GETRVN2 CALL
031184,000228: 37,3361 27412 INTSTALL
031185,000229: 37,3362 52014 CLEAR GOTO
031186,000230: 37,3363 01673 INTYPFLG # PREC EXTRAP FOR OTHER
031187,000231: 37,3364 77326 OTHINT
031188,000232: 37,3365 34041 R31SURF STCALL TDEC1 # LM ON SURFACE.
031189,000233: 37,3366 27057 LEMPREC
031190,000234: 37,3367 77650 GOTO # DO CSM CONIC
031191,000235: 37,3370 77315 OTHCONIC
![]() |
Page 716 |
031193,000237: 37,3371 52020 REDOEXTP STQ GOTO
031194,000238: 37,3372 02116 STATEXIT
031195,000239: 37,3373 77264 HAVEBASE
031196,000240:
End of include-file R31.agc. Parent file is MAIN.agc