Source Code
This source code is very close to the Apollo Guidance Computer software for the
Apollo 13 Lunar module. This revision of the Luminary 131 program is from December
of 1969, whereas there was a later revision in January of 1970, and still another
revision in February, which is the code that flew on the mission.
As far as this transcription is concerned, it was originally from a copy made in 1991 of
a printout from the collection of AGC developer Don Eyles for collector David Craig.
It was subsequently scanned by Gary Neff, reprocessed for online
presentation at the now-discontinued History of Recent Science and Technology (HRST) website
of MIT's Dibner Institute (the full-quality scans being discarded in the process),
and finally transcribed by Ron Burkey for the Virtual AGC Project. Although a
high-quality replacement scan for a completely illegible page was later provided by Gary
Neff, the reduced legibility of the reprocessed HRST posting nevertheless caused many
errors to be introduced into the transcription. Accordingly, a second scan of the same physical
printout was made in 2017 for the Virtual AGC Project's collection at the Internet Archive,
and used to correct the transcription errors. All of the scanned materials mentioned,
as well as other Luminary 131 related material, are available online.
Don Eyles apprently made additional hand-written notes in printout between 1991 and 2017,
so the two scans are not identical in that respect. The page-headings in the printout read, in part:GAP: ASSEMBLE REVISION 131 OF AGC PROGRAM LUMINARY BY NASA 2021112-091 17:53 DEC. 19, 1969Note that the date is the date the printout was made, not the date on which the program revision was released, although these happen to be very close together. |
035243,000002: ## Copyright: Public domain.
035244,000003: ## Filename: P70-P71.agc
035245,000004: ## Purpose: A section of Luminary 1C, revision 131.
035246,000005: ## It is part of the source code for the Lunar Module's (LM)
035247,000006: ## Apollo Guidance Computer (AGC) for Apollo 13.
035248,000007: ## This file is intended to be a faithful transcription, except
035249,000008: ## that the code format has been changed to conform to the
035250,000009: ## requirements of the yaYUL assembler rather than the
035251,000010: ## original YUL assembler.
035252,000011: ## Reference: pp. 823-830
035253,000012: ## Contact: Ron Burkey <info@sandroid.org>.
035254,000013: ## Website: www.ibiblio.org/apollo
035255,000014: ## Mod history: 05/26/03 RSB. Began transcribing.
035256,000015: ## 2017-01-06 RSB Page numbers now agree with those on the
035257,000016: ## original hardcopy, as opposed to the PDF page
035258,000017: ## numbers in 1701.pdf.
035259,000018: ## 2017-02-26 RSB Proofed comment text using octopus/ProoferComments.
035260,000019: ## 2017-03-01 RSB Fixed lingering typos.
035261,000020: ## 2017-03-14 RSB Comment-text fixes noted in proofing Luminary 116.
035262,000021:
Page 823 |
035264,000023: 21,2006 BANK 21
035265,000024: 21,2000 SETLOC R11
035266,000025: 21,2000 BANK
035267,000026:
035268,000027: 21,2006 E7,1515 EBANK= DVCNTR
035269,000028: 21,2006 COUNT* $$/R11
035270,000029:
035271,000030: 21,2006 40103 R10,R11 CS FLAGWRD7 # IS SERVICER STILL RUNNING?
035272,000031: 21,2007 74747 MASK AVEGFBIT
035273,000032: 21,2010 10000 CCS A
035274,000033: 21,2011 15261 TCF TASKOVER # LET AVGEND TAKE CARE OF GROUP 2.
035275,000034: 21,2012 11055 CCS PIPCTR
035276,000035: 21,2013 12015 TCF +2
035277,000036: 21,2014 12125 TCF LRHTASK # LAST PASS. CALL LRHTASK.
035278,000037: 21,2015 55714 +2 TS PIPCTR1
035279,000038:
035280,000039: 21,2016 E7,1714 PIPCTR1 = LADQSAVE
035281,000040: 21,2016 1055 PIPCTR = PHSPRDT2
035282,000041: 21,2016 36010 CAF OCT31
035283,000042: 21,2017 05173 TC TWIDDLE
035284,000043: 21,2020 02006 ADRES R10,R11
035285,000044: 21,2021 34753 R10,R11A CAF HFLSHBIT
035286,000045: 21,2022 70107 FLASHH? MASK FLGWRD11
035287,000046: 21,2023 00006 EXTEND
035288,000047: 21,2024 12030 BZF FLASHV? # H FLASH OFF, SO LEAVE ALONE
035289,000048:
035290,000049: 21,2025 34747 CA HLITE
035291,000050: 21,2026 54001 TS L
035292,000051: 21,2027 04606 TC FLIP # FLIP H LITE
035293,000052:
035294,000053: 21,2030 34752 FLASHV? CA VFLSHBIT # VFLASHBIT MUST BE BIT 2.
035295,000054: 21,2031 70107 MASK FLGWRD11
035296,000055: 21,2032 00006 EXTEND
035297,000056: 21,2033 12037 BZF 10,11 # VFLASH OFF
035298,000057:
035299,000058: 21,2034 34751 CA VLITE
035300,000059: 21,2035 54001 TS L
035301,000060: 21,2036 04606 TC FLIP # FLIP V LITE
035302,000061:
035303,000062: 21,2037 30105 10,11 CA FLAGWRD9 # IS THE LETABORT FLAG SET ?
035304,000063: 21,2040 74743 MASK LETABBIT
035305,000064: 21,2041 00006 EXTEND
035306,000065: 21,2042 12145 BZF LANDISP # NO. PROCEED TO R10.
035307,000066:
035308,000067: 21,2043 41010 P71NOW? CS MODREG # YES. ARE WE IN P71 NOW?
035309,000068: 21,2044 62104 AD 1DEC71
035310,000069: 21,2045 00006 EXTEND
035311,000070: 21,2046 12145 BZF LANDISP # YES. PROCEED TO R10.
Page 824 |
035313,000072: 21,2047 00006 EXTEND # NO. IS AN ABORT STAGE COMMANDED?
035314,000073: 21,2050 00030 READ CHAN30
035315,000074: 21,2051 40000 COM
035316,000075: 21,2052 54001 TS L
035317,000076: 21,2053 74750 MASK BIT4
035318,000077: 21,2054 10000 CCS A
035319,000078: 21,2055 12073 TCF P71A # YES.
035320,000079:
035321,000080: 21,2056 41010 P70NOW? CS MODREG # NO. ARE WE IN P70 NOW?
035322,000081: 21,2057 62103 AD 1DEC70
035323,000082: 21,2060 00006 EXTEND
035324,000083: 21,2061 12145 BZF LANDISP # YES. PROCEED TO R10.
035325,000084:
035326,000085: 21,2062 30001 CA L # NO. IS AN ABORT COMMANDED?
035327,000086: 21,2063 74753 MASK BIT1
035328,000087: 21,2064 10000 CCS A
035329,000088: 21,2065 12070 TCF P70A # YES.
035330,000089: 21,2066 12145 TCF LANDISP # NO. PROCEED TO R10.
035331,000090:
035332,000091: 21,2067 COUNT* $$/P70
035333,000092:
035334,000093: 21,2067 02105 P70 TC LEGAL?
035335,000094: 21,2070 44755 P70A CS ZERO
035336,000095: 21,2071 12074 TCF +3
035337,000096: 21,2072 02105 P71 TC LEGAL?
035338,000097: 21,2073 34752 P71A CAF TWO
035339,000098: 21,2074 54002 +3 TS Q
035340,000099: 21,2075 00004 INHINT
035341,000100: 21,2076 00006 EXTEND
035342,000101: 21,2077 32102 DCA CNTABTAD
035343,000102: 21,2100 52006 DTCB
035344,000103:
035345,000104: 21,2101 E7,1515 EBANK= DVCNTR
035346,000105: 21,2101 03413 12067 CNTABTAD 2CADR CONTABRT
035347,000106:
035348,000107: 21,2103 00106 1DEC70 DEC 70 B-14
035349,000108: 21,2104 00107 1DEC71 DEC 71 B-14
035350,000109:
035351,000110: 05,3413 BANK 05
035352,000111: 05,2000 SETLOC ABORTS1
035353,000112: 05,2000 BANK
035354,000113: 05,3413 COUNT* $$/P70
035355,000114:
035356,000115: 05,3413 33416 CONTABRT CAF ABRTJADR
035357,000116: 05,3414 54017 TS BRUPT
035358,000117: 05,3415 50017 RESUME
035359,000118:
035360,000119: 05,3416 13417 ABRTJADR TCF ABRTJASK
035361,000120: 05,3417 33477 ABRTJASK CAF OCTAL27
035362,000121:
Page 825 |
035364,000123: 05,3420 60002 AD Q
035365,000124: 05,3421 54001 TS L
035366,000125: 05,3422 40000 COM
035367,000126: 05,3423 52760 DXCH -PHASE4
035368,000127: 05,3424 50002 INDEX Q
035369,000128: 05,3425 33476 CAF MODE70
035370,000129: 05,3426 55010 TS MODREG
035371,000130:
035372,000131: 05,3427 55162 TS DISPDEX # INSURE DISPDEX IS POSITIVE.
035373,000132:
035374,000133: 05,3430 10002 CCS Q # SET APSFLAG IF P71.
035375,000134: 05,3431 40106 CS FLGWRD10 # SET APSFLAG PRIOR TO THE ENEMA.
035376,000135: 05,3432 74737 MASK APSFLBIT
035377,000136: 05,3433 26106 ADS FLGWRD10
035378,000137: 05,3434 43501 CS DAPBITS # DAPBITS = OCT 40640 = BITS 6,8,9,15
035379,000138: 05,3435 70111 MASK DAPBOOLS # RESET ULLAGE,DRIFT,XOVRIINH, AND PULSES
035380,000139: 05,3436 54111 TS DAPBOOLS
035381,000140:
035382,000141: 05,3437 33502 CAF 1DEGDB # INSURE DAP DEADBAND IS SET TO 1 DEGREE
035383,000142: 05,3440 55343 TS DB
035384,000143:
035385,000144: 05,3441 40101 CS FLAGWRD5 # SET ENGONFLG.
035386,000145: 05,3442 74745 MASK ENGONBIT
035387,000146: 05,3443 26101 ADS FLAGWRD5
035388,000147:
035389,000148: 05,3444 44355 CS PRIO30 # INSURE THAT THE ENGINE IS ON, IF ARMED.
035390,000149: 05,3445 00006 EXTEND
035391,000150: 05,3446 02011 RAND DSALMOUT
035392,000151: 05,3447 64737 AD BIT13
035393,000152: 05,3450 00006 EXTEND
035394,000153: 05,3451 01011 WRITE DSALMOUT
035395,000154:
035396,000155: 05,3452 34735 CAF LRBYBIT # TERMINATE R12.
035397,000156: 05,3453 54107 TS FLGWRD11
035398,000157:
035399,000158: 05,3454 40074 CS FLAGWRD0 # SET R10FLAG TO SUPPRESS OUTPUTS TO THE
035400,000159: 05,3455 74752 MASK R10FLBIT # CROSS-POINTER DISPLAY.
035401,000160: 05,3456 26074 ADS FLAGWRD0 # THE FOLLOWING ENEMA WILL REMOVE THE
035402,000161: # DISPLAY INERTIAL DATA OUTBIT.
035403,000162:
035404,000163: 05,3457 00006 EXTEND # LOAD TEVENT FOR THE DOWNLINK.
035405,000164: 05,3460 30025 DCA TIME2
035406,000165: 05,3461 53342 DXCH TEVENT
035407,000166:
035408,000167: 05,3462 00006 EXTEND
035409,000168: 05,3463 33475 DCA SVEXITAD
035410,000169: 05,3464 53252 DXCH AVGEXIT
035411,000170:
035412,000171: 05,3465 02653 TC ABTKLEAN # KILL GROUPS 1,3, AND 6.
Page 826 |
035414,000173: 05,3466 36250 CAF THREE # SET UP 4.3SPOT FOR GOABORT
035415,000174: 05,3467 54001 TS L
035416,000175: 05,3470 40000 COM
035417,000176: 05,3471 52760 DXCH -PHASE4
035418,000177:
035419,000178: 05,3472 04635 TC POSTJUMP
035420,000179: 05,3473 12763 CADR ENEMA
035421,000180:
035422,000181: 05,3474 E7,1515 EBANK= DVCNTR
035423,000182: 05,3474 03746 64067 SVEXITAD 2CADR SERVEXIT
035424,000183:
035425,000184: 05,3476 00106 MODE70 DEC 70 B-14
035426,000185: 05,3477 00027 OCTAL27 OCT 27
035427,000186: 05,3500 00107 MODE71 DEC 71 B-14
035428,000187:
035429,000188: 05,3501 40640 DAPBITS OCT 40640
035430,000189:
035431,000190: 05,3502 00554 1DEGDB OCT 00554
035432,000191: 32,3533 BANK 32
035433,000192: 32,2000 SETLOC ABORTS
035434,000193: 32,2000 BANK
035435,000194:
035436,000195: 32,3533 COUNT* $$/P70
035437,000196:
035438,000197: 32,3533 34751 GOABORT CAF FOUR
035439,000198: 32,3534 55515 TS DVCNTR
035440,000199:
035441,000200: 32,3535 33743 CAF WHICHADR
035442,000201: 32,3536 55455 TS WHICH
035443,000202:
035444,000203: 32,3537 06042 TC INTPRET
035445,000204: 32,3540 43014 CLEAR CLEAR
035446,000205: 32,3541 04665 FLRCS
035447,000206: 32,3542 04265 FLUNDISP
035448,000207: 32,3543 43014 CLEAR SET
035449,000208: 32,3544 03670 IDLEFLAG
035450,000209: 32,3545 06464 ACC4-2FL
035451,000210: 32,3546 45014 SET CALL
035452,000211: 32,3547 04462 P7071FLG
035453,000212: 32,3550 61071 INITCDUW
035454,000213: 32,3551 77776 EXIT
035455,000214:
035456,000215: 32,3552 05321 TC CHECKMM
035457,000216: 32,3553 00106 70DEC DEC 70 B-14
035458,000217: 32,3554 13667 TCF P71RET
035459,000218:
035460,000219: 32,3555 06042 P70INIT TC INTPRET
035461,000220: 32,3556 77624 CALL
035462,000221: 32,3557 65716 TGOCOMP
035463,000222: 32,3560 54345 DLOAD SL
Page 827 |
035465,000224: 32,3561 34003 MDOTDPS
035466,000225: 32,3562 20205 4D
035467,000226: 32,3563 77665 BDDV
035468,000227: 32,3564 01244 MASS
035469,000228: 32,3565 16271 STODL TBUP
035470,000229: 32,3566 01244 MASS
035471,000230: 32,3567 70471 DDV SR1
035472,000231: 32,3570 16015 K(1/DV)
035473,000232: 32,3571 03635 STORE 1/DV1
035474,000233: 32,3572 03637 STORE 1/DV2
035475,000234: 32,3573 03641 STORE 1/DV3
035476,000235: 32,3574 77665 BDDV
035477,000236: 32,3575 25742 K(AT)
035478,000237: 32,3576 16263 STODL AT
035479,000238: 32,3577 34015 100PCTTO
035480,000239: 32,3600 02267 STORE TTO
035481,000240: 32,3601 57535 SLOAD DCOMP
035482,000241: 32,3602 26002 DPSVEX
035483,000242: 32,3603 77702 SR2
035484,000243: 32,3604 36265 STCALL VE
035485,000244: 32,3605 60275 COMMINIT
035486,000245: 32,3606 77745 INJTARG DLOAD
035487,000246: 32,3607 02567 ABTRDOT
035488,000247: 32,3610 36273 STCALL RDOTD # INITIALIZE RDOTD.
035489,000248: 32,3611 57313 YCOMP # COMPUTE Y
035490,000249: 32,3612 45246 ABS DSU
035491,000250: 32,3613 02565 YLIM # /Y/-DYMAX
035492,000251: 32,3614 75240 BMN SIGN # IF <0, XR<.5DEG, LEAVE YCO AT 0
035493,000252: 32,3615 65620 YOK # IF >0, FIX SIGN OF DEFICIT, THIS IS YCO.
035494,000253: 32,3616 02335 Y
035495,000254: 32,3617 03633 STORE YCO
035496,000255: 32,3620 45345 YOK DLOAD DSU
035497,000256: 32,3621 03633 YCO
035498,000257: 32,3622 02335 Y
035499,000258: 32,3623 77661 SR
035500,000259: 32,3624 20606 5D
035501,000260: 32,3625 03643 STORE XRANGE
035502,000261: 32,3626 45014 SET CALL
035503,000262: 32,3627 04461 FLVR
035504,000263: 32,3630 71554 THETCOMP
035505,000264: 32,3631 51025 DSU BPL
035506,000265: 32,3632 02561 THETCRIT
035507,000266: 32,3633 65637 +4
035508,000267: 32,3634 52175 VLOAD GOTO
035509,000268: 32,3635 02551 J1PARM
035510,000269: 32,3636 65642 STORPARM
035511,000270: 32,3637 43175 +4 VLOAD SET # IF J2 IS USED, SET THE
035512,000271: 32,3640 02555 J2PARM # ABORT TARGETING FLAG
035513,000272: 32,3641 04470 ABTTGFLG
035514,000273: 32,3642 16621 STORPARM STODL JPARM
Page 828 |
035516,000275: 32,3643 03631 RCO
035517,000276: 32,3644 02625 STORE RP
035518,000277: 32,3645 77414 SET EXIT
035519,000278: 32,3646 04471 ROTFLAG
035520,000279:
035521,000280: 32,3647 03725 UPTHROT TC THROTUP
035522,000281:
035523,000282: 32,3650 05353 TC PHASCHNG
035524,000283: 32,3651 04024 OCT 04024
035525,000284:
035526,000285: 32,3652 05504 TC UPFLAG
035527,000286: 32,3653 00216 ADRES FLAP
035528,000287:
035529,000288: 32,3654 04616 UPTHROT1 TC BANKCALL # VERIFY THAT THE PANEL SWITCHES
035530,000289: 32,3655 73707 CADR P40AUTO # ARE PROPERLY SET.
035531,000290:
035532,000291: 32,3656 03725 TC THROTUP
035533,000292:
035534,000293: 32,3657 35027 CAF PRIO17 # LET SERVICER FINISH BEFORE CONNECTING
035535,000294: 32,3660 05146 TC PRIOCHNG # ASCENT GUIDANCE EQUATIONS.
035536,000295:
035537,000296: 32,3661 00006 EXTEND
035538,000297: 32,3662 33745 DCA ATMAGAD
035539,000298: 32,3663 53252 DXCH AVGEXIT
035540,000299:
035541,000300: 32,3664 05353 GRP4OFF TC PHASCHNG # TERMINATE USE OF GROUP 4.
035542,000301: 32,3665 00004 OCT 00004
035543,000302:
035544,000303: 32,3666 15155 TCF ENDOFJOB
035545,000304:
035546,000305: 32,3667 05516 P71RET TC DOWNFLAG
035547,000306: 32,3670 00215 ADRES LETABORT
035548,000307:
035549,000308: 32,3671 36000 CAF THRESH2 # SET DVMON THRESHOLD TO THE ASCENT VALUE.
035550,000309: 32,3672 55250 TS DVTHRUSH
035551,000310:
035552,000311: 32,3673 06042 TC INTPRET
035553,000312: 32,3674 77624 CALL
035554,000313: 32,3675 60251 P12INIT
035555,000314: 32,3676 45014 BON CALL
035556,000315: 32,3677 04707 FLAP
035557,000316: 32,3700 65704 OLDTIME
035558,000317: 32,3701 65716 TGOCOMP # IF FLAP=0, TGO=T-TIG
035559,000318: 32,3702 77650 GOTO
035560,000319: 32,3703 65606 INJTARG
035561,000320: 32,3704 72545 OLDTIME DLOAD SL1 # IF FLAP=1,TGO=2 TGO
035562,000321: 32,3705 03517 TGO
035563,000322: 32,3706 03502 STORE TGO1
035564,000323: 32,3707 77776 EXIT
035565,000324:
Page 829 |
035567,000326: 32,3710 05353 TC PHASCHNG
035568,000327: 32,3711 04024 OCT 04024
035569,000328:
035570,000329: 32,3712 00006 EXTEND
035571,000330: 32,3713 31502 DCA TGO1
035572,000331: 32,3714 53517 DXCH TGO
035573,000332: 32,3715 13654 TCF UPTHROT1
035574,000333:
035575,000334: 32,3716 E7,1501 TGO1 = VGBODY
035576,000335:
035577,000336: # ************************************************************************
035578,000337:
035579,000338: 21,2105 BANK 21
035580,000339: 21,2000 SETLOC R11
035581,000340: 21,2000 BANK
035582,000341: 21,2105 COUNT* $$/P70
035583,000342:
035584,000343: 21,2105 40774 LEGAL? CS MMNUMBER # IS THE DESIRED PGM ALREADY IN PROGRESS?
035585,000344: 21,2106 61010 AD MODREG
035586,000345: 21,2107 00006 EXTEND
035587,000346: 21,2110 12121 BZF ABORTALM
035588,000347:
035589,000348: 21,2111 40105 CS FLAGWRD9 # ARE THE ABORTS ENABLED?
035590,000349: 21,2112 74743 MASK LETABBIT
035591,000350: 21,2113 10000 CCS A
035592,000351: 21,2114 12121 TCF ABORTALM
035593,000352:
035594,000353: 21,2115 30103 CA FLAGWRD7 # IS SERVICER ON THE AIR?
035595,000354: 21,2116 74747 MASK AVEGFBIT
035596,000355: 21,2117 10000 CCS A
035597,000356: 21,2120 00002 TC Q # YES. ALL IS WELL.
035598,000357: 21,2121 04364 ABORTALM TC FALTON
035599,000358: 21,2122 04457 TC RELDSP
035600,000359: 21,2123 04635 TC POSTJUMP
035601,000360: 21,2124 21051 CADR PINBRNCH
035602,000361:
035603,000362: 32,3716 BANK 32
035604,000363: 32,2000 SETLOC ABORTS
035605,000364: 32,2000 BANK
035606,000365:
035607,000366: 32,3716 COUNT* $$/P70
035608,000367:
035609,000368: # ************************************************************************
035610,000369:
035611,000370: 32,3716 45234 TGOCOMP RTB DSU
035612,000371: 32,3717 21574 LOADTIME
035613,000372: 32,3720 03442 TIG
035614,000373: 32,3721 77661 SL
035615,000374: 32,3722 20214 11D
035616,000375: 32,3723 03517 STORE TGO
Page 830 |
035618,000377: 32,3724 77616 RVQ
035619,000378:
035620,000379: # ************************************************************************
035621,000380:
035622,000381: 32,3725 34737 THROTUP CAF BIT13
035623,000382: 32,3726 54055 TS THRUST
035624,000383: 32,3727 34750 CAF BIT4
035625,000384: 32,3730 00006 EXTEND
035626,000385: 32,3731 05014 WOR CHAN14
035627,000386: 32,3732 00002 TC Q
035628,000387:
035629,000388: # ************************************************************************
035630,000389:
035631,000390: 32,3733 00000 01750 10SECS 2DEC 1000 B-28
035632,000391: 32,3735 00021 33400 HINJECT 2DEC 18288 B-24 # 60,000 FEET EXPRESSED IN METERS.
035633,000392: 32,3737 11021 00000 (TGO)A 2DEC 37000 B-17
035634,000393: 32,3741 00507 25605 K(AT) 2DEC .02 # SCALING CONSTANT
035635,000394: 32,3743 02114 WHICHADR REMADR ABRTABLE
035636,000395:
035637,000396: # ************************************************************************
035638,000397:
035639,000398: 32,3744 E7,1515 EBANK= DVCNTR
035640,000399: 32,3744 03372 70067 ATMAGAD 2CADR ATMAG
End of include-file P70-P71.agc. Parent file is MAIN.agc