Source Code
These source-code files are part of a reconstructed copy of Luminary 173, the
second (unflown) release of the Apollo 14 Lunar Module (LM) Apollo Guidance
Computer (AGC) software.
The reconstruction began with reconstructed source code for Luminary 178. Changes between revision 173 and 178 were backed out, as described by Luminary memo 167 (revision 1). The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 173 listing would be different. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. |
030002,000002: ## Copyright: Public domain.
030003,000003: ## Filename: R31.agc
030004,000004: ## Purpose: A section of Luminary revision 173.
030005,000005: ## It is part of the reconstructed source code for the second
030006,000006: ## (unflown) release of the flight software for the Lunar
030007,000007: ## Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
030008,000008: ## The code has been recreated from a reconstructed copy of
030009,000009: ## Luminary 178, as well as Luminary memo 167 (revision 1).
030010,000010: ## It has been adapted such that the resulting bugger words
030011,000011: ## exactly match those specified for Luminary 173 in NASA
030012,000012: ## drawing 2021152N, which gives relatively high confidence
030013,000013: ## that the reconstruction is correct.
030014,000014: ## Reference: pp. 698-702
030015,000015: ## Assembler: yaYUL
030016,000016: ## Contact: Ron Burkey <info@sandroid.org>.
030017,000017: ## Website: www.ibiblio.org/apollo/index.html
030018,000018: ## Mod history: 2019-09-18 MAS Created from Luminary 178.
030019,000019:
Page 698 |
030021,000021: 40,3746 BANK 40
030022,000022: 40,2000 SETLOC R31LOC
030023,000023: 40,2000 BANK
030024,000024:
030025,000025: 40,3746 COUNT* $$/R31
030026,000026:
030027,000027: 40,3746 35015 R31CALL CAF PRIO3
030028,000028: 40,3747 05105 TC FINDVAC
030029,000029: 40,3750 E7,1470 EBANK= SUBEXIT
030030,000030: 40,3750 03113 76067 2CADR V83CALL
030031,000031:
030032,000032: 40,3752 05232 DSPDELAY TC FIXDELAY
030033,000033: 40,3753 00144 DEC 100 B-14
030034,000034: 40,3754 31043 CA EXTVBACT
030035,000035: 40,3755 74740 MASK BIT12
030036,000036: 40,3756 00006 EXTEND
030037,000037: 40,3757 13752 BZF DSPDELAY
030038,000038:
030039,000039: 40,3760 35017 CAF PRIO5
030040,000040: 40,3761 05072 TC NOVAC
030041,000041: 40,3762 E7,1611 EBANK= TSTRT
030042,000042: 40,3762 03766 60107 2CADR DISPN5X
030043,000043:
030044,000044: 40,3764 15272 TCF TASKOVER
030045,000045:
030046,000046: 40,3765 04066 V16N54 VN 1654
030047,000047: 40,3766 33765 DISPN5X CAF V16N54
030048,000048: 40,3767 04616 TC BANKCALL
030049,000049: 40,3770 20334 CADR GOMARKF
030050,000050: 40,3771 05574 TC B5OFF
030051,000051: 40,3772 05574 TC B5OFF
030052,000052: 40,3773 13766 TCF DISPN5X
030053,000053:
030054,000054: 37,3113 BANK 37
030055,000055: 37,2000 SETLOC R31
030056,000056: 37,2000 BANK
030057,000057:
030058,000058: 37,3113 40103 V83CALL CS FLAGWRD7 # TEST AVERAGE G FLAG
030059,000059: 37,3114 74747 MASK AVEGFBIT
030060,000060: 37,3115 00006 EXTEND
030061,000061: 37,3116 13371 BZF MUNG? # ON - TEST MUNFLAG
030062,000062:
030063,000063: 37,3117 40104 CS FLAGWRD8
030064,000064: 37,3120 74744 MASK SURFFBIT
030065,000065: 37,3121 00006 EXTEND
030066,000066: 37,3122 13375 BZF ONEBASE # ON SURFACE - BYPASS LEMPREC
030067,000067:
030068,000068: 37,3123 06042 TC INTPRET # EXTRAPOLATE BOTH STATE VECTORS
030069,000069: 37,3124 77634 RTB
Page 699 |
030071,000071: 37,3125 21574 LOADTIME
030072,000072: 37,3126 34041 STCALL TDEC1
030073,000073: 37,3127 27056 LEMPREC # PRECISION BASE VECTOR FOR LM
030074,000074: 37,3130 77775 VLOAD
030075,000075: 37,3131 00017 RATT1
030076,000076: 37,3132 26170 STOVL BASETHP
030077,000077: 37,3133 00025 VATT1
030078,000078: 37,3134 16105 STODL BASETHV
030079,000079: 37,3135 00015 TAT
030080,000080: 37,3136 02114 DOCMBASE STORE BASETIME # PRECISION BASE VECTOR FOR CM
030081,000081: 37,3137 34041 STCALL TDEC1
030082,000082: 37,3140 27042 CSMPREC
030083,000083: 37,3141 77775 VLOAD
030084,000084: 37,3142 00017 RATT1
030085,000085: 37,3143 26140 STOVL BASEOTP
030086,000086: 37,3144 00025 VATT1
030087,000087: 37,3145 02120 STORE BASEOTV
030088,000088: 37,3146 77776 EXIT
030089,000089:
030090,000090: 37,3147 40103 REV83 CS FLAGWRD7
030091,000091: 37,3150 74747 MASK AVEGFBIT
030092,000092: 37,3151 00006 EXTEND
030093,000093: 37,3152 13320 BZF GETRVN # IF AVEGFLAG SET, USE RN,VN
030094,000094:
030095,000095: 37,3153 40104 CS FLAGWRD8
030096,000096: 37,3154 74744 MASK SURFFBIT
030097,000097: 37,3155 00006 EXTEND
030098,000098: 37,3156 13362 BZF R31SURF # IF ON SURFACE,USE LEMAREC
030099,000099:
030100,000100: 37,3157 06042 TC INTPRET # DO CONIC EXTRAPOLATION FOR BOTH VEHICLES
030101,000101: 37,3160 77634 RTB
030102,000102: 37,3161 21574 LOADTIME
030103,000103: 37,3162 34041 STCALL TDEC1
030104,000104: 37,3163 27410 INTSTALL
030105,000105: 37,3164 43175 VLOAD CLEAR
030106,000106: 37,3165 02170 BASETHP
030107,000107: 37,3166 00263 MOONFLAG
030108,000108: 37,3167 25535 STOVL RCV
030109,000109: 37,3170 02105 BASETHV
030110,000110: 37,3171 15543 STODL VCV
030111,000111: 37,3172 02114 BASETIME
030112,000112: 37,3173 43014 BOF SET # GET APPROPRIATE MOONFLAG SETTING
030113,000113: 37,3174 04344 MOONTHIS
030114,000114: 37,3175 77177 +2
030115,000115: 37,3176 00063 MOONFLAG
030116,000116: 37,3177 77614 SET
030117,000117: 37,3200 01473 INTYPFLG # CONIC EXTRAP.
030118,000118: 37,3201 35517 STCALL TET
030119,000119: 37,3202 27106 INTEGRVS # INTEGRATION --- AT LAST---
030120,000120: 37,3203 77775 OTHCONIC VLOAD
Page 700 |
030122,000122: 37,3204 00001 RATT
030123,000123: 37,3205 26207 STOVL RONE
030124,000124: 37,3206 00007 VATT
030125,000125: 37,3207 36215 STCALL VONE # GET SET FOR CONIC EXTRAP.,OTHER.
030126,000126: 37,3210 27410 INTSTALL
030127,000127: 37,3211 71214 SET DLOAD
030128,000128: 37,3212 01473 INTYPFLG
030129,000129: 37,3213 00015 TAT
030130,000130: 37,3214 00041 OTHINT STORE TDEC1
030131,000131: 37,3215 43175 VLOAD CLEAR
030132,000132: 37,3216 02140 BASEOTP
030133,000133: 37,3217 00263 MOONFLAG
030134,000134: 37,3220 25535 STOVL RCV
030135,000135: 37,3221 02120 BASEOTV
030136,000136: 37,3222 15543 STODL VCV
030137,000137: 37,3223 02114 BASETIME
030138,000138: 37,3224 43014 BOF SET
030139,000139: 37,3225 04344 MOONTHIS
030140,000140: 37,3226 77230 +2
030141,000141: 37,3227 00063 MOONFLAG
030142,000142: 37,3230 35517 STCALL TET
030143,000143: 37,3231 27106 INTEGRVS
030144,000144: 37,3232 52375 COMPDISP VLOAD VSU
030145,000145: 37,3233 00001 RATT
030146,000146: 37,3234 02207 RONE
030147,000147: 37,3235 65234 RTB PDDL
030148,000148: 37,3236 21725 NORMUNX1 # UNIT(RANGE) TO PD 0-5
030149,000149: 37,3237 00045 36D
030150,000150: 37,3240 77657 SL* # RESCALE AFTER NORMUNIT
030151,000151: 37,3241 20201 0,1
030152,000152: 37,3242 26201 STOVL RANGE # SCALED 2(29)M
030153,000153: 37,3243 00007 VATT
030154,000154: 37,3244 50251 VSU DOT # (VCM- VLM).UNIT(LOS), PD=0
030155,000155: 37,3245 02215 VONE
030156,000156: 37,3246 77752 SL1 # SCALED 2(7)M/CS
030157,000157: 37,3247 26203 STOVL RRATE
030158,000158: 37,3250 02207 RONE
030159,000159: 37,3251 63256 UNIT PDVL # UNIT(R) TO PD 0-5
030160,000160: 37,3252 06512 UNITZ
030161,000161: 37,3253 77624 CALL
030162,000162: 37,3254 47666 CDU*NBSM
030163,000163: 37,3255 41505 VXM PUSH # UNIT (Z)/4 TO PD 6-11
030164,000164: 37,3256 01732 REFSMMAT
030165,000165: 37,3257 72431 VPROJ VSL2 # UNIT(P)=UNIT(UZ -(UZ)PROJ(UR))
030166,000166: 37,3260 00001 0D
030167,000167: 37,3261 53445 BVSU UNIT
030168,000168: 37,3262 00007 6D
030169,000169: 37,3263 47315 PDVL VXV # UNIT(P) TO PD 12-17
030170,000170: 37,3264 00001 0D # UNIT(RL)
030171,000171: 37,3265 02215 VONE
Page 701 |
030173,000173: 37,3266 50235 VXV DOT # (UR * VL)*UR . U(P)
030174,000174: 37,3267 00001 0D
030175,000175: 37,3270 00015 12D
030176,000176: 37,3271 77715 PDVL # SIGN TO 12-13 , LOAD U(P)
030177,000177: 37,3272 75241 DOT SIGN
030178,000178: 37,3273 00007 6D
030179,000179: 37,3274 00015 12D
030180,000180: 37,3275 65512 SL2 ACOS # ARCCOS(UP.UZ(SIGN))
030181,000181: 37,3276 26205 STOVL RTHETA
030182,000182: 37,3277 00001 0D
030183,000183: 37,3300 51041 DOT BPL # IF UR.UZ NEG,
030184,000184: 37,3301 00007 6D # RTHETA = 1 - RTHETA
030185,000185: 37,3302 77307 +5
030186,000186: 37,3303 45345 DLOAD DSU
030187,000187: 37,3304 06526 DPPOSMAX
030188,000188: 37,3305 02205 RTHETA
030189,000189: 37,3306 02205 STORE RTHETA
030190,000190: 37,3307 77776 EXIT
030191,000191:
030192,000192: 37,3310 34747 CA BIT5
030193,000193: 37,3311 71043 MASK EXTVBACT
030194,000194: 37,3312 00006 EXTEND # IF ANSWERED,
030195,000195: 37,3313 15503 BZF ENDEXT # TERMINATE
030196,000196:
030197,000197: 37,3314 41043 CS EXTVBACT
030198,000198: 37,3315 74740 MASK BIT12
030199,000199: 37,3316 27043 ADS EXTVBACT # SET BIT 12
030200,000200: 37,3317 13147 TCF REV83 # AND START AGAIN.
030201,000201:
030202,000202: 37,3320 37713 GETRVN CA PRIO22 # INHIBIT SERVICER
030203,000203: 37,3321 05146 TC PRIOCHNG
030204,000204: 37,3322 06042 TC INTPRET
030205,000205: 37,3323 40375 VLOAD SETPD
030206,000206: 37,3324 01220 RN # LM STATE VECTOR IN RN,VN
030207,000207: 37,3325 00001 0
030208,000208: 37,3326 26207 STOVL RONE
030209,000209: 37,3327 01226 VN
030210,000210: 37,3330 26215 STOVL VONE # LOAD R(CSM),V(CSM) IN CASE MUNFLAG SET
030211,000211: 37,3331 01724 V(CSM) # (TO INSURE TIME COMPATABILITY)
030212,000212: 37,3332 65315 PDVL PDDL
030213,000213: 37,3333 01716 R(CSM)
030214,000214: 37,3334 01234 PIPTIME
030215,000215: 37,3335 77776 EXIT
030216,000216: 37,3336 35015 CA PRIO3
030217,000217: 37,3337 05146 TC PRIOCHNG
030218,000218: 37,3340 06042 TC INTPRET
030219,000219: 37,3341 77214 BOFF VLOAD
030220,000220: 37,3342 03347 MUNFLAG
030221,000221: 37,3343 77355 GETRVN2 # IF MUNFLAG RESET, DO CM DELTA PRECISION
Page 702 |
030223,000223: 37,3344 60505 VXM VSR4 # CHANGE TO REFERENCE SYSTEM AND RESCALE
030224,000224: 37,3345 01732 REFSMMAT
030225,000225: 37,3346 77715 PDVL # R TO PD 0-5
030226,000226: 37,3347 76505 VXM VSL1
030227,000227: 37,3350 01732 REFSMMAT
030228,000228: 37,3351 40206 PUSH SETPD # V TO PD 5-11
030229,000229: 37,3352 00001 0
030230,000230: 37,3353 77650 GOTO
030231,000231: 37,3354 77232 COMPDISP
030232,000232:
030233,000233: 37,3355 77624 GETRVN2 CALL
030234,000234: 37,3356 27410 INTSTALL
030235,000235: 37,3357 52014 CLEAR GOTO
030236,000236: 37,3360 01673 INTYPFLG # PREC EXTRAP FOR OTHER
030237,000237: 37,3361 77214 OTHINT
030238,000238: 37,3362 06042 R31SURF TC INTPRET
030239,000239: 37,3363 77634 RTB # LM IS ON SURFACE, SO PRECISION
030240,000240: 37,3364 21574 LOADTIME # INTEGRATION USES PLANETARY INERTIAL
030241,000241: 37,3365 34041 STCALL TDEC1 # ORIENTATION SUBROUTINE
030242,000242: 37,3366 27056 LEMPREC
030243,000243: 37,3367 77650 GOTO # DO CSM CONIC
030244,000244: 37,3370 77203 OTHCONIC
030245,000245: 37,3371 40102 MUNG? CS FLAGWRD6
030246,000246: 37,3372 74744 MASK MUNFLBIT
030247,000247: 37,3373 00006 EXTEND
030248,000248: 37,3374 13320 BZF GETRVN # IF MUNFLAG SET, CSM BASE NOT NEEDED
030249,000249:
030250,000250: 37,3375 06042 ONEBASE TC INTPRET # GET CSM BASE VECTOR
030251,000251: 37,3376 52034 RTB GOTO
030252,000252: 37,3377 21574 LOADTIME
030253,000253: 37,3400 77136 DOCMBASE
End of include-file R31.agc. Parent file is MAIN.agc