Source Code

These source-code files are part of a reconstructed copy of Luminary 163, the first (unflown) release of the Apollo 14 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with reconstructed source code for Luminary 173. Changes between revision 163 and 173 were backed out, as described by Luminary memos 157 and 158. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 163 listing would be different.

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.

008266,000002:                                                                                                  ## Copyright:   Public domain.
008267,000003:                                                                                                  ## Filename:    RCS_FAILURE_MONITOR.agc
008268,000004:                                                                                                  ## Purpose:     A section of Luminary revision 163.
008269,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
008270,000006:                                                                                                  ##              (unflown) release of the flight software for the Lunar
008271,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
008272,000008:                                                                                                  ##              The code has been recreated from a reconstructed copy of
008273,000009:                                                                                                  ##              Luminary 173, as well as Luminary memos 157 amd 158.
008274,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
008275,000011:                                                                                                  ##              exactly match those specified for Luminary 163 in NASA
008276,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
008277,000013:                                                                                                  ##              that the reconstruction is correct.
008278,000014:                                                                                                  ## Reference:   pp. 196-198
008279,000015:                                                                                                  ## Assembler:   yaYUL
008280,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
008281,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
008282,000018:                                                                                                  ## Mod history: 2019-08-21 MAS  Created from Luminary 173.
008283,000019: 

Page 196

008285,000021:                                                                                                  #  PROGRAM DESCRIPTION
008286,000022: 
008287,000023:                                                                                                  #  AUTHOR: J S MILLER
008288,000024: 
008289,000025:                                                                                                  #  MODIFIED 6 MARCH 1968 BY P S WEISSMAN TO SET UP JOB FOR 1/ACCS WHEN THE MASKS ARE CHANGED.
008290,000026: 
008291,000027:                                                                                                  #       THIS ROUTINE IS ATTACHED TO T4RUPT, AND IS ENTERED EVERY 480 MS.  ITS FUNCTION IS TO EXAMINE THE LOW 8 BITS
008292,000028:                                                                                                  #  OF CHANNEL 32 TO SEE IF ANY ISOLATION-VALVE CLOSURE BITS HAVE APPEARED OR DISAPPEARED (THE CREW IS WARNED OF JET
008293,000029:                                                                                                  #  FAILURES BY LAMPS LIT BY THE GRUMMAN FAILURE-DETECTION CIRCUITRY; THEY MAY RESPOND BY OPERATING SWITCHES WHICH
008294,000030:                                                                                                  #  ISOLATE PAIRS OF JETS FROM THE PROPELLANT TANKS AND SET BITS IN CHANNEL 32).  IN THE EVENT THAT CHANNEL 32 BITS
008295,000031:                                                                                                  #  DIFFER FROM 'PVALVEST', THE RECORD OF ACTIONS TAKEN BY THIS ROUTINE, THE APPROPRIATE BITS IN 'CH5MASK' &
008296,000032:                                                                                                  #  'CH6MASK', USED BY THE DAP JET-SELECTION LOGIC, ARE UPDATED, AS IS 'PVALVEST'.  TO SPEED UP & SHORTEN THE
008297,000033:                                                                                                  #  ROUTINE, NO MORE THAN ONE CHANGE IS ACCEPTED PER ENTRY.  THE HIGHEST-NUMBERED BIT IN CHANNEL 32 WHICH REQUIRES
008298,000034:                                                                                                  #  ACTION IS THE ONE PROCESSED.
008299,000035: 
008300,000036:                                                                                                  #       THE CODING IN THE FAILURE MONITOR HAS BEEN WRITTEN SO AS TO HAVE ALMOST COMPLETE RESTART PROTECTION.  FOR
008301,000037:                                                                                                  #  EXAMPLE, NO ASSUMPTION IS MADE WHEN SETTING A 'CH5MASK' BIT TO 1 THAT THE PREVIOUS STATE IS 0, ALTHOUGH IT OF
008302,000038:                                                                                                  #  COURSE SHOULD BE.  ONE CASE WHICH MAY BE SEEN TO EVADE PROTECTION IS THE OCCURRENCE OF A RESTART AFTER UPDATING
008303,000039:                                                                                                  #  ONE OR BOTH DAP MASK-WORDS BUT BEFORE UPDATING 'PVALVEST', COUPLED WITH A CHANGE IN THE VALVE-BIT BACK TO ITS
008304,000040:                                                                                                  #  FORMER STATE.  THE CONSEQUENCE OF THIS IS THAT THE NEXT ENTRY WOULD NOT SEE THE CHANGE INCOMPLETELY INCORP-
008305,000041:                                                                                                  #  ORATED BY THE LAST PASS (BECAUSE IT WENT AWAY AT JUST THE RIGHT TIME), BUT THE DAP MASK-WORDS WILL BE INCORRECT.
008306,000042:                                                                                                  #  THIS COMBINATION OF EVENTS SEEMS QUITE REMOTE, BUT NOT IMPOSSIBLE UNLESS THE CREW OPERATES THE SWITCHES AT HALF-
008307,000043:                                                                                                  #  SECOND INTERVALS OR LONGER.  IN ANY EVENT, A DISAGREEMENT BETWEEN REALITY AND THE DAP MASKS WILL BE CURED IF
008308,000044:                                                                                                  #  THE MISINTERPRETED SWITCH IS REVERSED AND THEN RESTORED TO ITS CORRECT POSITION (SLOWLY).
008309,000045: 
008310,000046:                                                                                                  #  CALLING SEQUENCE:
008311,000047: 
008312,000048:                                                                                                  #           TCF    RCSMONIT        (IN INTERRUPT MODE, EVERY 480 MS.)
008313,000049: 
008314,000050:                                                                                                  #  EXIT:  TCF  RCSMONEX  (ALL PATHS EXIT VIA SUCH AN INSTRUCTION)
008315,000051: 06,3164     5301               RCSMONEX           EQUALS   RESUME                                
008316,000052: 
008317,000053:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
008318,000054: 
008319,000055:                                                                                                  #           VIA FRESH START:  PVALVEST          = +0  (ALL JETS ENABLED)
008320,000056:                                                                                                  #                             CH5MASK, CH6MASK  = +0  (ALL JETS OK)
008321,000057: 
008322,000058:                                                                                                  #  OUTPUT:  CH5MASK & CH6MASK UPDATED  (1'S WHERE JETS NOT TO BE USED, IN CHANNEL 5 & 6 FORMAT)
008323,000059:                                                                                                  #           PVALTEST UPDATED  (1,S WHEN VALVE CLOSURES HAVE BEEN TRANSLATED INTO CH5MASK & CH6MASK; CHAN 32 FORMAT)
008324,000060:                                                                                                  #           JOB TO DO 1/ACCS.
008325,000061: 
008326,000062:                                                                                                  #  DEBRIS:  A, L, Q AND DEBRIS OF NOVAC.
008327,000063: 
008328,000064:                                                                                                  #  SUBROUTINE CALLED:  NOVAC.
008329,000065: 
008330,000066: 06,3164     1257                                  EBANK=   CH5MASK                               
008331,000067: 
008332,000068: 23,2000                                           BANK     23                                    
008333,000069: 06,2000                                           SETLOC   RCSMONT                               
008334,000070: 06,2000                                           BANK                                           
008335,000071: 

Page 197

008337,000073: 06,3164                                           COUNT*   $$/T4RCS                              
008338,000074: 
008339,000075: 06,3164  06,3164               RCSMONIT           EQUALS   RCSMON                                
008340,000076: 
008341,000077: 06,3164           44755        RCSMON             CS       ZERO                                  
008342,000078: 06,3165           00006                           EXTEND                                         
008343,000079: 06,3166           06032                           RXOR     CHAN32                                #  PICK UP + INVERT INVERTED CHANNEL 32.
008344,000080: 06,3167           74357                           MASK     LOW8                                  #  KEEP JET-FAIL BITS ONLY.
008345,000081: 06,3170           54002                           TS       Q                                     
008346,000082: 
008347,000083: 06,3171           41273                           CS       PVALVEST                              #        -   -
008348,000084: 06,3172           70002                           MASK     Q                                     #  FORM PC + PC.
008349,000085: 06,3173           54001                           TS       L                                     #    (P = PREVIOUS ISOLATION VALVE STATE,
008350,000086: 06,3174           40002                           CS       Q                                     #     C = CURRENT VALVE STATE (CH 32)).
008351,000087: 06,3175           71273                           MASK     PVALVEST                              
008352,000088: 06,3176           26001                           ADS      L                                     #  RESULT NZ INDICATES ACTION REQUIRED.
008353,000089: 
008354,000090: 06,3177           00006                           EXTEND                                         
008355,000091: 06,3200           15301                           BZF      RCSMONEX                              #  QUIT IF NO ACTION REQUIRED.
008356,000092: 
008357,000093: 06,3201           00006                           EXTEND                                         
008358,000094: 06,3202           74745                           MP       BIT7                                  #  MOVE BITS 8 - 1 OF A TO 14 - 7 OF L.
008359,000095: 06,3203           56001                           XCH      L                                     #  ZERO TO L IN THE PROCESS.
008360,000096: 
008361,000097: 06,3204           24001                 -3        INCR     L                                     
008362,000098: 06,3205           60000                           DOUBLE                                         #  BOUND TO GET OVERFLOW IN THIS LOOP,
008363,000099: 06,3206           54000                           OVSK                                           #  SINCE WE ASSURED INITIAL NZ IN A.
008364,000100: 06,3207           13204                           TCF      -3                                    
008365,000101: 
008366,000102: 06,3210           50001                           INDEX    L                                     
008367,000103: 06,3211           34743                           CA       BIT8       -1                         #  SAVE THE RELEVANT BIT (8 - 1).
008368,000104: 06,3212           54002                           TS       Q                                     
008369,000105: 06,3213           71273                           MASK     PVALVEST                              #  LOOK AT PREVIOUS VALVE STATE BIT.
008370,000106: 06,3214           10000                           CCS      A                                     
008371,000107: 06,3215           13231                           TCF      VOPENED                               #  THE VALVE HAS JUST BEEN OPENED.
008372,000108: 
008373,000109: 06,3216           41257                           CS       CH5MASK                               #  THE VALVE HAS JUST BEEN CLOSED.
008374,000110: 06,3217           50001                           INDEX    L                                     
008375,000111: 06,3220           73250                           MASK     5FAILTAB                              
008376,000112: 06,3221           27257                           ADS      CH5MASK                               #  SET INHIBIT BIT FOR CHANNEL 5 JET.
008377,000113: 
008378,000114: 06,3222           41260                           CS       CH6MASK                               
008379,000115: 06,3223           50001                           INDEX    L                                     
008380,000116: 06,3224           73260                           MASK     6FAILTAB                              
008381,000117: 06,3225           27260                           ADS      CH6MASK                               #  SET INGIBIT BIT FOR CHANNEL 6 JET.
008382,000118: 
008383,000119: 06,3226           30002                           CA       Q                                     
008384,000120: 06,3227           27273                           ADS      PVALVEST                              #  RECORD ACTION TAKEN.
008385,000121: 
008386,000122: 06,3230           13244                           TCF      1/ACCFIX                              #  SET UP 1/ACCJOB AND EXIT.
008387,000123: 

Page 198

008389,000125: 06,3231           50001        VOPENED            INDEX    L                                     #  A VALVE HAS JUST BEEN OPENED.
008390,000126: 06,3232           43250                           CS       5FAILTAB                              
008391,000127: 06,3233           71257                           MASK     CH5MASK                               
008392,000128: 06,3234           55257                           TS       CH5MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 5 JET.
008393,000129: 
008394,000130: 06,3235           50001                           INDEX    L                                     
008395,000131: 06,3236           43260                           CS       6FAILTAB                              
008396,000132: 06,3237           71260                           MASK     CH6MASK                               
008397,000133: 06,3240           55260                           TS       CH6MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 6 JET.
008398,000134: 
008399,000135: 06,3241           40002                           CS       Q                                     
008400,000136: 06,3242           71273                           MASK     PVALVEST                              
008401,000137: 06,3243           55273                           TS       PVALVEST                              #  RECORD ACTION TAKEN.
008402,000138: 
008403,000139: 06,3244           37720        1/ACCFIX           CAF      PRIO27                                #  SET UP 1/ACCS SO THAT THE SWITCH CURVES
008404,000140: 06,3245           05072                           TC       NOVAC                                 #    FOR TJETLAW CAN BE MODIFIED IF CH5MASK
008405,000141: 06,3246  E6,1536                                  EBANK=   AOSQ                                  #    HAS BEEN ALTERED.
008406,000142: 06,3246           03635 42106                     2CADR    1/ACCJOB                              
008407,000143: 
008408,000144: 06,3250           15301                           TCF      RCSMONEX                              #  EXIT.
008409,000145: 
008410,000146: 06,3251                        5FAILTAB           EQUALS   -1                                    #  CH 5 JET BIT CORRESPONDING TO CH 32 BIT:
008411,000147: 06,3251           00040                           OCT      00040                                 #  8
008412,000148: 06,3252           00020                           OCT      00020                                 #  7
008413,000149: 06,3253           00100                           OCT      00100                                 #  6
008414,000150: 06,3254           00200                           OCT      00200                                 #  5
008415,000151: 06,3255           00010                           OCT      00010                                 #  4
008416,000152: 06,3256           00001                           OCT      00001                                 #  3
008417,000153: 06,3257           00004                           OCT      00004                                 #  2
008418,000154: 06,3260           00002                           OCT      00002                                 #  1
008419,000155: 
008420,000156: 06,3261                        6FAILTAB           EQUALS   -1                                    #  CH 6 JET BIT CORRESPONDING TO CH 32 BIT:
008421,000157: 06,3261           00010                           OCT      00010                                 #  8
008422,000158: 06,3262           00020                           OCT      00020                                 #  7
008423,000159: 06,3263           00004                           OCT      00004                                 #  6
008424,000160: 06,3264           00200                           OCT      00200                                 #  5
008425,000161: 06,3265           00001                           OCT      00001                                 #  4
008426,000162: 06,3266           00002                           OCT      00002                                 #  3
008427,000163: 06,3267           00040                           OCT      00040                                 #  2
008428,000164: 06,3270           00100                           OCT      00100                                 #  1

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