Source Code
These source-code files are part of a reconstructed copy of Luminary 178, the
final release of the Apollo 14 Lunar Module (LM) Apollo Guidance Computer
(AGC) software.
The reconstruction began with source code of Zerlina 56, Luminary 210, and Luminary 131, previously transcribed from digitized copies of those programs. The code was created by combining the three, using Zerlina 56 as a base, since it was based off of Luminary 183. The differences between the three were carefully merged using the Luminary memos as a guide, with all changes made after Luminary 178 being backed out. 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 178 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. |
035862,000002: ## Copyright: Public domain.
035863,000003: ## Filename: P70-P71.agc
035864,000004: ## Purpose: A section of Luminary revision 178.
035865,000005: ## It is part of the reconstructed source code for the final
035866,000006: ## release of the flight software for the Lunar Module's
035867,000007: ## (LM) Apollo Guidance Computer (AGC) for Apollo 14. The
035868,000008: ## code has been recreated from copies of Zerlina 56, Luminary
035869,000009: ## 210, and Luminary 131, as well as many Luminary memos.
035870,000010: ## It has been adapted such that the resulting bugger words
035871,000011: ## exactly match those specified for Luminary 178 in NASA
035872,000012: ## drawing 2021152N, which gives relatively high confidence
035873,000013: ## that the reconstruction is correct.
035874,000014: ## Reference: pp. 822-828
035875,000015: ## Assembler: yaYUL
035876,000016: ## Contact: Ron Burkey <info@sandroid.org>.
035877,000017: ## Website: www.ibiblio.org/apollo/index.html
035878,000018: ## Mod history: 2019-08-14 MAS Created from Zerlina 56.
035879,000019: ## 2019-09-11 MAS Re-based on Luminary 210. Removed checking
035880,000020: ## of CHANBKUP. Returned erasables TGO1, PIPCTR,
035881,000021: ## and PIPCTR1 to their original locations.
035882,000022:
Page 831 |
035884,000024: 21,2006 BANK 21
035885,000025: 21,2000 SETLOC R11
035886,000026: 21,2000 BANK
035887,000027:
035888,000028: 21,2006 E7,1515 EBANK= DVCNTR
035889,000029: 21,2006 COUNT* $$/R11
035890,000030:
035891,000031: 21,2006 40103 R10,R11 CS FLAGWRD7 # IS SERVICER STILL RUNNING?
035892,000032: 21,2007 74747 MASK AVEGFBIT
035893,000033: 21,2010 10000 CCS A
035894,000034: 21,2011 15272 TCF TASKOVER # LET AVGEND TAKE CARE OF GROUP 2.
035895,000035: 21,2012 11055 CCS PIPCTR
035896,000036: 21,2013 12020 TCF STORPCTR
035897,000037: 21,2014 00006 EXTEND
035898,000038: 21,2015 34755 DCA NEG0
035899,000039: 21,2016 52754 DXCH -PHASE2
035900,000040: 21,2017 12024 TCF R10,R11A
035901,000041:
035902,000042: 21,2020 55722 STORPCTR TS PIPCTR1
035903,000043:
035904,000044: 21,2021 E7,1722 PIPCTR1 = VVECTY
035905,000045: 21,2021 1055 PIPCTR = PHSPRDT2
035906,000046: 21,2021 36010 CAF OCT31
035907,000047: 21,2022 05204 TC TWIDDLE
035908,000048: 21,2023 02006 ADRES R10,R11
035909,000049: 21,2024 34753 R10,R11A CAF HFLSHBIT
035910,000050: 21,2025 70107 FLASHH? MASK FLGWRD11
035911,000051: 21,2026 00006 EXTEND
035912,000052: 21,2027 12033 BZF FLASHV? # H FLASH OFF, SO LEAVE ALONE
035913,000053:
035914,000054: 21,2030 34747 CA HLITE
035915,000055: 21,2031 54001 TS L
035916,000056: 21,2032 04606 TC FLIP # FLIP H LITE
035917,000057:
035918,000058: 21,2033 34752 FLASHV? CA VFLSHBIT # VFLASHBIT MUST BE BIT 2.
035919,000059: 21,2034 70107 MASK FLGWRD11
035920,000060: 21,2035 00006 EXTEND
035921,000061: 21,2036 12042 BZF 10,11 # VFLASH OFF
035922,000062:
035923,000063: 21,2037 34751 CA VLITE
035924,000064: 21,2040 54001 TS L
035925,000065: 21,2041 04606 TC FLIP # FLIP V LITE
035926,000066:
035927,000067:
035928,000068: 21,2042 30105 10,11 CA FLAGWRD9 # IS THE LETABORT FLAG SET ?
035929,000069: 21,2043 74743 MASK LETABBIT
035930,000070: 21,2044 00006 EXTEND
035931,000071: 21,2045 12130 BZF LANADISP # NO. PROCEED TO R10.
035932,000072:
035933,000073: 21,2046 41010 P71NOW? CS MODREG # YES. ARE WE IN P71 NOW?
035934,000074: 21,2047 62107 AD 1DEC71
035935,000075: 21,2050 00006 EXTEND
Page 832 |
035937,000077: 21,2051 12130 BZF LANADISP # YES. PROCEED TO R10.
035938,000078:
035939,000079: 21,2052 00006 EXTEND # NO. IS AN ABORT STAGE COMMANDED?
035940,000080: 21,2053 00030 READ CHAN30
035941,000081: 21,2054 40000 COM
035942,000082: 21,2055 54001 TS L
035943,000083: 21,2056 74750 MASK BIT4
035944,000084: 21,2057 10000 CCS A
035945,000085: 21,2060 12076 TCF P71A # YES.
035946,000086:
035947,000087: 21,2061 41010 P70NOW? CS MODREG # NO. ARE WE IN P70 NOW?
035948,000088: 21,2062 62106 AD 1DEC70
035949,000089: 21,2063 00006 EXTEND
035950,000090: 21,2064 12130 BZF LANADISP # YES. PROCEED TO R10.
035951,000091:
035952,000092: 21,2065 30001 CA L # NO. IS AN ABORT COMMANDED?
035953,000093: 21,2066 74753 MASK BIT1
035954,000094: 21,2067 10000 CCS A
035955,000095: 21,2070 12073 TCF P70A # YES.
035956,000096: 21,2071 12130 TCF LANADISP # NO. PROCEED TO R10.
035957,000097:
035958,000098: 21,2072 COUNT* $$/P70
035959,000099:
035960,000100: 21,2072 02110 P70 TC LEGAL?
035961,000101: 21,2073 44755 P70A CS ZERO
035962,000102: 21,2074 12077 TCF +3
035963,000103: 21,2075 02110 P71 TC LEGAL?
035964,000104: 21,2076 34752 P71A CAF TWO
035965,000105: 21,2077 54002 +3 TS Q
035966,000106: 21,2100 00004 INHINT
035967,000107: 21,2101 00006 EXTEND
035968,000108: 21,2102 32105 DCA CNTABTAD
035969,000109: 21,2103 52006 DTCB
035970,000110:
035971,000111: 21,2104 E7,1515 EBANK= DVCNTR
035972,000112: 21,2104 03416 12067 CNTABTAD 2CADR CONTABRT
035973,000113:
035974,000114: 21,2106 00106 1DEC70 DEC 70 B-14
035975,000115: 21,2107 00107 1DEC71 DEC 71 B-14
035976,000116:
035977,000117: 05,3416 BANK 05
035978,000118: 05,2000 SETLOC ABORTS1
035979,000119: 05,2000 BANK
035980,000120: 05,3416 COUNT* $$/P70
035981,000121:
Page 833 |
035983,000123: 05,3416 33421 CONTABRT CAF ABRTJADR
035984,000124: 05,3417 54017 TS BRUPT
035985,000125: 05,3420 50017 RESUME
035986,000126:
035987,000127: 05,3421 13422 ABRTJADR TCF ABRTJASK
035988,000128:
035989,000129: 05,3422 33502 ABRTJASK CAF OCTAL27
035990,000130: 05,3423 60002 AD Q
035991,000131: 05,3424 54001 TS L
035992,000132: 05,3425 40000 COM
035993,000133: 05,3426 52760 DXCH -PHASE4
035994,000134: 05,3427 50002 INDEX Q
035995,000135: 05,3430 33501 CAF MODE70
035996,000136: 05,3431 55010 TS MODREG
035997,000137:
035998,000138: 05,3432 55162 TS DISPDEX # INSURE DISPDEX IS POSITIVE.
035999,000139:
036000,000140: 05,3433 10002 CCS Q # SET APSFLAG IF P71.
036001,000141: 05,3434 40106 CS FLGWRD10 # SET APSFLAG PRIOR TO THE ENEMA.
036002,000142: 05,3435 74737 MASK APSFLBIT
036003,000143: 05,3436 26106 ADS FLGWRD10
036004,000144: 05,3437 43504 CS DAPBITS # DAPBITS = OCT 40640 = BITS 6,8,9,15
036005,000145: 05,3440 70111 MASK DAPBOOLS # RESET ULLAGE,DRIFT,XOVRIINH,AND PULSES
036006,000146: 05,3441 54111 TS DAPBOOLS
036007,000147:
036008,000148: 05,3442 33505 CAF 1DEGDB # INSURE DAP DEADBAND IS SET TO 1 DEGREE
036009,000149: 05,3443 55343 TS DB
036010,000150:
036011,000151: 05,3444 40101 CS FLAGWRD5 # SET ENGONFLG.
036012,000152: 05,3445 74745 MASK ENGONBIT
036013,000153: 05,3446 26101 ADS FLAGWRD5
036014,000154:
036015,000155: 05,3447 44355 CS PRIO30 # INSURE THAT THE ENGINE IS ON, IF ARMED.
036016,000156: 05,3450 00006 EXTEND
036017,000157: 05,3451 02011 RAND DSALMOUT
036018,000158: 05,3452 64737 AD BIT13
036019,000159: 05,3453 00006 EXTEND
036020,000160: 05,3454 01011 WRITE DSALMOUT
036021,000161:
036022,000162: 05,3455 34735 CAF LRBYBIT # TERMINATE R12.
036023,000163: 05,3456 54107 TS FLGWRD11
036024,000164:
036025,000165: 05,3457 40074 CS FLAGWRD0 # SIGNAL THE LAD TO DISPLAY LATVEL IN
036026,000166: 05,3460 74752 MASK R10FLBIT # INERTIAL COORDINATES AND FORVEL ZERO
036027,000167: 05,3461 26074 ADS FLAGWRD0
036028,000168:
036029,000169: 05,3462 00006 EXTEND # LOAD TEVENT FOR THE DOWNLINK.
036030,000170: 05,3463 30025 DCA TIME2
036031,000171: 05,3464 53342 DXCH TEVENT
036032,000172:
Page 834 |
036034,000174: 05,3465 00006 EXTEND
036035,000175: 05,3466 33500 DCA SVEXITAD
036036,000176: 05,3467 53252 DXCH AVGEXIT
036037,000177:
036038,000178: 05,3470 02665 TC ABTKLEAN # KILL GROUPS 1,3, AND 6.
036039,000179:
036040,000180: 05,3471 36250 CAF THREE # SET UP 4.3SPOT FOR GOABORT
036041,000181: 05,3472 54001 TS L
036042,000182: 05,3473 40000 COM
036043,000183: 05,3474 52760 DXCH -PHASE4
036044,000184:
036045,000185: 05,3475 04635 TC POSTJUMP
036046,000186: 05,3476 12775 CADR ENEMA
036047,000187:
036048,000188: 05,3477 E7,1515 EBANK= DVCNTR
036049,000189: 05,3477 03645 64067 SVEXITAD 2CADR SERVEXIT
036050,000190:
036051,000191: 05,3501 00106 MODE70 DEC 70 B-14
036052,000192: 05,3502 00027 OCTAL27 OCT 27
036053,000193: 05,3503 00107 MODE71 DEC 71 B-14
036054,000194:
036055,000195: 05,3504 40640 DAPBITS OCT 40640
036056,000196:
036057,000197: 05,3505 00554 1DEGDB OCT 00554
036058,000198: 32,3432 BANK 32
036059,000199: 32,2000 SETLOC ABORTS
036060,000200: 32,2000 BANK
036061,000201:
036062,000202: 32,3432 COUNT* $$/P70
036063,000203:
036064,000204: 32,3432 34751 GOABORT CAF FOUR
036065,000205: 32,3433 55515 TS DVCNTR
036066,000206:
036067,000207: 32,3434 33642 CAF WHICHADR
036068,000208: 32,3435 55455 TS WHICH
036069,000209:
036070,000210: 32,3436 06042 TC INTPRET
036071,000211: 32,3437 43014 CLEAR CLEAR
036072,000212: 32,3440 04665 FLRCS
036073,000213: 32,3441 04265 FLUNDISP
036074,000214: 32,3442 43014 CLEAR SET
036075,000215: 32,3443 03670 IDLEFLAG
036076,000216: 32,3444 06464 ACC4-2FL
036077,000217: 32,3445 45014 SET CALL
036078,000218: 32,3446 04462 P7071FLG
036079,000219: 32,3447 61062 INITCDUW
036080,000220: 32,3450 77776 EXIT
036081,000221:
036082,000222: 32,3451 05332 TC CHECKMM
036083,000223: 32,3452 00106 70DEC DEC 70 B-14
Page 835 |
036085,000225: 32,3453 13566 TCF P71RET
036086,000226:
036087,000227: 32,3454 06042 P70INIT TC INTPRET
036088,000228: 32,3455 77624 CALL
036089,000229: 32,3456 65615 TGOCOMP
036090,000230: 32,3457 54345 DLOAD SL
036091,000231: 32,3460 34003 MDOTDPS
036092,000232: 32,3461 20205 4D
036093,000233: 32,3462 77665 BDDV
036094,000234: 32,3463 01244 MASS
036095,000235: 32,3464 16271 STODL TBUP
036096,000236: 32,3465 01244 MASS
036097,000237: 32,3466 70471 DDV SR1
036098,000238: 32,3467 16015 K(1/DV)
036099,000239: 32,3470 03635 STORE 1/DV1
036100,000240: 32,3471 03637 STORE 1/DV2
036101,000241: 32,3472 03641 STORE 1/DV3
036102,000242: 32,3473 77665 BDDV
036103,000243: 32,3474 25641 K(AT)
036104,000244: 32,3475 16263 STODL AT
036105,000245: 32,3476 34015 100PCTTO
036106,000246: 32,3477 02267 STORE TTO
036107,000247: 32,3500 57535 SLOAD DCOMP
036108,000248: 32,3501 26002 DPSVEX
036109,000249: 32,3502 77702 SR2
036110,000250: 32,3503 36265 STCALL VE
036111,000251: 32,3504 60266 COMMINIT
036112,000252: 32,3505 77745 INJTARG DLOAD
036113,000253: 32,3506 02564 ABTRDOT
036114,000254: 32,3507 36273 STCALL RDOTD # INITIALIZE RDOTD.
036115,000255: 32,3510 57313 YCOMP # COMPUTE Y
036116,000256: 32,3511 45246 ABS DSU
036117,000257: 32,3512 02562 YLIM # /Y/-DYMAX
036118,000258: 32,3513 75240 BMN SIGN # IF <0, XR<.5DEG, LEAVE YCO AT 0
036119,000259: 32,3514 65517 YOK # IF >0, FIX SIGN OF DEFICIT, THIS IS YCO.
036120,000260: 32,3515 02335 Y
036121,000261: 32,3516 03633 STORE YCO
036122,000262: 32,3517 45345 YOK DLOAD DSU
036123,000263: 32,3520 03633 YCO
036124,000264: 32,3521 02335 Y
036125,000265: 32,3522 77661 SR
036126,000266: 32,3523 20606 5D
036127,000267: 32,3524 03643 STORE XRANGE
036128,000268: 32,3525 45014 SET CALL
036129,000269: 32,3526 04461 FLVR
036130,000270: 32,3527 71557 THETCOMP
036131,000271: 32,3530 51025 DSU BPL
036132,000272: 32,3531 02556 THETCRIT
036133,000273: 32,3532 65536 +4
036134,000274: 32,3533 52175 VLOAD GOTO
Page 836 |
036136,000276: 32,3534 02546 J1PARM
036137,000277: 32,3535 65541 STORPARM
036138,000278: 32,3536 43175 +4 VLOAD SET # IF J2 IS USED, SET THE
036139,000279: 32,3537 02552 J2PARM # ABORT TARGETING FLAG
036140,000280: 32,3540 04470 ABTTGFLG
036141,000281: 32,3541 16572 STORPARM STODL JPARM
036142,000282: 32,3542 03631 RCO
036143,000283: 32,3543 02576 STORE RP
036144,000284: 32,3544 77414 SET EXIT
036145,000285: 32,3545 04471 ROTFLAG
036146,000286:
036147,000287: 32,3546 03624 UPTHROT TC THROTUP
036148,000288:
036149,000289: 32,3547 05364 TC PHASCHNG
036150,000290: 32,3550 04024 OCT 04024
036151,000291:
036152,000292: 32,3551 05515 TC UPFLAG
036153,000293: 32,3552 00216 ADRES FLAP
036154,000294:
036155,000295: 32,3553 04616 UPTHROT1 TC BANKCALL # VERIFY THAT THE PANEL SWITCHES
036156,000296: 32,3554 73715 CADR P40AUTO # ARE PROPERLY SET.
036157,000297:
036158,000298: 32,3555 03624 TC THROTUP
036159,000299:
036160,000300: 32,3556 35027 CAF PRIO17 # LET SERVICER FINISH BEFORE CONNECTING
036161,000301: 32,3557 05146 TC PRIOCHNG # ASCENT GUIDANCE EQUATIONS.
036162,000302:
036163,000303: 32,3560 00006 EXTEND
036164,000304: 32,3561 33644 DCA ATMAGAD
036165,000305: 32,3562 53252 DXCH AVGEXIT
036166,000306:
036167,000307: 32,3563 05364 GRP4OFF TC PHASCHNG # TERMINATE USE OF GROUP 4.
036168,000308: 32,3564 00004 OCT 00004
036169,000309:
036170,000310: 32,3565 15155 TCF ENDOFJOB
036171,000311:
036172,000312: 32,3566 05527 P71RET TC DOWNFLAG
036173,000313: 32,3567 00215 ADRES LETABORT
036174,000314:
036175,000315: 32,3570 36000 CAF THRESH2 # SET DVMON THRESHOLD TO THE ASCENT VALUE.
036176,000316: 32,3571 55250 TS DVTHRUSH
036177,000317:
036178,000318: 32,3572 06042 TC INTPRET
036179,000319: 32,3573 77624 CALL
036180,000320: 32,3574 60242 P12INIT
036181,000321: 32,3575 45014 BON CALL
036182,000322: 32,3576 04707 FLAP
036183,000323: 32,3577 65603 OLDTIME
036184,000324: 32,3600 65615 TGOCOMP # IF FLAP=0, TGO=T-TIG
036185,000325: 32,3601 77650 GOTO
Page 837 |
036187,000327: 32,3602 65505 INJTARG
036188,000328: 32,3603 72545 OLDTIME DLOAD SL1 # IF FLAP=1,TGO=2 TGO
036189,000329: 32,3604 03517 TGO
036190,000330: 32,3605 03502 STORE TGO1
036191,000331: 32,3606 77776 EXIT
036192,000332:
036193,000333: 32,3607 05364 TC PHASCHNG
036194,000334: 32,3610 04024 OCT 04024
036195,000335:
036196,000336: 32,3611 00006 EXTEND
036197,000337: 32,3612 31502 DCA TGO1
036198,000338: 32,3613 53517 DXCH TGO
036199,000339: 32,3614 13553 TCF UPTHROT1
036200,000340:
036201,000341: 32,3615 E7,1501 TGO1 = VGBODY
036202,000342:
036203,000343: # ************************************************************************
036204,000344:
036205,000345: 21,2110 BANK 21
036206,000346: 21,2000 SETLOC R11
036207,000347: 21,2000 BANK
036208,000348:
036209,000349: 21,2110 COUNT* $$/P70
036210,000350:
036211,000351: 21,2110 40774 LEGAL? CS MMNUMBER # IS THE DESIRED PGM ALREADY IN PROGRESS?
036212,000352: 21,2111 61010 AD MODREG
036213,000353: 21,2112 00006 EXTEND
036214,000354: 21,2113 12124 BZF ABORTALM
036215,000355:
036216,000356: 21,2114 40105 CS FLAGWRD9 # ARE THE ABORTS ENABLED?
036217,000357: 21,2115 74743 MASK LETABBIT
036218,000358: 21,2116 10000 CCS A
036219,000359: 21,2117 12124 TCF ABORTALM
036220,000360:
036221,000361: 21,2120 30103 CA FLAGWRD7 # IS SERVICER ON THE AIR?
036222,000362: 21,2121 74747 MASK AVEGFBIT
036223,000363: 21,2122 10000 CCS A
036224,000364: 21,2123 00002 TC Q # YES. ALL IS WELL.
036225,000365: 21,2124 04364 ABORTALM TC FALTON
036226,000366: 21,2125 04457 TC RELDSP
036227,000367: 21,2126 04635 TC POSTJUMP
036228,000368: 21,2127 21051 CADR PINBRNCH
036229,000369:
036230,000370: 32,3615 BANK 32
036231,000371: 32,2000 SETLOC ABORTS
036232,000372: 32,2000 BANK
036233,000373:
036234,000374: 32,3615 COUNT* $$/P70
036235,000375:
036236,000376: # ************************************************************************
036237,000377:
036238,000378: 32,3615 45234 TGOCOMP RTB DSU
Page 838 |
036240,000380: 32,3616 21574 LOADTIME
036241,000381: 32,3617 03442 TIG
036242,000382: 32,3620 77661 SL
036243,000383: 32,3621 20214 11D
036244,000384: 32,3622 03517 STORE TGO
036245,000385: 32,3623 77616 RVQ
036246,000386:
036247,000387: # ************************************************************************
036248,000388:
036249,000389: 32,3624 34737 THROTUP CAF BIT13
036250,000390: 32,3625 54055 TS THRUST
036251,000391: 32,3626 34750 CAF BIT4
036252,000392: 32,3627 00006 EXTEND
036253,000393: 32,3630 05014 WOR CHAN14
036254,000394: 32,3631 00002 TC Q
036255,000395:
036256,000396: # ************************************************************************
036257,000397:
036258,000398: 32,3632 00000 01750 10SECS 2DEC 1000 B-28
036259,000399:
036260,000400: 32,3634 00021 33400 HINJECT 2DEC 18288 B-24 # 60,000 FEET EXPRESSED IN METERS.
036261,000401:
036262,000402: 32,3636 11021 00000 (TGO)A 2DEC 37000 B-17
036263,000403:
036264,000404: 32,3640 00507 25605 K(AT) 2DEC .02 # SCALING CONSTANT
036265,000405:
036266,000406: 32,3642 02114 WHICHADR REMADR ABRTABLE
036267,000407:
036268,000408: # ************************************************************************
036269,000409:
036270,000410: 32,3643 E7,1515 EBANK= DVCNTR
036271,000411: 32,3643 03375 70067 ATMAGAD 2CADR ATMAG
End of include-file P70-P71.agc. Parent file is MAIN.agc