Source Code

This is a reconstructed version of Luminary 130, the initial AGC program released in November 1969 for the Apollo 13 LM. Three more releases followed before the flown revision was finally manufactured in February 1970.

This reconstruction was created from a previous transcription of the original listing of Luminary 131, combined with Luminary memo #129 which describes the small difference between the Luminary 130 and 131. The reconstructed source code was verified by matching memory-bank checksums to those listed for Luminary 130 in drawing 2021152G.

In this source code, program comments from the original (Luminary 131) code are prefixed with '#', while those added later by the Virtual AGC project are prefixed with '##'.

007745,000002:                                                                                                  ## Copyright:   Public domain.
007746,000003:                                                                                                  ## Filename:    RCS_FAILURE_MONITOR.agc
007747,000004:                                                                                                  ## Purpose:     A section of the reconstructed source code for Luminary 130.
007748,000005:                                                                                                  ##              This was the original program released for the Apollo 13 LM,
007749,000006:                                                                                                  ##              although several more revisions would follow. It has been
007750,000007:                                                                                                  ##              reconstructed from a listing of Luminary 131, from which it
007751,000008:                                                                                                  ##              differs on only two lines in P70-P71. The difference is
007752,000009:                                                                                                  ##              described in detail in Luminary memo #129, which was used
007753,000010:                                                                                                  ##              to perform the reconstruction. This file is intended to be a
007754,000011:                                                                                                  ##              faithful reconstruction, except that the code format has been
007755,000012:                                                                                                  ##              changed to conform to the requirements of the yaYUL assembler
007756,000013:                                                                                                  ##              rather than the original YUL assembler.
007757,000014:                                                                                                  ## Reference:   pp. 192-194
007758,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
007759,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
007760,000017:                                                                                                  ## Mod history: 05/05/03 RSB.   Began transcribing.
007761,000018:                                                                                                  ##              05/14/05 RSB    Corrected website references above.
007762,000019:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
007763,000020:                                                                                                  ##                              original harcopy, as opposed to the PDF page
007764,000021:                                                                                                  ##                              numbers in 1701.pdf.
007765,000022:                                                                                                  ##              2017-02-16 RSB  Proofed comment text using octopus/ProoferComments.
007766,000023:                                                                                                  ##              2017-03-14 RSB  Comment-text fixes noted in proofing Luminary 116.
007767,000024:                                                                                                  ##              2017-08-18 RSB  Comment-text bug identified in ZERLINA 56.
007768,000025:                                                                                                  ##              2018-09-04 MAS  Copied from Luminary 131 for Luminary 130.
007769,000026:                                                                                                  ##              2021-05-30 ABS  Added missing RCSMON definition to match
007770,000027:                                                                                                  ##                              Luminary 131.
007771,000028: 

Page 192

007773,000030:                                                                                                  #  PROGRAM DESCRIPTION
007774,000031: 
007775,000032:                                                                                                  #  AUTHOR: J S MILLER
007776,000033: 
007777,000034:                                                                                                  #  MODIFIED 6 MARCH 1968 BY P S WEISSMAN TO SET UP JOB FOR 1/ACCS WHEN THE MASKS ARE CHANGED.
007778,000035: 
007779,000036:                                                                                                  #  THIS ROUTINE IS ATTACHED TO T4RUPT, AND IS ENTERED EVERY 480 MS.  ITS FUNCTION IS TO EXAMINE THE LOW 8 BITS
007780,000037:                                                                                                  #  OF CHANNEL 32 TO SEE IF ANY ISOLATION-VALVE CLOSURE BITS HAVE APPEARED OR DISAPPEARED (THE CREW IS WARNED OF JET
007781,000038:                                                                                                  #  FAILURES BY LAMPS LIT BY THE GRUMMAN FAILURE-DETECTION CIRCUITRY; THEY MAY RESPOND BY OPERATING SWITCHES WHICH
007782,000039:                                                                                                  #  ISOLATE PAIRS OF JETS FROM THE PROPELLANT TANKS AND SET BITS IN CHANNEL 32).  IN THE EVENT THAT CHANNEL 32 BITS
007783,000040:                                                                                                  #  DIFFER FROM 'PVALVEST', THE RECORD OF ACTIONS TAKEN BY THIS ROUTINE, THE APPROPRIATE BITS IN 'CH5MASK' &
007784,000041:                                                                                                  #  'CH6MASK', USED BY THE DAP JET-SELECTION LOGIC, ARE UPDATED, AS IS 'PVALVEST'.  TO SPEED UP & SHORTEN THE
007785,000042:                                                                                                  #  ROUTINE, NO MORE THAN ONE CHANGE IS ACCEPTED PER ENTRY.  THE HIGHEST-NUMBERED BIT IN CHANNEL 32 WHICH REQUIRES
007786,000043:                                                                                                  #  ACTION IS THE ONE PROCESSED.
007787,000044: 
007788,000045:                                                                                                  #  THE CODING IN THE FAILURE MONITOR HAS BEEN WRITTEN SO AS TO HAVE ALMOST COMPLETE RESTART PROTECTION.  FOR
007789,000046:                                                                                                  #  EXAMPLE, NO ASSUMPTION IS MADE WHEN SETTING A 'CH5MASK' BIT TO 1 THAT THE PREVIOUS STATE IS 0, ALTHOUGH IT OF
007790,000047:                                                                                                  #  COURSE SHOULD BE.  ONE CASE WHICH MAY BE SEEN TO EVADE PROTECTION IS THE OCCURRENCE OF A RESTART AFTER UPDATING
007791,000048:                                                                                                  #  ONE OR BOTH DAP MASK-WORDS BUT BEFORE UPDATING 'PVALVEST', COUPLED WITH A CHANGE IN THE VALVE-BIT BACK TO ITS
007792,000049:                                                                                                  #  FORMER STATE.  THE CONSEQUENCE OF THIS IS THAT THE NEXT ENTRY WOULD NOT SEE THE CHANGE INCOMPLETELY INCORP-
007793,000050:                                                                                                  #  ORATED BY THE LAST PASS (BECAUSE IT WENT AWAY AT JUST THE RIGHT TIME), BUT THE DAP MASK-WORDS WILL BE INCORRECT.
007794,000051:                                                                                                  #  THIS COMBINATION OF EVENTS SEEMS QUITE REMOTE, BUT NOT IMPOSSIBLE UNLESS THE CREW OPERATES THE SWITCHES AT HALF-
007795,000052:                                                                                                  #  SECOND INTERVALS OR LONGER.  IN ANY EVENT, A DISAGREEMENT BETWEEN REALITY AND THE DAP MASKS WILL BE CURED IF
007796,000053:                                                                                                  #  THE MISINTERPRETED SWITCH IS REVERSED AND THEN RESTORED TO ITS CORRECT POSITION (SLOWLY).
007797,000054: 
007798,000055:                                                                                                  #  CALLING SEQUENCE:
007799,000056: 
007800,000057:                                                                                                  #        TCF     RCSMONIT                (IN INTERRUPT MODE, EVERY 480 MS.)
007801,000058: 
007802,000059:                                                                                                  #  EXIT: TCF RCSMONEX (ALL PATHS EXIT VIA SUCH AN INSTRUCTION)
007803,000060: 
007804,000061: 06,3164     5270               RCSMONEX           EQUALS   RESUME                                
007805,000062: 
007806,000063:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
007807,000064: 
007808,000065:                                                                                                  #        VIA FRESH START:        PVALVEST        =       +0      (ALL JETS ENABLED)
007809,000066:                                                                                                  #                                CH5MASK,CH6MASK =       +0      (ALL JETS OK)
007810,000067: 
007811,000068:                                                                                                  #  OUTPUT:       CH5MASK & CH6MASK UPDATED (1'S WHERE JETS NOT TO BE USED, IN CHANNEL 5 & 6 FORMAT)
007812,000069:                                                                                                  #                PVALTEST UPDATED (1,S WHEN VALVE CLOSURES HAVE BEEN TRANSLATED INTO CH5MASK & CH6MASK; CHAN 32 FORMAT)
007813,000070:                                                                                                  #                JOB TO DO 1/ACCS.
007814,000071: 
007815,000072:                                                                                                  #  DEBRIS:  A, L, Q AND DEBRIS OF NOVAC.
007816,000073: 
007817,000074:                                                                                                  #  SUBROUTINE CALLED:  NOVAC.
007818,000075: 
007819,000076: 06,3164     1257                                  EBANK=   CH5MASK                               
007820,000077: 
007821,000078: 23,2000                                           BANK     23                                    
007822,000079: 06,2000                                           SETLOC   RCSMONT                               
007823,000080: 06,2000                                           BANK                                           

Page 193

007825,000082: 06,3164                                           COUNT*   $$/T4RCS                              
007826,000083: 
007827,000084: 06,3164  06,3164               RCSMONIT           EQUALS   RCSMON                                
007828,000085: 
007829,000086: 06,3164           44755        RCSMON             CS       ZERO                                  
007830,000087: 06,3165           00006                           EXTEND                                         
007831,000088: 06,3166           06032                           RXOR     CHAN32                                #  PICK UP + INVERT INVERTED CHANNEL 32.
007832,000089: 06,3167           74357                           MASK     LOW8                                  #  KEEP JET-FAIL BITS ONLY.
007833,000090: 06,3170           54002                           TS       Q                                     
007834,000091: 
007835,000092: 06,3171           41273                           CS       PVALVEST                              #        -   -
007836,000093: 06,3172           70002                           MASK     Q                                     #  FORM PC + PC.
007837,000094: 06,3173           54001                           TS       L                                     #        (P = PREVIOUS ISOLATION VALVE STATE,
007838,000095: 06,3174           40002                           CS       Q                                     #         C = CURRENT VALVE STATE (CH32)).
007839,000096: 06,3175           71273                           MASK     PVALVEST                              
007840,000097: 06,3176           26001                           ADS      L                                     #  RESULT NZ INDICATES ACTION REQUIRED.
007841,000098: 
007842,000099: 06,3177           00006                           EXTEND                                         
007843,000100: 06,3200           15270                           BZF      RCSMONEX                              #  QUIT IF NO ACTION REQUIRED.
007844,000101: 
007845,000102: 06,3201           00006                           EXTEND                                         
007846,000103: 06,3202           74745                           MP       BIT7                                  #  MOVE BITS 8-1 OF A TO 14-7 OF L.
007847,000104: 06,3203           56001                           XCH      L                                     #  ZERO TO L IN THE PROCESS.
007848,000105: 
007849,000106: 06,3204           24001                 -3        INCR     L                                     
007850,000107: 06,3205           60000                           DOUBLE                                         #  BOUND TO GET OVERFLOW IN THIS LOOP,
007851,000108: 06,3206           54000                           OVSK                                           #  SINCE WE ASSURED INITIAL NZ IN A.
007852,000109: 06,3207           13204                           TCF      -3                                    
007853,000110: 
007854,000111: 06,3210           50001                           INDEX    L                                     
007855,000112: 06,3211           34743                           CA       BIT8       -1                         #  SAVE THE RELEVANT BIT (8-1).
007856,000113: 06,3212           54002                           TS       Q                                     
007857,000114: 06,3213           71273                           MASK     PVALVEST                              #  LOOK AT PREVIOUS VALVE STATE BIT.
007858,000115: 06,3214           10000                           CCS      A                                     
007859,000116: 06,3215           13231                           TCF      VOPENED                               #  THE VALVE HAS JUST BEEN OPENED.
007860,000117: 
007861,000118: 06,3216           41257                           CS       CH5MASK                               #  THE VALVE HAS JUST BEEN CLOSED.
007862,000119: 06,3217           50001                           INDEX    L                                     
007863,000120: 06,3220           73250                           MASK     5FAILTAB                              
007864,000121: 06,3221           27257                           ADS      CH5MASK                               #  SET INHIBIT BIT FOR CHANNEL 5 JET.
007865,000122: 
007866,000123: 06,3222           41260                           CS       CH6MASK                               
007867,000124: 06,3223           50001                           INDEX    L                                     
007868,000125: 06,3224           73260                           MASK     6FAILTAB                              
007869,000126: 06,3225           27260                           ADS      CH6MASK                               #  SET INGIBIT BIT FOR CHANNEL 6 JET.
007870,000127: 
007871,000128: 06,3226           30002                           CA       Q                                     
007872,000129: 06,3227           27273                           ADS      PVALVEST                              #  RECORD ACTION TAKEN.
007873,000130: 
007874,000131: 06,3230           13244                           TCF      1/ACCFIX                              #  SET UP 1/ACCJOB AND EXIT.
007875,000132: 

Page 194

007877,000134: 06,3231           50001        VOPENED            INDEX    L                                     #  A VALVE HAS JUST BEEN OPENED.
007878,000135: 06,3232           43250                           CS       5FAILTAB                              
007879,000136: 06,3233           71257                           MASK     CH5MASK                               
007880,000137: 06,3234           55257                           TS       CH5MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 5 JET.
007881,000138: 
007882,000139: 06,3235           50001                           INDEX    L                                     
007883,000140: 06,3236           43260                           CS       6FAILTAB                              
007884,000141: 06,3237           71260                           MASK     CH6MASK                               
007885,000142: 06,3240           55260                           TS       CH6MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 6 JET.
007886,000143: 
007887,000144: 06,3241           40002                           CS       Q                                     
007888,000145: 06,3242           71273                           MASK     PVALVEST                              
007889,000146: 06,3243           55273                           TS       PVALVEST                              #  RECORD ACTION TAKEN.
007890,000147: 
007891,000148: 06,3244           37720        1/ACCFIX           CAF      PRIO27                                #  SET UP 1/ACCS SO THAT THE SWITCH CURVES
007892,000149: 06,3245           05072                           TC       NOVAC                                 #        FOR TJETLAW CAN BE MODIFIED IF CH5MASK
007893,000150: 06,3246  E6,1536                                  EBANK=   AOSQ                                  #        HAS BEEN ALTERED.
007894,000151: 06,3246           03652 42106                     2CADR    1/ACCJOB                              
007895,000152: 
007896,000153: 06,3250           15270                           TCF      RCSMONEX                              #  EXIT.
007897,000154: 
007898,000155: 06,3251                        5FAILTAB           EQUALS   -1                                    #  CH 5 JET BIT CORRESPONDING TO CH 32 BIT:
007899,000156: 06,3251           00040                           OCT      00040                                 #  8
007900,000157: 06,3252           00020                           OCT      00020                                 #  7
007901,000158: 06,3253           00100                           OCT      00100                                 #  6
007902,000159: 06,3254           00200                           OCT      00200                                 #  5
007903,000160: 06,3255           00010                           OCT      00010                                 #  4
007904,000161: 06,3256           00001                           OCT      00001                                 #  3
007905,000162: 06,3257           00004                           OCT      00004                                 #  2
007906,000163: 06,3260           00002                           OCT      00002                                 #  1
007907,000164: 
007908,000165: 06,3261                        6FAILTAB           EQUALS   -1                                    #  CH 6 JET BIT CORRESPONDING TO CH 32 BIT:
007909,000166: 06,3261           00010                           OCT      00010                                 #  8
007910,000167: 06,3262           00020                           OCT      00020                                 #  7
007911,000168: 06,3263           00004                           OCT      00004                                 #  6
007912,000169: 06,3264           00200                           OCT      00200                                 #  5
007913,000170: 06,3265           00001                           OCT      00001                                 #  4
007914,000171: 06,3266           00002                           OCT      00002                                 #  3
007915,000172: 06,3267           00040                           OCT      00040                                 #  2
007916,000173: 06,3270           00100                           OCT      00100                                 #  1
007917,000174: 
007918,000175: 

End of include-file RCS_FAILURE_MONITOR.agc.  Parent file is MAIN.agc