Source Code

These source-code files are part of a reconstructed copy of Luminary 97, the second release of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software. It was created to fix two incorrect ephemeris constants in Luminary 96, as described by anomaly report LNY-59.

The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memos 83 and 85, using asterisks indicating changed lines in the listing as a guide. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152D. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 97 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.

007554,000002:                                                                                                  ## Copyright:   Public domain.
007555,000003:                                                                                                  ## Filename:    RCS_FAILURE_MONITOR.agc
007556,000004:                                                                                                  ## Purpose:     A section of Luminary revision 97.
007557,000005:                                                                                                  ##              It is part of the reconstructed source code for the
007558,000006:                                                                                                  ##              second release of the flight software for the Lunar 
007559,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
007560,000008:                                                                                                  ##              It was created to fix two incorrect ephemeris constants in
007561,000009:                                                                                                  ##              Luminary 96, as described by anomaly report LNY-59.
007562,000010:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
007563,000011:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
007564,000012:                                                                                                  ##              the listing and Luminary Memos #83 and #85, which list 
007565,000013:                                                                                                  ##              changes between Luminary 97 and 98, and 98 and 99. The
007566,000014:                                                                                                  ##              code has been adapted such that the resulting bugger words
007567,000015:                                                                                                  ##              exactly match those specified for Luminary 97 in NASA drawing
007568,000016:                                                                                                  ##              2021152D, which gives relatively high confidence that the
007569,000017:                                                                                                  ##              reconstruction is correct.
007570,000018:                                                                                                  ## Reference:   pp. 190-192
007571,000019:                                                                                                  ## Assembler:   yaYUL
007572,000020:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
007573,000021:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
007574,000022:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
007575,000023: 

Page 190

007577,000025:                                                                                                  #  PROGRAM DESCRIPTION
007578,000026: 
007579,000027:                                                                                                  #  AUTHOR: J S MILLER
007580,000028: 
007581,000029:                                                                                                  #  MODIFIED 6 MARCH 1968 BY P S WEISSMAN TO SET UP JOB FOR 1/ACCS WHEN THE MASKS ARE CHANGED.
007582,000030: 
007583,000031:                                                                                                  #  THIS ROUTINE IS ATTACHED TO T4RUPT, AND IS ENTERED EVERY 480 MS.  ITS FUNCTION IS TO EXAMINE THE LOW 8 BITS
007584,000032:                                                                                                  #  OF CHANNEL 32 TO SEE IF ANY ISOLATION-VALVE CLOSURE BITS HAVE APPEARED OR DISAPPEARED (THE CREW IS WARNED OF JET
007585,000033:                                                                                                  #  FAILURES BY LAMPS LIT BY THE GRUMMAN FAILURE-DETECTION CIRCUITRY; THEY MAY RESPOND BY OPERATING SWITCHES WHICH
007586,000034:                                                                                                  #  ISOLATE PAIRS OF JETS FROM THE PROPELLANT TANKS AND SET BITS IN CHANNEL 32).  IN THE EVENT THAT CHANNEL 32 BITS
007587,000035:                                                                                                  #  DIFFER FROM 'PVALVEST', THE RECORD OF ACTIONS TAKEN BY THIS ROUTINE, THE APPROPRIATE BITS IN 'CH5MASK' &
007588,000036:                                                                                                  #  'CH6MASK', USED BY THE DAP JET-SELECTION LOGIC, ARE UPDATED, AS IS 'PVALVEST'.  TO SPEED UP & SHORTEN THE
007589,000037:                                                                                                  #  ROUTINE, NO MORE THAN ONE CHANGE IS ACCEPTED PER ENTRY.  THE HIGHEST-NUMBERED BIT IN CHANNEL 32 WHICH REQUIRES
007590,000038:                                                                                                  #  ACTION IS THE ONE PROCESSED.
007591,000039: 
007592,000040:                                                                                                  #  THE CODING IN THE FAILURE MONITOR HAS BEEN WRITTEN SO AS TO HAVE ALMOST COMPLETE RESTART PROTECTION.  FOR
007593,000041:                                                                                                  #  EXAMPLE, NO ASSUMPTION IS MADE WHEN SETTING A 'CH5MASK' BIT TO 1 THAT THE PREVIOUS STATE IS 0, ALTHOUGH IT OF
007594,000042:                                                                                                  #  COURSE SHOULD BE.  ONE CASE WHICH MAY BE SEEN TO EVADE PROTECTION IS THE OCCURRENCE OF A RESTART AFTER UPDATING
007595,000043:                                                                                                  #  ONE OR BOTH DAP MASK-WORDS BUT BEFORE UPDATING 'PVALVEST', COUPLED WITH A CHANGE IN THE VALVE-BIT BACK TO ITS
007596,000044:                                                                                                  #  FORMER STATE.  THE CONSEQUENCE OF THIS IS THAT THE NEXT ENTRY WOULD NOT SEE THE CHANGE INCOMPLETELY INCORP-
007597,000045:                                                                                                  #  ORATED BY THE LAST PASS (BECAUSE IT WENT AWAY AT JUST THE RIGHT TIME), BUT THE DAP MASK-WORDS WILL BE INCORRECT.
007598,000046:                                                                                                  #  THIS COMBINATION OF EVENTS SEEMS QUITE REMOTE, BUT NOT IMPOSSIBLE UNLESS THE CREW OPERATES THE SWITCHES AT HALF-
007599,000047:                                                                                                  #  SECOND INTERVALS OR LONGER.  IN ANY EVENT, A DISAGREEMENT BETWEEN REALITY AND THE DAP MASKS WILL BE CURED IF
007600,000048:                                                                                                  #  THE MISINTERPRETED SWITCH IS REVERSED AND THEN RESTORED TO ITS CORRECT POSITION (SLOWLY).
007601,000049: 
007602,000050:                                                                                                  #  CALLING SEQUENCE:
007603,000051: 
007604,000052:                                                                                                  #        TCF     RCSMONIT                (IN INTERRUPT MODE, EVERY 480 MS.)
007605,000053: 
007606,000054:                                                                                                  #  EXIT: TCF RCSMONEX (ALL PATHS EXIT VIA SUCH AN INSTRUCTION)
007607,000055: 
007608,000056: 06,3156     5270               RCSMONEX           EQUALS   RESUME                                
007609,000057: 
007610,000058:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
007611,000059: 
007612,000060:                                                                                                  #        VIA FRESH START:        PVALVEST        =       +0      (ALL JETS ENABLED)
007613,000061:                                                                                                  #                                CH5MASK,CH6MASK =       +0      (ALL JETS OK)
007614,000062: 
007615,000063:                                                                                                  #  OUTPUT:       CH5MASK & CH6MASK UPDATED (1'S WHERE JETS NOT TO BE USED, IN CHANNEL 5 & 6 FORMAT)
007616,000064:                                                                                                  #                PVALTEST UPDATED (1,S WHEN VALVE CLOSURES HAVE BEEN TRANSLATED INTO CH5MASK & CH6MASK; CHAN 32 FORMAT)
007617,000065:                                                                                                  #                JOB TO DO 1/ACCS.
007618,000066: 
007619,000067:                                                                                                  #  DEBRIS:  A, L, Q AND DEBRIS OF NOVAC.
007620,000068: 
007621,000069:                                                                                                  #  SUBROUTINE CALLED:  NOVAC.
007622,000070: 
007623,000071: 06,3156     1262                                  EBANK=   CH5MASK                               
007624,000072: 
007625,000073: 23,2000                                           BANK     23                                    
007626,000074: 06,2000                                           SETLOC   RCSMONT                               
007627,000075: 06,2000                                           BANK                                           

Page 191

007629,000077: 06,3156                                           COUNT*   $$/T4RCS                              
007630,000078: 
007631,000079: 06,3156  06,3156               RCSMONIT           EQUALS   RCSMON                                
007632,000080: 
007633,000081: 06,3156           44755        RCSMON             CS       ZERO                                  
007634,000082: 06,3157           00006                           EXTEND                                         
007635,000083: 06,3160           06032                           RXOR     CHAN32                                #  PICK UP + INVERT INVERTED CHANNEL 32.
007636,000084: 06,3161           74357                           MASK     LOW8                                  #  KEEP JET-FAIL BITS ONLY.
007637,000085: 06,3162           54002                           TS       Q                                     
007638,000086: 
007639,000087: 06,3163           41276                           CS       PVALVEST                              #        -   -
007640,000088: 06,3164           70002                           MASK     Q                                     #  FORM PC + PC.
007641,000089: 06,3165           54001                           TS       L                                     #        (P = PREVIOUS ISOLATION VALVE STATE,
007642,000090: 06,3166           40002                           CS       Q                                     #         C = CURRENT VALVE STATE (CH32)).
007643,000091: 06,3167           71276                           MASK     PVALVEST                              
007644,000092: 06,3170           26001                           ADS      L                                     #  RESULT NZ INDICATES ACTION REQUIRED.
007645,000093: 
007646,000094: 06,3171           00006                           EXTEND                                         
007647,000095: 06,3172           15270                           BZF      RCSMONEX                              #  QUIT IF NO ACTION REQUIRED.
007648,000096: 
007649,000097: 06,3173           00006                           EXTEND                                         
007650,000098: 06,3174           74745                           MP       BIT7                                  #  MOVE BITS 8-1 OF A TO 14-7 OF L.
007651,000099: 06,3175           56001                           XCH      L                                     #  ZERO TO L IN THE PROCESS.
007652,000100: 
007653,000101: 06,3176           24001                 -3        INCR     L                                     
007654,000102: 06,3177           60000                           DOUBLE                                         #  BOUND TO GET OVERFLOW IN THIS LOOP,
007655,000103: 06,3200           54000                           OVSK                                           #  SINCE WE ASSURED INITIAL NZ IN A.
007656,000104: 06,3201           13176                           TCF      -3                                    
007657,000105: 
007658,000106: 06,3202           50001                           INDEX    L                                     
007659,000107: 06,3203           34743                           CA       BIT8       -1                         #  SAVE THE RELEVANT BIT (8-1).
007660,000108: 06,3204           54002                           TS       Q                                     
007661,000109: 06,3205           71276                           MASK     PVALVEST                              #  LOOK AT PREVIOUS VALVE STATE BIT.
007662,000110: 06,3206           10000                           CCS      A                                     
007663,000111: 06,3207           13223                           TCF      VOPENED                               #  THE VALVE HAS JUST BEEN OPENED.
007664,000112: 
007665,000113: 06,3210           41262                           CS       CH5MASK                               #  THE VALVE HAS JUST BEEN CLOSED.
007666,000114: 06,3211           50001                           INDEX    L                                     
007667,000115: 06,3212           73242                           MASK     5FAILTAB                              
007668,000116: 06,3213           27262                           ADS      CH5MASK                               #  SET INHIBIT BIT FOR CHANNEL 5 JET.
007669,000117: 
007670,000118: 06,3214           41263                           CS       CH6MASK                               
007671,000119: 06,3215           50001                           INDEX    L                                     
007672,000120: 06,3216           73252                           MASK     6FAILTAB                              
007673,000121: 06,3217           27263                           ADS      CH6MASK                               #  SET INGIBIT BIT FOR CHANNEL 6 JET.
007674,000122: 
007675,000123: 06,3220           30002                           CA       Q                                     
007676,000124: 06,3221           27276                           ADS      PVALVEST                              #  RECORD ACTION TAKEN.
007677,000125: 
007678,000126: 06,3222           13236                           TCF      1/ACCFIX                              #  SET UP 1/ACCJOB AND EXIT.
007679,000127: 

Page 192

007681,000129: 06,3223           50001        VOPENED            INDEX    L                                     #  A VALVE HAS JUST BEEN OPENED.
007682,000130: 06,3224           43242                           CS       5FAILTAB                              
007683,000131: 06,3225           71262                           MASK     CH5MASK                               
007684,000132: 06,3226           55262                           TS       CH5MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 5 JET.
007685,000133: 
007686,000134: 06,3227           50001                           INDEX    L                                     
007687,000135: 06,3230           43252                           CS       6FAILTAB                              
007688,000136: 06,3231           71263                           MASK     CH6MASK                               
007689,000137: 06,3232           55263                           TS       CH6MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 6 JET.
007690,000138: 
007691,000139: 06,3233           40002                           CS       Q                                     
007692,000140: 06,3234           71276                           MASK     PVALVEST                              
007693,000141: 06,3235           55276                           TS       PVALVEST                              #  RECORD ACTION TAKEN.
007694,000142: 
007695,000143: 06,3236           37715        1/ACCFIX           CAF      PRIO27                                #  SET UP 1/ACCS SO THAT THE SWITCH CURVES
007696,000144: 06,3237           05072                           TC       NOVAC                                 #        FOR TJETLAW CAN BE MODIFIED IF CH5MASK
007697,000145: 06,3240  E6,1537                                  EBANK=   AOSQ                                  #        HAS BEEN ALTERED.
007698,000146: 06,3240           02454 40106                     2CADR    1/ACCJOB                              
007699,000147: 
007700,000148: 06,3242           15270                           TCF      RCSMONEX                              #  EXIT.
007701,000149: 
007702,000150: 06,3243                        5FAILTAB           EQUALS   -1                                    #  CH 5 JET BIT CORRESPONDING TO CH 32 BIT:
007703,000151: 06,3243           00040                           OCT      00040                                 #  8
007704,000152: 06,3244           00020                           OCT      00020                                 #  7
007705,000153: 06,3245           00100                           OCT      00100                                 #  6
007706,000154: 06,3246           00200                           OCT      00200                                 #  5
007707,000155: 06,3247           00010                           OCT      00010                                 #  4
007708,000156: 06,3250           00001                           OCT      00001                                 #  3
007709,000157: 06,3251           00004                           OCT      00004                                 #  2
007710,000158: 06,3252           00002                           OCT      00002                                 #  1
007711,000159: 
007712,000160: 06,3253                        6FAILTAB           EQUALS   -1                                    #  CH 6 JET BIT CORRESPONDING TO CH 32 BIT:
007713,000161: 06,3253           00010                           OCT      00010                                 #  8
007714,000162: 06,3254           00020                           OCT      00020                                 #  7
007715,000163: 06,3255           00004                           OCT      00004                                 #  6
007716,000164: 06,3256           00200                           OCT      00200                                 #  5
007717,000165: 06,3257           00001                           OCT      00001                                 #  4
007718,000166: 06,3260           00002                           OCT      00002                                 #  3
007719,000167: 06,3261           00040                           OCT      00040                                 #  2
007720,000168: 06,3262           00100                           OCT      00100                                 #  1
007721,000169: 
007722,000170: 

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