Source Code

This source code is very close to the Apollo Guidance Computer software for the Apollo 13 Lunar module. This revision of the Luminary 131 program is from December of 1969, whereas there was a later revision in January of 1970, and still another revision in February, which is the code that flew on the mission. As far as this transcription is concerned, it was originally from a copy made in 1991 of a printout from the collection of AGC developer Don Eyles for collector David Craig. It was subsequently scanned by Gary Neff, reprocessed for online presentation at the now-discontinued History of Recent Science and Technology (HRST) website of MIT's Dibner Institute (the full-quality scans being discarded in the process), and finally transcribed by Ron Burkey for the Virtual AGC Project. Although a high-quality replacement scan for a completely illegible page was later provided by Gary Neff, the reduced legibility of the reprocessed HRST posting nevertheless caused many errors to be introduced into the transcription. Accordingly, a second scan of the same physical printout was made in 2017 for the Virtual AGC Project's collection at the Internet Archive, and used to correct the transcription errors. All of the scanned materials mentioned, as well as other Luminary 131 related material, are available online. Don Eyles apprently made additional hand-written notes in printout between 1991 and 2017, so the two scans are not identical in that respect. The page-headings in the printout read, in part:
	GAP:  ASSEMBLE REVISION 131 OF AGC PROGRAM LUMINARY BY NASA 2021112-091
	17:53 DEC. 19, 1969
Note that the date is the date the printout was made, not the date on which the program revision was released, although these happen to be very close together.

058843,000002:                                                                                                  ## Copyright:   Public domain.
058844,000003:                                                                                                  ## Filename:    T6-RUPT_PROGRAMS.agc
058845,000004:                                                                                                  ## Purpose:     A section of Luminary 1C, revision 131.
058846,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
058847,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13.
058848,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
058849,000008:                                                                                                  ##              that the code format has been changed to conform to the
058850,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
058851,000010:                                                                                                  ##              original YUL assembler.
058852,000011:                                                                                                  ## Reference:   pp. 1395-1397
058853,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
058854,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
058855,000014:                                                                                                  ## Mod history: 06/07/03 RSB.   Began transcribing.
058856,000015:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
058857,000016:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
058858,000017:                                                                                                  ##                              original hardcopy, as opposed to the PDF page
058859,000018:                                                                                                  ##                              numbers in 1701.pdf.
058860,000019:                                                                                                  ##              2017-02-28 RSB  Proofed comment text using octopus/ProoferComments.
058861,000020:                                                                                                  ##              2017-08-29 MAS  Fixed a comment-text error found while transcribing
058862,000021:                                                                                                  ##                              Zerlina 56.
058863,000022: 

Page 1395

058865,000024:                                                                                                  #  PROGRAM NAMES:        (1) T6JOBCHK    MOD. NO. 5      OCTOBER 2, 1967
058866,000025:                                                                                                  #                        (2) DOT6RUPT
058867,000026:                                                                                                  #  MODIFICATION BY:      LOWELL G HULL (A.C.ELECTRONICS)
058868,000027: 
058869,000028:                                                                                                  #  THESE PROGRAMS ENABLE THE LM DAP TO CONTROL THE THRUST TIMES OF THE REACTION CONTROL SYSTEM JETS BY USING TIME6.
058870,000029:                                                                                                  #  SINCE THE LM DAP MAINTAINS EXCLUSIVE CONTROL OVER TIME6 AND ITS INTERRUPTS, THE FOLLOWING CONVENTIONS HAVE BEEN
058871,000030:                                                                                                  #  ESTABLISHED AND MUST NOT BE TAMPERED WITH:
058872,000031:                                                                                                  #        1.      NO NUMBER IS EVER PLACED INTO TIME6 EXCEPT BY LM DAP.
058873,000032:                                                                                                  #        2.      NO PROGRAM OTHER THAN LM DAP ENABLES THE TIME6 COUNTER.
058874,000033:                                                                                                  #        3.      TO USE TIME6, THE FOLLOWING SEQUENCE IS ALWAYS EMPLOYED:
058875,000034:                                                                                                  #                A.      A POSITIVE (NON-ZERO) NUMBER IS STORED IN TIME6.
058876,000035:                                                                                                  #                B.      THE TIME6 CLOCK IS ENABLED.
058877,000036:                                                                                                  #                C.      TIME6 IS INTERROGATED AND IS:
058878,000037:                                                                                                  #                        I.      NEVER FOUND NEGATIVE (NON-ZERO) OR +0.
058879,000038:                                                                                                  #                        II.     SOMETIMES FOUND POSITIVE (BETWEEN 1 AND 240D) INDICATING THAT IT IS ACTIVE.
058880,000039:                                                                                                  #                        III.    SOMETIMES FOUND POSMAX INDICATING THAT IT IS INACTIVE AND NOT ENABLED.
058881,000040:                                                                                                  #                        IV.     SOMETIMES FOUND NEGATIVE ZERO INDICATING THAT:
058882,000041:                                                                                                  #                                A.      A T6RUPT IS ABOUT TO OCCUR AT THE NEXT DINC, OR
058883,000042:                                                                                                  #                                B.      A T6RUPT IS WAITING IN THE PRIORITY CHAIN, OR
058884,000043:                                                                                                  #                                C.      A T6RUPT IS IN PROCESS NOW.
058885,000044:                                                                                                  #        4)      ALL PROGRAMS WHICH OPERATE IN EITHER INTERRUPT MODE OR WITH INTERRUPT INHIBITED MUST CALL T6JOBCHK
058886,000045:                                                                                                  #                EVERY 5 MILLISECONDS TO PROCESS A POSSIBLE WAITING T6RUPT BEFORE IT CAN BE HONORED BY THE HARDWARE.
058887,000046:                                                                                                  #       (5.      PROGRAM JTLST, IN Q,R-AXES, HANDLES THE INPUT LIST.)
058888,000047: 
058889,000048:                                                                                                  #  T6JOBCHK CALLING SEQUENCE:
058890,000049:                                                                                                  #                L       TC      T6JOBCHK
058891,000050:                                                                                                  #                L+1     (RETURN)
058892,000051: 
058893,000052:                                                                                                  #  DOT6RUPT CALLING SEQUENCE:
058894,000053:                                                                                                  #                        DXCH    ARUPT           T6RUPT LEAD IN AT LOCATION 4004.
058895,000054:                                                                                                  #                        EXTEND
058896,000055:                                                                                                  #                        DCA     T6ADR
058897,000056:                                                                                                  #                        DTCB
058898,000057: 
058899,000058:                                                                                                  #  SUBROUTINES CALLED:   DOT6RUPT CALLS T6JOBCHK.
058900,000059: 
058901,000060:                                                                                                  #  NORMAL EXIT MODES:    T6JOBCHK RETURNS TO L +1.
058902,000061:                                                                                                  #                        DOT6RUPT TRANSFERS CONTROL TO RESUME.
058903,000062: 
058904,000063:                                                                                                  #  ALARM/ABORT MODES:    NONE.
058905,000064: 
058906,000065:                                                                                                  #  INPUT:        TIME6           NXT6ADR         OUTPUT:         TIME6           NXT6ADR         CHANNEL 5
058907,000066:                                                                                                  #                T6NEXT          T6NEXT +1                       T6NEXT          T6NEXT +1       CHANNEL 6
058908,000067:                                                                                                  #                T6FURTHA        T6FURTHA +1                     T6FURTHA        T6FURTHA +1     BIT15/CH13
058909,000068: 
058910,000069:                                                                                                  #  DEBRIS:       T6JOBCHK CLOBBERS A.  DOT6RUPT CLOBBERS NOTHING.
058911,000070: 
058912,000071:    5743                                           BLOCK    02                                    

Page 1396

058914,000073: 17,2055                                           BANK     17                                    
058915,000074: 17,2000                                           SETLOC   DAPS2                                 
058916,000075: 17,2000                                           BANK                                           
058917,000076: 17,2055  E6,1466                                  EBANK=   T6NEXT                                
058918,000077: 17,2055                                           COUNT*   $$/DAPT6                              
058919,000078: 
058920,000079: 17,2055           10031        T6JOBCHK           CCS      TIME6                                 #  CHECK TIME6 FOR WAITING T6RUPT:
058921,000080: 17,2056           00002                           TC       Q                                     #  NONE: CLOCK COUTING DOWN.
058922,000081: 17,2057           05675                           TC       CCSHOLE                               
058923,000082: 17,2060           05675                           TC       CCSHOLE                               
058924,000083: 
058925,000084:                                                                                                  #  CONTROL PASSES TO T6JOB ONLY WHEN C(TIME6) = -0 (I.E. WHEN A T6RUPT MUST BE PROCESSED).
058926,000085: 
058927,000086: 17,2061           34733        T6JOB              CA       POSMAX                                
058928,000087: 17,2062           22007                           ZL                                             
058929,000088: 17,2063           53471                           DXCH     T6FURTHA                              
058930,000089: 17,2064           53467                           DXCH     T6NEXT                                
058931,000090: 17,2065           23465                           LXCH     NXT6ADR                               
058932,000091: 17,2066           54031                           TS       TIME6                                 
058933,000092: 
058934,000093: 17,2067           67730                           AD       PRIO37                                
058935,000094: 17,2070           54000                           TS       A                                     
058936,000095: 17,2071           12075                           TCF      ENABLET6                              
058937,000096: 17,2072           34733                           CA       POSMAX                                
058938,000097: 17,2073           54031                           TS       TIME6                                 
058939,000098: 17,2074           12115                           TCF      GOCH56                                
058940,000099: 17,2075           00006        ENABLET6           EXTEND                                         
058941,000100: 17,2076           23265                           QXCH     C13QSAV                               
058942,000101: 17,2077           22070                           LXCH     RUPTREG1                              
058943,000102: 17,2100           06022                           TC       C13STALL                              
058944,000103: 17,2101           00006                           EXTEND                                         
058945,000104: 17,2102           23265                           QXCH     C13QSAV                               
058946,000105: 17,2103           22070                           LXCH     RUPTREG1                              
058947,000106: 17,2104           34735                           CAF      BIT15                                 
058948,000107: 17,2105           00006                           EXTEND                                         
058949,000108: 17,2106           05013                           WOR      CHAN13                                
058950,000109: 17,2107           31466                           CA       T6NEXT                                
058951,000110: 17,2110           67730                           AD       PRIO37                                
058952,000111: 17,2111           54000                           TS       A                                     
058953,000112: 17,2112           12115                           TCF      GOCH56                                
058954,000113: 17,2113           34733                           CA       POSMAX                                
058955,000114: 17,2114           55466                           TS       T6NEXT                                
058956,000115: 17,2115           50001        GOCH56             INDEX    L                                     
058957,000116: 17,2116           15743                           TCF      WRITEP     -1                         
058958,000117: 
058959,000118:    5743                                           BLOCK    02                                    
058960,000119:    4000                                           SETLOC   FFTAG9                                
058961,000120:    4000                                           BANK                                           
058962,000121:    5743  E6,1634                                  EBANK=   CDUXD                                 
058963,000122:    5743                                           COUNT*   $$/DAPT6                              

Page 1397

058965,000124:    5743           31472                           CA       NEXTP                                 
058966,000125:    5744           00006        WRITEP             EXTEND                                         
058967,000126:    5745           01006                           WRITE    CHAN6                                 
058968,000127:    5746           00002                           TC       Q                                     
058969,000128: 
058970,000129:    5747           31473                           CA       NEXTU                                 
058971,000130:    5750           54001        WRITEU             TS       L                                     
058972,000131:    5751           45764                           CS       00314OCT                              
058973,000132:    5752           00006                           EXTEND                                         
058974,000133:    5753           02005                           RAND     CHAN5                                 
058975,000134:    5754           60001                           AD       L                                     
058976,000135:    5755           00006                           EXTEND                                         
058977,000136:    5756           01005                           WRITE    CHAN5                                 
058978,000137:    5757           00002                           TC       Q                                     
058979,000138: 
058980,000139:    5760           31474                           CA       NEXTV                                 
058981,000140:    5761           54001        WRITEV             TS       L                                     
058982,000141:    5762           35764                           CA       00314OCT                              
058983,000142:    5763           15752                           TCF      -9D                                   
058984,000143:    5764           00314        00314OCT           OCT      00314                                 
058985,000144: 
058986,000145: 17,2117                                           BANK     17                                    
058987,000146: 17,2000                                           SETLOC   DAPS2                                 
058988,000147: 17,2000                                           BANK                                           
058989,000148: 
058990,000149: 17,2117  E6,1466                                  EBANK=   T6NEXT                                
058991,000150: 17,2117                                           COUNT*   $$/DAPT6                              
058992,000151: 
058993,000152: 17,2117           22016        DOT6RUPT           LXCH     BANKRUPT                              #  (INTERRUPT LEAD INS CONTINUED)
058994,000153: 17,2120           00006                           EXTEND                                         
058995,000154: 17,2121           22012                           QXCH     QRUPT                                 
058996,000155: 
058997,000156: 17,2122           02055                           TC       T6JOBCHK                              #  CALL T6JOBCHK.
058998,000157: 
058999,000158: 17,2123           15270                           TCF      RESUME                                #  END TIME6 INTERRUPT PROCESSOR.
059000,000159: 
059001,000160: 

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