Source Code

These source-code files derive from a printout of Luminary 116 (the Apollo 12 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Ron Burkey, and transcribed to source code by a team of volunteers. This colorized, syntax-highlighted form was created by assembling that transcribed source code. Note that the full page images are available on the Virtual AGC project page at archive.org, while reduced-size images are presented at the VirtualAGC project website. Report or fix any transcription errors at the Virtual AGC project code repository.

Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 116 OF AGC PROGRAM LUMINARY BY NASA 2021112-071
	19:09 AUG. 11,1969
Note that the date is the date of the printout, not the date of the program revision.

059193,000002:                                                                                                  ## Copyright:   Public domain.
059194,000003:                                                                                                  ## Filename:    T6-RUPT_PROGRAMS.agc
059195,000004:                                                                                                  ## Purpose:     A section of Luminary revision 116.
059196,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM) 
059197,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 12.
059198,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
059199,000008:                                                                                                  ##              that the code format has been changed to conform to the
059200,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
059201,000010:                                                                                                  ##              original YUL assembler.
059202,000011:                                                                                                  ## Reference:   pp. 1393-1395
059203,000012:                                                                                                  ## Assembler:   yaYUL
059204,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
059205,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
059206,000015:                                                                                                  ## Mod history: 2017-01-22 MAS  Created from Luminary 99.
059207,000016:                                                                                                  ##              2017-02-07 NV   Updated for Luminary 116.
059208,000017:                                                                                                  ##              2017-03-14 RSB  Proofed comment text via 3-way diff vs
059209,000018:                                                                                                  ##                              Luminary 99 and 131 ... no problems found.
059210,000019:                                                                                                  ##              2017-08-29 MAS  Fixed a comment-text error found while transcribing
059211,000020:                                                                                                  ##                              Zerlina 56.
059212,000021: 

Page 1393

059214,000023:                                                                                                  #  PROGRAM NAMES:        (1) T6JOBCHK    MOD. NO. 5      OCTOBER 2, 1967
059215,000024:                                                                                                  #                        (2) DOT6RUPT
059216,000025:                                                                                                  #  MODIFICATION BY:      LOWELL G HULL (A.C.ELECTRONICS)
059217,000026: 
059218,000027:                                                                                                  #  THESE PROGRAMS ENABLE THE LM DAP TO CONTROL THE THRUST TIMES OF THE REACTION CONTROL SYSTEM JETS BY USING TIME6.
059219,000028:                                                                                                  #  SINCE THE LM DAP MAINTAINS EXCLUSIVE CONTROL OVER TIME6 AND ITS INTERRUPTS, THE FOLLOWING CONVENTIONS HAVE BEEN
059220,000029:                                                                                                  #  ESTABLISHED AND MUST NOT BE TAMPERED WITH:
059221,000030:                                                                                                  #        1.      NO NUMBER IS EVER PLACED INTO TIME6 EXCEPT BY LM DAP.
059222,000031:                                                                                                  #        2.      NO PROGRAM OTHER THAN LM DAP ENABLES THE TIME6 COUNTER.
059223,000032:                                                                                                  #        3.      TO USE TIME6, THE FOLLOWING SEQUENCE IS ALWAYS EMPLOYED:
059224,000033:                                                                                                  #                A.      A POSITIVE (NON-ZERO) NUMBER IS STORED IN TIME6.
059225,000034:                                                                                                  #                B.      THE TIME6 CLOCK IS ENABLED.
059226,000035:                                                                                                  #                C.      TIME6 IS INTERROGATED AND IS:
059227,000036:                                                                                                  #                        I.      NEVER FOUND NEGATIVE (NON-ZERO) OR +0.
059228,000037:                                                                                                  #                        II.     SOMETIMES FOUND POSITIVE (BETWEEN 1 AND 240D) INDICATING THAT IT IS ACTIVE.
059229,000038:                                                                                                  #                        III.    SOMETIMES FOUND POSMAX INDICATING THAT IT IS INACTIVE AND NOT ENABLED.
059230,000039:                                                                                                  #                        IV.     SOMETIMES FOUND NEGATIVE ZERO INDICATING THAT:
059231,000040:                                                                                                  #                                A.      A T6RUPT IS ABOUT TO OCCUR AT THE NEXT DINC, OR
059232,000041:                                                                                                  #                                B.      A T6RUPT IS WAITING IN THE PRIORITY CHAIN, OR
059233,000042:                                                                                                  #                                C.      A T6RUPT IS IN PROCESS NOW.
059234,000043:                                                                                                  #        4)      ALL PROGRAMS WHICH OPERATE IN EITHER INTERRUPT MODE OR WITH INTERRUPT INHIBITED MUST CALL T6JOBCHK
059235,000044:                                                                                                  #                EVERY 5 MILLISECONDS TO PROCESS A POSSIBLE WAITING T6RUPT BEFORE IT CAN BE HONORED BY THE HARDWARE.
059236,000045:                                                                                                  #       (5.      PROGRAM JTLST, IN Q,R-AXES, HANDLES THE INPUT LIST.)
059237,000046: 
059238,000047:                                                                                                  #  T6JOBCHK CALLING SEQUENCE:
059239,000048:                                                                                                  #                L       TC      T6JOBCHK
059240,000049:                                                                                                  #                L+1     (RETURN)
059241,000050: 
059242,000051:                                                                                                  #  DOT6RUPT CALLING SEQUENCE:
059243,000052:                                                                                                  #                        DXCH    ARUPT           T6RUPT LEAD IN AT LOCATION 4004.
059244,000053:                                                                                                  #                        EXTEND
059245,000054:                                                                                                  #                        DCA     T6ADR
059246,000055:                                                                                                  #                        DTCB
059247,000056: 
059248,000057:                                                                                                  #  SUBROUTINES CALLED:   DOT6RUPT CALLS T6JOBCHK.
059249,000058: 
059250,000059:                                                                                                  #  NORMAL EXIT MODES:    T6JOBCHK RETURNS TO L +1.
059251,000060:                                                                                                  #                        DOT6RUPT TRANSFERS CONTROL TO RESUME.
059252,000061: 
059253,000062:                                                                                                  #  ALARM/ABORT MODES:    NONE.
059254,000063: 
059255,000064:                                                                                                  #  INPUT:        TIME6           NXT6ADR         OUTPUT:         TIME6           NXT6ADR         CHANNEL 5
059256,000065:                                                                                                  #                T6NEXT          T6NEXT +1                       T6NEXT          T6NEXT +1       CHANNEL 6
059257,000066:                                                                                                  #                T6FURTHA        T6FURTHA +1                     T6FURTHA        T6FURTHA +1     BIT15/CH13
059258,000067: 
059259,000068:                                                                                                  #  DEBRIS:       T6JOBCHK CLOBBERS A.  DOT6RUPT CLOBBERS NOTHING.
059260,000069: 
059261,000070:    5743                                           BLOCK    02                                    

Page 1394

059263,000072: 17,2055                                           BANK     17                                    
059264,000073: 17,2000                                           SETLOC   DAPS2                                 
059265,000074: 17,2000                                           BANK                                           
059266,000075: 17,2055  E6,1466                                  EBANK=   T6NEXT                                
059267,000076: 17,2055                                           COUNT*   $$/DAPT6                              
059268,000077: 
059269,000078: 17,2055           10031        T6JOBCHK           CCS      TIME6                                 #  CHECK TIME6 FOR WAITING T6RUPT:
059270,000079: 17,2056           00002                           TC       Q                                     #  NONE: CLOCK COUTING DOWN.
059271,000080: 17,2057           05675                           TC       CCSHOLE                               
059272,000081: 17,2060           05675                           TC       CCSHOLE                               
059273,000082: 
059274,000083:                                                                                                  #  CONTROL PASSES TO T6JOB ONLY WHEN C(TIME6) = -0 (I.E. WHEN A T6RUPT MUST BE PROCESSED).
059275,000084: 
059276,000085: 17,2061           34733        T6JOB              CA       POSMAX                                
059277,000086: 17,2062           22007                           ZL                                             
059278,000087: 17,2063           53471                           DXCH     T6FURTHA                              
059279,000088: 17,2064           53467                           DXCH     T6NEXT                                
059280,000089: 17,2065           23465                           LXCH     NXT6ADR                               
059281,000090: 17,2066           54031                           TS       TIME6                                 
059282,000091: 
059283,000092: 17,2067           67730                           AD       PRIO37                                
059284,000093: 17,2070           54000                           TS       A                                     
059285,000094: 17,2071           12075                           TCF      ENABLET6                              
059286,000095: 17,2072           34733                           CA       POSMAX                                
059287,000096: 17,2073           54031                           TS       TIME6                                 
059288,000097: 17,2074           12115                           TCF      GOCH56                                
059289,000098: 17,2075           00006        ENABLET6           EXTEND                                         
059290,000099: 17,2076           23265                           QXCH     C13QSAV                               
059291,000100: 17,2077           22070                           LXCH     RUPTREG1                              
059292,000101: 17,2100           06022                           TC       C13STALL                              
059293,000102: 17,2101           00006                           EXTEND                                         
059294,000103: 17,2102           23265                           QXCH     C13QSAV                               
059295,000104: 17,2103           22070                           LXCH     RUPTREG1                              
059296,000105: 17,2104           34735                           CAF      BIT15                                 
059297,000106: 17,2105           00006                           EXTEND                                         
059298,000107: 17,2106           05013                           WOR      CHAN13                                
059299,000108: 17,2107           31466                           CA       T6NEXT                                
059300,000109: 17,2110           67730                           AD       PRIO37                                
059301,000110: 17,2111           54000                           TS       A                                     
059302,000111: 17,2112           12115                           TCF      GOCH56                                
059303,000112: 17,2113           34733                           CA       POSMAX                                
059304,000113: 17,2114           55466                           TS       T6NEXT                                
059305,000114: 17,2115           50001        GOCH56             INDEX    L                                     
059306,000115: 17,2116           15743                           TCF      WRITEP     -1                         
059307,000116: 
059308,000117:    5743                                           BLOCK    02                                    
059309,000118:    4000                                           SETLOC   FFTAG9                                
059310,000119:    4000                                           BANK                                           
059311,000120:    5743  E6,1635                                  EBANK=   CDUXD                                 
059312,000121:    5743                                           COUNT*   $$/DAPT6                              
059313,000122: 

Page 1395

059315,000124:    5743           31472                           CA       NEXTP                                 
059316,000125:    5744           00006        WRITEP             EXTEND                                         
059317,000126:    5745           01006                           WRITE    CHAN6                                 
059318,000127:    5746           00002                           TC       Q                                     
059319,000128: 
059320,000129:    5747           31473                           CA       NEXTU                                 
059321,000130:    5750           54001        WRITEU             TS       L                                     
059322,000131:    5751           45764                           CS       00314OCT                              
059323,000132:    5752           00006                           EXTEND                                         
059324,000133:    5753           02005                           RAND     CHAN5                                 
059325,000134:    5754           60001                           AD       L                                     
059326,000135:    5755           00006                           EXTEND                                         
059327,000136:    5756           01005                           WRITE    CHAN5                                 
059328,000137:    5757           00002                           TC       Q                                     
059329,000138: 
059330,000139:    5760           31474                           CA       NEXTV                                 
059331,000140:    5761           54001        WRITEV             TS       L                                     
059332,000141:    5762           35764                           CA       00314OCT                              
059333,000142:    5763           15752                           TCF      -9D                                   
059334,000143:    5764           00314        00314OCT           OCT      00314                                 
059335,000144: 
059336,000145: 17,2117                                           BANK     17                                    
059337,000146: 17,2000                                           SETLOC   DAPS2                                 
059338,000147: 17,2000                                           BANK                                           
059339,000148: 
059340,000149: 17,2117  E6,1466                                  EBANK=   T6NEXT                                
059341,000150: 17,2117                                           COUNT*   $$/DAPT6                              
059342,000151: 
059343,000152: 17,2117           22016        DOT6RUPT           LXCH     BANKRUPT                              #  (INTERRUPT LEAD INS CONTINUED)
059344,000153: 17,2120           00006                           EXTEND                                         
059345,000154: 17,2121           22012                           QXCH     QRUPT                                 
059346,000155: 
059347,000156: 17,2122           02055                           TC       T6JOBCHK                              #  CALL T6JOBCHK.
059348,000157: 
059349,000158: 17,2123           15270                           TCF      RESUME                                #  END TIME6 INTERRUPT PROCESSOR.
059350,000159: 

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