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.

055224,000002:                                                                                                  ## Copyright:   Public domain.
055225,000003:                                                                                                  ## Filename:    T6-RUPT_PROGRAMS.agc
055226,000004:                                                                                                  ## Purpose:     A section of a reconstructed, mixed version of Sundance
055227,000005:                                                                                                  ##              It is part of the reconstructed source code for the Lunar
055228,000006:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 9.
055229,000007:                                                                                                  ##              No original listings of this program are available;
055230,000008:                                                                                                  ##              instead, this file was created via disassembly of dumps
055231,000009:                                                                                                  ##              of various revisions of Sundance core rope modules.
055232,000010:                                                                                                  ## Assembler:   yaYUL
055233,000011:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
055234,000012:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
055235,000013:                                                                                                  ## Mod history: 2020-06-17 MAS  Created from Luminary 69.
055236,000014: 
055237,000015:                                                                                                  ## Sundance 302
055238,000016: 
055239,000017:                                                                                                  #  PROGRAM NAMES:        (1) T6JOBCHK    MOD. NO. 5      OCTOBER 2, 1967
055240,000018:                                                                                                  #                        (2) DOT6RUPT
055241,000019:                                                                                                  #  MODIFICATION BY:      LOWELL G HULL (A.C.ELECTRONICS)
055242,000020: 
055243,000021:                                                                                                  #  THESE PROGRAMS ENABLE THE LM DAP TO CONTROL THE THRUST TIMES OF THE REACTION CONTROL SYSTEM JETS BY USING TIME6.
055244,000022:                                                                                                  #  SINCE THE LM DAP MAINTAINS EXCLUSIVE CONTROL OVER TIME6 AND ITS INTERRUPTS, THE FOLLOWING CONVENTIONS HAVE BEEN
055245,000023:                                                                                                  #  ESTABLISHED AND MUST NOT BE TAMPERED WITH:
055246,000024:                                                                                                  #        1.      NO NUMBER IS EVER PLACED INTO TIME6 EXCEPT BY LM DAP.
055247,000025:                                                                                                  #        2.      NO PROGRAM OTHER THAN LM DAP ENABLES THE TIME6 COUNTER.
055248,000026:                                                                                                  #        3.      TO USE TIME6, THE FOLLOWING SEQUENCE IS ALWAYS EMPLOYED:
055249,000027:                                                                                                  #                A.      A POSITIVE (NON-ZERO) NUMBER IS STORED IN TIME6.
055250,000028:                                                                                                  #                B.      THE TIME6 CLOCK IS ENABLED.
055251,000029:                                                                                                  #                C.      TIME6 IS INTERROGATED AND IS:
055252,000030:                                                                                                  #                        I.      NEVER FOUND NEGATIVE (NON-ZERO) OR +0.
055253,000031:                                                                                                  #                        II.     SOMETIMES FOUND POSITIVE (BETWEEN 1 AND 240D) INDICATING THAT IT IS ACTIVE.
055254,000032:                                                                                                  #                        III.    SOMETIMES FOUND POSMAX INDICATING THAT IT IS INACTIVE AND NOT ENABLED.
055255,000033:                                                                                                  #                        IV.     SOMETIMES FOUND NEGATIVE ZERO INDICATING THAT:
055256,000034:                                                                                                  #                                A.      A T6RUPT IS ABOUT TO OCCUR AT THE NEXT DINC, OR
055257,000035:                                                                                                  #                                B.      A T6RUPT IS WAITING IN THE PRIORITY CHAIN, OR
055258,000036:                                                                                                  #                                C.      A T6RUPT IS IN PROCESS NOW.
055259,000037:                                                                                                  #        4)      ALL PROGRAMS WHICH OPERATE IN EITHER INTERRUPT MODE OR WITH INTERRUPT INHIBITED MUST CALL T6JOBCHK
055260,000038:                                                                                                  #                EVERY 5 MILLISECONDS TO PROCESS A POSSIBLE WAITING T6RUPT BEFORE IT CAN BE HONORED BY THE HARDWARE.
055261,000039:                                                                                                  #       (5.      PROGRAM JTLST, IN Q,R-AXES, HANDLES THE INPUT LIST.)
055262,000040: 
055263,000041:                                                                                                  #  T6JOBCHK CALLING SEQUENCE:
055264,000042:                                                                                                  #                L       TC      T6JOBCHK
055265,000043:                                                                                                  #                L+1     (RETURN)
055266,000044: 
055267,000045:                                                                                                  #  DOT6RUPT CALLING SEQUENCE:
055268,000046:                                                                                                  #                        DXCH    ARUPT           T6RUPT LEAD IN AT LOCATION 4004.
055269,000047:                                                                                                  #                        EXTEND
055270,000048:                                                                                                  #                        DCA     T6ADR
055271,000049:                                                                                                  #                        DTCB
055272,000050: 
055273,000051:                                                                                                  #  SUBROUTINES CALLED:   DOT6RUPT CALLS T6JOBCHK.
055274,000052: 
055275,000053:                                                                                                  #  NORMAL EXIT MODES:    T6JOBCHK RETURNS TO L +1.
055276,000054:                                                                                                  #                        DOT6RUPT TRANSFERS CONTROL TO RESUME.
055277,000055: 
055278,000056:                                                                                                  #  ALARM/ABORT MODES:    NONE.
055279,000057: 
055280,000058:                                                                                                  #  INPUT:        TIME6           NXT6ADR         OUTPUT:         TIME6           NXT6ADR         CHANNEL 5
055281,000059:                                                                                                  #                T6NEXT          T6NEXT +1                       T6NEXT          T6NEXT +1       CHANNEL 6
055282,000060:                                                                                                  #                T6FURTHA        T6FURTHA +1                     T6FURTHA        T6FURTHA +1     BIT15/CH13
055283,000061: 
055284,000062:                                                                                                  #  DEBRIS:       T6JOBCHK CLOBBERS A.  DOT6RUPT CLOBBERS NOTHING.
055285,000063: 
055286,000064:    5745                                           BLOCK    02                                    
055287,000065: 16,2000                                           BANK     16                                    
055288,000066: 16,2000                                           SETLOC   DAPS1                                 
055289,000067: 16,2000                                           BANK                                           
055290,000068: 16,2000  E6,1454                                  EBANK=   T6NEXT                                
055291,000069: 16,2000                                           COUNT*   $$/DAPT6                              
055292,000070: 
055293,000071: 16,2000           10031        T6JOBCHK           CCS      TIME6                                 #  CHECK TIME6 FOR WAITING T6RUPT:
055294,000072: 16,2001           00002                           TC       Q                                     #  NONE: CLOCK COUTING DOWN.
055295,000073: 16,2002           05723                           TC       CCSHOLE                               
055296,000074: 16,2003           02003                           TC       T6JOBCHK   +3                         
055297,000075: 
055298,000076:                                                                                                  #  CONTROL PASSES TO T6JOB ONLY WHEN C(TIME6) = -0 (I.E. WHEN A T6RUPT MUST BE PROCESSED).
055299,000077: 
055300,000078: 16,2004           35006        T6JOB              CAF      POSMAX                                #  DISABLE CLOCK: NEEDED SINCE RUPT OCCURS
055301,000079: 16,2005           00006                           EXTEND                                         #  1 DINC AFTER T6 = 77777. FOR 625 MUSECS
055302,000080: 16,2006           03013                           WAND     CHAN13                                #  MUST NOT HAVE T6 = +0 WITH ENABLE SET
055303,000081: 
055304,000082: 16,2007           35006                           CA       POSMAX                                
055305,000083: 16,2010           22007                           ZL                                             
055306,000084: 16,2011           53457                           DXCH     T6FURTHA                              
055307,000085: 16,2012           53455                           DXCH     T6NEXT                                
055308,000086: 16,2013           23453                           LXCH     NXT6ADR                               
055309,000087: 16,2014           54031                           TS       TIME6                                 
055310,000088: 
055311,000089: 16,2015           67677                           AD       PRIO37                                
055312,000090: 16,2016           54000                           TS       A                                     
055313,000091: 16,2017           12023                           TCF      ENABLET6                              
055314,000092: 16,2020           35006                           CA       POSMAX                                
055315,000093: 16,2021           54031                           TS       TIME6                                 
055316,000094: 16,2022           12034                           TCF      GOCH56                                
055317,000095: 16,2023           35010        ENABLET6           CA       BIT15                                 
055318,000096: 16,2024           00006                           EXTEND                                         
055319,000097: 16,2025           05013                           WOR      CHAN13                                
055320,000098: 16,2026           31454                           CA       T6NEXT                                
055321,000099: 16,2027           67677                           AD       PRIO37                                
055322,000100: 16,2030           54000                           TS       A                                     
055323,000101: 16,2031           12034                           TCF      GOCH56                                
055324,000102: 16,2032           35006                           CA       POSMAX                                
055325,000103: 16,2033           55454                           TS       T6NEXT                                
055326,000104: 16,2034           50001        GOCH56             INDEX    L                                     
055327,000105: 16,2035           15751                           TCF      WRITEP     -1                         
055328,000106: 

Sundance 292

055330,000108: 
055331,000109:    5745                                           BLOCK    02                                    
055332,000110:    4000                                           SETLOC   FFTAG9                                
055333,000111:    4000                                           BANK                                           
055334,000112:    5745  E6,1632                                  EBANK=   CDUXD                                 
055335,000113:    5745                                           COUNT*   $$/DAPT6                              
055336,000114: 
055337,000115:    5745           00155        NARROWDB           OCTAL    00155                                 #  0.3 DEGREE SCALED AT 45.
055338,000116:    5746           03434        WIDEDB             OCTAL    03434                                 #  5.0 DEGREES SCALED AT 45.
055339,000117: 
055340,000118:    5747  E6,1454                                  EBANK=   T6NEXT                                
055341,000119:    5747           02036 34106  T6ADR              2CADR    DOT6RUPT                              #  2CADR OF INTERRUPT PROCESSOR.
055342,000120: 
055343,000121:    5751           31460                           CA       NEXTP                                 
055344,000122:    5752           00006        WRITEP             EXTEND                                         
055345,000123:    5753           01006                           WRITE    CHAN6                                 
055346,000124:    5754           00002                           TC       Q                                     
055347,000125: 
055348,000126:    5755           31461                           CA       NEXTU                                 
055349,000127:    5756           54001        WRITEU             TS       L                                     
055350,000128:    5757           45772                           CS       00314OCT                              
055351,000129:    5760           00006                           EXTEND                                         
055352,000130:    5761           02005                           RAND     CHAN5                                 
055353,000131:    5762           60001                           AD       L                                     
055354,000132:    5763           00006                           EXTEND                                         
055355,000133:    5764           01005                           WRITE    CHAN5                                 
055356,000134:    5765           00002                           TC       Q                                     
055357,000135: 
055358,000136:    5766           31462                           CA       NEXTV                                 
055359,000137:    5767           54001        WRITEV             TS       L                                     
055360,000138:    5770           35772                           CA       00314OCT                              
055361,000139:    5771           15760                           TCF      -9D                                   
055362,000140:    5772           00314        00314OCT           OCT      00314                                 
055363,000141: 

Sundance 302

055365,000143: 
055366,000144: 16,2036                                           BANK     16                                    
055367,000145: 16,2000                                           SETLOC   DAPS1                                 
055368,000146: 16,2000                                           BANK                                           
055369,000147: 
055370,000148: 16,2036  E6,1454                                  EBANK=   T6NEXT                                
055371,000149: 16,2036                                           COUNT*   $$/DAPT6                              
055372,000150: 
055373,000151: 16,2036           22016        DOT6RUPT           LXCH     BANKRUPT                              #  (INTERRUPT LEAD INS CONTINUED)
055374,000152: 16,2037           00006                           EXTEND                                         
055375,000153: 16,2040           22012                           QXCH     QRUPT                                 
055376,000154: 
055377,000155: 16,2041           02000                           TC       T6JOBCHK                              #  CALL T6JOBCHK.
055378,000156: 
055379,000157: 16,2042           15330                           TCF      RESUME                                #  END TIME6 INTERRUPT PROCESSOR.
055380,000158: 

End of include-file T6-RUPT_PROGRAMS.agc.  Parent file is MAIN.agc