Source Code

These source-code files were from the printout at the MIT Museum, with many thanks to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing it to us. The printout was digitally photographed by Paul Fjeld. A team of volunteers transcribed the source code manually from these images or, where appropriate, modified already-transcribed but similar source Luminary 131 (Apollo 13) source code to agree with the images from the printout. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 001 OF AGC PROGRAM LMY99 BY NASA 2021112-061
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

007698,000002:                                                                                                  ## Copyright:   Public domain.
007699,000003:                                                                                                  ## Filename:    RCS_FAILURE_MONITOR.agc
007700,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
007701,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
007702,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
007703,000007:                                                                                                  ## Assembler:   yaYUL
007704,000008:                                                                                                  ## Contact:     Hartmuth Gutsche <hgutsche@xplornet.com>.
007705,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
007706,000010:                                                                                                  ## Pages:       190-192
007707,000011:                                                                                                  ## Mod history: 2009-05-19 HG   Transcribed from page images.
007708,000012:                                                                                                  ##              2016-12-13 RSB  Proofed text comments with octopus/ProoferComments
007709,000013:                                                                                                  ##                              and corrected the errors found.
007710,000014:                                                                                                  ##              2017-03-14 RSB  Comment-text fixes noted in proofing Luminary 116.
007711,000015:                                                                                                  ##              2017-08-18 RSB  Comment-text bug identified in ZERLINA 56.
007712,000016: 
007713,000017:                                                                                                  ## This source code has been transcribed or otherwise adapted from
007714,000018:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
007715,000019:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
007716,000020:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
007717,000021:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
007718,000022:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
007719,000023:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
007720,000024:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
007721,000025:                                                                                                  ## actually created.
007722,000026:                                                                                                  ##
007723,000027:                                                                                                  ## Notations on the hardcopy document read, in part:
007724,000028:                                                                                                  ##
007725,000029:                                                                                                  ##      Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
007726,000030:                                                                                                  ##      16:27 JULY 14, 1969 
007727,000031: 

Page 190

007729,000033:                                                                                                  #  PROGRAM DESCRIPTION
007730,000034: 
007731,000035:                                                                                                  #  AUTHOR: J S MILLER
007732,000036: 
007733,000037:                                                                                                  #  MODIFIED 6 MARCH 1968 BY P S WEISSMAN TO SET UP JOB FOR 1/ACCS WHEN THE MASKS ARE CHANGED.
007734,000038: 
007735,000039:                                                                                                  #  THIS ROUTINE IS ATTACHED TO T4RUPT, AND IS ENTERED EVERY 480 MS.  ITS FUNCTION IS TO EXAMINE THE LOW 8 BITS
007736,000040:                                                                                                  #  OF CHANNEL 32 TO SEE IF ANY ISOLATION-VALVE CLOSURE BITS HAVE APPEARED OR DISAPPEARED (THE CREW IS WARNED OF JET
007737,000041:                                                                                                  #  FAILURES BY LAMPS LIT BY THE GRUMMAN FAILURE-DETECTION CIRCUITRY; THEY MAY RESPOND BY OPERATING SWITCHES WHICH
007738,000042:                                                                                                  #  ISOLATE PAIRS OF JETS FROM THE PROPELLANT TANKS AND SET BITS IN CHANNEL 32).  IN THE EVENT THAT CHANNEL 32 BITS
007739,000043:                                                                                                  #  DIFFER FROM 'PVALVEST', THE RECORD OF ACTIONS TAKEN BY THIS ROUTINE, THE APPROPRIATE BITS IN 'CH5MASK' &
007740,000044:                                                                                                  #  'CH6MASK', USED BY THE DAP JET-SELECTION LOGIC, ARE UPDATED, AS IS 'PVALVEST'.  TO SPEED UP & SHORTEN THE
007741,000045:                                                                                                  #  ROUTINE, NO MORE THAN ONE CHANGE IS ACCEPTED PER ENTRY.  THE HIGHEST-NUMBERED BIT IN CHANNEL 32 WHICH REQUIRES
007742,000046:                                                                                                  #  ACTION IS THE ONE PROCESSED.
007743,000047: 
007744,000048:                                                                                                  #  THE CODING IN THE FAILURE MONITOR HAS BEEN WRITTEN SO AS TO HAVE ALMOST COMPLETE RESTART PROTECTION.  FOR
007745,000049:                                                                                                  #  EXAMPLE, NO ASSUMPTION IS MADE WHEN SETTING A 'CH5MASK' BIT TO 1 THAT THE PREVIOUS STATE IS 0, ALTHOUGH IT OF
007746,000050:                                                                                                  #  COURSE SHOULD BE.  ONE CASE WHICH MAY BE SEEN TO EVADE PROTECTION IS THE OCCURRENCE OF A RESTART AFTER UPDATING
007747,000051:                                                                                                  #  ONE OR BOTH DAP MASK-WORDS BUT BEFORE UPDATING 'PVALVEST', COUPLED WITH A CHANGE IN THE VALVE-BIT BACK TO ITS
007748,000052:                                                                                                  #  FORMER STATE.  THE CONSEQUENCE OF THIS IS THAT THE NEXT ENTRY WOULD NOT SEE THE CHANGE INCOMPLETELY INCORP-
007749,000053:                                                                                                  #  ORATED BY THE LAST PASS (BECAUSE IT WENT AWAY AT JUST THE RIGHT TIME), BUT THE DAP MASK-WORDS WILL BE INCORRECT.
007750,000054:                                                                                                  #  THIS COMBINATION OF EVENTS SEEMS QUITE REMOTE, BUT NOT IMPOSSIBLE UNLESS THE CREW OPERATES THE SWITCHES AT HALF-
007751,000055:                                                                                                  #  SECOND INTERVALS OR LONGER.  IN ANY EVENT, A DISAGREEMENT BETWEEN REALITY AND THE DAP MASKS WILL BE CURED IF
007752,000056:                                                                                                  #  THE MISINTERPRETED SWITCH IS REVERSED AND THEN RESTORED TO ITS CORRECT POSITION (SLOWLY).
007753,000057: 
007754,000058:                                                                                                  #  CALLING SEQUENCE:
007755,000059: 
007756,000060:                                                                                                  #        TCF     RCSMONIT                (IN INTERRUPT MODE, EVERY 480 MS.)
007757,000061: 
007758,000062:                                                                                                  #  EXIT: TCF RCSMONEX (ALL PATHS EXIT VIA SUCH AN INSTRUCTION)
007759,000063: 
007760,000064: 06,3156     5270               RCSMONEX           EQUALS   RESUME                                
007761,000065: 
007762,000066:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
007763,000067: 
007764,000068:                                                                                                  #        VIA FRESH START:        PVALVEST        =       +0      (ALL JETS ENABLED)
007765,000069:                                                                                                  #                                CH5MASK,CH6MASK =       +0      (ALL JETS OK)
007766,000070: 
007767,000071:                                                                                                  #  OUTPUT:       CH5MASK & CH6MASK UPDATED (1'S WHERE JETS NOT TO BE USED, IN CHANNEL 5 & 6 FORMAT)
007768,000072:                                                                                                  #                PVALTEST UPDATED (1,S WHEN VALVE CLOSURES HAVE BEEN TRANSLATED INTO CH5MASK & CH6MASK; CHAN 32 FORMAT)
007769,000073:                                                                                                  #                JOB TO DO 1/ACCS.
007770,000074: 
007771,000075:                                                                                                  #  DEBRIS:  A, L, Q AND DEBRIS OF NOVAC.
007772,000076: 
007773,000077:                                                                                                  #  SUBROUTINE CALLED:  NOVAC.
007774,000078: 
007775,000079: 06,3156     1262                                  EBANK=   CH5MASK                               
007776,000080: 
007777,000081: 23,2000                                           BANK     23                                    
007778,000082: 06,2000                                           SETLOC   RCSMONT                               
007779,000083: 06,2000                                           BANK                                           

Page 191

007781,000085: 06,3156                                           COUNT*   $$/T4RCS                              
007782,000086: 
007783,000087: 06,3156  06,3156               RCSMONIT           EQUALS   RCSMON                                
007784,000088: 
007785,000089: 06,3156           44755        RCSMON             CS       ZERO                                  
007786,000090: 06,3157           00006                           EXTEND                                         
007787,000091: 06,3160           06032                           RXOR     CHAN32                                #  PICK UP + INVERT INVERTED CHANNEL 32.
007788,000092: 06,3161           74357                           MASK     LOW8                                  #  KEEP JET-FAIL BITS ONLY.
007789,000093: 06,3162           54002                           TS       Q                                     
007790,000094: 
007791,000095: 06,3163           41276                           CS       PVALVEST                              #        -   -
007792,000096: 06,3164           70002                           MASK     Q                                     #  FORM PC + PC.
007793,000097: 06,3165           54001                           TS       L                                     #        (P = PREVIOUS ISOLATION VALVE STATE,
007794,000098: 06,3166           40002                           CS       Q                                     #         C = CURRENT VALVE STATE (CH32)).
007795,000099: 06,3167           71276                           MASK     PVALVEST                              
007796,000100: 06,3170           26001                           ADS      L                                     #  RESULT NZ INDICATES ACTION REQUIRED.
007797,000101: 
007798,000102: 06,3171           00006                           EXTEND                                         
007799,000103: 06,3172           15270                           BZF      RCSMONEX                              #  QUIT IF NO ACTION REQUIRED.
007800,000104: 
007801,000105: 06,3173           00006                           EXTEND                                         
007802,000106: 06,3174           74745                           MP       BIT7                                  #  MOVE BITS 8-1 OF A TO 14-7 OF L.
007803,000107: 06,3175           56001                           XCH      L                                     #  ZERO TO L IN THE PROCESS.
007804,000108: 
007805,000109: 06,3176           24001                 -3        INCR     L                                     
007806,000110: 06,3177           60000                           DOUBLE                                         #  BOUND TO GET OVERFLOW IN THIS LOOP,
007807,000111: 06,3200           54000                           OVSK                                           #  SINCE WE ASSURED INITIAL NZ IN A.
007808,000112: 06,3201           13176                           TCF      -3                                    
007809,000113: 
007810,000114: 06,3202           50001                           INDEX    L                                     
007811,000115: 06,3203           34743                           CA       BIT8       -1                         #  SAVE THE RELEVANT BIT (8-1).
007812,000116: 06,3204           54002                           TS       Q                                     
007813,000117: 06,3205           71276                           MASK     PVALVEST                              #  LOOK AT PREVIOUS VALVE STATE BIT.
007814,000118: 06,3206           10000                           CCS      A                                     
007815,000119: 06,3207           13223                           TCF      VOPENED                               #  THE VALVE HAS JUST BEEN OPENED.
007816,000120: 
007817,000121: 06,3210           41262                           CS       CH5MASK                               #  THE VALVE HAS JUST BEEN CLOSED.
007818,000122: 06,3211           50001                           INDEX    L                                     
007819,000123: 06,3212           73242                           MASK     5FAILTAB                              
007820,000124: 06,3213           27262                           ADS      CH5MASK                               #  SET INHIBIT BIT FOR CHANNEL 5 JET.
007821,000125: 
007822,000126: 06,3214           41263                           CS       CH6MASK                               
007823,000127: 06,3215           50001                           INDEX    L                                     
007824,000128: 06,3216           73252                           MASK     6FAILTAB                              
007825,000129: 06,3217           27263                           ADS      CH6MASK                               #  SET INGIBIT BIT FOR CHANNEL 6 JET.
007826,000130: 
007827,000131: 06,3220           30002                           CA       Q                                     
007828,000132: 06,3221           27276                           ADS      PVALVEST                              #  RECORD ACTION TAKEN.
007829,000133: 
007830,000134: 06,3222           13236                           TCF      1/ACCFIX                              #  SET UP 1/ACCJOB AND EXIT.
007831,000135: 

Page 192

007833,000137: 06,3223           50001        VOPENED            INDEX    L                                     #  A VALVE HAS JUST BEEN OPENED.
007834,000138: 06,3224           43242                           CS       5FAILTAB                              
007835,000139: 06,3225           71262                           MASK     CH5MASK                               
007836,000140: 06,3226           55262                           TS       CH5MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 5 JET.
007837,000141: 
007838,000142: 06,3227           50001                           INDEX    L                                     
007839,000143: 06,3230           43252                           CS       6FAILTAB                              
007840,000144: 06,3231           71263                           MASK     CH6MASK                               
007841,000145: 06,3232           55263                           TS       CH6MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 6 JET.
007842,000146: 
007843,000147: 06,3233           40002                           CS       Q                                     
007844,000148: 06,3234           71276                           MASK     PVALVEST                              
007845,000149: 06,3235           55276                           TS       PVALVEST                              #  RECORD ACTION TAKEN.
007846,000150: 
007847,000151: 06,3236           37715        1/ACCFIX           CAF      PRIO27                                #  SET UP 1/ACCS SO THAT THE SWITCH CURVES
007848,000152: 06,3237           05072                           TC       NOVAC                                 #        FOR TJETLAW CAN BE MODIFIED IF CH5MASK
007849,000153: 06,3240  E6,1537                                  EBANK=   AOSQ                                  #        HAS BEEN ALTERED.
007850,000154: 06,3240           02454 40106                     2CADR    1/ACCJOB                              
007851,000155: 
007852,000156: 06,3242           15270                           TCF      RCSMONEX                              #  EXIT.
007853,000157: 
007854,000158: 06,3243                        5FAILTAB           EQUALS   -1                                    #  CH 5 JET BIT CORRESPONDING TO CH 32 BIT:
007855,000159: 06,3243           00040                           OCT      00040                                 #  8
007856,000160: 06,3244           00020                           OCT      00020                                 #  7
007857,000161: 06,3245           00100                           OCT      00100                                 #  6
007858,000162: 06,3246           00200                           OCT      00200                                 #  5
007859,000163: 06,3247           00010                           OCT      00010                                 #  4
007860,000164: 06,3250           00001                           OCT      00001                                 #  3
007861,000165: 06,3251           00004                           OCT      00004                                 #  2
007862,000166: 06,3252           00002                           OCT      00002                                 #  1
007863,000167: 
007864,000168: 06,3253                        6FAILTAB           EQUALS   -1                                    #  CH 6 JET BIT CORRESPONDING TO CH 32 BIT:
007865,000169: 06,3253           00010                           OCT      00010                                 #  8
007866,000170: 06,3254           00020                           OCT      00020                                 #  7
007867,000171: 06,3255           00004                           OCT      00004                                 #  6
007868,000172: 06,3256           00200                           OCT      00200                                 #  5
007869,000173: 06,3257           00001                           OCT      00001                                 #  4
007870,000174: 06,3260           00002                           OCT      00002                                 #  3
007871,000175: 06,3261           00040                           OCT      00040                                 #  2
007872,000176: 06,3262           00100                           OCT      00100                                 #  1
007873,000177: 
007874,000178: 

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