Source Code
These source code files are a reconstruction of Sundance, the Apollo 9 LM (Lunar Module) AGC
(Apollo Guidance Computer) flight software, created from binary dumps of original core rope
program modules, as follows:
Since only binary dumps (rather than listings) of Sundance are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing. |
030903,000002: ## Copyright: Public domain.
030904,000003: ## Filename: THE_LUNAR_LANDING.agc
030905,000004: ## Purpose: A section of a reconstructed, mixed version of Sundance
030906,000005: ## It is part of the reconstructed source code for the Lunar
030907,000006: ## Module's (LM) Apollo Guidance Computer (AGC) for Apollo 9.
030908,000007: ## No original listings of this program are available;
030909,000008: ## instead, this file was created via disassembly of dumps
030910,000009: ## of various revisions of Sundance core rope modules.
030911,000010: ## Assembler: yaYUL
030912,000011: ## Contact: Ron Burkey <info@sandroid.org>.
030913,000012: ## Website: www.ibiblio.org/apollo/index.html
030914,000013: ## Mod history: 2020-06-17 MAS Created from Luminary 69.
030915,000014:
030916,000015: ## Sundance 292
030917,000016:
030918,000017: 32,2671 BANK 32
030919,000018: 32,2000 SETLOC F2DPS*32
030920,000019: 32,2000 BANK
030921,000020:
030922,000021: 32,2671 E7,1606 EBANK= E2DPS
030923,000022:
030924,000023: # ****************************************
030925,000024: # P63: THE LUNAR LANDING, BRAKING PHASE
030926,000025: # ****************************************
030927,000026:
030928,000027: 32,2671 COUNT* $$/P63
030929,000028:
030930,000029: 32,2671 05413 P63LM TC PHASCHNG
030931,000030: 32,2672 04024 OCT 04024
030932,000031:
030933,000032: 32,2673 04655 TC BANKCALL # DO IMU STATUS CHECK ROUTINE R02
030934,000033: 32,2674 11064 CADR R02BOTH
030935,000034:
030936,000035: 32,2675 33114 CAF P63ADRES # INITIALIZE WHICH FOR BURNBABY
030937,000036: 32,2676 55430 TS WHICH
030938,000037:
030939,000038: 32,2677 33115 CAF IGNADRES # INITIALIZE WCHPHASE AND FLPASSO
030940,000039: 32,2700 22007 ZL # FOR IGNITION ALGORITHM
030941,000040: 32,2701 53607 DXCH WCHPHASE
030942,000041:
030943,000042:
030944,000043: 32,2702 06014 FLAGORGY TC INTPRET # DIONYSIAN FLAG WAVING
030945,000044: 32,2703 43014 CLEAR CLEAR
030946,000045: 32,2704 02663 NOTHROTL
030947,000046: 32,2705 02671 3AXISFLG
030948,000047: 32,2706 43014 CLEAR CLEAR
030949,000048: 32,2707 00264 VINHFLG
030950,000049: 32,2710 00676 HINHFLG
030951,000050: 32,2711 43014 SET SET
030952,000051: 32,2712 03464 SWANDISP
030953,000052: 32,2713 03067 MUNFLAG
030954,000053:
030955,000054: # ****************************************
030956,000055:
030957,000056: 32,2714 77201 IGNALG1 SETPD VLOAD # FIRST SET UP INPUTS FOR RP-TO-R:-
030958,000057: 32,2715 00001 0 # AT 0D LANDING SITE IN MOON FIXED FRAME
030959,000058: 32,2716 02025 RLS # AT 6D ESTIMATED TIME OF LANDING
030960,000059: 32,2717 41525 PDDL PUSH # MPAC NON-ZERO TO INDICATE LUNAR CASE
030961,000060: 32,2720 02021 TLAND
030962,000061: 32,2721 37612 STCALL TPIP # ALSO SET TPIP FOR FIRST GUIDANCE PASS
030963,000062: 32,2722 51220 RP-TO-R
030964,000063: 32,2723 64312 VSL4 MXV
030965,000064: 32,2724 01736 REFSMMAT
030966,000065: 32,2725 17630 STODL LAND
030967,000066: 32,2726 02021 TLAND
030968,000067: 32,2727 77625 DSU
030969,000068: 32,2730 25120 GUIDDURN
030970,000069: 32,2731 34041 STCALL TDEC1 # INTEGRATE STATE FORWARD TO THAT TIME
030971,000070: 32,2732 27030 LEMPREC
030972,000071: 32,2733 64375 VLOAD MXV
030973,000072: 32,2734 23672 WMREF
030974,000073: 32,2735 01736 REFSMMAT
030975,000074: 32,2736 17622 STODL WM
030976,000075: 32,2737 23672 WMREF
030977,000076: 32,2740 03656 STORE NIGNLOOP
030978,000077: 32,2741 03636 STORE TTF/8
030979,000078:
030980,000079: 32,2742 77745 IGNALOOP DLOAD
030981,000080: 32,2743 00015 TAT
030982,000081: 32,2744 25234 STOVL PIPTIME
030983,000082: 32,2745 00025 VATT1
030984,000083: 32,2746 01543 STORE VCV
030985,000084: 32,2747 74521 MXV VSR1
030986,000085: 32,2750 01736 REFSMMAT
030987,000086: 32,2751 27504 STOVL V
030988,000087: 32,2752 00017 RATT1
030989,000088: 32,2753 01535 STORE RCV
030990,000089: 32,2754 64312 VSL4 MXV
030991,000090: 32,2755 01736 REFSMMAT
030992,000091: 32,2756 37476 STCALL R
030993,000092: 32,2757 67200 MUNGRAV
030994,000093: 32,2760 35236 STCALL GDT/2
030995,000094: 32,2761 62474 ?GUIDSUB # WHICH DELIVERS N PASSES OF GUIDANCE
030996,000095:
030997,000096: # DDUMCALC IS PROGRAMMED AS FOLLOWS:-
030998,000097: # 2 -
030999,000098: # (RIGNZ - RGU )/16 + 16(RGU )KIGNY/B8 + (RGU - RIGNX)KIGNX/B4 + (ABVAL(VGU) - VIGN)KIGNV/B4
031000,000099: # 2 1 0
031001,000100: # DDUM = -------------------------------------------------------------------------------------------
031002,000101: # 10
031003,000102: # 2 (VGU - 16 VGU KIGNX/B4)
031004,000103: # 2 0
031005,000104: # THE NUMERATOR IS SCALED IN METERS AT 2(28). THE DENOMINATOR IS A VELOCITY IN UNITS OF 2(10) M/CS.
031006,000105: # THE QUOTIENT IS THUS A TIME IN UNITS OF 2(18) CENTISECONDS. THE FINAL SHIFT RESCALES TO UNITS OF 2(28) CS.
031007,000106: # THERE IS NO DAMPING FACTOR. THE CONSTANTS KIGNX/B4, KIGNY/B8 AND KIGNV/B4 ARE ALL NEGATIVE IN SIGN.
031008,000107:
031009,000108: 32,2762 45345 DDUMCALC DLOAD DSU # FORM DENOMINATOR FIRST
031010,000109: 32,2763 25130 RIGNZ
031011,000110: 32,2764 03536 RGU +4
031012,000111: 32,2765 63525 PDDL DSQ
031013,000112: 32,2766 03534 RGU +2
031014,000113: 32,2767 65275 DMPR PDDL
031015,000114: 32,2770 25134 KIGNY
031016,000115: 32,2771 03532 RGU
031017,000116: 32,2772 56225 DSU DDV
031018,000117: 32,2773 25126 RIGNX
031019,000118: 32,2774 25132 1/KIGNX
031020,000119: 32,2775 51515 PDVL ABVAL
031021,000120: 32,2776 03614 VGU
031022,000121: 32,2777 57225 DSU DMPR
031023,000122: 32,3000 25124 VIGN
031024,000123: 32,3001 25136 KIGNV
031025,000124: 32,3002 43215 DAD DAD
031026,000125: 32,3003 44415 DAD SR4R
031027,000126: 32,3004 54271 DDV SRR
031028,000127: 32,3005 03620 VGU +4
031029,000128: 32,3006 21615 12D
031030,000129:
031031,000130: 32,3007 43206 PUSH DAD
031032,000131: 32,3010 01234 PIPTIME
031033,000132: 32,3011 14041 STODL TDEC1 # STORE NEW GUESS FOR NEXT INTEGRATION
031034,000133: 32,3012 45246 ABS DSU
031035,000134: 32,3013 25122 DDUMCRIT
031036,000135: 32,3014 45040 BMN CALL
031037,000136: 32,3015 65031 DDUMGOOD
031038,000137: 32,3016 27362 INTSTALL
031039,000138: 32,3017 43014 SET SET
031040,000139: 32,3020 01473 INTYPFLG
031041,000140: 32,3021 00063 MOONFLAG
031042,000141: 32,3022 71214 CLEAR DLOAD
031043,000142: 32,3023 00262 MIDFLAG
031044,000143: 32,3024 01234 PIPTIME
031045,000144: 32,3025 35517 STCALL TET
031046,000145: 32,3026 27060 INTEGRVS
031047,000146: 32,3027 77650 GOTO
031048,000147: 32,3030 64742 IGNALOOP
031049,000148:
031050,000149: 32,3031 45345 DDUMGOOD DLOAD DSU
031051,000150: 32,3032 00041 TDEC1
031052,000151: 32,3033 03421 ZOOMTDP
031053,000152: 32,3034 27425 STOVL TIG # COMPUTE DISTANCE LANDING SITE WILL BE
031054,000153: 32,3035 03476 R # OUT OF LM'S ORBITAL PLANE AT IGNITION:
031055,000154: 32,3036 53435 VXV UNIT # SIGN IS + IF LANDING SITE IS TO THE
031056,000155: 32,3037 03504 V # RIGHT, NORTH; - IF TO THE LEFT, SOUTH.
031057,000156: 32,3040 72441 DOT SL1
031058,000157: 32,3041 03630 LAND
031059,000158: 32,3042 26427 R60INIT STOVL OUTOFPLN # INITIALIZATION FOR CALCMANU
031060,000159: 32,3043 03250 UNFC/2
031061,000160: 32,3044 25256 STOVL POINTVSM
031062,000161: 32,3045 06231 UNITX
031063,000162: 32,3046 01250 STORE SCAXIS
031064,000163: 32,3047 77776 EXIT
031065,000164: # ****************************************
031066,000165:
031067,000166: 32,3050 05413 IGNALGRT TC PHASCHNG # PREVENT REPEATING IGNALG
031068,000167: 32,3051 04024 OCT 04024
031069,000168:
031070,000169: 32,3052 04655 TC BANKCALL
031071,000170: 32,3053 75053 CADR GOASTCLK
031072,000171:
031073,000172: 32,3054 35743 CAF OCT14
031074,000173: 32,3055 04655 TC BANKCALL
031075,000174: 32,3056 20532 CADR GOPERF1
031076,000175: 32,3057 14106 TCF GOTOPOOH
031077,000176: 32,3060 13062 TCF P63SPOT2
031078,000177: 32,3061 13066 TCF +5
031079,000178:
031080,000179: 32,3062 06014 P63SPOT2 TC INTPRET
031081,000180: 32,3063 77624 CALL
031082,000181: 32,3064 30317 R51
031083,000182: 32,3065 77776 EXIT
031084,000183:
031085,000184: 32,3066 00004 INHINT
031086,000185: 32,3067 04737 TC IBNKCALL
031087,000186: 32,3070 40223 CADR PFLITEDB
031088,000187: 32,3071 00003 RELINT
031089,000188:
031090,000189: 32,3072 04655 TC BANKCALL
031091,000190: 32,3073 54103 CADR R60LEM
031092,000191:
031093,000192: 32,3074 05413 TC PHASCHNG # PREVENT RECALLING R60
031094,000193: 32,3075 04024 OCT 04024
031095,000194:
031096,000195: 32,3076 35021 P63SPOT3 CA BIT6 # IS THE LR ANTENNA IN POSITION 1 YET
031097,000196: 32,3077 00006 EXTEND
031098,000197: 32,3100 02033 RAND CHAN33
031099,000198: 32,3101 00006 EXTEND
031100,000199: 32,3102 13110 BZF P63SPOT4 # BRANCH IF ANTENNA ALREADY IN POSITION 1
031101,000200:
031102,000201: 32,3103 33116 CAF CODE500 # ASTRONAUT: PLEASE CRANK THE
031103,000202: 32,3104 04655 TC BANKCALL # SILLY THING AROUND
031104,000203: 32,3105 20532 CADR GOPERF1
031105,000204: 32,3106 14106 TCF GOTOPOOH # TERMINATE
031106,000205: 32,3107 13076 TCF P63SPOT3 # PROCEED SEE IF HE'S LYING
031107,000206:
031108,000207: 32,3110 04655 P63SPOT4 TC BANKCALL # ENTER INITIALIZE LANDING RADAR
031109,000208: 32,3111 67665 CADR SETPOS1
031110,000209:
031111,000210: 32,3112 04674 TC POSTJUMP # OFF TO SEE THE WIZARD ...
031112,000211: 32,3113 74133 CADR BURNBABY
031113,000212:
031114,000213: # ----------------------------------------
031115,000214:
031116,000215: # CONSTANTS FOR P63LM AND IGNALG
031117,000216:
031118,000217: 32,3114 02061 P63ADRES GENADR P63TABLE
031119,000218:
031120,000219: 32,3115 02417 IGNADRES GENADR IGNALG
031121,000220:
031122,000221: 32,3116 00500 CODE500 OCT 00500
031123,000222:
031124,000223: 32,3117 00003 26600 GUIDDURN 2DEC +60800 B-28
031125,000224: 32,3121 00000 00024 DDUMCRIT 2DEC +20 B-28 # CRITERION FOR IGNALG CONVERGENCE
031126,000225:
031127,000226: 32,3123 00417 16641 VIGN 2DEC* +1.69664345 E+1 B-10*
031128,000227: 32,3125 77736 63511 RIGNX 2DEC* -3.41873750 E+4 B-24*
031129,000228: 32,3127 77126 65060 RIGNZ 2DEC* -4.35548938 E+5 B-24*
031130,000229: 32,3131 71463 46314 1/KIGNX 2DEC* -1.99999999 E-1 B+0*
031131,000230: 32,3133 77777 74571 KIGNY 2DEC* -0.02430170 E-6 B+8*
031132,000231: 32,3135 76647 77777 KIGNV 2DEC -384 E2 B-20
031133,000232:
031134,000233: # ----------------------------------------
031135,000234:
031136,000235: # ****************************************
031137,000236: # LANDING CONFIRMATION
031138,000237: # ****************************************
031139,000238:
031140,000239: 31,2000 BANK 31
031141,000240: 31,2000 SETLOC F2DPS*31
031142,000241: 31,2000 BANK
031143,000242:
031144,000243: 31,2000 COUNT* $$/P6567
031145,000244:
031146,000245: 31,2000 05563 LANDJUNK TC UPFLAG
031147,000246: 31,2001 00175 ADRES FLUNDISP
031148,000247: 31,2002 03562 TC FASTCHNG
031149,000248: 31,2003 05413 TC PHASCHNG
031150,000249: 31,2004 00005 OCT 00005
031151,000250:
031152,000251: 31,2005 00004 INHINT
031153,000252: 31,2006 04737 TC IBNKCALL
031154,000253: 31,2007 75561 CADR ENGINOF3
031155,000254:
031156,000255: 31,2010 05563 TC UPFLAG
031157,000256: 31,2011 22371 CADR LRBYPASS
031158,000257:
031159,000258: 31,2012 06014 TC INTPRET # TO INTERPRETIVE AS TIME IS NOT CRITICAL
031160,000259: 31,2013 72234 RTB TLOAD
031161,000260: 31,2014 30653 RDCDUS
031162,000261: 31,2015 00002 1D
031163,000262: 31,2016 03233 STORE CDUXD
031164,000263: 31,2017 43014 SET SET
031165,000264: 31,2020 04067 SURFFLAG
031166,000265: 31,2021 03072 KILLROSE
031167,000266: 31,2022 43014 CLEAR CLEAR
031168,000267: 31,2023 03672 AVEGFLAG
031169,000268: 31,2024 03664 SWANDISP
031170,000269: 31,2025 72575 VLOAD VSL2
031171,000270: 31,2026 01220 RN
031172,000271: 31,2027 16034 STODL ALPHAV
031173,000272: 31,2030 01234 PIPTIME
031174,000273: 31,2031 45014 SET CALL
031175,000274: 31,2032 01463 LUNAFLAG
031176,000275: 31,2033 26323 LAT-LONG
031177,000276: 31,2034 77201 SETPD VLOAD # COMPUTE RLS AND STORE IT AWAY
031178,000277: 31,2035 00001 0
031179,000278: 31,2036 01220 RN
031180,000279: 31,2037 65352 VSL2 PDDL
031181,000280: 31,2040 01234 PIPTIME
031182,000281: 31,2041 45006 PUSH CALL
031183,000282: 31,2042 51245 R-TO-RP
031184,000283: 31,2043 02025 STORE RLS
031185,000284: 31,2044 77776 EXIT
031186,000285: 31,2045 32062 CAF V06N43* # ASTRONAUT: NOW LOOK WHERE YOU ENDED UP
031187,000286: 31,2046 04655 TC BANKCALL
031188,000287: 31,2047 20406 CADR GOFLASH
031189,000288: 31,2050 14106 TCF GOTOPOOH # TERMINATE
031190,000289: 31,2051 12053 TCF +2 # PROCEED
031191,000290: 31,2052 12045 TCF -5 # RECYCLE
031192,000291:
031193,000292: 31,2053 32063 CAF OCT501
031194,000293: 31,2054 04655 TC BANKCALL
031195,000294: 31,2055 20532 CADR GOPERF1
031196,000295: 31,2056 14106 TCF GOTOPOOH
031197,000296: 31,2057 12061 TCF +2
031198,000297: 31,2060 12053 TCF -5
031199,000298:
031200,000299: 31,2061 14106 TCF GOTOPOOH # ASTRONAUT: PLEASE SELECT P57
031201,000300:
031202,000301: 31,2062 01453 V06N43* VN 0643
031203,000302: 31,2063 00501 OCT501 OCT 501
031204,000303: 31,2064 00071 OCT71 OCT 71
031205,000304:
031206,000305: # ****************************************
031207,000306: # LANDING TEST PROGRAM
031208,000307: # ****************************************
031209,000308:
031210,000309: 31,2065 32234 LANDTEST CA VERTADR
031211,000310: 31,2066 55606 TS WCHPHASE
031212,000311: 31,2067 55607 TS FLPASS0
031213,000312: 31,2070 55656 TS WCHVERT
031214,000313:
031215,000314: 31,2071 06014 TC INTPRET
031216,000315: 31,2072 64375 VLOAD MXV
031217,000316: 31,2073 23672 WMREF
031218,000317: 31,2074 01736 REFSMMAT
031219,000318: 31,2075 17622 STODL WM
031220,000319: 31,2076 35122 LUNLANAD
031221,000320: 31,2077 25253 STOVL AVEGEXIT
031222,000321: 31,2100 03532 RGU
031223,000322: 31,2101 74256 UNIT VXSC
031224,000323: 31,2102 22167 LANDSCAL
031225,000324: 31,2103 03630 STORE LAND
031226,000325: 31,2104 43046 ABVAL SET
031227,000326: 31,2105 03470 IDLEFLAG
031228,000327: 31,2106 26023 STOVL /LAND/
031229,000328: 31,2107 06231 UNITX
031230,000329: 31,2110 26401 STOVL CG
031231,000330: 31,2111 06227 UNITY
031232,000331: 31,2112 26407 STOVL CG +6
031233,000332: 31,2113 06225 UNITZ
031234,000333: 31,2114 02415 STORE CG +12D
031235,000334: 31,2115 47014 SET RTB
031236,000335: 31,2116 03067 MUNFLAG
031237,000336: 31,2117 21454 LOADTIME
031238,000337: 31,2120 03612 STORE TPIP
031239,000338: 31,2121 77776 EXIT
031240,000339:
031241,000340: 31,2122 00004 INHINT
031242,000341: 31,2123 35026 CAF ONE
031243,000342: 31,2124 05252 TC WAITLIST
031244,000343: 31,2125 E7,1472 EBANK= DVCNTR
031245,000344: 31,2125 02000 66067 2CADR PREREAD
031246,000345:
031247,000346: 31,2127 35012 CAF BIT13
031248,000347: 31,2130 00006 EXTEND
031249,000348: 31,2131 02011 RAND DSALMOUT
031250,000349: 31,2132 10000 CCS A
031251,000350: 31,2133 12144 TCF TSTENGON
031252,000351:
031253,000352: 31,2134 04737 TC IBNKCALL
031254,000353: 31,2135 74647 CADR ONULLAGE
031255,000354:
031256,000355: 31,2136 35052 CAF 3SECS
031257,000356: 31,2137 05243 TC TWIDDLE
031258,000357: 31,2140 02155 ADRES TESTIGN
031259,000358:
031260,000359: 31,2141 35054 CAF LOW9
031261,000360: 31,2142 04655 TC BANKCALL
031262,000361: 31,2143 01730 CADR DELAYJOB
031263,000362:
031264,000363: 31,2144 00004 TSTENGON INHINT
031265,000364: 31,2145 45017 CS DRIFTBIT
031266,000365: 31,2146 71102 MASK DAPBOOLS
031267,000366: 31,2147 55102 TS DAPBOOLS
031268,000367:
031269,000368: 31,2150 35030 CAF ZERO
031270,000369: 31,2151 55607 TS FLPASS0
031271,000370:
031272,000371: 31,2152 32170 CAF TESTDB
031273,000372: 31,2153 55356 TS DB
031274,000373: 31,2154 15225 TCF ENDOFJOB
031275,000374:
031276,000375: 31,2155 44367 TESTIGN CS PRIO30
031277,000376: 31,2156 00006 EXTEND
031278,000377: 31,2157 02011 RAND DSALMOUT
031279,000378: 31,2160 65012 AD BIT13
031280,000379: 31,2161 00006 EXTEND
031281,000380: 31,2162 01011 WRITE DSALMOUT
031282,000381: 31,2163 05563 TC UPFLAG
031283,000382: 31,2164 00123 ADRES ENGONFLG
031284,000383: 31,2165 15321 TCF TASKOVER
031285,000384:
031286,000385: 31,2166 06502 26500 LANDSCAL 2DEC 0.207196475
031287,000386: 31,2170 00554 TESTDB DEC 0.02222
End of include-file THE_LUNAR_LANDING.agc. Parent file is MAIN.agc