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.

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

Page 191

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

Page 192

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

Page 193

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

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