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. |
036658,000002: ## Copyright: Public domain.
036659,000003: ## Filename: P70-P71.agc
036660,000004: ## Purpose: A section of Luminary revision 210.
036661,000005: ## It is part of the source code for the Lunar Module's (LM)
036662,000006: ## Apollo Guidance Computer (AGC) for Apollo 15-17.
036663,000007: ## This file is intended to be a faithful transcription, except
036664,000008: ## that the code format has been changed to conform to the
036665,000009: ## requirements of the yaYUL assembler rather than the
036666,000010: ## original YUL assembler.
036667,000011: ## Reference: pp. 831-838
036668,000012: ## Assembler: yaYUL
036669,000013: ## Contact: Ron Burkey <info@sandroid.org>.
036670,000014: ## Website: www.ibiblio.org/apollo/index.html
036671,000015: ## Mod history: 2016-11-17 JL Created from Luminary131 version.
036672,000016: ## 2016-12-01 RSB Completed transcription.
036673,000017: ## 2016-12-07 HG Fix pseudo operator ADDRESS -> ADRES
036674,000018: ## 2016-12-08 HG Fix operand LANDISP -> LANADISP
036675,000019: ## 2016-12-25 RSB Comment-text proofed using ProoferComments
036676,000020: ## and corrected errors found.
036677,000021: ## 2017-03-16 RSB Comment-text fixes identified in 5-way
036678,000022: ## side-by-side diff of Luminary 69/99/116/131/210.
036679,000023:
Page 831 |
036681,000025: 21,2042 BANK 21
036682,000026: 21,2000 SETLOC R11
036683,000027: 21,2000 BANK
036684,000028:
036685,000029: 21,2042 E7,1515 EBANK= DVCNTR
036686,000030: 21,2042 COUNT* $$/R11
036687,000031:
036688,000032: 21,2042 40103 R10,R11 CS FLAGWRD7 # IS SERVICER STILL RUNNING?
036689,000033: 21,2043 74740 MASK AVEGFBIT
036690,000034: 21,2044 10000 CCS A
036691,000035: 21,2045 15263 TCF TASKOVER # LET AVGEND TAKE CARE OF GROUP 2.
036692,000036: 21,2046 11055 CCS PIPCTR
036693,000037: 21,2047 12054 TCF STORPCTR
036694,000038: 21,2050 00006 EXTEND
036695,000039: 21,2051 34746 DCA NEG0
036696,000040: 21,2052 52754 DXCH -PHASE2
036697,000041: 21,2053 12060 TCF R10,R11A
036698,000042:
036699,000043: 21,2054 55722 STORPCTR TS PIPCTR1
036700,000044:
036701,000045: 21,2055 36010 CAF OCT31
036702,000046: 21,2056 05175 TC TWIDDLE
036703,000047: 21,2057 02042 ADRES R10,R11
036704,000048: 21,2060 34744 R10,R11A CAF HFLSHBIT
036705,000049: 21,2061 70107 FLASHH? MASK FLGWRD11
036706,000050: 21,2062 00006 EXTEND
036707,000051: 21,2063 12067 BZF FLASHV? # H FLASH OFF, SO LEAVE ALONE
036708,000052:
In the assembly-listing hardcopy, there is a handwritten note, reading "page 541". |
036710,000054: 21,2064 34740 CA HLITE
036711,000055: 21,2065 54001 TS L
036712,000056: 21,2066 04577 TC FLIP # FLIP H LITE
036713,000057:
036714,000058: 21,2067 34743 FLASHV? CA VFLSHBIT # VFLASHBIT MUST BE BIT 2.
036715,000059: 21,2070 70107 MASK FLGWRD11
036716,000060: 21,2071 00006 EXTEND
036717,000061: 21,2072 12076 BZF 10,11 # VFLASH OFF
036718,000062:
036719,000063: 21,2073 34742 CA VLITE
036720,000064: 21,2074 54001 TS L
036721,000065: 21,2075 04577 TC FLIP # FLIP V LITE
036722,000066:
036723,000067:
036724,000068: 21,2076 30105 10,11 CA FLAGWRD9 # IS THE LETABORT FLAG SET ?
036725,000069: 21,2077 74734 MASK LETABBIT
036726,000070: 21,2100 00006 EXTEND
036727,000071: 21,2101 12170 BZF LANADISP # NO. PROCEED TO R10.
036728,000072:
036729,000073: 21,2102 41010 P71NOW? CS MODREG # YES. ARE WE IN P71 NOW?
036730,000074: 21,2103 62147 AD 1DEC71
036731,000075: 21,2104 00006 EXTEND
Page 832 |
036733,000077: 21,2105 12170 BZF LANADISP # YES. PROCEED TO R10.
036734,000078:
036735,000079: 21,2106 34744 CAF BIT1
036736,000080: 21,2107 70374 MASK CHANBKUP
036737,000081: 21,2110 10000 CCS A
036738,000082: 21,2111 12170 TCF LANADISP # IGNORE CHAN BITS - ASSUME NO ABORT
036739,000083:
036740,000084: 21,2112 00006 EXTEND # NO. IS AN ABORT STAGE COMMANDED?
036741,000085: 21,2113 00030 READ CHAN30
036742,000086: 21,2114 40000 COM
036743,000087: 21,2115 54001 TS L
036744,000088: 21,2116 74741 MASK BIT4
036745,000089: 21,2117 10000 CCS A
036746,000090: 21,2120 12136 TCF P71A # YES.
036747,000091:
036748,000092: 21,2121 41010 P70NOW? CS MODREG # NO. ARE WE IN P70 NOW?
036749,000093: 21,2122 62146 AD 1DEC70
036750,000094: 21,2123 00006 EXTEND
036751,000095: 21,2124 12170 BZF LANADISP # YES. PROCEED TO R10.
036752,000096:
036753,000097: 21,2125 30001 CA L # NO. IS AN ABORT COMMANDED?
036754,000098: 21,2126 74744 MASK BIT1
036755,000099: 21,2127 10000 CCS A
036756,000100: 21,2130 12133 TCF P70A # YES.
036757,000101: 21,2131 12170 TCF LANADISP # NO. PROCEED TO R10.
036758,000102:
036759,000103: 21,2132 COUNT* $$/P70
036760,000104:
036761,000105: 21,2132 02150 P70 TC LEGAL?
036762,000106: 21,2133 44746 P70A CS ZERO
036763,000107: 21,2134 12137 TCF +3
036764,000108: 21,2135 02150 P71 TC LEGAL?
036765,000109: 21,2136 34743 P71A CAF TWO
036766,000110: 21,2137 54002 +3 TS Q
036767,000111: 21,2140 00004 INHINT
036768,000112: 21,2141 00006 EXTEND
036769,000113: 21,2142 32145 DCA CNTABTAD
036770,000114: 21,2143 52006 DTCB
036771,000115:
036772,000116: 21,2144 E7,1515 EBANK= DVCNTR
036773,000117: 21,2144 03417 12067 CNTABTAD 2CADR CONTABRT
036774,000118:
036775,000119: 21,2146 00106 1DEC70 DEC 70 B-14
036776,000120: 21,2147 00107 1DEC71 DEC 71 B-14
036777,000121:
036778,000122: 05,3417 BANK 05
036779,000123: 05,2000 SETLOC ABORTS1
036780,000124: 05,2000 BANK
036781,000125: 05,3417 COUNT* $$/P70
036782,000126:
Page 833 |
036784,000128: 05,3417 33422 CONTABRT CAF ABRTJADR
036785,000129: 05,3420 54017 TS BRUPT
036786,000130: 05,3421 50017 RESUME
036787,000131:
036788,000132: 05,3422 13423 ABRTJADR TCF ABRTJASK
036789,000133:
036790,000134: 05,3423 33503 ABRTJASK CAF OCTAL27
036791,000135: 05,3424 60002 AD Q
036792,000136: 05,3425 54001 TS L
036793,000137: 05,3426 40000 COM
036794,000138: 05,3427 52760 DXCH -PHASE4
036795,000139: 05,3430 50002 INDEX Q
036796,000140: 05,3431 33502 CAF MODE70
036797,000141: 05,3432 55010 TS MODREG
036798,000142:
036799,000143: 05,3433 55162 TS DISPDEX # INSURE DISPDEX IS POSITIVE.
036800,000144:
036801,000145: 05,3434 10002 CCS Q # SET APSFLAG IF P71.
036802,000146: 05,3435 40106 CS FLGWRD10 # SET APSFLAG PRIOR TO THE ENEMA.
036803,000147: 05,3436 74730 MASK APSFLBIT
036804,000148: 05,3437 26106 ADS FLGWRD10
036805,000149: 05,3440 43505 CS DAPBITS # DAPBITS = OCT 40640 = BITS 6,8,9,15
036806,000150: 05,3441 70111 MASK DAPBOOLS # RESET ULLAGE,DRIFT,XOVRIINH,AND PULSES
036807,000151: 05,3442 54111 TS DAPBOOLS
036808,000152:
036809,000153: 05,3443 33506 CAF 1DEGDB # INSURE DAP DEADBAND IS SET TO 1 DEGREE
036810,000154: 05,3444 55343 TS DB
036811,000155:
036812,000156: 05,3445 40101 CS FLAGWRD5 # SET ENGONFLG.
036813,000157: 05,3446 74736 MASK ENGONBIT
036814,000158: 05,3447 26101 ADS FLAGWRD5
036815,000159:
036816,000160: 05,3450 44346 CS PRIO30 # INSURE THAT THE ENGINE IS ON, IF ARMED.
036817,000161: 05,3451 00006 EXTEND
036818,000162: 05,3452 02011 RAND DSALMOUT
036819,000163: 05,3453 64730 AD BIT13
036820,000164: 05,3454 00006 EXTEND
036821,000165: 05,3455 01011 WRITE DSALMOUT
036822,000166:
036823,000167: 05,3456 34726 CAF LRBYBIT # TERMINATE R12.
036824,000168: 05,3457 54107 TS FLGWRD11
036825,000169:
036826,000170: 05,3460 40074 CS FLAGWRD0 # SIGNAL THE LAD TO DISPLAY LATVEL IN
036827,000171: 05,3461 74743 MASK R10FLBIT # INERTIAL COORDINATES AND FORVEL ZERO
036828,000172: 05,3462 26074 ADS FLAGWRD0
036829,000173:
036830,000174: 05,3463 00006 EXTEND # LOAD TEVENT FOR THE DOWNLINK.
036831,000175: 05,3464 30025 DCA TIME2
036832,000176: 05,3465 53342 DXCH TEVENT
036833,000177:
Page 834 |
036835,000179: 05,3466 00006 EXTEND
036836,000180: 05,3467 33501 DCA SVEXITAD
036837,000181: 05,3470 53252 DXCH AVGEXIT
036838,000182:
036839,000183: 05,3471 02657 TC ABTKLEAN # KILL GROUPS 1,3, AND 6.
036840,000184:
036841,000185: 05,3472 36266 CAF THREE # SET UP 4.3SPOT FOR GOABORT
036842,000186: 05,3473 54001 TS L
036843,000187: 05,3474 40000 COM
036844,000188: 05,3475 52760 DXCH -PHASE4
036845,000189:
036846,000190: 05,3476 04626 TC POSTJUMP
036847,000191: 05,3477 12767 CADR ENEMA
036848,000192:
036849,000193: 05,3500 E7,1515 EBANK= DVCNTR
036850,000194: 05,3500 03656 64067 SVEXITAD 2CADR SERVEXIT
036851,000195:
036852,000196: 05,3502 00106 MODE70 DEC 70 B-14
036853,000197: 05,3503 00027 OCTAL27 OCT 27
036854,000198: 05,3504 00107 MODE71 DEC 71 B-14
036855,000199:
036856,000200: 05,3505 40640 DAPBITS OCT 40640
036857,000201:
036858,000202: 05,3506 00554 1DEGDB OCT 00554
036859,000203: 32,3443 BANK 32
036860,000204: 32,2000 SETLOC ABORTS
036861,000205: 32,2000 BANK
036862,000206:
036863,000207: 32,3443 COUNT* $$/P70
036864,000208:
036865,000209: 32,3443 34742 GOABORT CAF FOUR
036866,000210: 32,3444 55515 TS DVCNTR
036867,000211:
036868,000212: 32,3445 33653 CAF WHICHADR
036869,000213: 32,3446 55455 TS WHICH
036870,000214:
036871,000215: 32,3447 06060 TC INTPRET
036872,000216: 32,3450 43014 CLEAR CLEAR
036873,000217: 32,3451 04665 FLRCS
036874,000218: 32,3452 04265 FLUNDISP
036875,000219: 32,3453 43014 CLEAR SET
036876,000220: 32,3454 03670 IDLEFLAG
036877,000221: 32,3455 06464 ACC4-2FL
036878,000222: 32,3456 45014 SET CALL
036879,000223: 32,3457 04462 P7071FLG
036880,000224: 32,3460 61063 INITCDUW
036881,000225: 32,3461 77776 EXIT
036882,000226:
036883,000227: 32,3462 05323 TC CHECKMM
036884,000228: 32,3463 00106 70DEC DEC 70 B-14
Page 835 |
036886,000230: 32,3464 13577 TCF P71RET
036887,000231:
036888,000232: 32,3465 06060 P70INIT TC INTPRET
036889,000233: 32,3466 77624 CALL
036890,000234: 32,3467 65626 TGOCOMP
036891,000235: 32,3470 54345 DLOAD SL
036892,000236: 32,3471 34003 MDOTDPS
036893,000237: 32,3472 20205 4D
036894,000238: 32,3473 77665 BDDV
036895,000239: 32,3474 01244 MASS
036896,000240: 32,3475 16262 STODL TBUP
036897,000241: 32,3476 01244 MASS
036898,000242: 32,3477 70471 DDV SR1
036899,000243: 32,3500 16015 K(1/DV)
036900,000244: 32,3501 03635 STORE 1/DV1
036901,000245: 32,3502 03637 STORE 1/DV2
036902,000246: 32,3503 03641 STORE 1/DV3
036903,000247: 32,3504 77665 BDDV
036904,000248: 32,3505 25652 K(AT)
036905,000249: 32,3506 16254 STODL AT
036906,000250: 32,3507 34015 100PCTTO
036907,000251: 32,3510 02260 STORE TTO
036908,000252: 32,3511 57535 SLOAD DCOMP
036909,000253: 32,3512 26002 DPSVEX
036910,000254: 32,3513 77702 SR2
036911,000255: 32,3514 36256 STCALL VE
036912,000256: 32,3515 60267 COMMINIT
036913,000257: 32,3516 77745 INJTARG DLOAD
036914,000258: 32,3517 02564 ABTRDOT
036915,000259: 32,3520 36264 STCALL RDOTD # INITIALIZE RDOTD.
036916,000260: 32,3521 57315 YCOMP # COMPUTE Y
036917,000261: 32,3522 45246 ABS DSU
036918,000262: 32,3523 02562 YLIM # /Y/-DYMAX
036919,000263: 32,3524 75240 BMN SIGN # IF <0, XR<.5DEG, LEAVE YCO AT 0
036920,000264: 32,3525 65530 YOK # IF >0, FIX SIGN OF DEFICIT, THIS IS YCO.
036921,000265: 32,3526 02326 Y
036922,000266: 32,3527 03633 STORE YCO
036923,000267: 32,3530 45345 YOK DLOAD DSU
036924,000268: 32,3531 03633 YCO
036925,000269: 32,3532 02326 Y
036926,000270: 32,3533 77661 SR
036927,000271: 32,3534 20606 5D
036928,000272: 32,3535 03643 STORE XRANGE
036929,000273: 32,3536 45014 SET CALL
036930,000274: 32,3537 04461 FLVR
036931,000275: 32,3540 71650 THETCOMP
036932,000276: 32,3541 51025 DSU BPL
036933,000277: 32,3542 02556 THETCRIT
036934,000278: 32,3543 65547 +4
036935,000279: 32,3544 52175 VLOAD GOTO
Page 836 |
036937,000281: 32,3545 02546 J1PARM
036938,000282: 32,3546 65552 STORPARM
036939,000283: 32,3547 43175 +4 VLOAD SET # IF J2 IS USED, SET THE
036940,000284: 32,3550 02552 J2PARM # ABORT TARGETING FLAG
036941,000285: 32,3551 04470 ABTTGFLG
036942,000286: 32,3552 16572 STORPARM STODL JPARM
036943,000287: 32,3553 03631 RCO
036944,000288: 32,3554 02576 STORE RP
036945,000289: 32,3555 77414 SET EXIT
036946,000290: 32,3556 04471 ROTFLAG
036947,000291:
036948,000292: 32,3557 03635 UPTHROT TC THROTUP
036949,000293:
036950,000294: 32,3560 05355 TC PHASCHNG
036951,000295: 32,3561 04024 OCT 04024
036952,000296:
036953,000297: 32,3562 05506 TC UPFLAG
036954,000298: 32,3563 00216 ADRES FLAP
036955,000299:
036956,000300: 32,3564 04607 UPTHROT1 TC BANKCALL # VERIFY THAT THE PANEL SWITCHES
036957,000301: 32,3565 73710 CADR P40AUTO # ARE PROPERLY SET.
036958,000302:
036959,000303: 32,3566 03635 TC THROTUP
036960,000304:
036961,000305: 32,3567 35020 CAF PRIO17 # LET SERVICER FINISH BEFORE CONNECTING
036962,000306: 32,3570 05137 TC PRIOCHNG # ASCENT GUIDANCE EQUATIONS.
036963,000307:
036964,000308: 32,3571 00006 EXTEND
036965,000309: 32,3572 33655 DCA ATMAGAD
036966,000310: 32,3573 53252 DXCH AVGEXIT
036967,000311:
036968,000312: 32,3574 05355 GRP4OFF TC PHASCHNG # TERMINATE USE OF GROUP 4.
036969,000313: 32,3575 00004 OCT 00004
036970,000314:
036971,000315: 32,3576 15146 TCF ENDOFJOB
036972,000316:
036973,000317: 32,3577 05520 P71RET TC DOWNFLAG
036974,000318: 32,3600 00215 ADRES LETABORT
036975,000319:
036976,000320: 32,3601 36000 CAF THRESH2 # SET DVMON THRESHOLD TO THE ASCENT VALUE.
036977,000321: 32,3602 55250 TS DVTHRUSH
036978,000322:
036979,000323: 32,3603 06060 TC INTPRET
036980,000324: 32,3604 77624 CALL
036981,000325: 32,3605 60243 P12INIT
036982,000326: 32,3606 45014 BON CALL
036983,000327: 32,3607 04707 FLAP
036984,000328: 32,3610 65614 OLDTIME
036985,000329: 32,3611 65626 TGOCOMP # IF FLAP=0, TGO=T-TIG
036986,000330: 32,3612 77650 GOTO
Page 837 |
036988,000332: 32,3613 65516 INJTARG
036989,000333: 32,3614 72545 OLDTIME DLOAD SL1 # IF FLAP=1,TGO=2 TGO
036990,000334: 32,3615 03517 TGO
036991,000335: 32,3616 03502 STORE TGO1
036992,000336: 32,3617 77776 EXIT
036993,000337:
036994,000338: 32,3620 05355 TC PHASCHNG
036995,000339: 32,3621 04024 OCT 04024
036996,000340:
036997,000341: 32,3622 00006 EXTEND
036998,000342: 32,3623 31502 DCA TGO1
036999,000343: 32,3624 53517 DXCH TGO
037000,000344: 32,3625 13564 TCF UPTHROT1
037001,000345:
037002,000346: # ************************************************************************
037003,000347:
037004,000348: 21,2150 BANK 21
037005,000349: 21,2000 SETLOC R11
037006,000350: 21,2000 BANK
037007,000351:
037008,000352: 21,2150 COUNT* $$/P70
037009,000353:
037010,000354: 21,2150 40774 LEGAL? CS MMNUMBER # IS THE DESIRED PGM ALREADY IN PROGRESS?
037011,000355: 21,2151 61010 AD MODREG
037012,000356: 21,2152 00006 EXTEND
037013,000357: 21,2153 12164 BZF ABORTALM
037014,000358:
037015,000359: 21,2154 40105 CS FLAGWRD9 # ARE THE ABORTS ENABLED?
037016,000360: 21,2155 74734 MASK LETABBIT
037017,000361: 21,2156 10000 CCS A
037018,000362: 21,2157 12164 TCF ABORTALM
037019,000363:
037020,000364: 21,2160 30103 CA FLAGWRD7 # IS SERVICER ON THE AIR?
037021,000365: 21,2161 74740 MASK AVEGFBIT
037022,000366: 21,2162 10000 CCS A
037023,000367: 21,2163 00002 TC Q # YES. ALL IS WELL.
037024,000368: 21,2164 04355 ABORTALM TC FALTON
037025,000369: 21,2165 04450 TC RELDSP
037026,000370: 21,2166 04626 TC POSTJUMP
037027,000371: 21,2167 21062 CADR PINBRNCH
037028,000372:
037029,000373: 32,3626 BANK 32
037030,000374: 32,2000 SETLOC ABORTS
037031,000375: 32,2000 BANK
037032,000376:
037033,000377: 32,3626 COUNT* $$/P70
037034,000378:
037035,000379: # ************************************************************************
037036,000380:
037037,000381: 32,3626 45234 TGOCOMP RTB DSU
Page 838 |
037039,000383: 32,3627 21603 LOADTIME
037040,000384: 32,3630 03442 TIG
037041,000385: 32,3631 77661 SL
037042,000386: 32,3632 20214 11D
037043,000387: 32,3633 03517 STORE TGO
037044,000388: 32,3634 77616 RVQ
037045,000389:
037046,000390: # ************************************************************************
037047,000391:
037048,000392: 32,3635 34730 THROTUP CAF BIT13
037049,000393: 32,3636 54055 TS THRUST
037050,000394: 32,3637 34741 CAF BIT4
037051,000395: 32,3640 00006 EXTEND
037052,000396: 32,3641 05014 WOR CHAN14
037053,000397: 32,3642 00002 TC Q
037054,000398:
037055,000399: # ************************************************************************
037056,000400:
037057,000401: 32,3643 00000 01750 10SECS 2DEC 1000 B-28
037058,000402:
037059,000403: 32,3645 00021 33400 HINJECT 2DEC 18288 B-24 # 60,000 FEET EXPRESSED IN METERS.
037060,000404:
037061,000405: 32,3647 11021 00000 (TGO)A 2DEC 37000 B-17
037062,000406:
037063,000407: 32,3651 00507 25605 K(AT) 2DEC .02 # SCALING CONSTANT
037064,000408:
037065,000409: 32,3653 02114 WHICHADR REMADR ABRTABLE
037066,000410:
037067,000411: # ************************************************************************
037068,000412:
037069,000413: 32,3654 E7,1515 EBANK= DVCNTR
037070,000414: 32,3654 03375 70067 ATMAGAD 2CADR ATMAG
End of include-file P70-P71.agc. Parent file is MAIN.agc