Source Code
These source-code files derive from a printout of Luminary 116 (the Apollo 12
Lunar Module guidance computer program), from the personal library of
original AGC developer Don Eyles, digitally photographed at archive.org,
financially sponsored by Ron Burkey, 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 116 OF AGC PROGRAM LUMINARY BY NASA 2021112-071 19:09 AUG. 11,1969Note that the date is the date of the printout, not the date of the program revision. |
035408,000002: ## Copyright: Public domain.
035409,000003: ## Filename: P70-P71.agc
035410,000004: ## Purpose: A section of Luminary revision 116.
035411,000005: ## It is part of the source code for the Lunar Module's (LM)
035412,000006: ## Apollo Guidance Computer (AGC) for Apollo 12.
035413,000007: ## This file is intended to be a faithful transcription, except
035414,000008: ## that the code format has been changed to conform to the
035415,000009: ## requirements of the yaYUL assembler rather than the
035416,000010: ## original YUL assembler.
035417,000011: ## Reference: pp. 823-830
035418,000012: ## Assembler: yaYUL
035419,000013: ## Contact: Ron Burkey <info@sandroid.org>.
035420,000014: ## Website: www.ibiblio.org/apollo/index.html
035421,000015: ## Mod history: 2017-01-22 MAS Created from Luminary 99.
035422,000016: ## 2017-03-10 HG Transcribed
035423,000017: ## 2017-03-14 RSB Proofed comment text via 3-way diff vs
035424,000018: ## Luminary 99 and 131.
035425,000019: ## 2017-03-19 HG Fix operand ROO --> RCO
035426,000020:
Page 823 |
035428,000022: 21,2006 BANK 21
035429,000023: 21,2000 SETLOC R11
035430,000024: 21,2000 BANK
035431,000025:
035432,000026: 21,2006 E7,1515 EBANK= DVCNTR
035433,000027: 21,2006 COUNT* $$/R11
035434,000028:
035435,000029: 21,2006 40103 R10,R11 CS FLAGWRD7 # IS SERVICER STILL RUNNING?
035436,000030: 21,2007 74747 MASK AVEGFBIT
035437,000031: 21,2010 10000 CCS A
035438,000032: 21,2011 15261 TCF TASKOVER # LET AVGEND TAKE CARE OF GROUP 2.
035439,000033: 21,2012 11055 CCS PIPCTR
035440,000034: 21,2013 12015 TCF +2
035441,000035: 21,2014 12125 TCF LRHTASK # LAST PASS. CALL LRHTASK.
Note: The operand "LRHTASK" above is circled with a red pen. |
035443,000037: 21,2015 55714 +2 TS PIPCTR1
035444,000038:
035445,000039: 21,2016 E7,1714 PIPCTR1 = LADQSAVE
035446,000040: 21,2016 1055 PIPCTR = PHSPRDT2
035447,000041: 21,2016 36010 CAF OCT31
035448,000042: 21,2017 05173 TC TWIDDLE
035449,000043: 21,2020 02006 ADRES R10,R11
035450,000044: 21,2021 34753 R10,R11A CAF HFLSHBIT
035451,000045: 21,2022 70107 FLASHH? MASK FLGWRD11
035452,000046: 21,2023 00006 EXTEND
035453,000047: 21,2024 12030 BZF FLASHV? # H FLASH OFF, SO LEAVE ALONE
035454,000048:
035455,000049: 21,2025 34747 CA HLITE
035456,000050: 21,2026 54001 TS L
035457,000051: 21,2027 04606 TC FLIP # FLIP H LITE
035458,000052:
035459,000053: 21,2030 34752 FLASHV? CA VFLSHBIT # VFLASHBIT MUST BE BIT 2.
035460,000054: 21,2031 70107 MASK FLGWRD11
035461,000055: 21,2032 00006 EXTEND
035462,000056: 21,2033 12037 BZF 10,11 # V FLASH OFF
035463,000057:
035464,000058: 21,2034 34751 CA VLITE
035465,000059: 21,2035 54001 TS L
035466,000060: 21,2036 04606 TC FLIP # FLIP V LITE
035467,000061:
035468,000062:
035469,000063: 21,2037 30105 10,11 CA FLAGWRD9 # IS THE LETABORT FLAG SET ?
035470,000064: 21,2040 74743 MASK LETABBIT
035471,000065: 21,2041 00006 EXTEND
035472,000066: 21,2042 12145 BZF LANDISP # NO. PROCEED TO R10.
035473,000067:
035474,000068: 21,2043 41010 P71NOW? CS MODREG # YES. ARE WE IN P71 NOW?
035475,000069: 21,2044 62104 AD 1DEC71
035476,000070: 21,2045 00006 EXTEND
035477,000071: 21,2046 12145 BZF LANDISP # YES. PROCEED TO R10.
035478,000072:
Page 824 |
035480,000074: 21,2047 00006 EXTEND # NO. IS AN ABORT STAGE COMMANDED?
035481,000075: 21,2050 00030 READ CHAN30
035482,000076: 21,2051 40000 COM
035483,000077: 21,2052 54001 TS L
035484,000078: 21,2053 74750 MASK BIT4
035485,000079: 21,2054 10000 CCS A
035486,000080: 21,2055 12073 TCF P71A # YES.
035487,000081:
035488,000082: 21,2056 41010 P70NOW? CS MODREG # NO. ARE WE IN P70 NOW?
035489,000083: 21,2057 62103 AD 1DEC70
035490,000084: 21,2060 00006 EXTEND
035491,000085: 21,2061 12145 BZF LANDISP # YES. PROCEED TO R10.
035492,000086:
035493,000087: 21,2062 30001 CA L # NO. IS AN ABORT COMMANDED?
035494,000088: 21,2063 74753 MASK BIT1
035495,000089: 21,2064 10000 CCS A
035496,000090: 21,2065 12070 TCF P70A # YES.
035497,000091: 21,2066 12145 TCF LANDISP # NO. PROCEED TO R10.
035498,000092:
035499,000093: 21,2067 COUNT* $$/P70
035500,000094:
035501,000095: 21,2067 02105 P70 TC LEGAL?
035502,000096: 21,2070 44755 P70A CS ZERO
035503,000097: 21,2071 12074 TCF +3
035504,000098: 21,2072 02105 P71 TC LEGAL?
035505,000099: 21,2073 34752 P71A CAF TWO
035506,000100: 21,2074 54002 +3 TS Q
035507,000101: 21,2075 00004 INHINT
035508,000102: 21,2076 00006 EXTEND
035509,000103: 21,2077 32102 DCA CNTABTAD
035510,000104: 21,2100 52006 DTCB
035511,000105:
035512,000106: 21,2101 E7,1515 EBANK= DVCNTR
035513,000107: 21,2101 03400 12067 CNTABTAD 2CADR CONTABRT
035514,000108: 21,2103 00106 1DEC70 DEC 70 B-14
035515,000109: 21,2104 00107 1DEC71 DEC 71 B-14
035516,000110:
035517,000111: 05,3400 BANK 05
035518,000112: 05,2000 SETLOC ABORTS1
035519,000113: 05,2000 BANK
035520,000114: 05,3400 COUNT* $$/P70
035521,000115:
035522,000116: 05,3400 33403 CONTABRT CAF ABRTJADR
035523,000117: 05,3401 54017 TS BRUPT
035524,000118: 05,3402 50017 RESUME
035525,000119:
035526,000120: 05,3403 13404 ABRTJADR TCF ABRTJASK
035527,000121:
035528,000122: 05,3404 33464 ABRTJASK CAF OCTAL27
035529,000123:
Page 825 |
035531,000125: 05,3405 60002 AD Q
035532,000126: 05,3406 54001 TS L
035533,000127: 05,3407 40000 COM
035534,000128: 05,3410 52760 DXCH -PHASE4
035535,000129: 05,3411 50002 INDEX Q
035536,000130: 05,3412 33463 CAF MODE70
035537,000131: 05,3413 55010 TS MODREG
035538,000132:
035539,000133: 05,3414 55162 TS DISPDEX # INSURE DISPDEX IS POSITIVE.
035540,000134:
035541,000135: 05,3415 10002 CCS Q # SET APSFLAG IF P71.
035542,000136: 05,3416 40106 CS FLGWRD10 # SET APSFLAG PRIOR TO THE ENEMA.
035543,000137: 05,3417 74737 MASK APSFLBIT
035544,000138: 05,3420 26106 ADS FLGWRD10
035545,000139: 05,3421 43466 CS DAPBITS # DAPBITS = OCT 40640 = BITS 6,8,9,15
035546,000140: 05,3422 70111 MASK DAPBOOLS # RESET ULLAGE,DRIFT,XOVRIINH,AND PULSES
035547,000141: 05,3423 54111 TS DAPBOOLS
035548,000142:
035549,000143: 05,3424 33467 CAF 1DEGDB # INSURE DAP DEADBAND IS SET TO 1 DEGREE
035550,000144: 05,3425 55343 TS DB
035551,000145:
035552,000146: 05,3426 40101 CS FLAGWRD5 # SET ENGONFLG.
035553,000147: 05,3427 74745 MASK ENGONBIT
035554,000148: 05,3430 26101 ADS FLAGWRD5
035555,000149:
035556,000150: 05,3431 44355 CS PRIO30 # INSURE THAT THE ENGINE IS ON, IF ARMED.
035557,000151: 05,3432 00006 EXTEND
035558,000152: 05,3433 02011 RAND DSALMOUT
035559,000153: 05,3434 64737 AD BIT13
035560,000154: 05,3435 00006 EXTEND
035561,000155: 05,3436 01011 WRITE DSALMOUT
035562,000156:
035563,000157: 05,3437 34735 CAF LRBYBIT # TERMINATE R12.
035564,000158: 05,3440 54107 TS FLGWRD11
035565,000159:
035566,000160: 05,3441 40074 CS FLAGWRD0 # SET R10FLAG TO SUPPRESS OUTPUTS TO THE
035567,000161: 05,3442 74752 MASK R10FLBIT # CROSS-POINTER DISPLAY.
035568,000162: 05,3443 26074 ADS FLAGWRD0 # THE FOLLOWING ENEMA WILL REMOVE THE
035569,000163: # DISPLAY INERTIAL DATA OUTBIT.
035570,000164:
035571,000165: 05,3444 00006 EXTEND # LOAD TEVENT FOR THE DOWNLINK.
035572,000166: 05,3445 30025 DCA TIME2
035573,000167: 05,3446 53342 DXCH TEVENT
035574,000168:
035575,000169: 05,3447 00006 EXTEND
035576,000170: 05,3450 33462 DCA SVEXITAD
035577,000171: 05,3451 53252 DXCH AVGEXIT
035578,000172:
035579,000173: 05,3452 02653 TC ABTKLEAN # KILL GROUPS 1,3, AND 6.
035580,000174:
Page 826 |
035582,000176: 05,3453 36250 CAF THREE # SET UP 4.3SPOT FOR GOABORT
035583,000177: 05,3454 54001 TS L
035584,000178: 05,3455 40000 COM
035585,000179: 05,3456 52760 DXCH -PHASE4
035586,000180:
035587,000181: 05,3457 04635 TC POSTJUMP
035588,000182: 05,3460 12763 CADR ENEMA
035589,000183:
035590,000184: 05,3461 E7,1515 EBANK= DVCNTR
035591,000185: 05,3461 03761 64067 SVEXITAD 2CADR SERVEXIT
035592,000186: 05,3463 00106 MODE70 DEC 70 B-14
035593,000187: 05,3464 00027 OCTAL27 OCT 27
035594,000188: 05,3465 00107 MODE71 DEC 71 B-14
035595,000189:
035596,000190: 05,3466 40640 DAPBITS OCT 40640
035597,000191:
035598,000192: 05,3467 00554 1DEGDB OCT 00554
035599,000193: 32,3547 BANK 32
035600,000194: 32,2000 SETLOC ABORTS
035601,000195: 32,2000 BANK
035602,000196:
035603,000197: 32,3547 COUNT* $$/P70
035604,000198:
035605,000199: 32,3547 34751 GOABORT CAF FOUR
035606,000200: 32,3550 55515 TS DVCNTR
035607,000201:
035608,000202: 32,3551 33756 CAF WHICHADR
035609,000203: 32,3552 55455 TS WHICH
035610,000204:
035611,000205: 32,3553 06042 TC INTPRET
035612,000206: 32,3554 43014 CLEAR CLEAR
035613,000207: 32,3555 04665 FLRCS
035614,000208: 32,3556 04265 FLUNDISP
035615,000209: 32,3557 43014 CLEAR SET
035616,000210: 32,3560 03670 IDLEFLAG
035617,000211: 32,3561 06464 ACC4-2FL
035618,000212: 32,3562 45014 SET CALL
035619,000213: 32,3563 04462 P7071FLG
035620,000214: 32,3564 61071 INITCDUW
Note: Above interpretive operand "INITCDUW" is circled with a black pen. |
035622,000216: 32,3565 77776 EXIT
035623,000217:
035624,000218: 32,3566 05321 TC CHECKMM
035625,000219: 32,3567 00106 70DEC DEC 70 B-14
035626,000220: 32,3570 13702 TCF P71RET
035627,000221:
035628,000222: 32,3571 06042 P70INIT TC INTPRET
035629,000223: 32,3572 77624 CALL
035630,000224: 32,3573 65731 TGOCOMP
035631,000225: 32,3574 54345 DLOAD SL
035632,000226:
Page 827 |
035634,000228: 32,3575 34003 MDOTDPS
035635,000229: 32,3576 20205 4D
035636,000230: 32,3577 77665 BDDV
035637,000231: 32,3600 01244 MASS
035638,000232: 32,3601 16271 STODL TBUP
035639,000233: 32,3602 01244 MASS
035640,000234: 32,3603 70471 DDV SR1
035641,000235: 32,3604 16015 K(1/DV)
035642,000236: 32,3605 03635 STORE 1/DV1
035643,000237: 32,3606 03637 STORE 1/DV2
035644,000238: 32,3607 03641 STORE 1/DV3
035645,000239: 32,3610 77665 BDDV
035646,000240: 32,3611 25755 K(AT)
035647,000241: 32,3612 16263 STODL AT
035648,000242: 32,3613 34015 100PCTTO
035649,000243: 32,3614 02267 STORE TTO
035650,000244: 32,3615 57535 SLOAD DCOMP
035651,000245: 32,3616 26002 DPSVEX
035652,000246: 32,3617 77702 SR2
035653,000247: 32,3620 36265 STCALL VE
035654,000248: 32,3621 60275 COMMINIT
035655,000249: 32,3622 77745 INJTARG DLOAD
035656,000250: 32,3623 02567 ABTRDOT
035657,000251: 32,3624 36273 STCALL RDOTD # INITIALIZE RDOTD.
035658,000252: 32,3625 57312 YCOMP # COMPUTE Y
035659,000253: 32,3626 45246 ABS DSU
035660,000254: 32,3627 02565 YLIM # /Y/-DYMAX
035661,000255: 32,3630 75240 BMN SIGN # IF <0, XR<.5DEG, LEAVE YCO AT 0
035662,000256: 32,3631 65634 YOK # IF >0, FIX SIGN OF DEFICIT, THIS IS YCO.
035663,000257: 32,3632 02335 Y
035664,000258: 32,3633 03633 STORE YCO
035665,000259: 32,3634 45345 YOK DLOAD DSU
035666,000260: 32,3635 03633 YCO
035667,000261: 32,3636 02335 Y
035668,000262: 32,3637 77661 SR
035669,000263: 32,3640 20606 5D
035670,000264: 32,3641 03643 STORE XRANGE
035671,000265: 32,3642 45014 SET CALL
035672,000266: 32,3643 04461 FLVR
035673,000267: 32,3644 71554 THETCOMP
035674,000268: 32,3645 51025 DSU BPL
035675,000269: 32,3646 02561 THETCRIT
035676,000270: 32,3647 65653 +4
035677,000271: 32,3650 52175 VLOAD GOTO
035678,000272: 32,3651 02551 J1PARM
035679,000273: 32,3652 65655 +3
035680,000274: 32,3653 77775 +4 VLOAD
035681,000275: 32,3654 02555 J2PARM
035682,000276: 32,3655 16621 +3 STODL JPARM
035683,000277: 32,3656 03631 RCO
035684,000278:
Page 828 |
035686,000280: 32,3657 02625 STORE RP
035687,000281: 32,3660 77414 SET EXIT
035688,000282: 32,3661 04471 ROTFLAG
035689,000283:
035690,000284: 32,3662 03740 UPTHROT TC THROTUP
035691,000285:
035692,000286: 32,3663 05353 TC PHASCHNG
035693,000287: 32,3664 04024 OCT 04024
035694,000288:
035695,000289: 32,3665 05504 TC UPFLAG
035696,000290: 32,3666 00216 ADRES FLAP
035697,000291:
035698,000292: 32,3667 04616 UPTHROT1 TC BANKCALL # VERIFY THAT THE PANEL SWITCHES
035699,000293: 32,3670 73707 CADR P40AUTO # ARE PROPERLY SET.
035700,000294:
035701,000295: 32,3671 03740 TC THROTUP
035702,000296:
035703,000297: 32,3672 35027 CAF PRIO17 # LET SERVICER FINISH BEFORE CONNECTING
035704,000298: 32,3673 05146 TC PRIOCHNG # ASCENT GUIDANCE EQUATIONS.
035705,000299:
035706,000300: 32,3674 00006 EXTEND
035707,000301: 32,3675 33760 DCA ATMAGAD
035708,000302: 32,3676 53252 DXCH AVGEXIT
035709,000303:
035710,000304: 32,3677 05353 GRP4OFF TC PHASCHNG # TERMINATE USE OF GROUP 4.
035711,000305: 32,3700 00004 OCT 00004
035712,000306:
035713,000307: 32,3701 15155 TCF ENDOFJOB
035714,000308:
035715,000309: 32,3702 05516 P71RET TC DOWNFLAG
035716,000310: 32,3703 00215 ADRES LETABORT
035717,000311:
035718,000312: 32,3704 36000 CAF THRESH2 # SET DVMON THRESHOLD TO THE ASCENT VALUE.
035719,000313: 32,3705 55250 TS DVTHRUSH
035720,000314:
035721,000315: 32,3706 06042 TC INTPRET
035722,000316: 32,3707 77624 CALL
035723,000317: 32,3710 60251 P12INIT
035724,000318: 32,3711 45014 BON CALL
035725,000319: 32,3712 04707 FLAP
035726,000320: 32,3713 65717 OLDTIME
035727,000321: 32,3714 65731 TGOCOMP # IF FLAP=0, TGO=T-TIG
035728,000322: 32,3715 77650 GOTO
035729,000323: 32,3716 65622 INJTARG
035730,000324: 32,3717 72545 OLDTIME DLOAD SL1 # IF FLAP=1,TGO=2 TGO
035731,000325: 32,3720 03517 TGO
035732,000326: 32,3721 03502 STORE TGO1
035733,000327: 32,3722 77776 EXIT
035734,000328:
035735,000329: 32,3723 05353 TC PHASCHNG
035736,000330:
Page 829 |
035738,000332: 32,3724 04024 OCT 04024
035739,000333:
035740,000334: 32,3725 00006 EXTEND
035741,000335: 32,3726 31502 DCA TGO1
035742,000336: 32,3727 53517 DXCH TGO
035743,000337: 32,3730 13667 TCF UPTHROT1
035744,000338:
035745,000339: 32,3731 E7,1501 TGO1 = VGBODY
035746,000340: # ************************************************************************
035747,000341:
035748,000342: 21,2105 BANK 21
035749,000343: 21,2000 SETLOC R11
035750,000344: 21,2000 BANK
035751,000345:
035752,000346: 21,2105 COUNT* $$/P70
035753,000347:
035754,000348: 21,2105 40774 LEGAL? CS MMNUMBER # IS THE DESIRED PGM ALREADY IN PROGRESS?
035755,000349: 21,2106 61010 AD MODREG
035756,000350: 21,2107 00006 EXTEND
035757,000351: 21,2110 12121 BZF ABORTALM
035758,000352:
035759,000353: 21,2111 40105 CS FLAGWRD9 # ARE THE ABORTS ENABLED?
035760,000354: 21,2112 74743 MASK LETABBIT
035761,000355: 21,2113 10000 CCS A
035762,000356: 21,2114 12121 TCF ABORTALM
035763,000357:
035764,000358: 21,2115 30103 CA FLAGWRD7 # IS SERVICER ON THE AIR?
035765,000359: 21,2116 74747 MASK AVEGFBIT
035766,000360: 21,2117 10000 CCS A
035767,000361: 21,2120 00002 TC Q # YES. ALL IS WELL.
035768,000362: 21,2121 04364 ABORTALM TC FALTON
035769,000363: 21,2122 04457 TC RELDSP
035770,000364: 21,2123 04635 TC POSTJUMP
035771,000365: 21,2124 21051 CADR PINBRNCH
035772,000366:
035773,000367: 32,3731 BANK 32
035774,000368: 32,2000 SETLOC ABORTS
035775,000369: 32,2000 BANK
035776,000370:
035777,000371: 32,3731 COUNT* $$/P70
035778,000372:
035779,000373: # ************************************************************************
035780,000374:
035781,000375: 32,3731 45234 TGOCOMP RTB DSU
035782,000376: 32,3732 21574 LOADTIME
035783,000377: 32,3733 03442 TIG
035784,000378: 32,3734 77661 SL
035785,000379: 32,3735 20214 11D
035786,000380: 32,3736 03517 STORE TGO
035787,000381: 32,3737 77616 RVQ
035788,000382:
Page 830 |
035790,000384: # ************************************************************************
035791,000385:
035792,000386: 32,3740 34737 THROTUP CAF BIT13
035793,000387: 32,3741 54055 TS THRUST
035794,000388: 32,3742 34750 CAF BIT4
035795,000389: 32,3743 00006 EXTEND
035796,000390: 32,3744 05014 WOR CHAN14
035797,000391: 32,3745 00002 TC Q
035798,000392:
035799,000393: # ************************************************************************
035800,000394:
035801,000395: 32,3746 00000 01750 10SECS 2DEC 1000 B-28
035802,000396: 32,3750 00021 33400 HINJECT 2DEC 18288 B-24 # 60,000 FEET EXPRESSED IN METERS.
035803,000397: 32,3752 11021 00000 (TGO)A 2DEC 37000 B-17
035804,000398: 32,3754 00507 25605 K(AT) 2DEC .02 # SCALING CONSTANT
035805,000399: 32,3756 02114 WHICHADR REMADR ABRTABLE
035806,000400:
035807,000401: # ************************************************************************
035808,000402:
035809,000403: 32,3757 E7,1515 EBANK= DVCNTR
035810,000404: 32,3757 03372 70067 ATMAGAD 2CADR ATMAG
End of include-file P70-P71.agc. Parent file is MAIN.agc