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:
  • B1 — Revision 292
  • B2 — Revision 302
  • B3 — Revision 302
  • B4 — Revision 302
  • B5 — Revision 292
  • B6 — Revision 306
This means that source code does not represent a specific historical revision of Sundance, but rather a mixture of the three released versions. Nonetheless, it is capable of flying the whole Apollo 9 mission. This source code matches the binary dumps, as closely as feasible, but 100% match is not possible, due mostly to changes in memory addresses at which code and variables were allocated in different revisions of Sundance. Refer to this list of explanations for each binary mismatch.

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.

014165,000002:                                                                                                  ## Copyright:   Public domain.
014166,000003:                                                                                                  ## Filename:    IMU_PERFORMANCE_TESTS_4.agc
014167,000004:                                                                                                  ## Purpose:     A section of a reconstructed, mixed version of Sundance
014168,000005:                                                                                                  ##              It is part of the reconstructed source code for the Lunar
014169,000006:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 9.
014170,000007:                                                                                                  ##              No original listings of this program are available;
014171,000008:                                                                                                  ##              instead, this file was created via disassembly of dumps
014172,000009:                                                                                                  ##              of various revisions of Sundance core rope modules.
014173,000010:                                                                                                  ## Assembler:   yaYUL
014174,000011:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
014175,000012:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
014176,000013:                                                                                                  ## Mod history: 2020-06-17 MAS  Created from Luminary 69.
014177,000014: 
014178,000015:                                                                                                  ## Sundance 306
014179,000016: 
014180,000017:                                                                                                  #  PROGRAM-IMU PERFORMANCE TESTS 4
014181,000018:                                                                                                  #  DATE-NOV 15, 1966
014182,000019:                                                                                                  #  BY-GEORGE SCHMIDT IL7-146 EXT 1126
014183,000020:                                                                                                  #  MOD NO-ZERO
014184,000021: 
014185,000022:                                                                                                  #  FUNCTIONAL DESCRIPTION
014186,000023: 
014187,000024:                                                                                                  #  THIS SECTION CONSISTS OF THE FILTER FOR THE GYRO DRIFT TESTS. NO COMPASS
014188,000025:                                                                                                  #  IS DONE IN LEM. FOR A DESCRIPTION OF THE FILTER SEE E-1973. THIS
014189,000026:                                                                                                  #  SECTION IS ENTERED FROM IMU 2. IT RETURNS THERE AT END OF TEST.
014190,000027: 
014191,000028:                                                                                                  #  EARTHR,OGC ZERO,ERTHRVSE
014192,000029: 
014193,000030:                                                                                                  #  NORMAL EXIT
014194,000031: 
014195,000032:                                                                                                  #  LENGTHOT GOES TO ZERO-RETURN TO IMU PERF TESTS 2 CONTROL
014196,000033: 
014197,000034:                                                                                                  #  ALARMS
014198,000035: 
014199,000036:                                                                                                  #  1600  OVERFLOW IN DRIFT TEST
014200,000037:                                                                                                  #  1601  BAD IMU MODING IN ANY ROUTINE THAT USES IMUSTALL
014201,000038:                                                                                                  #  OUTPUT
014202,000039: 
014203,000040:                                                                                                  #  FLASHING DISPLAY OF RESULTS - CONTROLLED IN IMU PERF TESTS 2
014204,000041: 
014205,000042:                                                                                                  #  DEBRIS
014206,000043: 
014207,000044:                                                                                                  #  ALL CENTRALS - ALL OF EBANK XSM
014208,000045: 
014209,000046: 33,2000                                           BANK     33                                    
014210,000047: 37,2000                                           SETLOC   IMU4                                  
014211,000048: 37,2000                                           BANK                                           
014212,000049: 37,2477                                           COUNT*   $$/P07                                
014213,000050: 
014214,000051: 37,2477  E5,1642                                  EBANK=   XSM                                   
014215,000052: 
014216,000053: 37,2477           00004        ESTIMS             INHINT                                         
014217,000054: 37,2500           31572                           CAE      1SECXT                                
014218,000055: 37,2501           05243                           TC       TWIDDLE                               
014219,000056: 37,2502  E5,1642                                  EBANK=   XSM                                   
014220,000057: 37,2502           02535                           ADRES    ALLOOP                                
014221,000058: 37,2503           35030                           CAF      ZERO                                  #  ZERO THE PIPAS
014222,000059: 37,2504           54037                           TS       PIPAX                                 
014223,000060: 37,2505           54040                           TS       PIPAY                                 
014224,000061: 37,2506           54041                           TS       PIPAZ                                 
014225,000062: 37,2507           00003                           RELINT                                         
014226,000063: 37,2510           33061                           CA       77DECML                               
014227,000064: 37,2511           55571                           TS       ZERONDX                               
014228,000065: 37,2512           33062                           CA       ALXXXZ                                
014229,000066: 37,2513           02364                           TC       ZEROING                               
014230,000067: 37,2514           06014                           TC       INTPRET                               
014231,000068: 37,2515           77735                           SLOAD                                          
014232,000069: 37,2516           37043                                    SCHZEROS                              
014233,000070: 37,2517           25477                           STOVL    GCOMPSW    -1                         
014234,000071: 37,2520           37054                                    INTVAL     +2                         
014235,000072: 37,2521           26445                           STOVL    ALX1S                                 
014236,000073: 37,2522           37043                                    SCHZEROS                              
014237,000074: 37,2523           01212                           STORE    DELVX                                 
014238,000075: 37,2524           01472                           STORE    GCOMP                                 
014239,000076: 37,2525           77735                           SLOAD                                          
014240,000077: 37,2526           02441                                    TORQNDX                               
014241,000078: 37,2527           50076                           DCOMP    BMN                                   
014242,000079: 37,2530           76533                                    VERTSKIP                              
014243,000080: 37,2531           77624                           CALL                                           
014244,000081: 37,2532           76376                                    ERTHRVSE                              
014245,000082: 37,2533           77776        VERTSKIP           EXIT                                           
014246,000083: 37,2534           03030                           TC       SLEEPIE    +1                         
014247,000084: 
014248,000085: 37,2535           11530        ALLOOP             CCS      ALTIM                                 
014249,000086: 37,2536           30000                           CA       A                                     #  SHOULD NEVER HIT THIS LOCATION
014250,000087: 37,2537           55531                           TS       ALTIMS                                
014251,000088: 37,2540           40000                           CS       A                                     
014252,000089: 37,2541           55530                           TS       ALTIM                                 
014253,000090: 37,2542           45026                           CS       ONE                                   
014254,000091: 37,2543           61562                           AD       GEOCOMPS                              
014255,000092: 37,2544           00006                           EXTEND                                         
014256,000093: 37,2545           12551                           BZF      +4                                    
014257,000094: 37,2546           31412                           CA       LENGTHOT                              
014258,000095: 37,2547           00006                           EXTEND                                         
014259,000096: 37,2550           62555                           BZMF     +5                                    
014260,000097: 37,2551           31572                           CAE      1SECXT                                
014261,000098: 37,2552           05243                           TC       TWIDDLE                               
014262,000099: 37,2553  E5,1642                                  EBANK=   XSM                                   
014263,000100: 37,2553           02535                           ADRES    ALLOOP                                
014264,000101: 37,2554           35030                           CAF      ZERO                                  
014265,000102: 37,2555           56037                           XCH      PIPAX                                 
014266,000103: 37,2556           55211                           TS       DELVX                                 
014267,000104: 37,2557           35030                           CAF      ZERO                                  
014268,000105: 37,2560           56040                           XCH      PIPAY                                 
014269,000106: 37,2561           55213                           TS       DELVY                                 
014270,000107: 37,2562           35030                           CAF      ZERO                                  
014271,000108: 37,2563           56041                           XCH      PIPAZ                                 
014272,000109: 37,2564           55215                           TS       DELVZ                                 
014273,000110: 37,2565           35011        SPECSTS            CAF      PRIO20                                
014274,000111: 37,2566           05155                           TC       FINDVAC                               
014275,000112: 37,2567  E5,1642                                  EBANK=   XSM                                   
014276,000113: 37,2567           02572 76065                     2CADR    ALFLT                                 #  START THE JOB
014277,000114: 
014278,000115: 37,2571           05321                           TC       TASKOVER                              
014279,000116: 
014280,000117: 37,2572           11562        ALFLT              CCS      GEOCOMPS                              
014281,000118: 37,2573           02575                           TC       +2                                    
014282,000119: 37,2574           02577                           TC       NORMLOP                               
014283,000120: 37,2575           04655                           TC       BANKCALL                              
014284,000121: 37,2576           15277                           CADR     1/PIPA                                
014285,000122: 37,2577           06014        NORMLOP            TC       INTPRET                               
014286,000123: 37,2600           77745                           DLOAD                                          
014287,000124: 37,2601           37052                                    INTVAL                                
014288,000125: 37,2602           24051                           STOVL    S1                                    
014289,000126: 37,2603           01212                                    DELVX                                 
014290,000127: 37,2604           76505                           VXM      VSL1                                  
014291,000128: 37,2605           02643                                    XSM                                   
014292,000129: 37,2606           57545                           DLOAD    DCOMP                                 
014293,000130: 37,2607           00160                                    MPAC       +3                         
014294,000131: 37,2610           16523                           STODL    DPIPAY                                
014295,000132: 37,2611           00162                                    MPAC       +5                         
014296,000133: 37,2612           02527                           STORE    DPIPAZ                                
014297,000134: 
014298,000135: 37,2613           76001                           SETPD    AXT,1                                 
014299,000136: 37,2614           00001                                    0                                     
014300,000137: 37,2615           00010                                    8D                                    
014301,000138: 37,2616           57535                           SLOAD    DCOMP                                 
014302,000139: 37,2617           02563                                    GEOCOMPS                              
014303,000140: 37,2620           77640                           BMN                                            
014304,000141: 37,2621           76765                                    PERFERAS                              
014305,000142: 37,2622           50135        ALCGKK             SLOAD    BMN                                   
014306,000143: 37,2623           02532                                    ALTIMS                                
014307,000144: 37,2624           76637                                    ALFLT3                                
014308,000145: 37,2625           72174        ALKCG              AXT,2    LXA,1                                 #  LOADS SLOPES AND TIME CONSTANTS AT RQST
014309,000146: 37,2626           00014                                    12D                                   
014310,000147: 37,2627           02444                                    ALX1S                                 
014311,000148: 37,2630           62143        ALKCG2             DLOAD*   INCR,1                                
014312,000149: 37,2631           02243                                    ALFDK      +144D,1                    
014313,000150: 37,2632           77775                           DEC      -2         B-14                       
014314,000151: 37,2633           12545                           STORE    ALDK       +10D,2                     
014315,000152: 37,2634           66104                           TIX,2    SXA,1                                 
014316,000153: 37,2635           76630                                    ALKCG2                                
014317,000154: 37,2636           02444                                    ALX1S                                 
014318,000155: 
014319,000156: 37,2637           77770        ALFLT3             AXT,1                                          
014320,000157: 37,2640           00010                                    8D                                    
014321,000158: 37,2641           41343        DELMLP             DLOAD*   DMP                                   
014322,000159: 37,2642           02533                                    DPIPAY     +8D,1                      
014323,000160: 37,2643           37064                                    PIPASC                                
014324,000161: 37,2644           43661                           SLR      BDSU*                                 
014325,000162: 37,2645           21212                                    9D                                    
014326,000163: 37,2646           02501                                    INTY       +8D,1                      
014327,000164: 37,2647           06501                           STORE    INTY       +8D,1                      
014328,000165: 37,2650           40725                           PDDL     DMP*                                  
014329,000166: 37,2651           37066                                    VELSC                                 
014330,000167: 37,2652           02521                                    VLAUN      +8D,1                      
014331,000168: 37,2653           77732                           SL2R                                           
014332,000169: 37,2654           45425                           DSU      STADR                                 
014333,000170: 37,2655           71216                           STORE    DELM       +8D,1                      
014334,000171: 37,2656           06563                           STORE    DELM       +10D,1                     
014335,000172: 37,2657           77100                           TIX,1    AXT,2                                 
014336,000173: 37,2660           76641                                    DELMLP                                
014337,000174: 37,2661           00004                                    4                                     
014338,000175: 37,2662           56743        ALILP              DLOAD*   DMPR*                                 
014339,000176: 37,2663           75324                                    ALK        +4,2                       
014340,000177: 37,2664           75240                                    ALDK       +4,2                       
014341,000178: 37,2665           12453                           STORE    ALK        +4,2                       
014342,000179: 37,2666           77104                           TIX,2    AXT,2                                 
014343,000180: 37,2667           76662                                    ALILP                                 
014344,000181: 37,2670           00010                                    8D                                    
014345,000182: 37,2671           66140        ALKLP              LXC,1    SXA,1                                 
014346,000183: 37,2672           02445                                    CMPX1                                 
014347,000184: 37,2673           02445                                    CMPX1                                 
014348,000185: 37,2674           56743                           DLOAD*   DMPR*                                 
014349,000186: 37,2675           02450                                    ALK        +1,1                       
014350,000187: 37,2676           75216                                    DELM       +8D,2                      
014351,000188: 37,2677           77613                           DAD*                                           
014352,000189: 37,2700           75276                                    INTY       +8D,2                      
014353,000190: 37,2701           12501                           STORE    INTY       +8D,2                      
014354,000191: 37,2702           42743                           DLOAD*   DAD*                                  
014355,000192: 37,2703           75314                                    ALK        +12D,2                     
014356,000193: 37,2704           75230                                    ALDK       +12D,2                     
014357,000194: 37,2705           12463                           STORE    ALK        +12D,2                     
014358,000195: 37,2706           42673                           DMPR*    DAD*                                  
014359,000196: 37,2707           75216                                    DELM       +8D,2                      
014360,000197: 37,2710           75266                                    INTY       +16D,2                     
014361,000198: 37,2711           12511                           STORE    INTY       +16D,2                     
014362,000199: 37,2712           40743                           DLOAD*   DMP*                                  
014363,000200: 37,2713           37071                                    ALSK       +1,1                       
014364,000201: 37,2714           75216                                    DELM       +8D,2                      
014365,000202: 37,2715           42772                           SL1R     DAD*                                  
014366,000203: 37,2716           75256                                    VLAUN      +8D,2                      
014367,000204: 37,2717           12521                           STORE    VLAUN      +8D,2                      
014368,000205: 37,2720           76104                           TIX,2    AXT,1                                 
014369,000206: 37,2721           76671                                    ALKLP                                 
014370,000207: 37,2722           00010                                    8D                                    
014371,000208: 
014372,000209: 37,2723           64743        LOOSE              DLOAD*   PDDL*                                 
014373,000210: 37,2724           02523                                    ACCWD      +8D,1                      
014374,000211: 37,2725           02521                                    VLAUN      +8D,1                      
014375,000212: 37,2726           55523                           PDDL*    VDEF                                  
014376,000213: 37,2727           02531                                    POSNV      +8D,1                      
014377,000214: 37,2730           76521                           MXV      VSL1                                  
014378,000215: 37,2731           02001                                    TRANSM1                               
014379,000216: 37,2732           77745                           DLOAD                                          
014380,000217: 37,2733           00155                                    MPAC                                  
014381,000218: 37,2734           06531                           STORE    POSNV      +8D,1                      
014382,000219: 37,2735           77745                           DLOAD                                          
014383,000220: 37,2736           00160                                    MPAC       +3                         
014384,000221: 37,2737           06521                           STORE    VLAUN      +8D,1                      
014385,000222: 37,2740           77745                           DLOAD                                          
014386,000223: 37,2741           00162                                    MPAC       +5                         
014387,000224: 37,2742           06523                           STORE    ACCWD      +8D,1                      
014388,000225: 37,2743           77700                           TIX,1                                          
014389,000226: 37,2744           76723                                    LOOSE                                 
014390,000227: 
014391,000228: 37,2745           76174                           AXT,2    AXT,1                                 #  EVALUATE SINES AND COSINES
014392,000229: 37,2746           00006                                    6                                     
014393,000230: 37,2747           00002                                    2                                     
014394,000231: 37,2750           57343        BOOP               DLOAD*   DMPR                                  
014395,000232: 37,2751           02503                                    ANGX       +2,1                       
014396,000233: 37,2752           37074                                    GEORGEJ                               
014397,000234: 37,2753           77722                           SR2R                                           
014398,000235: 37,2754           73406                           PUSH     SIN                                   
014399,000236: 37,2755           56072                           SL3R     XAD,1                                 
014400,000237: 37,2756           00046                                    X1                                    
014401,000238: 37,2757           10021                           STORE    16D,2                                 
014402,000239: 37,2760           77745                           DLOAD                                          
014403,000240: 37,2761           77746                           COS                                            
014404,000241: 37,2762           10027                           STORE    22D,2                                 #  COSINES
014405,000242: 37,2763           77704                           TIX,2                                          
014406,000243: 37,2764           76750                                    BOOP                                  
014407,000244: 
014408,000245: 37,2765           77776        PERFERAS           EXIT                                           
014409,000246: 37,2766           35066                           CA       EBANK7                                
014410,000247: 37,2767           54003                           TS       EBANK                                 
014411,000248: 37,2770  E7,1400                                  EBANK=   ATIGINC                               
014412,000249: 37,2770           01400                           TC       ATIGINC                               #  GOTO ERASABLE TO CALCULATE ONLY TO RETN
014413,000250: 
014414,000251:                                                                                                  #                             CAUTION
014415,000252: 
014416,000253:                                                                                                  #  THE ERASABLE PROGRAM THAT DOES THE CALCULATIONS MUST BE LOADED
014417,000254:                                                                                                  #  BEFORE ANY ATTEMPT IS MADE TO RUN THE IMU PERFORMANCE TEST
014418,000255: 
014419,000256: 37,2771  E5,1400                                  EBANK=   AZIMUTH                               
014420,000257: 37,2771           11412                           CCS      LENGTHOT                              
014421,000258: 37,2772           03027                           TC       SLEEPIE                               
014422,000259: 37,2773           11440                           CCS      TORQNDX                               
014423,000260: 37,2774           12776                           TCF      +2                                    
014424,000261: 37,2775           03000                           TC       SETUPER1                              
014425,000262: 37,2776           30032                           CA       CDUX                                  
014426,000263: 37,2777           55414                           TS       LOSVEC     +1                         #  FOR TROUBLESHOOTING VD POSNS 2$4
014427,000264: 
014428,000265: 37,3000           06014        SETUPER1           TC       INTPRET                               
014429,000266: 37,3001           65345                           DLOAD    PDDL                                  #  ANGLES FROM DRIFT TEST ONLY
014430,000267: 37,3002           02473                                    ANGZ                                  
014431,000268: 37,3003           02477                                    ANGY                                  
014432,000269: 37,3004           55525                           PDDL     VDEF                                  
014433,000270: 37,3005           02501                                    ANGX                                  
014434,000271: 37,3006           74276                           VCOMP    VXSC                                  
014435,000272: 37,3007           37074                                    GEORGEJ                               
014436,000273: 37,3010           74521                           MXV      VSR1                                  
014437,000274: 37,3011           02643                                    XSM                                   
014438,000275: 37,3012           02740                           STORE    OGC                                   
014439,000276: 37,3013           77776                           EXIT                                           
014440,000277: 
014441,000278: 37,3014           32472                           CA       OGCPL                                 
014442,000279: 37,3015           04655                           TC       BANKCALL                              
014443,000280: 37,3016           17234                           CADR     IMUPULSE                              
014444,000281: 37,3017           02312                           TC       IMUSLLLG                              
014445,000282: 37,3020           11440        GEOSTRT4           CCS      TORQNDX                               #  ONLY POSITIVE IF IN VERTICAL DRIFT TEST
014446,000283: 37,3021           02260                           TC       VALMIS                                
014447,000284: 37,3022           06014                           TC       INTPRET                               
014448,000285: 37,3023           77624                           CALL                                           
014449,000286: 37,3024           76376                                    ERTHRVSE                              
014450,000287: 37,3025           77776                           EXIT                                           
014451,000288: 37,3026           02114                           TC       TORQUE                                
014452,000289: 
014453,000290: 37,3027           55412        SLEEPIE            TS       LENGTHOT                              #  TEST NOT OVER-DECREMENT LENGTHOT
014454,000291: 37,3030           11440                           CCS      TORQNDX                               #  ARE WE DOING VERTDRIFT
014455,000292: 37,3031           02444                           TC       EARTHR*                               
014456,000293: 37,3032           05225                           TC       ENDOFJOB                              
014457,000294: 
014458,000295: 37,3033           05646        SOMEERRR           TC       ALARM                                 
014459,000296: 37,3034           01600                           OCT      1600                                  
014460,000297: 37,3035           02265                           TC       ENDTEST1                              
014461,000298: 37,3036           05646        SOMERR2            TC       ALARM                                 
014462,000299: 37,3037           01601                           OCT      1601                                  
014463,000300: 37,3040           02265                           TC       ENDTEST1                              
014464,000301: 
014465,000302: 37,3041           06200        DEC585             OCT      06200                                 #  3200 B+14  ORDER IS IMPORTANT
014466,000303: 37,3042           00000 00000  SCHZEROS           2DEC     .00000000                             
014467,000304: 37,3044           00000 00000                     2DEC     .00000000                             
014468,000305: 
014469,000306: 37,3046           00000                           OCT      00000                                 
014470,000307: 37,3047           00000        ONEDPP             OCT      00000                                 #  ORDER IS IMPORTANT
014471,000308: 37,3050           00001                           OCT      00001                                 
014472,000309: 
014473,000310: 37,3051           00004        INTVAL             OCT      4                                     
014474,000311: 37,3052           00002                           OCT      2                                     
014475,000312: 37,3053           00220                           DEC      144        B-14                       
014476,000313: 37,3054           77776                           DEC      -1         B-14                       
014477,000314: 37,3055           35730 00035  SOUPLY             2DEC     .93505870                             #  INITIAL GAINS FOR PIP OUTPUTS
014478,000315: 
014479,000316: 37,3057           10317 17550                     2DEC     .26266423                             #  INITIAL GAINS/4 FOR ERECTION ANGLES
014480,000317: 
014481,000318: 37,3061           00115        77DECML            DEC      77         B-14                       
014482,000319: 37,3062           01443        ALXXXZ             GENADR   ALX1S      -1                         
014483,000320: 37,3063           04133 02265  PIPASC             2DEC     .13055869                             
014484,000321: 
014485,000322: 37,3065           57223 66451  VELSC              2DEC     -.52223476                            #  512/980.402
014486,000323: 
014487,000324: 37,3067           05427 12577  ALSK               2DEC     .17329931                             #  SSWAY VEL GAIN X 980.402/4096
014488,000325: 
014489,000326: 37,3071           77567 44202                     2DEC     -.00835370                            #  SSWAY ACCEL GAIN X 980.402/4096
014490,000327: 
014491,000328: 37,3073           24276 14066  GEORGEJ            2DEC     .63661977                             
014492,000329: 
014493,000330: 37,3075           23073 11773  GEORGEK            2DEC     .59737013                             
014494,000331: 

End of include-file IMU_PERFORMANCE_TESTS_4.agc.  Parent file is MAIN.agc