Source Code
These source-code files are part of a reconstructed copy of LM131 revision 1,
the final release of the Apollo 13 Lunar Module (LM) Apollo Guidance Computer
(AGC) software.
The source reconstruction began with source code of Luminary 131 previously transcribed from a digitized copy of that program. A dump of the flight spare core rope memory module B5, part number 2010802-171, serial number RAY 411, was obtained. This module is the only module different between Luminary 131 and LM131 revision 1. The dump was disassembled and all changes were incorporated into these source files. Note that page numbers in the reconstructed code match those on the Luminary 131 printout, although the changed code would likely have changed page numbers for a real LM131 revision 1 listing. 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. |
035117,000002: ## Copyright: Public domain.
035118,000003: ## Filename: P70-P71.agc
035119,000004: ## Purpose: A section of LM131 revision 1.
035120,000005: ## It is part of the reconstructed source code for the final
035121,000006: ## release of the flight software for the Lunar Module's (LM)
035122,000007: ## Apollo Guidance Computer (AGC) for Apollo 13. The code has
035123,000008: ## been reconstructed from a listing of Luminary 131 and a dump
035124,000009: ## of a core rope memory module B5, part number 2010802-171,
035125,000010: ## which is the only module different between LM131 revision 1
035126,000011: ## and Luminary 131. The executable generated from this source
035127,000012: ## has been verified against the module dump, so while the names,
035128,000013: ## comments, and ordering may not be exactly correct, the
035129,000014: ## resulting binary is.
035130,000015: ## Reference: pp. 823-830
035131,000016: ## Assembler: yaYUL
035132,000017: ## Contact: Ron Burkey <info@sandroid.org>.
035133,000018: ## Website: www.ibiblio.org/apollo/index.html
035134,000019: ## Mod history: 2022-10-28 MAS Created from Luminary 131.
035135,000020:
Page 823 |
035137,000022: 21,2006 BANK 21
035138,000023: 21,2000 SETLOC R11
035139,000024: 21,2000 BANK
035140,000025:
035141,000026: 21,2006 E7,1515 EBANK= DVCNTR
035142,000027: 21,2006 COUNT* $$/R11
035143,000028:
035144,000029: 21,2006 40103 R10,R11 CS FLAGWRD7 # IS SERVICER STILL RUNNING?
035145,000030: 21,2007 74747 MASK AVEGFBIT
035146,000031: 21,2010 10000 CCS A
035147,000032: 21,2011 15261 TCF TASKOVER # LET AVGEND TAKE CARE OF GROUP 2.
035148,000033: 21,2012 11055 CCS PIPCTR
035149,000034: 21,2013 12015 TCF +2
035150,000035: 21,2014 12125 TCF LRHTASK # LAST PASS. CALL LRHTASK.
035151,000036: 21,2015 55714 +2 TS PIPCTR1
035152,000037:
035153,000038: 21,2016 E7,1714 PIPCTR1 = LADQSAVE
035154,000039: 21,2016 1055 PIPCTR = PHSPRDT2
035155,000040: 21,2016 36010 CAF OCT31
035156,000041: 21,2017 05173 TC TWIDDLE
035157,000042: 21,2020 02006 ADRES R10,R11
035158,000043: 21,2021 34753 R10,R11A CAF HFLSHBIT
035159,000044: 21,2022 70107 FLASHH? MASK FLGWRD11
035160,000045: 21,2023 00006 EXTEND
035161,000046: 21,2024 12030 BZF FLASHV? # H FLASH OFF, SO LEAVE ALONE
035162,000047:
035163,000048: 21,2025 34747 CA HLITE
035164,000049: 21,2026 54001 TS L
035165,000050: 21,2027 04606 TC FLIP # FLIP H LITE
035166,000051:
035167,000052: 21,2030 34752 FLASHV? CA VFLSHBIT # VFLASHBIT MUST BE BIT 2.
035168,000053: 21,2031 70107 MASK FLGWRD11
035169,000054: 21,2032 00006 EXTEND
035170,000055: 21,2033 12037 BZF 10,11 # VFLASH OFF
035171,000056:
035172,000057: 21,2034 34751 CA VLITE
035173,000058: 21,2035 54001 TS L
035174,000059: 21,2036 04606 TC FLIP # FLIP V LITE
035175,000060:
035176,000061: 21,2037 30105 10,11 CA FLAGWRD9 # IS THE LETABORT FLAG SET ?
035177,000062: 21,2040 74743 MASK LETABBIT
035178,000063: 21,2041 00006 EXTEND
035179,000064: 21,2042 12145 BZF LANDISP # NO. PROCEED TO R10.
035180,000065:
035181,000066: 21,2043 41010 P71NOW? CS MODREG # YES. ARE WE IN P71 NOW?
035182,000067: 21,2044 62104 AD 1DEC71
035183,000068: 21,2045 00006 EXTEND
035184,000069: 21,2046 12145 BZF LANDISP # YES. PROCEED TO R10.
Page 824 |
035186,000071: 21,2047 00006 EXTEND # NO. IS AN ABORT STAGE COMMANDED?
035187,000072: 21,2050 00030 READ CHAN30
035188,000073: 21,2051 40000 COM
035189,000074: 21,2052 54001 TS L
035190,000075: 21,2053 74750 MASK BIT4
035191,000076: 21,2054 10000 CCS A
035192,000077: 21,2055 12073 TCF P71A # YES.
035193,000078:
035194,000079: 21,2056 41010 P70NOW? CS MODREG # NO. ARE WE IN P70 NOW?
035195,000080: 21,2057 62103 AD 1DEC70
035196,000081: 21,2060 00006 EXTEND
035197,000082: 21,2061 12145 BZF LANDISP # YES. PROCEED TO R10.
035198,000083:
035199,000084: 21,2062 30001 CA L # NO. IS AN ABORT COMMANDED?
035200,000085: 21,2063 74753 MASK BIT1
035201,000086: 21,2064 10000 CCS A
035202,000087: 21,2065 12070 TCF P70A # YES.
035203,000088: 21,2066 12145 TCF LANDISP # NO. PROCEED TO R10.
035204,000089:
035205,000090: 21,2067 COUNT* $$/P70
035206,000091:
035207,000092: 21,2067 02105 P70 TC LEGAL?
035208,000093: 21,2070 44755 P70A CS ZERO
035209,000094: 21,2071 12074 TCF +3
035210,000095: 21,2072 02105 P71 TC LEGAL?
035211,000096: 21,2073 34752 P71A CAF TWO
035212,000097: 21,2074 54002 +3 TS Q
035213,000098: 21,2075 00004 INHINT
035214,000099: 21,2076 00006 EXTEND
035215,000100: 21,2077 32102 DCA CNTABTAD
035216,000101: 21,2100 52006 DTCB
035217,000102:
035218,000103: 21,2101 E7,1515 EBANK= DVCNTR
035219,000104: 21,2101 03413 12067 CNTABTAD 2CADR CONTABRT
035220,000105:
035221,000106: 21,2103 00106 1DEC70 DEC 70 B-14
035222,000107: 21,2104 00107 1DEC71 DEC 71 B-14
035223,000108:
035224,000109: 05,3413 BANK 05
035225,000110: 05,2000 SETLOC ABORTS1
035226,000111: 05,2000 BANK
035227,000112: 05,3413 COUNT* $$/P70
035228,000113:
035229,000114: 05,3413 33416 CONTABRT CAF ABRTJADR
035230,000115: 05,3414 54017 TS BRUPT
035231,000116: 05,3415 50017 RESUME
035232,000117:
035233,000118: 05,3416 13417 ABRTJADR TCF ABRTJASK
035234,000119: 05,3417 33477 ABRTJASK CAF OCTAL27
035235,000120:
Page 825 |
035237,000122: 05,3420 60002 AD Q
035238,000123: 05,3421 54001 TS L
035239,000124: 05,3422 40000 COM
035240,000125: 05,3423 52760 DXCH -PHASE4
035241,000126: 05,3424 50002 INDEX Q
035242,000127: 05,3425 33476 CAF MODE70
035243,000128: 05,3426 55010 TS MODREG
035244,000129:
035245,000130: 05,3427 55162 TS DISPDEX # INSURE DISPDEX IS POSITIVE.
035246,000131:
035247,000132: 05,3430 10002 CCS Q # SET APSFLAG IF P71.
035248,000133: 05,3431 40106 CS FLGWRD10 # SET APSFLAG PRIOR TO THE ENEMA.
035249,000134: 05,3432 74737 MASK APSFLBIT
035250,000135: 05,3433 26106 ADS FLGWRD10
035251,000136: 05,3434 43501 CS DAPBITS # DAPBITS = OCT 40640 = BITS 6,8,9,15
035252,000137: 05,3435 70111 MASK DAPBOOLS # RESET ULLAGE,DRIFT,XOVRIINH, AND PULSES
035253,000138: 05,3436 54111 TS DAPBOOLS
035254,000139:
035255,000140: 05,3437 33502 CAF 1DEGDB # INSURE DAP DEADBAND IS SET TO 1 DEGREE
035256,000141: 05,3440 55343 TS DB
035257,000142:
035258,000143: 05,3441 40101 CS FLAGWRD5 # SET ENGONFLG.
035259,000144: 05,3442 74745 MASK ENGONBIT
035260,000145: 05,3443 26101 ADS FLAGWRD5
035261,000146:
035262,000147: 05,3444 44355 CS PRIO30 # INSURE THAT THE ENGINE IS ON, IF ARMED.
035263,000148: 05,3445 00006 EXTEND
035264,000149: 05,3446 02011 RAND DSALMOUT
035265,000150: 05,3447 64737 AD BIT13
035266,000151: 05,3450 00006 EXTEND
035267,000152: 05,3451 01011 WRITE DSALMOUT
035268,000153:
035269,000154: 05,3452 34735 CAF LRBYBIT # TERMINATE R12.
035270,000155: 05,3453 54107 TS FLGWRD11
035271,000156:
035272,000157: 05,3454 40074 CS FLAGWRD0 # SET R10FLAG TO SUPPRESS OUTPUTS TO THE
035273,000158: 05,3455 74752 MASK R10FLBIT # CROSS-POINTER DISPLAY.
035274,000159: 05,3456 26074 ADS FLAGWRD0 # THE FOLLOWING ENEMA WILL REMOVE THE
035275,000160: # DISPLAY INERTIAL DATA OUTBIT.
035276,000161:
035277,000162: 05,3457 00006 EXTEND # LOAD TEVENT FOR THE DOWNLINK.
035278,000163: 05,3460 30025 DCA TIME2
035279,000164: 05,3461 53342 DXCH TEVENT
035280,000165:
035281,000166: 05,3462 00006 EXTEND
035282,000167: 05,3463 33475 DCA SVEXITAD
035283,000168: 05,3464 53252 DXCH AVGEXIT
035284,000169:
035285,000170: 05,3465 02653 TC ABTKLEAN # KILL GROUPS 1,3, AND 6.
Page 826 |
035287,000172: 05,3466 36250 CAF THREE # SET UP 4.3SPOT FOR GOABORT
035288,000173: 05,3467 54001 TS L
035289,000174: 05,3470 40000 COM
035290,000175: 05,3471 52760 DXCH -PHASE4
035291,000176:
035292,000177: 05,3472 04635 TC POSTJUMP
035293,000178: 05,3473 12763 CADR ENEMA
035294,000179:
035295,000180: 05,3474 E7,1515 EBANK= DVCNTR
035296,000181: 05,3474 03746 64067 SVEXITAD 2CADR SERVEXIT
035297,000182:
035298,000183: 05,3476 00106 MODE70 DEC 70 B-14
035299,000184: 05,3477 00027 OCTAL27 OCT 27
035300,000185: 05,3500 00107 MODE71 DEC 71 B-14
035301,000186:
035302,000187: 05,3501 40640 DAPBITS OCT 40640
035303,000188:
035304,000189: 05,3502 00554 1DEGDB OCT 00554
035305,000190: 32,3533 BANK 32
035306,000191: 32,2000 SETLOC ABORTS
035307,000192: 32,2000 BANK
035308,000193:
035309,000194: 32,3533 COUNT* $$/P70
035310,000195:
035311,000196: 32,3533 34751 GOABORT CAF FOUR
035312,000197: 32,3534 55515 TS DVCNTR
035313,000198:
035314,000199: 32,3535 33743 CAF WHICHADR
035315,000200: 32,3536 55455 TS WHICH
035316,000201:
035317,000202: 32,3537 06042 TC INTPRET
035318,000203: 32,3540 43014 CLEAR CLEAR
035319,000204: 32,3541 04665 FLRCS
035320,000205: 32,3542 04265 FLUNDISP
035321,000206: 32,3543 43014 CLEAR SET
035322,000207: 32,3544 03670 IDLEFLAG
035323,000208: 32,3545 06464 ACC4-2FL
035324,000209: 32,3546 45014 SET CALL
035325,000210: 32,3547 04462 P7071FLG
035326,000211: 32,3550 61071 INITCDUW
035327,000212: 32,3551 77776 EXIT
035328,000213:
035329,000214: 32,3552 05321 TC CHECKMM
035330,000215: 32,3553 00106 70DEC DEC 70 B-14
035331,000216: 32,3554 13667 TCF P71RET
035332,000217:
035333,000218: 32,3555 06042 P70INIT TC INTPRET
035334,000219: 32,3556 77624 CALL
035335,000220: 32,3557 65716 TGOCOMP
035336,000221: 32,3560 54345 DLOAD SL
Page 827 |
035338,000223: 32,3561 34003 MDOTDPS
035339,000224: 32,3562 20205 4D
035340,000225: 32,3563 77665 BDDV
035341,000226: 32,3564 01244 MASS
035342,000227: 32,3565 16271 STODL TBUP
035343,000228: 32,3566 01244 MASS
035344,000229: 32,3567 70471 DDV SR1
035345,000230: 32,3570 16015 K(1/DV)
035346,000231: 32,3571 03635 STORE 1/DV1
035347,000232: 32,3572 03637 STORE 1/DV2
035348,000233: 32,3573 03641 STORE 1/DV3
035349,000234: 32,3574 77665 BDDV
035350,000235: 32,3575 25742 K(AT)
035351,000236: 32,3576 16263 STODL AT
035352,000237: 32,3577 34015 100PCTTO
035353,000238: 32,3600 02267 STORE TTO
035354,000239: 32,3601 57535 SLOAD DCOMP
035355,000240: 32,3602 26002 DPSVEX
035356,000241: 32,3603 77702 SR2
035357,000242: 32,3604 36265 STCALL VE
035358,000243: 32,3605 60275 COMMINIT
035359,000244: 32,3606 77745 INJTARG DLOAD
035360,000245: 32,3607 02567 ABTRDOT
035361,000246: 32,3610 36273 STCALL RDOTD # INITIALIZE RDOTD.
035362,000247: 32,3611 57313 YCOMP # COMPUTE Y
035363,000248: 32,3612 45246 ABS DSU
035364,000249: 32,3613 02565 YLIM # /Y/-DYMAX
035365,000250: 32,3614 75240 BMN SIGN # IF <0, XR<.5DEG, LEAVE YCO AT 0
035366,000251: 32,3615 65620 YOK # IF >0, FIX SIGN OF DEFICIT, THIS IS YCO.
035367,000252: 32,3616 02335 Y
035368,000253: 32,3617 03633 STORE YCO
035369,000254: 32,3620 45345 YOK DLOAD DSU
035370,000255: 32,3621 03633 YCO
035371,000256: 32,3622 02335 Y
035372,000257: 32,3623 77661 SR
035373,000258: 32,3624 20606 5D
035374,000259: 32,3625 03643 STORE XRANGE
035375,000260: 32,3626 45014 SET CALL
035376,000261: 32,3627 04461 FLVR
035377,000262: 32,3630 71554 THETCOMP
035378,000263: 32,3631 51025 DSU BPL
035379,000264: 32,3632 02561 THETCRIT
035380,000265: 32,3633 65637 +4
035381,000266: 32,3634 52175 VLOAD GOTO
035382,000267: 32,3635 02551 J1PARM
035383,000268: 32,3636 65642 STORPARM
035384,000269: 32,3637 43175 +4 VLOAD SET # IF J2 IS USED, SET THE
035385,000270: 32,3640 02555 J2PARM # ABORT TARGETING FLAG
035386,000271: 32,3641 04470 ABTTGFLG
035387,000272: 32,3642 16621 STORPARM STODL JPARM
Page 828 |
035389,000274: 32,3643 03631 RCO
035390,000275: 32,3644 02625 STORE RP
035391,000276: 32,3645 77414 SET EXIT
035392,000277: 32,3646 04471 ROTFLAG
035393,000278:
035394,000279: 32,3647 03725 UPTHROT TC THROTUP
035395,000280:
035396,000281: 32,3650 05353 TC PHASCHNG
035397,000282: 32,3651 04024 OCT 04024
035398,000283:
035399,000284: 32,3652 05504 TC UPFLAG
035400,000285: 32,3653 00216 ADRES FLAP
035401,000286:
035402,000287: 32,3654 04616 UPTHROT1 TC BANKCALL # VERIFY THAT THE PANEL SWITCHES
035403,000288: 32,3655 73707 CADR P40AUTO # ARE PROPERLY SET.
035404,000289:
035405,000290: 32,3656 03725 TC THROTUP
035406,000291:
035407,000292: 32,3657 35027 CAF PRIO17 # LET SERVICER FINISH BEFORE CONNECTING
035408,000293: 32,3660 05146 TC PRIOCHNG # ASCENT GUIDANCE EQUATIONS.
035409,000294:
035410,000295: 32,3661 00006 EXTEND
035411,000296: 32,3662 33745 DCA ATMAGAD
035412,000297: 32,3663 53252 DXCH AVGEXIT
035413,000298:
035414,000299: 32,3664 05353 GRP4OFF TC PHASCHNG # TERMINATE USE OF GROUP 4.
035415,000300: 32,3665 00004 OCT 00004
035416,000301:
035417,000302: 32,3666 15155 TCF ENDOFJOB
035418,000303:
035419,000304: 32,3667 05516 P71RET TC DOWNFLAG
035420,000305: 32,3670 00215 ADRES LETABORT
035421,000306:
035422,000307: 32,3671 36000 CAF THRESH2 # SET DVMON THRESHOLD TO THE ASCENT VALUE.
035423,000308: 32,3672 55250 TS DVTHRUSH
035424,000309:
035425,000310: 32,3673 06042 TC INTPRET
035426,000311: 32,3674 77624 CALL
035427,000312: 32,3675 60251 P12INIT
035428,000313: 32,3676 45014 BON CALL
035429,000314: 32,3677 04707 FLAP
035430,000315: 32,3700 65704 OLDTIME
035431,000316: 32,3701 65716 TGOCOMP # IF FLAP=0, TGO=T-TIG
035432,000317: 32,3702 77650 GOTO
035433,000318: 32,3703 65606 INJTARG
035434,000319: 32,3704 72545 OLDTIME DLOAD SL1 # IF FLAP=1,TGO=2 TGO
035435,000320: 32,3705 03517 TGO
035436,000321: 32,3706 03502 STORE TGO1
035437,000322: 32,3707 77776 EXIT
035438,000323:
Page 829 |
035440,000325: 32,3710 05353 TC PHASCHNG
035441,000326: 32,3711 04024 OCT 04024
035442,000327:
035443,000328: 32,3712 00006 EXTEND
035444,000329: 32,3713 31502 DCA TGO1
035445,000330: 32,3714 53517 DXCH TGO
035446,000331: 32,3715 13654 TCF UPTHROT1
035447,000332:
035448,000333: 32,3716 E7,1501 TGO1 = VGBODY
035449,000334:
035450,000335: # ************************************************************************
035451,000336:
035452,000337: 21,2105 BANK 21
035453,000338: 21,2000 SETLOC R11
035454,000339: 21,2000 BANK
035455,000340: 21,2105 COUNT* $$/P70
035456,000341:
035457,000342: 21,2105 40774 LEGAL? CS MMNUMBER # IS THE DESIRED PGM ALREADY IN PROGRESS?
035458,000343: 21,2106 61010 AD MODREG
035459,000344: 21,2107 00006 EXTEND
035460,000345: 21,2110 12121 BZF ABORTALM
035461,000346:
035462,000347: 21,2111 40105 CS FLAGWRD9 # ARE THE ABORTS ENABLED?
035463,000348: 21,2112 74743 MASK LETABBIT
035464,000349: 21,2113 10000 CCS A
035465,000350: 21,2114 12121 TCF ABORTALM
035466,000351:
035467,000352: 21,2115 30103 CA FLAGWRD7 # IS SERVICER ON THE AIR?
035468,000353: 21,2116 74747 MASK AVEGFBIT
035469,000354: 21,2117 10000 CCS A
035470,000355: 21,2120 00002 TC Q # YES. ALL IS WELL.
035471,000356: 21,2121 04364 ABORTALM TC FALTON
035472,000357: 21,2122 04457 TC RELDSP
035473,000358: 21,2123 04635 TC POSTJUMP
035474,000359: 21,2124 21051 CADR PINBRNCH
035475,000360:
035476,000361: 32,3716 BANK 32
035477,000362: 32,2000 SETLOC ABORTS
035478,000363: 32,2000 BANK
035479,000364:
035480,000365: 32,3716 COUNT* $$/P70
035481,000366:
035482,000367: # ************************************************************************
035483,000368:
035484,000369: 32,3716 45234 TGOCOMP RTB DSU
035485,000370: 32,3717 21574 LOADTIME
035486,000371: 32,3720 03442 TIG
035487,000372: 32,3721 77661 SL
035488,000373: 32,3722 20214 11D
035489,000374: 32,3723 03517 STORE TGO
Page 830 |
035491,000376: 32,3724 77616 RVQ
035492,000377:
035493,000378: # ************************************************************************
035494,000379:
035495,000380: 32,3725 34737 THROTUP CAF BIT13
035496,000381: 32,3726 54055 TS THRUST
035497,000382: 32,3727 34750 CAF BIT4
035498,000383: 32,3730 00006 EXTEND
035499,000384: 32,3731 05014 WOR CHAN14
035500,000385: 32,3732 00002 TC Q
035501,000386:
035502,000387: # ************************************************************************
035503,000388:
035504,000389: 32,3733 00000 01750 10SECS 2DEC 1000 B-28
035505,000390: 32,3735 00021 33400 HINJECT 2DEC 18288 B-24 # 60,000 FEET EXPRESSED IN METERS.
035506,000391: 32,3737 11021 00000 (TGO)A 2DEC 37000 B-17
035507,000392: 32,3741 00507 25605 K(AT) 2DEC .02 # SCALING CONSTANT
035508,000393: 32,3743 02114 WHICHADR REMADR ABRTABLE
035509,000394:
035510,000395: # ************************************************************************
035511,000396:
035512,000397: 32,3744 E7,1515 EBANK= DVCNTR
035513,000398: 32,3744 03372 70067 ATMAGAD 2CADR ATMAG
End of include-file P70-P71.agc. Parent file is MAIN.agc