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