Source Code

These source-code files are part of a reconstructed copy of Luminary 98, a development version of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

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 memo 85, using asterisks indicating changed lines in the listing as a guide. While no listing of this version is known to exist, nor are the memory-bank checksums available, the reconstruction is believed to be correct because it was an an intermediate step in reconstructing Luminary 97 whose reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152G. 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 98 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.

007507,000002:                                                                                                  ## Copyright:   Public domain.
007508,000003:                                                                                                  ## Filename:    RCS_FAILURE_MONITOR.agc
007509,000004:                                                                                                  ## Purpose:     A section of Luminary revision 98.
007510,000005:                                                                                                  ##              It is part of the reconstructed source code for the a
007511,000006:                                                                                                  ##              development version of the flight software for the Lunar 
007512,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
007513,000008:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
007514,000009:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
007515,000010:                                                                                                  ##              the listing and Luminary Memo #85, which lists changes between
007516,000011:                                                                                                  ##              Luminary 98 and 99.
007517,000012:                                                                                                  ## Reference:   pp. 190-192
007518,000013:                                                                                                  ## Assembler:   yaYUL
007519,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
007520,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
007521,000016:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
007522,000017: 

Page 190

007524,000019:                                                                                                  #  PROGRAM DESCRIPTION
007525,000020: 
007526,000021:                                                                                                  #  AUTHOR: J S MILLER
007527,000022: 
007528,000023:                                                                                                  #  MODIFIED 6 MARCH 1968 BY P S WEISSMAN TO SET UP JOB FOR 1/ACCS WHEN THE MASKS ARE CHANGED.
007529,000024: 
007530,000025:                                                                                                  #  THIS ROUTINE IS ATTACHED TO T4RUPT, AND IS ENTERED EVERY 480 MS.  ITS FUNCTION IS TO EXAMINE THE LOW 8 BITS
007531,000026:                                                                                                  #  OF CHANNEL 32 TO SEE IF ANY ISOLATION-VALVE CLOSURE BITS HAVE APPEARED OR DISAPPEARED (THE CREW IS WARNED OF JET
007532,000027:                                                                                                  #  FAILURES BY LAMPS LIT BY THE GRUMMAN FAILURE-DETECTION CIRCUITRY; THEY MAY RESPOND BY OPERATING SWITCHES WHICH
007533,000028:                                                                                                  #  ISOLATE PAIRS OF JETS FROM THE PROPELLANT TANKS AND SET BITS IN CHANNEL 32).  IN THE EVENT THAT CHANNEL 32 BITS
007534,000029:                                                                                                  #  DIFFER FROM 'PVALVEST', THE RECORD OF ACTIONS TAKEN BY THIS ROUTINE, THE APPROPRIATE BITS IN 'CH5MASK' &
007535,000030:                                                                                                  #  'CH6MASK', USED BY THE DAP JET-SELECTION LOGIC, ARE UPDATED, AS IS 'PVALVEST'.  TO SPEED UP & SHORTEN THE
007536,000031:                                                                                                  #  ROUTINE, NO MORE THAN ONE CHANGE IS ACCEPTED PER ENTRY.  THE HIGHEST-NUMBERED BIT IN CHANNEL 32 WHICH REQUIRES
007537,000032:                                                                                                  #  ACTION IS THE ONE PROCESSED.
007538,000033: 
007539,000034:                                                                                                  #  THE CODING IN THE FAILURE MONITOR HAS BEEN WRITTEN SO AS TO HAVE ALMOST COMPLETE RESTART PROTECTION.  FOR
007540,000035:                                                                                                  #  EXAMPLE, NO ASSUMPTION IS MADE WHEN SETTING A 'CH5MASK' BIT TO 1 THAT THE PREVIOUS STATE IS 0, ALTHOUGH IT OF
007541,000036:                                                                                                  #  COURSE SHOULD BE.  ONE CASE WHICH MAY BE SEEN TO EVADE PROTECTION IS THE OCCURRENCE OF A RESTART AFTER UPDATING
007542,000037:                                                                                                  #  ONE OR BOTH DAP MASK-WORDS BUT BEFORE UPDATING 'PVALVEST', COUPLED WITH A CHANGE IN THE VALVE-BIT BACK TO ITS
007543,000038:                                                                                                  #  FORMER STATE.  THE CONSEQUENCE OF THIS IS THAT THE NEXT ENTRY WOULD NOT SEE THE CHANGE INCOMPLETELY INCORP-
007544,000039:                                                                                                  #  ORATED BY THE LAST PASS (BECAUSE IT WENT AWAY AT JUST THE RIGHT TIME), BUT THE DAP MASK-WORDS WILL BE INCORRECT.
007545,000040:                                                                                                  #  THIS COMBINATION OF EVENTS SEEMS QUITE REMOTE, BUT NOT IMPOSSIBLE UNLESS THE CREW OPERATES THE SWITCHES AT HALF-
007546,000041:                                                                                                  #  SECOND INTERVALS OR LONGER.  IN ANY EVENT, A DISAGREEMENT BETWEEN REALITY AND THE DAP MASKS WILL BE CURED IF
007547,000042:                                                                                                  #  THE MISINTERPRETED SWITCH IS REVERSED AND THEN RESTORED TO ITS CORRECT POSITION (SLOWLY).
007548,000043: 
007549,000044:                                                                                                  #  CALLING SEQUENCE:
007550,000045: 
007551,000046:                                                                                                  #        TCF     RCSMONIT                (IN INTERRUPT MODE, EVERY 480 MS.)
007552,000047: 
007553,000048:                                                                                                  #  EXIT: TCF RCSMONEX (ALL PATHS EXIT VIA SUCH AN INSTRUCTION)
007554,000049: 
007555,000050: 06,3156     5270               RCSMONEX           EQUALS   RESUME                                
007556,000051: 
007557,000052:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
007558,000053: 
007559,000054:                                                                                                  #        VIA FRESH START:        PVALVEST        =       +0      (ALL JETS ENABLED)
007560,000055:                                                                                                  #                                CH5MASK,CH6MASK =       +0      (ALL JETS OK)
007561,000056: 
007562,000057:                                                                                                  #  OUTPUT:       CH5MASK & CH6MASK UPDATED (1'S WHERE JETS NOT TO BE USED, IN CHANNEL 5 & 6 FORMAT)
007563,000058:                                                                                                  #                PVALTEST UPDATED (1,S WHEN VALVE CLOSURES HAVE BEEN TRANSLATED INTO CH5MASK & CH6MASK; CHAN 32 FORMAT)
007564,000059:                                                                                                  #                JOB TO DO 1/ACCS.
007565,000060: 
007566,000061:                                                                                                  #  DEBRIS:  A, L, Q AND DEBRIS OF NOVAC.
007567,000062: 
007568,000063:                                                                                                  #  SUBROUTINE CALLED:  NOVAC.
007569,000064: 
007570,000065: 06,3156     1262                                  EBANK=   CH5MASK                               
007571,000066: 
007572,000067: 23,2000                                           BANK     23                                    
007573,000068: 06,2000                                           SETLOC   RCSMONT                               
007574,000069: 06,2000                                           BANK                                           

Page 191

007576,000071: 06,3156                                           COUNT*   $$/T4RCS                              
007577,000072: 
007578,000073: 06,3156  06,3156               RCSMONIT           EQUALS   RCSMON                                
007579,000074: 
007580,000075: 06,3156           44755        RCSMON             CS       ZERO                                  
007581,000076: 06,3157           00006                           EXTEND                                         
007582,000077: 06,3160           06032                           RXOR     CHAN32                                #  PICK UP + INVERT INVERTED CHANNEL 32.
007583,000078: 06,3161           74357                           MASK     LOW8                                  #  KEEP JET-FAIL BITS ONLY.
007584,000079: 06,3162           54002                           TS       Q                                     
007585,000080: 
007586,000081: 06,3163           41276                           CS       PVALVEST                              #        -   -
007587,000082: 06,3164           70002                           MASK     Q                                     #  FORM PC + PC.
007588,000083: 06,3165           54001                           TS       L                                     #        (P = PREVIOUS ISOLATION VALVE STATE,
007589,000084: 06,3166           40002                           CS       Q                                     #         C = CURRENT VALVE STATE (CH32)).
007590,000085: 06,3167           71276                           MASK     PVALVEST                              
007591,000086: 06,3170           26001                           ADS      L                                     #  RESULT NZ INDICATES ACTION REQUIRED.
007592,000087: 
007593,000088: 06,3171           00006                           EXTEND                                         
007594,000089: 06,3172           15270                           BZF      RCSMONEX                              #  QUIT IF NO ACTION REQUIRED.
007595,000090: 
007596,000091: 06,3173           00006                           EXTEND                                         
007597,000092: 06,3174           74745                           MP       BIT7                                  #  MOVE BITS 8-1 OF A TO 14-7 OF L.
007598,000093: 06,3175           56001                           XCH      L                                     #  ZERO TO L IN THE PROCESS.
007599,000094: 
007600,000095: 06,3176           24001                 -3        INCR     L                                     
007601,000096: 06,3177           60000                           DOUBLE                                         #  BOUND TO GET OVERFLOW IN THIS LOOP,
007602,000097: 06,3200           54000                           OVSK                                           #  SINCE WE ASSURED INITIAL NZ IN A.
007603,000098: 06,3201           13176                           TCF      -3                                    
007604,000099: 
007605,000100: 06,3202           50001                           INDEX    L                                     
007606,000101: 06,3203           34743                           CA       BIT8       -1                         #  SAVE THE RELEVANT BIT (8-1).
007607,000102: 06,3204           54002                           TS       Q                                     
007608,000103: 06,3205           71276                           MASK     PVALVEST                              #  LOOK AT PREVIOUS VALVE STATE BIT.
007609,000104: 06,3206           10000                           CCS      A                                     
007610,000105: 06,3207           13223                           TCF      VOPENED                               #  THE VALVE HAS JUST BEEN OPENED.
007611,000106: 
007612,000107: 06,3210           41262                           CS       CH5MASK                               #  THE VALVE HAS JUST BEEN CLOSED.
007613,000108: 06,3211           50001                           INDEX    L                                     
007614,000109: 06,3212           73242                           MASK     5FAILTAB                              
007615,000110: 06,3213           27262                           ADS      CH5MASK                               #  SET INHIBIT BIT FOR CHANNEL 5 JET.
007616,000111: 
007617,000112: 06,3214           41263                           CS       CH6MASK                               
007618,000113: 06,3215           50001                           INDEX    L                                     
007619,000114: 06,3216           73252                           MASK     6FAILTAB                              
007620,000115: 06,3217           27263                           ADS      CH6MASK                               #  SET INGIBIT BIT FOR CHANNEL 6 JET.
007621,000116: 
007622,000117: 06,3220           30002                           CA       Q                                     
007623,000118: 06,3221           27276                           ADS      PVALVEST                              #  RECORD ACTION TAKEN.
007624,000119: 
007625,000120: 06,3222           13236                           TCF      1/ACCFIX                              #  SET UP 1/ACCJOB AND EXIT.
007626,000121: 

Page 192

007628,000123: 06,3223           50001        VOPENED            INDEX    L                                     #  A VALVE HAS JUST BEEN OPENED.
007629,000124: 06,3224           43242                           CS       5FAILTAB                              
007630,000125: 06,3225           71262                           MASK     CH5MASK                               
007631,000126: 06,3226           55262                           TS       CH5MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 5 JET.
007632,000127: 
007633,000128: 06,3227           50001                           INDEX    L                                     
007634,000129: 06,3230           43252                           CS       6FAILTAB                              
007635,000130: 06,3231           71263                           MASK     CH6MASK                               
007636,000131: 06,3232           55263                           TS       CH6MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 6 JET.
007637,000132: 
007638,000133: 06,3233           40002                           CS       Q                                     
007639,000134: 06,3234           71276                           MASK     PVALVEST                              
007640,000135: 06,3235           55276                           TS       PVALVEST                              #  RECORD ACTION TAKEN.
007641,000136: 
007642,000137: 06,3236           37715        1/ACCFIX           CAF      PRIO27                                #  SET UP 1/ACCS SO THAT THE SWITCH CURVES
007643,000138: 06,3237           05072                           TC       NOVAC                                 #        FOR TJETLAW CAN BE MODIFIED IF CH5MASK
007644,000139: 06,3240  E6,1537                                  EBANK=   AOSQ                                  #        HAS BEEN ALTERED.
007645,000140: 06,3240           02454 40106                     2CADR    1/ACCJOB                              
007646,000141: 
007647,000142: 06,3242           15270                           TCF      RCSMONEX                              #  EXIT.
007648,000143: 
007649,000144: 06,3243                        5FAILTAB           EQUALS   -1                                    #  CH 5 JET BIT CORRESPONDING TO CH 32 BIT:
007650,000145: 06,3243           00040                           OCT      00040                                 #  8
007651,000146: 06,3244           00020                           OCT      00020                                 #  7
007652,000147: 06,3245           00100                           OCT      00100                                 #  6
007653,000148: 06,3246           00200                           OCT      00200                                 #  5
007654,000149: 06,3247           00010                           OCT      00010                                 #  4
007655,000150: 06,3250           00001                           OCT      00001                                 #  3
007656,000151: 06,3251           00004                           OCT      00004                                 #  2
007657,000152: 06,3252           00002                           OCT      00002                                 #  1
007658,000153: 
007659,000154: 06,3253                        6FAILTAB           EQUALS   -1                                    #  CH 6 JET BIT CORRESPONDING TO CH 32 BIT:
007660,000155: 06,3253           00010                           OCT      00010                                 #  8
007661,000156: 06,3254           00020                           OCT      00020                                 #  7
007662,000157: 06,3255           00004                           OCT      00004                                 #  6
007663,000158: 06,3256           00200                           OCT      00200                                 #  5
007664,000159: 06,3257           00001                           OCT      00001                                 #  4
007665,000160: 06,3260           00002                           OCT      00002                                 #  3
007666,000161: 06,3261           00040                           OCT      00040                                 #  2
007667,000162: 06,3262           00100                           OCT      00100                                 #  1
007668,000163: 
007669,000164: 

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