Source Code

These source-code files derive from a printout of Luminary 116 (the Apollo 12 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Ron Burkey, 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 116 OF AGC PROGRAM LUMINARY BY NASA 2021112-071
	19:09 AUG. 11,1969
Note that the date is the date of the printout, not the date of the program revision.

007854,000002:                                                                                                  ## Copyright:   Public domain.
007855,000003:                                                                                                  ## Filename:    RCS_FAILURE_MONITOR.agc
007856,000004:                                                                                                  ## Purpose:     A section of Luminary revision 116.
007857,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
007858,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 12.
007859,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
007860,000008:                                                                                                  ##              that the code format has been changed to conform to the
007861,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
007862,000010:                                                                                                  ##              original YUL assembler.
007863,000011:                                                                                                  ## Reference:   pp. 191-193
007864,000012:                                                                                                  ## Assembler:   yaYUL
007865,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
007866,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
007867,000015:                                                                                                  ## Mod history: 2017-01-22 MAS  Created from Luminary 99.
007868,000016:                                                                                                  ##              2017-03-12 HG   Transcribed
007869,000017:                                                                                                  ##              2017-03-14 RSB  Proofed comment text via 3-way diff vs
007870,000018:                                                                                                  ##                              Luminary 99 and 131.
007871,000019:                                                                                                  ##              2017-08-18 RSB  Comment-text bug identified in ZERLINA 56.
007872,000020: 

Page 191

007874,000022:                                                                                                  #  PROGRAM DESCRIPTION
007875,000023: 
007876,000024:                                                                                                  #  AUTHOR:  J S MILLER
007877,000025: 
007878,000026:                                                                                                  #  MODIFIED 6 MARCH 1968 BY P S WEISSMAN TO SET UP JOB FOR 1/ACCS WHEN THE MASKS ARE CHANGED.
007879,000027: 
007880,000028:                                                                                                  #       THIS ROUTINE IS ATTACHED TO T4RUPT, AND IS ENTERED EVERY 480 MS.  ITS FUNCTION IS TO EXAMINE THE LOW 8 BITS
007881,000029:                                                                                                  #  OF CHANNEL 32 TO SEE IF ANY ISOLATION-VALVE CLOSURE BITS HAVE APPEARED OR DISAPPEARED (THE CREW IS WARNED OF JET
007882,000030:                                                                                                  #  FAILURES BY LAMPS LIT BY THE GRUMMAN FAILURE-DETECTION CIRCUITRY; THEY MAY RESPOND BY OPERATING SWITCHES WHICH
007883,000031:                                                                                                  #  ISOLATE PAIRS OF JETS FROM THE PROPELLANT TANKS AND SET BITS IN CHANNEL 32).  IN THE EVENT THAT CHANNEL 32 BITS
007884,000032:                                                                                                  #  DIFFER FROM 'PVALVEST', THE RECORD OF ACTIONS TAKEN BY THIS ROUTINE, THE APPROPRIATE BITS IN 'CH5MASK' &
007885,000033:                                                                                                  #  'CH6MASK', USED BY THE DAP JET-SELECTION LOGIC, ARE UPDATED, AS IS 'PVALVEST'.  TO SPEED UP & SHORTEN THE
007886,000034:                                                                                                  #  ROUTINE, NO MORE THAN ONE CHANGE IS ACCEPTED PER ENTRY.  THE HIGHEST-NUMBERED BIT IN CHANNEL 32 WHICH REQUIRES
007887,000035:                                                                                                  #  ACTION IS THE ONE PROCESSED.
007888,000036: 
007889,000037:                                                                                                  #       THE CODING IN THE FAILURE MONITOR HAS BEEN WRITTEN SO AS TO HAVE ALMOST COMPLETE RESTART PROTECTION.  FOR
007890,000038:                                                                                                  #  EXAMPLE, NO ASSUMPTION IS MADE WHEN SETTING A 'CH5MASK' BIT TO 1 THAT THE PREVIOUS STATE IS 0, ALTHOUGH IT OF
007891,000039:                                                                                                  #  COURSE SHOULD BE.  ONE CASE WHICH MAY BE SEEN TO EVADE PROTECTION IS THE OCCURRENCE OF A RESTART AFTER UPDATING
007892,000040:                                                                                                  #  ONE OR BOTH DAP MASK-WORDS BUT BEFORE UPDATING 'PVALVEST', COUPLED WITH A CHANGE IN THE VALVE-BIT BACK TO ITS
007893,000041:                                                                                                  #  FORMER STATE.  THE CONSEQUENCE OF THIS IS THAT THE NEXT ENTRY WOULD NOT SEE THE CHANGE INCOMPLETELY INCORP-
007894,000042:                                                                                                  #  ORATED BY THE LAST PASS (BECAUSE IT WENT AWAY AT JUST THE RIGHT TIME), BUT THE DAP MASK-WORDS WILL BE INCORRECT.
007895,000043:                                                                                                  #  THIS COMBINATION OF EVENTS SEEMS QUITE REMOTE, BUT NOT IMPOSSIBLE UNLESS THE CREW OPERATES THE SWITCHES AT HALF-
007896,000044:                                                                                                  #  SECOND INTERVALS OR LONGER.  IN ANY EVENT, A DISAGREEMENT BETWEEN REALITY AND THE DAP MASKS WILL BE CURED IF
007897,000045:                                                                                                  #  THE MISINTERPRETED SWITCH IS REVERSED AND THEN RESTORED TO ITS CORRECT POSITION (SLOWLY).
007898,000046: 
007899,000047:                                                                                                  #  CALLING SEQUENCE:
007900,000048: 
007901,000049:                                                                                                  #           TCF    RCSMONIT        (IN INTERRUPT MODE, EVERY 480 MS.)
007902,000050: 
007903,000051:                                                                                                  #  EXIT:  TCF  RCSMONEX  (ALL PATHS EXIT VIA SUCH AN INSTRUCTION)
007904,000052: 06,3164     5270               RCSMONEX           EQUALS   RESUME                                
007905,000053: 
007906,000054:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
007907,000055: 
007908,000056:                                                                                                  #           VIA FRESH START:  PVALVEST          = +0  (ALL JETS ENABLED)
007909,000057:                                                                                                  #                             CH5MASK, CH6MASK  = +0  (ALL JETS OK)
007910,000058: 
007911,000059:                                                                                                  #  OUTPUT:  CH5MASK & CH6MASK UPDATED  (1'S WHERE JETS NOT TO BE USED, IN CHANNEL 5 & 6 FORMAT)
007912,000060:                                                                                                  #           PVALTEST UPDATED  (1,S WHEN VALVE CLOSURES HAVE BEEN TRANSLATED INTO CH5MASK & CH6MASK; CHAN 32 FORMAT)
007913,000061:                                                                                                  #           JOB TO DO 1/ACCS.
007914,000062: 
007915,000063:                                                                                                  #  DEBRIS:  A, L, Q AND DEBRIS OF NOVAC.
007916,000064: 
007917,000065:                                                                                                  #  SUBROUTINE CALLED:  NOVAC.
007918,000066: 
007919,000067: 06,3164     1257                                  EBANK=   CH5MASK                               
007920,000068: 
007921,000069: 23,2000                                           BANK     23                                    
007922,000070: 06,2000                                           SETLOC   RCSMONT                               
007923,000071: 06,2000                                           BANK                                           

Page 192

007925,000073: 06,3164                                           COUNT*   $$/T4RCS                              
007926,000074: 
007927,000075: 06,3164  06,3164               RCSMONIT           EQUALS   RCSMON                                
007928,000076: 
007929,000077: 06,3164           44755        RCSMON             CS       ZERO                                  
007930,000078: 06,3165           00006                           EXTEND                                         
007931,000079: 06,3166           06032                           RXOR     CHAN32                                #  PICK UP + INVERT INVERTED CHANNEL 32.
007932,000080: 06,3167           74357                           MASK     LOW8                                  #  KEEP JET-FAIL BITS ONLY.
007933,000081: 06,3170           54002                           TS       Q                                     
007934,000082: 
007935,000083: 06,3171           41273                           CS       PVALVEST                              #        -   -
007936,000084: 06,3172           70002                           MASK     Q                                     #  FORM PC + PC.
007937,000085: 06,3173           54001                           TS       L                                     #    (P = PREVIOUS ISOLATION VALVE STATE,
007938,000086: 06,3174           40002                           CS       Q                                     #     C = CURRENT VALVE STATE (CH32)).
007939,000087: 06,3175           71273                           MASK     PVALVEST                              
007940,000088: 06,3176           26001                           ADS      L                                     #  RESULT NZ INDICATES ACTION REQUIRED.
007941,000089: 
007942,000090: 06,3177           00006                           EXTEND                                         
007943,000091: 06,3200           15270                           BZF      RCSMONEX                              #  QUIT IF NO ACTION REQUIRED.
007944,000092: 
007945,000093: 06,3201           00006                           EXTEND                                         
007946,000094: 06,3202           74745                           MP       BIT7                                  #  MOVE BITS 8 - 1 OF A TO 14 - 7 OF L.
007947,000095: 06,3203           56001                           XCH      L                                     #  ZERO TO L IN THE PROCESS.
007948,000096: 
007949,000097: 06,3204           24001                 -3        INCR     L                                     
007950,000098: 06,3205           60000                           DOUBLE                                         #  BOUND TO GET OVERFLOW IN THIS LOOP,
007951,000099: 06,3206           54000                           OVSK                                           #  SINCE WE ASSURED INITIAL NZ IN A.
007952,000100: 06,3207           13204                           TCF      -3                                    
007953,000101: 
007954,000102: 06,3210           50001                           INDEX    L                                     
007955,000103: 06,3211           34743                           CA       BIT8       -1                         #  SAVE THE RELEVANT BIT (8 - 1).
007956,000104: 06,3212           54002                           TS       Q                                     
007957,000105: 06,3213           71273                           MASK     PVALVEST                              #  LOOK AT PREVIOUS VALVE STATE BIT.
007958,000106: 06,3214           10000                           CCS      A                                     
007959,000107: 06,3215           13231                           TCF      VOPENED                               #  THE VALVE HAS JUST BEEN OPENED.
007960,000108: 
007961,000109: 06,3216           41257                           CS       CH5MASK                               #  THE VALVE HAS JUST BEEN CLOSED.
007962,000110: 06,3217           50001                           INDEX    L                                     
007963,000111: 06,3220           73250                           MASK     5FAILTAB                              
007964,000112: 06,3221           27257                           ADS      CH5MASK                               #  SET INHIBIT BIT FOR CHANNEL 5 JET.
007965,000113: 
007966,000114: 06,3222           41260                           CS       CH6MASK                               
007967,000115: 06,3223           50001                           INDEX    L                                     
007968,000116: 06,3224           73260                           MASK     6FAILTAB                              
007969,000117: 06,3225           27260                           ADS      CH6MASK                               #  SET INGIBIT BIT FOR CHANNEL 6 JET.
007970,000118: 
007971,000119: 06,3226           30002                           CA       Q                                     
007972,000120: 06,3227           27273                           ADS      PVALVEST                              #  RECORD ACTION TAKEN.
007973,000121: 
007974,000122: 06,3230           13244                           TCF      1/ACCFIX                              #  SET UP 1/ACCJOB AND EXIT.
007975,000123: 

Page 193

007977,000125: 06,3231           50001        VOPENED            INDEX    L                                     #  A VALVE HAS JUST BEEN OPENED.
007978,000126: 06,3232           43250                           CS       5FAILTAB                              
007979,000127: 06,3233           71257                           MASK     CH5MASK                               
007980,000128: 06,3234           55257                           TS       CH5MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 5 JET.
007981,000129: 
007982,000130: 06,3235           50001                           INDEX    L                                     
007983,000131: 06,3236           43260                           CS       6FAILTAB                              
007984,000132: 06,3237           71260                           MASK     CH6MASK                               
007985,000133: 06,3240           55260                           TS       CH6MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 6 JET.
007986,000134: 
007987,000135: 06,3241           40002                           CS       Q                                     
007988,000136: 06,3242           71273                           MASK     PVALVEST                              
007989,000137: 06,3243           55273                           TS       PVALVEST                              #  RECORD ACTION TAKEN.
007990,000138: 
007991,000139: 06,3244           37720        1/ACCFIX           CAF      PRIO27                                #  SET UP 1/ACCS SO THAT THE SWITCH CURVES
007992,000140: 06,3245           05072                           TC       NOVAC                                 #    FOR TJETLAW CAN BE MODIFIED IF CH5MASK
007993,000141: 06,3246  E6,1537                                  EBANK=   AOSQ                                  #    HAS BEEN ALTERED.
007994,000142: 06,3246           03644 42106                     2CADR    1/ACCJOB                              
007995,000143: 
007996,000144: 06,3250           15270                           TCF      RCSMONEX                              #  EXIT.
007997,000145: 
007998,000146: 
007999,000147: 06,3251                        5FAILTAB           EQUALS   -1                                    #  CH 5 JET BIT CORRESPONDING TO CH 32 BIT:
008000,000148: 06,3251           00040                           OCT      00040                                 #  8
008001,000149: 06,3252           00020                           OCT      00020                                 #  7
008002,000150: 06,3253           00100                           OCT      00100                                 #  6
008003,000151: 06,3254           00200                           OCT      00200                                 #  5
008004,000152: 06,3255           00010                           OCT      00010                                 #  4
008005,000153: 06,3256           00001                           OCT      00001                                 #  3
008006,000154: 06,3257           00004                           OCT      00004                                 #  2
008007,000155: 06,3260           00002                           OCT      00002                                 #  1
008008,000156: 
008009,000157: 06,3261                        6FAILTAB           EQUALS   -1                                    #  CH 6 JET BIT CORRESPONDING TO CH 32 BIT:
008010,000158: 06,3261           00010                           OCT      00010                                 #  8
008011,000159: 06,3262           00020                           OCT      00020                                 #  7
008012,000160: 06,3263           00004                           OCT      00004                                 #  6
008013,000161: 06,3264           00200                           OCT      00200                                 #  5
008014,000162: 06,3265           00001                           OCT      00001                                 #  4
008015,000163: 06,3266           00002                           OCT      00002                                 #  3
008016,000164: 06,3267           00040                           OCT      00040                                 #  2
008017,000165: 06,3270           00100                           OCT      00100                                 #  1

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