Source Code

These source-code files are part of a reconstructed copy of LM131 revision 1, the final release of the Apollo 13 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The source reconstruction began with source code of Luminary 131 previously transcribed from a digitized copy of that program. A dump of the flight spare core rope memory module B5, part number 2010802-171, serial number RAY 411, was obtained. This module is the only module different between Luminary 131 and LM131 revision 1. The dump was disassembled and all changes were incorporated into these source files. Note that page numbers in the reconstructed code match those on the Luminary 131 printout, although the changed code would likely have changed page numbers for a real LM131 revision 1 listing.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

058685,000002:                                                                                                  ## Copyright:   Public domain.
058686,000003:                                                                                                  ## Filename:    T6-RUPT_PROGRAMS.agc
058687,000004:                                                                                                  ## Purpose:     A section of LM131 revision 1.
058688,000005:                                                                                                  ##              It is part of the reconstructed source code for the final
058689,000006:                                                                                                  ##              release of the flight software for the Lunar Module's (LM)
058690,000007:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13. The code has
058691,000008:                                                                                                  ##              been reconstructed from a listing of Luminary 131 and a dump
058692,000009:                                                                                                  ##              of a core rope memory module B5, part number 2010802-171,
058693,000010:                                                                                                  ##              which is the only module different between LM131 revision 1
058694,000011:                                                                                                  ##              and Luminary 131. The executable generated from this source
058695,000012:                                                                                                  ##              has been verified against the module dump, so while the names,
058696,000013:                                                                                                  ##              comments, and ordering may not be exactly correct, the
058697,000014:                                                                                                  ##              resulting binary is.
058698,000015:                                                                                                  ## Reference:   pp. 1395-1397
058699,000016:                                                                                                  ## Assembler:   yaYUL
058700,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
058701,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
058702,000019:                                                                                                  ## Mod history: 2022-10-28 MAS  Created from Luminary 131.
058703,000020: 

Page 1395

058705,000022:                                                                                                  #  PROGRAM NAMES:        (1) T6JOBCHK    MOD. NO. 5      OCTOBER 2, 1967
058706,000023:                                                                                                  #                        (2) DOT6RUPT
058707,000024:                                                                                                  #  MODIFICATION BY:      LOWELL G HULL (A.C.ELECTRONICS)
058708,000025: 
058709,000026:                                                                                                  #  THESE PROGRAMS ENABLE THE LM DAP TO CONTROL THE THRUST TIMES OF THE REACTION CONTROL SYSTEM JETS BY USING TIME6.
058710,000027:                                                                                                  #  SINCE THE LM DAP MAINTAINS EXCLUSIVE CONTROL OVER TIME6 AND ITS INTERRUPTS, THE FOLLOWING CONVENTIONS HAVE BEEN
058711,000028:                                                                                                  #  ESTABLISHED AND MUST NOT BE TAMPERED WITH:
058712,000029:                                                                                                  #        1.      NO NUMBER IS EVER PLACED INTO TIME6 EXCEPT BY LM DAP.
058713,000030:                                                                                                  #        2.      NO PROGRAM OTHER THAN LM DAP ENABLES THE TIME6 COUNTER.
058714,000031:                                                                                                  #        3.      TO USE TIME6, THE FOLLOWING SEQUENCE IS ALWAYS EMPLOYED:
058715,000032:                                                                                                  #                A.      A POSITIVE (NON-ZERO) NUMBER IS STORED IN TIME6.
058716,000033:                                                                                                  #                B.      THE TIME6 CLOCK IS ENABLED.
058717,000034:                                                                                                  #                C.      TIME6 IS INTERROGATED AND IS:
058718,000035:                                                                                                  #                        I.      NEVER FOUND NEGATIVE (NON-ZERO) OR +0.
058719,000036:                                                                                                  #                        II.     SOMETIMES FOUND POSITIVE (BETWEEN 1 AND 240D) INDICATING THAT IT IS ACTIVE.
058720,000037:                                                                                                  #                        III.    SOMETIMES FOUND POSMAX INDICATING THAT IT IS INACTIVE AND NOT ENABLED.
058721,000038:                                                                                                  #                        IV.     SOMETIMES FOUND NEGATIVE ZERO INDICATING THAT:
058722,000039:                                                                                                  #                                A.      A T6RUPT IS ABOUT TO OCCUR AT THE NEXT DINC, OR
058723,000040:                                                                                                  #                                B.      A T6RUPT IS WAITING IN THE PRIORITY CHAIN, OR
058724,000041:                                                                                                  #                                C.      A T6RUPT IS IN PROCESS NOW.
058725,000042:                                                                                                  #        4)      ALL PROGRAMS WHICH OPERATE IN EITHER INTERRUPT MODE OR WITH INTERRUPT INHIBITED MUST CALL T6JOBCHK
058726,000043:                                                                                                  #                EVERY 5 MILLISECONDS TO PROCESS A POSSIBLE WAITING T6RUPT BEFORE IT CAN BE HONORED BY THE HARDWARE.
058727,000044:                                                                                                  #       (5.      PROGRAM JTLST, IN Q,R-AXES, HANDLES THE INPUT LIST.)
058728,000045: 
058729,000046:                                                                                                  #  T6JOBCHK CALLING SEQUENCE:
058730,000047:                                                                                                  #                L       TC      T6JOBCHK
058731,000048:                                                                                                  #                L+1     (RETURN)
058732,000049: 
058733,000050:                                                                                                  #  DOT6RUPT CALLING SEQUENCE:
058734,000051:                                                                                                  #                        DXCH    ARUPT           T6RUPT LEAD IN AT LOCATION 4004.
058735,000052:                                                                                                  #                        EXTEND
058736,000053:                                                                                                  #                        DCA     T6ADR
058737,000054:                                                                                                  #                        DTCB
058738,000055: 
058739,000056:                                                                                                  #  SUBROUTINES CALLED:   DOT6RUPT CALLS T6JOBCHK.
058740,000057: 
058741,000058:                                                                                                  #  NORMAL EXIT MODES:    T6JOBCHK RETURNS TO L +1.
058742,000059:                                                                                                  #                        DOT6RUPT TRANSFERS CONTROL TO RESUME.
058743,000060: 
058744,000061:                                                                                                  #  ALARM/ABORT MODES:    NONE.
058745,000062: 
058746,000063:                                                                                                  #  INPUT:        TIME6           NXT6ADR         OUTPUT:         TIME6           NXT6ADR         CHANNEL 5
058747,000064:                                                                                                  #                T6NEXT          T6NEXT +1                       T6NEXT          T6NEXT +1       CHANNEL 6
058748,000065:                                                                                                  #                T6FURTHA        T6FURTHA +1                     T6FURTHA        T6FURTHA +1     BIT15/CH13
058749,000066: 
058750,000067:                                                                                                  #  DEBRIS:       T6JOBCHK CLOBBERS A.  DOT6RUPT CLOBBERS NOTHING.
058751,000068: 
058752,000069:    5743                                           BLOCK    02                                    

Page 1396

058754,000071: 17,2055                                           BANK     17                                    
058755,000072: 17,2000                                           SETLOC   DAPS2                                 
058756,000073: 17,2000                                           BANK                                           
058757,000074: 17,2055  E6,1466                                  EBANK=   T6NEXT                                
058758,000075: 17,2055                                           COUNT*   $$/DAPT6                              
058759,000076: 
058760,000077: 17,2055           10031        T6JOBCHK           CCS      TIME6                                 #  CHECK TIME6 FOR WAITING T6RUPT:
058761,000078: 17,2056           00002                           TC       Q                                     #  NONE: CLOCK COUTING DOWN.
058762,000079: 17,2057           05675                           TC       CCSHOLE                               
058763,000080: 17,2060           05675                           TC       CCSHOLE                               
058764,000081: 
058765,000082:                                                                                                  #  CONTROL PASSES TO T6JOB ONLY WHEN C(TIME6) = -0 (I.E. WHEN A T6RUPT MUST BE PROCESSED).
058766,000083: 
058767,000084: 17,2061           34733        T6JOB              CA       POSMAX                                
058768,000085: 17,2062           22007                           ZL                                             
058769,000086: 17,2063           53471                           DXCH     T6FURTHA                              
058770,000087: 17,2064           53467                           DXCH     T6NEXT                                
058771,000088: 17,2065           23465                           LXCH     NXT6ADR                               
058772,000089: 17,2066           54031                           TS       TIME6                                 
058773,000090: 
058774,000091: 17,2067           67730                           AD       PRIO37                                
058775,000092: 17,2070           54000                           TS       A                                     
058776,000093: 17,2071           12075                           TCF      ENABLET6                              
058777,000094: 17,2072           34733                           CA       POSMAX                                
058778,000095: 17,2073           54031                           TS       TIME6                                 
058779,000096: 17,2074           12115                           TCF      GOCH56                                
058780,000097: 17,2075           00006        ENABLET6           EXTEND                                         
058781,000098: 17,2076           23265                           QXCH     C13QSAV                               
058782,000099: 17,2077           22070                           LXCH     RUPTREG1                              
058783,000100: 17,2100           06022                           TC       C13STALL                              
058784,000101: 17,2101           00006                           EXTEND                                         
058785,000102: 17,2102           23265                           QXCH     C13QSAV                               
058786,000103: 17,2103           22070                           LXCH     RUPTREG1                              
058787,000104: 17,2104           34735                           CAF      BIT15                                 
058788,000105: 17,2105           00006                           EXTEND                                         
058789,000106: 17,2106           05013                           WOR      CHAN13                                
058790,000107: 17,2107           31466                           CA       T6NEXT                                
058791,000108: 17,2110           67730                           AD       PRIO37                                
058792,000109: 17,2111           54000                           TS       A                                     
058793,000110: 17,2112           12115                           TCF      GOCH56                                
058794,000111: 17,2113           34733                           CA       POSMAX                                
058795,000112: 17,2114           55466                           TS       T6NEXT                                
058796,000113: 17,2115           50001        GOCH56             INDEX    L                                     
058797,000114: 17,2116           15743                           TCF      WRITEP     -1                         
058798,000115: 
058799,000116:    5743                                           BLOCK    02                                    
058800,000117:    4000                                           SETLOC   FFTAG9                                
058801,000118:    4000                                           BANK                                           
058802,000119:    5743  E6,1634                                  EBANK=   CDUXD                                 
058803,000120:    5743                                           COUNT*   $$/DAPT6                              

Page 1397

058805,000122:    5743           31472                           CA       NEXTP                                 
058806,000123:    5744           00006        WRITEP             EXTEND                                         
058807,000124:    5745           01006                           WRITE    CHAN6                                 
058808,000125:    5746           00002                           TC       Q                                     
058809,000126: 
058810,000127:    5747           31473                           CA       NEXTU                                 
058811,000128:    5750           54001        WRITEU             TS       L                                     
058812,000129:    5751           45764                           CS       00314OCT                              
058813,000130:    5752           00006                           EXTEND                                         
058814,000131:    5753           02005                           RAND     CHAN5                                 
058815,000132:    5754           60001                           AD       L                                     
058816,000133:    5755           00006                           EXTEND                                         
058817,000134:    5756           01005                           WRITE    CHAN5                                 
058818,000135:    5757           00002                           TC       Q                                     
058819,000136: 
058820,000137:    5760           31474                           CA       NEXTV                                 
058821,000138:    5761           54001        WRITEV             TS       L                                     
058822,000139:    5762           35764                           CA       00314OCT                              
058823,000140:    5763           15752                           TCF      -9D                                   
058824,000141:    5764           00314        00314OCT           OCT      00314                                 
058825,000142: 
058826,000143: 17,2117                                           BANK     17                                    
058827,000144: 17,2000                                           SETLOC   DAPS2                                 
058828,000145: 17,2000                                           BANK                                           
058829,000146: 
058830,000147: 17,2117  E6,1466                                  EBANK=   T6NEXT                                
058831,000148: 17,2117                                           COUNT*   $$/DAPT6                              
058832,000149: 
058833,000150: 17,2117           22016        DOT6RUPT           LXCH     BANKRUPT                              #  (INTERRUPT LEAD INS CONTINUED)
058834,000151: 17,2120           00006                           EXTEND                                         
058835,000152: 17,2121           22012                           QXCH     QRUPT                                 
058836,000153: 
058837,000154: 17,2122           02055                           TC       T6JOBCHK                              #  CALL T6JOBCHK.
058838,000155: 
058839,000156: 17,2123           15270                           TCF      RESUME                                #  END TIME6 INTERRUPT PROCESSOR.
058840,000157: 
058841,000158: 

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