Source Code

These source-code files derive from a printout of Luminary 210 (Apollo 15-17 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Jim Lawton, and transcribed to source code by a team of volunteers. This colorized, syntax-highlighted form was created by assembling that transcribed source code. Note that the full page images are available on the Virtual AGC project page at archive.org, while reduced-size images are presented at the VirtualAGC project website. Report or fix any transcription errors at the Virtual AGC project code repository.

Notations on the program listing read, in part:

	GAP: ASSEMBLE REVISION 210 OF AGC PROGRAM LUMINARY 
	BY NASA 2021112-161 17:11 MAR. 19,1971
Note that the date is the date of the printout, not the date of the program revision.

008540,000002:                                                                                                  ## Copyright:   Public domain.
008541,000003:                                                                                                  ## Filename:    RCS_FAILURE_MONITOR.agc
008542,000004:                                                                                                  ## Purpose:     A section of Luminary revision 210.
008543,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
008544,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 15-17.
008545,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
008546,000008:                                                                                                  ##              that the code format has been changed to conform to the
008547,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
008548,000010:                                                                                                  ##              original YUL assembler.
008549,000011:                                                                                                  ## Reference:   pp. 201-203
008550,000012:                                                                                                  ## Assembler:   yaYUL
008551,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
008552,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
008553,000015:                                                                                                  ## Mod history: 2016-11-17 JL   Created from Luminary131 version.
008554,000016:                                                                                                  ##              2016-11-21 HG   Transcribed
008555,000017:                                                                                                  ##              2016-12-23 RSB  Proofed comment text with octopus/ProoferComments
008556,000018:                                                                                                  ##                              and fixed all errors found.
008557,000019:                                                                                                  ##              2017-08-18 RSB  Comment-text bug identified in ZERLINA 56.
008558,000020: 

Page 201

008560,000022:                                                                                                  #  PROGRAM DESCRIPTION
008561,000023: 
008562,000024:                                                                                                  #  AUTHOR: J S MILLER
008563,000025: 
008564,000026:                                                                                                  #  MODIFIED 6 MARCH 1968 BY P S WEISSMAN TO SET UP JOB FOR 1/ACCS WHEN THE MASKS ARE CHANGED.
008565,000027: 
008566,000028:                                                                                                  #       THIS ROUTINE IS ATTACHED TO T4RUPT, AND IS ENTERED EVERY 480 MS.  ITS FUNCTION IS TO EXAMINE THE LOW 8 BITS
008567,000029:                                                                                                  #  OF CHANNEL 32 TO SEE IF ANY ISOLATION-VALVE CLOSURE BITS HAVE APPEARED OR DISAPPEARED (THE CREW IS WARNED OF JET
008568,000030:                                                                                                  #  FAILURES BY LAMPS LIT BY THE GRUMMAN FAILURE-DETECTION CIRCUITRY; THEY MAY RESPOND BY OPERATING SWITCHES WHICH
008569,000031:                                                                                                  #  ISOLATE PAIRS OF JETS FROM THE PROPELLANT TANKS AND SET BITS IN CHANNEL 32).  IN THE EVENT THAT CHANNEL 32 BITS
008570,000032:                                                                                                  #  DIFFER FROM 'PVALVEST', THE RECORD OF ACTIONS TAKEN BY THIS ROUTINE, THE APPROPRIATE BITS IN 'CH5MASK' &
008571,000033:                                                                                                  #  'CH6MASK', USED BY THE DAP JET-SELECTION LOGIC, ARE UPDATED, AS IS 'PVALVEST'.  TO SPEED UP & SHORTEN THE
008572,000034:                                                                                                  #  ROUTINE, NO MORE THAN ONE CHANGE IS ACCEPTED PER ENTRY.  THE HIGHEST-NUMBERED BIT IN CHANNEL 32 WHICH REQUIRES
008573,000035:                                                                                                  #  ACTION IS THE ONE PROCESSED.
008574,000036: 
008575,000037:                                                                                                  #       THE CODING IN THE FAILURE MONITOR HAS BEEN WRITTEN SO AS TO HAVE ALMOST COMPLETE RESTART PROTECTION.  FOR
008576,000038:                                                                                                  #  EXAMPLE, NO ASSUMPTION IS MADE WHEN SETTING A 'CH5MASK' BIT TO 1 THAT THE PREVIOUS STATE IS 0, ALTHOUGH IT OF
008577,000039:                                                                                                  #  COURSE SHOULD BE.  ONE CASE WHICH MAY BE SEEN TO EVADE PROTECTION IS THE OCCURRENCE OF A RESTART AFTER UPDATING
008578,000040:                                                                                                  #  ONE OR BOTH DAP MASK-WORDS BUT BEFORE UPDATING 'PVALVEST', COUPLED WITH A CHANGE IN THE VALVE-BIT BACK TO ITS
008579,000041:                                                                                                  #  FORMER STATE.  THE CONSEQUENCE OF THIS IS THAT THE NEXT ENTRY WOULD NOT SEE THE CHANGE INCOMPLETELY INCORP-
008580,000042:                                                                                                  #  ORATED BY THE LAST PASS (BECAUSE IT WENT AWAY AT JUST THE RIGHT TIME), BUT THE DAP MASK-WORDS WILL BE INCORRECT.
008581,000043:                                                                                                  #  THIS COMBINATION OF EVENTS SEEMS QUITE REMOTE, BUT NOT IMPOSSIBLE UNLESS THE CREW OPERATES THE SWITCHES AT HALF-
008582,000044:                                                                                                  #  SECOND INTERVALS OR LONGER.  IN ANY EVENT, A DISAGREEMENT BETWEEN REALITY AND THE DAP MASKS WILL BE CURED IF
008583,000045:                                                                                                  #  THE MISINTERPRETED SWITCH IS REVERSED AND THEN RESTORED TO ITS CORRECT POSITION (SLOWLY).
008584,000046: 
008585,000047:                                                                                                  #  CALLING SEQUENCE:
008586,000048: 
008587,000049:                                                                                                  #           TCF    RCSMONIT        (IN INTERRUPT MODE, EVERY 480 MS.)
008588,000050: 
008589,000051:                                                                                                  #  EXIT:  TCF  RCSMONEX  (ALL PATHS EXIT VIA SUCH AN INSTRUCTION)
008590,000052: 06,3213     5272               RCSMONEX           EQUALS   RESUME                                
008591,000053: 
008592,000054:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
008593,000055: 
008594,000056:                                                                                                  #           VIA FRESH START:  PVALVEST          = +0  (ALL JETS ENABLED)
008595,000057:                                                                                                  #                             CH5MASK,CH6MASK   = +0  (ALL JETS OK)
008596,000058: 
008597,000059:                                                                                                  #  OUTPUT:  CH5MASK & CH6MASK UPDATED  (1'S WHERE JETS NOT TO BE USED, IN CHANNEL 5 & 6 FORMAT)
008598,000060:                                                                                                  #           PVALTEST UPDATED  (1,S WHEN VALVE CLOSURES HAVE BEEN TRANSLATED INTO CH5MASK & CH6MASK; CHAN 32 FORMAT)
008599,000061:                                                                                                  #           JOB TO DO 1/ACCS.
008600,000062: 
008601,000063:                                                                                                  #  DEBRIS:  A, L, Q AND DEBRIS OF NOVAC.
008602,000064: 
008603,000065:                                                                                                  #  SUBROUTINE CALLED:  NOVAC.
008604,000066: 
008605,000067: 06,3213     1257                                  EBANK=   CH5MASK                               
008606,000068: 
008607,000069: 23,2000                                           BANK     23                                    
008608,000070: 06,2000                                           SETLOC   RCSMONT                               
008609,000071: 06,2000                                           BANK                                           
008610,000072: 

Page 202

008612,000074: 06,3213                                           COUNT*   $$/T4RCS                              
008613,000075: 
008614,000076: 06,3213  06,3213               RCSMONIT           EQUALS   RCSMON                                
008615,000077: 
008616,000078: 06,3213           44746        RCSMON             CS       ZERO                                  
008617,000079: 06,3214           00006                           EXTEND                                         
008618,000080: 06,3215           06032                           RXOR     CHAN32                                #  PICK UP + INVERT INVERTED CHANNEL 32.
008619,000081: 06,3216           74350                           MASK     LOW8                                  #  KEEP JET-FAIL BITS ONLY.
008620,000082: 06,3217           54002                           TS       Q                                     
008621,000083: 
008622,000084: 06,3220           41273                           CS       PVALVEST                              #        -   -
008623,000085: 06,3221           70002                           MASK     Q                                     #  FORM PC + PC.
008624,000086: 06,3222           54001                           TS       L                                     #    (P = PREVIOUS ISOLATION VALVE STATE,
008625,000087: 06,3223           40002                           CS       Q                                     #     C = CURRENT VALVE STATE (CH 32)).
008626,000088: 06,3224           71273                           MASK     PVALVEST                              
008627,000089: 06,3225           26001                           ADS      L                                     #  RESULT NZ INDICATES ACTION REQUIRED.
008628,000090: 
008629,000091: 06,3226           00006                           EXTEND                                         
008630,000092: 06,3227           15272                           BZF      RCSMONEX                              #  QUIT IF NO ACTION REQUIRED.
008631,000093: 
008632,000094: 06,3230           00006                           EXTEND                                         
008633,000095: 06,3231           74736                           MP       BIT7                                  #  MOVE BITS 8 - 1 OF A TO 14 - 7 OF L.
008634,000096: 06,3232           56001                           XCH      L                                     #  ZERO TO L IN THE PROCESS.
008635,000097: 
008636,000098: 06,3233           24001                 -3        INCR     L                                     
008637,000099: 06,3234           60000                           DOUBLE                                         #  BOUND TO GET OVERFLOW IN THIS LOOP,
008638,000100: 06,3235           54000                           OVSK                                           #  SINCE WE ASSURED INITIAL NZ IN A.
008639,000101: 06,3236           13233                           TCF      -3                                    
008640,000102: 
008641,000103: 06,3237           50001                           INDEX    L                                     
008642,000104: 06,3240           34734                           CA       BIT8       -1                         #  SAVE THE RELEVANT BIT (8 - 1).
008643,000105: 06,3241           54002                           TS       Q                                     
008644,000106: 06,3242           71273                           MASK     PVALVEST                              #  LOOK AT PREVIOUS VALVE STATE BIT.
008645,000107: 06,3243           10000                           CCS      A                                     
008646,000108: 06,3244           13260                           TCF      VOPENED                               #  THE VALVE HAS JUST BEEN OPENED.
008647,000109: 
008648,000110: 06,3245           41257                           CS       CH5MASK                               #  THE VALVE HAS JUST BEEN CLOSED.
008649,000111: 06,3246           50001                           INDEX    L                                     
008650,000112: 06,3247           73277                           MASK     5FAILTAB                              
008651,000113: 06,3250           27257                           ADS      CH5MASK                               #  SET INHIBIT BIT FOR CHANNEL 5 JET.
008652,000114: 
008653,000115: 06,3251           41260                           CS       CH6MASK                               
008654,000116: 06,3252           50001                           INDEX    L                                     
008655,000117: 06,3253           73307                           MASK     6FAILTAB                              
008656,000118: 06,3254           27260                           ADS      CH6MASK                               #  SET INGIBIT BIT FOR CHANNEL 6 JET.
008657,000119: 
008658,000120: 06,3255           30002                           CA       Q                                     
008659,000121: 06,3256           27273                           ADS      PVALVEST                              #  RECORD ACTION TAKEN.
008660,000122: 
008661,000123: 06,3257           13273                           TCF      1/ACCFIX                              #  SET UP 1/ACCJOB AND EXIT.
008662,000124: 

Page 203

008664,000126: 06,3260           50001        VOPENED            INDEX    L                                     #  A VALVE HAS JUST BEEN OPENED.
008665,000127: 06,3261           43277                           CS       5FAILTAB                              
008666,000128: 06,3262           71257                           MASK     CH5MASK                               
008667,000129: 06,3263           55257                           TS       CH5MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 5 JET.
008668,000130: 
008669,000131: 06,3264           50001                           INDEX    L                                     
008670,000132: 06,3265           43307                           CS       6FAILTAB                              
008671,000133: 06,3266           71260                           MASK     CH6MASK                               
008672,000134: 06,3267           55260                           TS       CH6MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 6 JET.
008673,000135: 
008674,000136: 06,3270           40002                           CS       Q                                     
008675,000137: 06,3271           71273                           MASK     PVALVEST                              
008676,000138: 06,3272           55273                           TS       PVALVEST                              #  RECORD ACTION TAKEN.
008677,000139: 
008678,000140: 06,3273           37736        1/ACCFIX           CAF      PRIO27                                #  SET UP 1/ACCS SO THAT THE SWITCH CURVES
008679,000141: 06,3274           05063                           TC       NOVAC                                 #    FOR TJETLAW CAN BE MODIFIED IF CH5MASK
008680,000142: 06,3275  E6,1536                                  EBANK=   AOSQ                                  #    HAS BEEN ALTERED.
008681,000143: 06,3275           03603 42106                     2CADR    1/ACCJOB                              
008682,000144: 
008683,000145: 06,3277           15272                           TCF      RCSMONEX                              #  EXIT.
008684,000146: 
008685,000147: 06,3300                        5FAILTAB           EQUALS   -1                                    #  CH 5 JET BIT CORRESPONDING TO CH 32 BIT:
008686,000148: 06,3300           00040                           OCT      00040                                 #  8
008687,000149: 06,3301           00020                           OCT      00020                                 #  7
008688,000150: 06,3302           00100                           OCT      00100                                 #  6
008689,000151: 06,3303           00200                           OCT      00200                                 #  5
008690,000152: 06,3304           00010                           OCT      00010                                 #  4
008691,000153: 06,3305           00001                           OCT      00001                                 #  3
008692,000154: 06,3306           00004                           OCT      00004                                 #  2
008693,000155: 06,3307           00002                           OCT      00002                                 #  1
008694,000156: 
008695,000157: 06,3310                        6FAILTAB           EQUALS   -1                                    #  CH 6 JET BIT CORRESPONDING TO CH 32 BIT:
008696,000158: 06,3310           00010                           OCT      00010                                 #  8
008697,000159: 06,3311           00020                           OCT      00020                                 #  7
008698,000160: 06,3312           00004                           OCT      00004                                 #  6
008699,000161: 06,3313           00200                           OCT      00200                                 #  5
008700,000162: 06,3314           00001                           OCT      00001                                 #  4
008701,000163: 06,3315           00002                           OCT      00002                                 #  3
008702,000164: 06,3316           00040                           OCT      00040                                 #  2
008703,000165: 06,3317           00100                           OCT      00100                                 #  1

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