Source Code

This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the second release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 97. A bug (which had been around since at least Apollo 10, Luminary 69) was discovered in Rev 0 shortly before the Apollo 11 flight, resulting in a last minute revision into Rev 1, which is what actually flew rather than the Rev 0 presented here. A hardcopy of Rev 0 is known to exist — it belonged to AGC developer Allan Klumpp for many years — but unfortunately the Virtual AGC Project has not had access to that hardcopy. Thus the code you see here had been reconstructed (we believe accurately) rather than transcribed. The first step of the reconstruction of the Rev 0 source code was the transcription of the Rev 1 source code from a hardcopy in the MIT Museum collection. The process of reverting the active portion of the source code (i.e., other than program comments) from Rev 1 to Rev 0 was very minor, consisting only of moving the position of the STARTSB1 label in FRESH START AND RESTART. Allan had previously given us the checksums of the memory banks of Rev 0, and we have verified the program presented here has checksums identical to all banks of Allan's listing of Rev 0. The notations on Allan's Rev 0 program listing read, in part:

	GAP:  ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-051

A single program comment is known to differ between Rev 0 and Rev 1, but these are harder to reconstruct and verify than changes to the active portion of the code. Thus it is possible that there are additional differences between the program comments in Rev 0 and Rev 1 that are unknown to us, and therefore are not reflected in the code presented here.

061395,000002:                                                                                                  ## Copyright:   Public domain.
061396,000003:                                                                                                  ## Filename:    T6-RUPT_PROGRAMS.agc
061397,000004:                                                                                                  ## Purpose:     Part of the reconstructed source code for LMY99 Rev 0,
061398,000005:                                                                                                  ##              otherwise known as Luminary Rev 99, the second release
061399,000006:                                                                                                  ##              of the Apollo Guidance Computer (AGC) software for Apollo 11.
061400,000007:                                                                                                  ##              It differs from LMY99 Rev 1 (the flown version) only in the
061401,000008:                                                                                                  ##              placement of a single label. The corrections shown here have
061402,000009:                                                                                                  ##              been verified to have the same bank checksums as AGC developer
061403,000010:                                                                                                  ##              Allan Klumpp's copy of Luminary Rev 99, and so are believed
061404,000011:                                                                                                  ##              to be accurate. This file is intended to be a faithful 
061405,000012:                                                                                                  ##              recreation, except that the code format has been changed to 
061406,000013:                                                                                                  ##              conform to the requirements of the yaYUL assembler rather than 
061407,000014:                                                                                                  ##              the original YUL assembler.
061408,000015:                                                                                                  ##
061409,000016:                                                                                                  ## Assembler:   yaYUL
061410,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
061411,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo.
061412,000019:                                                                                                  ## Pages:       1403-1405
061413,000020:                                                                                                  ## Mod history: 2009-05-10 SN   (Sergio Navarro).  Started adapting
061414,000021:                                                                                                  ##                              from the Luminary131/ file of the same
061415,000022:                                                                                                  ##                              name, using Luminary099 page images.
061416,000023:                                                                                                  ##              2016-12-18 RSB  Proofed text comments with octopus/ProoferComments
061417,000024:                                                                                                  ##                              and corrected the errors found.
061418,000025:                                                                                                  ##              2017-08-01 MAS  Created from LMY99 Rev 1.
061419,000026:                                                                                                  ##              2017-08-29 MAS  Fixed a comment-text error found while transcribing
061420,000027:                                                                                                  ##                              Zerlina 56.
061421,000028: 
061422,000029:                                                                                                  ## This source code has been transcribed or otherwise adapted from
061423,000030:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
061424,000031:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
061425,000032:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
061426,000033:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
061427,000034:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
061428,000035:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
061429,000036:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
061430,000037:                                                                                                  ## actually created.
061431,000038:                                                                                                  ##
061432,000039:                                                                                                  ## The code has been modified to match LMY99 Revision 0, otherwise
061433,000040:                                                                                                  ## known as Luminary Revision 99, the Apollo 11 software release preceeding
061434,000041:                                                                                                  ## the listing from which it was transcribed. It has been verified to
061435,000042:                                                                                                  ## contain the same bank checksums as AGC developer Allan Klumpp's listing
061436,000043:                                                                                                  ## of Luminary Revision 99 (for which we do not have scans).
061437,000044:                                                                                                  ##
061438,000045:                                                                                                  ## Notations on Allan Klumpp's listing read, in part:
061439,000046:                                                                                                  ##
061440,000047:                                                                                                  ##      ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
061441,000048: 

Page 1403

061443,000050:                                                                                                  #  PROGRAM NAMES:        (1) T6JOBCHK    MOD. NO. 5      OCTOBER 2, 1967
061444,000051:                                                                                                  #                        (2) DOT6RUPT
061445,000052:                                                                                                  #  MODIFICATION BY:      LOWELL G HULL (A.C.ELECTRONICS)
061446,000053: 
061447,000054:                                                                                                  #  THESE PROGRAMS ENABLE THE LM DAP TO CONTROL THE THRUST TIMES OF THE REACTION CONTROL SYSTEM JETS BY USING TIME6.
061448,000055:                                                                                                  #  SINCE THE LM DAP MAINTAINS EXCLUSIVE CONTROL OVER TIME6 AND ITS INTERRUPTS, THE FOLLOWING CONVENTIONS HAVE BEEN
061449,000056:                                                                                                  #  ESTABLISHED AND MUST NOT BE TAMPERED WITH:
061450,000057:                                                                                                  #        1.      NO NUMBER IS EVER PLACED INTO TIME6 EXCEPT BY LM DAP.
061451,000058:                                                                                                  #        2.      NO PROGRAM OTHER THAN LM DAP ENABLES THE TIME6 COUNTER.
061452,000059:                                                                                                  #        3.      TO USE TIME6, THE FOLLOWING SEQUENCE IS ALWAYS EMPLOYED:
061453,000060:                                                                                                  #                A.      A POSITIVE (NON-ZERO) NUMBER IS STORED IN TIME6.
061454,000061:                                                                                                  #                B.      THE TIME6 CLOCK IS ENABLED.
061455,000062:                                                                                                  #                C.      TIME6 IS INTERROGATED AND IS:
061456,000063:                                                                                                  #                        I.      NEVER FOUND NEGATIVE (NON-ZERO) OR +0.
061457,000064:                                                                                                  #                        II.     SOMETIMES FOUND POSITIVE (BETWEEN 1 AND 240D) INDICATING THAT IT IS ACTIVE.
061458,000065:                                                                                                  #                        III.    SOMETIMES FOUND POSMAX INDICATING THAT IT IS INACTIVE AND NOT ENABLED.
061459,000066:                                                                                                  #                        IV.     SOMETIMES FOUND NEGATIVE ZERO INDICATING THAT:
061460,000067:                                                                                                  #                                A.      A T6RUPT IS ABOUT TO OCCUR AT THE NEXT DINC, OR
061461,000068:                                                                                                  #                                B.      A T6RUPT IS WAITING IN THE PRIORITY CHAIN, OR
061462,000069:                                                                                                  #                                C.      A T6RUPT IS IN PROCESS NOW.
061463,000070:                                                                                                  #        4)      ALL PROGRAMS WHICH OPERATE IN EITHER INTERRUPT MODE OR WITH INTERRUPT INHIBITED MUST CALL T6JOBCHK
061464,000071:                                                                                                  #                EVERY 5 MILLISECONDS TO PROCESS A POSSIBLE WAITING T6RUPT BEFORE IT CAN BE HONORED BY THE HARDWARE.
061465,000072:                                                                                                  #       (5.      PROGRAM JTLST, IN Q,R-AXES, HANDLES THE INPUT LIST.)
061466,000073: 
061467,000074:                                                                                                  #  T6JOBCHK CALLING SEQUENCE:
061468,000075:                                                                                                  #                L       TC      T6JOBCHK
061469,000076:                                                                                                  #                L+1     (RETURN)
061470,000077: 
061471,000078:                                                                                                  #  DOT6RUPT CALLING SEQUENCE:
061472,000079:                                                                                                  #                        DXCH    ARUPT           T6RUPT LEAD IN AT LOCATION 4004.
061473,000080:                                                                                                  #                        EXTEND
061474,000081:                                                                                                  #                        DCA     T6ADR
061475,000082:                                                                                                  #                        DTCB
061476,000083: 
061477,000084:                                                                                                  #  SUBROUTINES CALLED:   DOT6RUPT CALLS T6JOBCHK.
061478,000085: 
061479,000086:                                                                                                  #  NORMAL EXIT MODES:    T6JOBCHK RETURNS TO L +1.
061480,000087:                                                                                                  #                        DOT6RUPT TRANSFERS CONTROL TO RESUME.
061481,000088: 
061482,000089:                                                                                                  #  ALARM/ABORT MODES:    NONE.
061483,000090: 
061484,000091:                                                                                                  #  INPUT:        TIME6           NXT6ADR         OUTPUT:         TIME6           NXT6ADR         CHANNEL 5
061485,000092:                                                                                                  #                T6NEXT          T6NEXT +1                       T6NEXT          T6NEXT +1       CHANNEL 6
061486,000093:                                                                                                  #                T6FURTHA        T6FURTHA +1                     T6FURTHA        T6FURTHA +1     BIT15/CH13
061487,000094: 
061488,000095:                                                                                                  #  DEBRIS:       T6JOBCHK CLOBBERS A.  DOT6RUPT CLOBBERS NOTHING.
061489,000096: 
061490,000097:    5753                                           BLOCK    02                                    

Page 1404

061492,000099: 17,2027                                           BANK     17                                    
061493,000100: 17,2000                                           SETLOC   DAPS2                                 
061494,000101: 17,2000                                           BANK                                           
061495,000102: 17,2027  E6,1466                                  EBANK=   T6NEXT                                
061496,000103: 17,2027                                           COUNT*   $$/DAPT6                              
061497,000104: 
061498,000105: 17,2027           10031        T6JOBCHK           CCS      TIME6                                 #  CHECK TIME6 FOR WAITING T6RUPT:
061499,000106: 17,2030           00002                           TC       Q                                     #  NONE: CLOCK COUTING DOWN.
061500,000107: 17,2031           05705                           TC       CCSHOLE                               
061501,000108: 17,2032           02032                           TC       T6JOBCHK   +3                         
061502,000109: 
061503,000110:                                                                                                  #  CONTROL PASSES TO T6JOB ONLY WHEN C(TIME6) = -0 (I.E. WHEN A T6RUPT MUST BE PROCESSED).
061504,000111: 
061505,000112: 17,2033           34733        T6JOB              CAF      POSMAX                                #  DISABLE CLOCK: NEEDED SINCE RUPT OCCURS
061506,000113: 17,2034           00006                           EXTEND                                         #  1 DINC AFTER T6 = 77777. FOR 625 MUSECS
061507,000114: 17,2035           03013                           WAND     CHAN13                                #  MUST NOT HAVE T6 = +0 WITH ENABLE SET
061508,000115: 
061509,000116: 17,2036           34733                           CA       POSMAX                                
061510,000117: 17,2037           22007                           ZL                                             
061511,000118: 17,2040           53471                           DXCH     T6FURTHA                              
061512,000119: 17,2041           53467                           DXCH     T6NEXT                                
061513,000120: 17,2042           23465                           LXCH     NXT6ADR                               
061514,000121: 17,2043           54031                           TS       TIME6                                 
061515,000122: 
061516,000123: 17,2044           67725                           AD       PRIO37                                
061517,000124: 17,2045           54000                           TS       A                                     
061518,000125: 17,2046           12052                           TCF      ENABLET6                              
061519,000126: 17,2047           34733                           CA       POSMAX                                
061520,000127: 17,2050           54031                           TS       TIME6                                 
061521,000128: 17,2051           12063                           TCF      GOCH56                                
061522,000129: 17,2052           34735        ENABLET6           CA       BIT15                                 
061523,000130: 17,2053           00006                           EXTEND                                         
061524,000131: 17,2054           05013                           WOR      CHAN13                                
061525,000132: 17,2055           31466                           CA       T6NEXT                                
061526,000133: 17,2056           67725                           AD       PRIO37                                
061527,000134: 17,2057           54000                           TS       A                                     
061528,000135: 17,2060           12063                           TCF      GOCH56                                
061529,000136: 17,2061           34733                           CA       POSMAX                                
061530,000137: 17,2062           55466                           TS       T6NEXT                                
061531,000138: 17,2063           50001        GOCH56             INDEX    L                                     
061532,000139: 17,2064           15753                           TCF      WRITEP     -1                         
061533,000140: 
061534,000141:    5753                                           BLOCK    02                                    
061535,000142:    4000                                           SETLOC   FFTAG9                                
061536,000143:    4000                                           BANK                                           
061537,000144:    5753  E6,1635                                  EBANK=   CDUXD                                 
061538,000145:    5753                                           COUNT*   $$/DAPT6                              
061539,000146: 
061540,000147:    5753           31472                           CA       NEXTP                                 
061541,000148:    5754           00006        WRITEP             EXTEND                                         
061542,000149:    5755           01006                           WRITE    CHAN6                                 

Page 1405

061544,000151:    5756           00002                           TC       Q                                     
061545,000152: 
061546,000153:    5757           31473                           CA       NEXTU                                 
061547,000154:    5760           54001        WRITEU             TS       L                                     
061548,000155:    5761           45774                           CS       00314OCT                              
061549,000156:    5762           00006                           EXTEND                                         
061550,000157:    5763           02005                           RAND     CHAN5                                 
061551,000158:    5764           60001                           AD       L                                     
061552,000159:    5765           00006                           EXTEND                                         
061553,000160:    5766           01005                           WRITE    CHAN5                                 
061554,000161:    5767           00002                           TC       Q                                     
061555,000162: 
061556,000163:    5770           31474                           CA       NEXTV                                 
061557,000164:    5771           54001        WRITEV             TS       L                                     
061558,000165:    5772           35774                           CA       00314OCT                              
061559,000166:    5773           15762                           TCF      -9D                                   
061560,000167:    5774           00314        00314OCT           OCT      00314                                 
061561,000168: 
061562,000169: 17,2065                                           BANK     17                                    
061563,000170: 17,2000                                           SETLOC   DAPS2                                 
061564,000171: 17,2000                                           BANK                                           
061565,000172: 
061566,000173: 17,2065  E6,1466                                  EBANK=   T6NEXT                                
061567,000174: 17,2065                                           COUNT*   $$/DAPT6                              
061568,000175: 
061569,000176: 17,2065           22016        DOT6RUPT           LXCH     BANKRUPT                              #  (INTERRUPT LEAD INS CONTINUED)
061570,000177: 17,2066           00006                           EXTEND                                         
061571,000178: 17,2067           22012                           QXCH     QRUPT                                 
061572,000179: 
061573,000180: 17,2070           02027                           TC       T6JOBCHK                              #  CALL T6JOBCHK.
061574,000181: 
061575,000182: 17,2071           15270                           TCF      RESUME                                #  END TIME6 INTERRUPT PROCESSOR.
061576,000183: 

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