Source Code

These source-code files are part of a reconstructed copy of Luminary 69/2, the flown, final release of the Apollo 10 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction is based on the source code of Luminary 69 — i.e., the initial, unflown version, "revision 0" — of which a contemporary listing was available. The code was then updated by incorporating the differences between Luminary 69 and Luminary 69/2, known from other contemporary documentation. The only such difference is the implementation in Luminary 69/2 of the "R-2 Lunar Potential Model", the source code for which was taken from program Luminary 99/1 (Apollo 11 LM), of which a contemporary listing was also available. Finally, the now-reconstructed Luminary 69/2 was then validated by assembling it to executable form and verifying that its memory banks had the correct checksums, known from still other contemporary documentation.

Note that page numbers in the reconstructed code match those in the original Luminary 69 program listing, or in the ORBITAL INTEGRATION log section, in Luminary 99/1. Page numbers would certainly differ somewhat in a contemporary Luminary 69/2 listing. Moreover, annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change in Luminary 69/2 relative to Luminary 69. Here's a guide to the Apollo documentation referenced in those annotations:
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.

008914,000002:                                                                                                  ## Copyright:   Public domain.
008915,000003:                                                                                                  ## Filename:    RCS_FAILURE_MONITOR.agc
008916,000004:                                                                                                  ## Purpose:     A section of LUM69 revision 2.
008917,000005:                                                                                                  ##              It is part of the reconstructed source code for the flown
008918,000006:                                                                                                  ##              version of the flight software for the Lunar Module's (LM)
008919,000007:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 10. The code has
008920,000008:                                                                                                  ##              been recreated from a copy of Luminary revsion 069, using
008921,000009:                                                                                                  ##              changes present in Luminary 099 which were described in
008922,000010:                                                                                                  ##              Luminary memos 75 and 78. The code has been adapted such
008923,000011:                                                                                                  ##              that the resulting bugger words exactly match those specified
008924,000012:                                                                                                  ##              for LUM69 revision 2 in NASA drawing 2021152B, which gives
008925,000013:                                                                                                  ##              relatively high confidence that the reconstruction is correct.
008926,000014:                                                                                                  ## Reference:   pp. 205-207
008927,000015:                                                                                                  ## Assembler:   yaYUL
008928,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
008929,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
008930,000018:                                                                                                  ## Mod history: 2019-07-27 MAS  Created from Luminary 69.
008931,000019: 

Page 205

008933,000021:                                                                                                  #  PROGRAM DESCRIPTION
008934,000022: 
008935,000023:                                                                                                  #  AUTHOR:  J S MILLER
008936,000024: 
008937,000025:                                                                                                  #  MODIFIED 6 MARCH 1968 BY P S WEISSMAN TO SET UP JOB FOR 1/ACCS WHEN THE MASKS ARE CHANGED.
008938,000026: 
008939,000027:                                                                                                  #       THIS ROUTINE IS ATTACHED TO T4RUPT, AND IS ENTERED EVERY 480 MS.  ITS FUNCTION IS TO EXAMINE THE LOW 8 BITS
008940,000028:                                                                                                  #  OF CHANNEL 32 TO SEE IF ANY ISOLATION-VALVE CLOSURE BITS HAVE APPEARED OR DISAPPEARED (THE CREW IS WARNED OF JET
008941,000029:                                                                                                  #  FAILURES BY LAMPS LIT BY THE GRUMMAN FAILURE-DETECTION CIRCUITRY; THEY MAY RESPOND BY OPERATING SWITCHES WHICH
008942,000030:                                                                                                  #  ISOLATE PAIRS OF JETS FROM THE PROPELLANT TANKS AND SET BITS IN CHANNEL 32).  IN THE EVENT THAT CHANNEL 32 BITS
008943,000031:                                                                                                  #  DIFFER FROM 'PVALVEST', THE RECORD OF ACTIONS TAKEN BY THIS ROUTINE, THE APPROPRIATE BITS IN 'CH5MASK' &
008944,000032:                                                                                                  #  'CH6MASK', USED BY THE DAP JET-SELECTION LOGIC, ARE UPDATED, AS IS 'PVALVEST'.  TO SPEED UP & SHORTEN THE
008945,000033:                                                                                                  #  ROUTINE, NO MORE THAN ONE CHANGE IS ACCEPTED PER ENTRY.  THE HIGHEST-NUMBERED BIT IN CHANNEL 32 WHICH REQUIRES
008946,000034:                                                                                                  #  ACTION IS THE ONE PROCESSED.
008947,000035: 
008948,000036:                                                                                                  #       THE CODING IN THE FAILURE MONITOR HAS BEEN WRITTEN SO AS TO HAVE ALMOST COMPLETE RESTART PROTECTION.  FOR
008949,000037:                                                                                                  #  EXAMPLE, NO ASSUMPTION IS MADE WHEN SETTING A 'CH5MASK' BIT TO 1 THAT THE PREVIOUS STATE IS 0, ALTHOUGH IT OF
008950,000038:                                                                                                  #  COURSE SHOULD BE.  ONE CASE WHICH MAY BE SEEN TO EVADE PROTECTION IS THE OCCURRENCE OF A RESTART AFTER UPDATING
008951,000039:                                                                                                  #  ONE OR BOTH DAP MASK-WORDS BUT BEFORE UPDATING 'PVALVEST', COUPLED WITH A CHANGE IN THE VALVE-BIT BACK TO ITS
008952,000040:                                                                                                  #  FORMER STATE.  THE CONSEQUENCE OF THIS IS THAT THE NEXT ENTRY WOULD NOT SEE THE CHANGE INCOMPLETELY INCORP-
008953,000041:                                                                                                  #  ORATED BY THE LAST PASS (BECAUSE IT WENT AWAY AT JUST THE RIGHT TIME), BUT THE DAP MASK-WORDS WILL BE INCORRECT.
008954,000042:                                                                                                  #  THIS COMBINATION OF EVENTS SEEMS QUITE REMOTE, BUT NOT IMPOSSIBLE UNLESS THE CREW OPERATES THE SWITCHES AT HALF-
008955,000043:                                                                                                  #  SECOND INTERVALS OR LONGER.  IN ANY EVENT, A DISAGREEMENT BETWEEN REALITY AND THE DAP MASKS WILL BE CURED IF
008956,000044:                                                                                                  #  THE MISINTERPRETED SWITCH IS REVERSED AND THEN RESTORED TO ITS CORRECT POSITION (SLOWLY).
008957,000045: 
008958,000046:                                                                                                  #  CALLING SEQUENCE:
008959,000047: 
008960,000048:                                                                                                  #           TCF    RCSMONIT        (IN INTERRUPT MODE, EVERY 480 MS.)
008961,000049: 
008962,000050:                                                                                                  #  EXIT:  TCF  RCSMONEX  (ALL PATHS EXIT VIA SUCH AN INSTRUCTION)
008963,000051: 06,3156     5270               RCSMONEX           EQUALS   RESUME                                
008964,000052: 
008965,000053:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
008966,000054: 
008967,000055:                                                                                                  #           VIA FRESH START:  PVALVEST          = +0  (ALL JETS ENABLED)
008968,000056:                                                                                                  #                             CH5MASK, CH6MASK  = +0  (ALL JETS OK)
008969,000057: 
008970,000058:                                                                                                  #  OUTPUT:  CH5MASK & CH6MASK UPDATED  (1'S WHERE JETS NOT TO BE USED, IN CHANNEL 5 & 6 FORMAT)
008971,000059:                                                                                                  #           PVALTEST UPDATED  (1,S WHEN VALVE CLOSURES HAVE BEEN TRANSLATED INTO CH5MASK & CH6MASK; CHAN 32 FORMAT)
008972,000060:                                                                                                  #           JOB TO DO 1/ACCS.
008973,000061: 
008974,000062:                                                                                                  #  DEBRIS:  A, L, Q AND DEBRIS OF NOVAC.
008975,000063: 
008976,000064:                                                                                                  #  SUBROUTINE CALLED:  NOVAC.
008977,000065: 
008978,000066: 06,3156     1262                                  EBANK=   CH5MASK                               
008979,000067: 
008980,000068: 23,2000                                           BANK     23                                    
008981,000069: 06,2000                                           SETLOC   RCSMONT                               
008982,000070: 06,2000                                           BANK                                           
008983,000071: 

Page 206

008985,000073: 06,3156                                           COUNT*   $$/T4RCS                              
008986,000074: 
008987,000075: 06,3156  06,3156               RCSMONIT           EQUALS   RCSMON                                
008988,000076: 
008989,000077: 06,3156           44755        RCSMON             CS       ZERO                                  
008990,000078: 06,3157           00006                           EXTEND                                         
008991,000079: 06,3160           06032                           RXOR     CHAN32                                #  PICK UP + INVERT INVERTED CHANNEL 32.
008992,000080: 06,3161           74357                           MASK     LOW8                                  #  KEEP JET-FAIL BITS ONLY.
008993,000081: 06,3162           54002                           TS       Q                                     
008994,000082: 
008995,000083: 06,3163           41276                           CS       PVALVEST                              #        -   -
008996,000084: 06,3164           70002                           MASK     Q                                     #  FORM PC + PC.
008997,000085: 06,3165           54001                           TS       L                                     #    (P = PREVIOUS ISOLATION VALVE STATE,
008998,000086: 06,3166           40002                           CS       Q                                     #     C = CURRENT VALVE STATE (CH32)).
008999,000087: 06,3167           71276                           MASK     PVALVEST                              
009000,000088: 06,3170           26001                           ADS      L                                     #  RESULT NZ INDICATES ACTION REQUIRED.
009001,000089: 
009002,000090: 06,3171           00006                           EXTEND                                         
009003,000091: 06,3172           15270                           BZF      RCSMONEX                              #  QUIT IF NO ACTION REQUIRED.
009004,000092: 
009005,000093: 06,3173           00006                           EXTEND                                         
009006,000094: 06,3174           74745                           MP       BIT7                                  #  MOVE BITS 8 - 1 OF A TO 14 - 7 OF L.
009007,000095: 06,3175           56001                           XCH      L                                     #  ZERO TO L IN THE PROCESS.
009008,000096: 
009009,000097: 06,3176           24001                 -3        INCR     L                                     
009010,000098: 06,3177           60000                           DOUBLE                                         #  BOUND TO GET OVERFLOW IN THIS LOOP,
009011,000099: 06,3200           54000                           OVSK                                           #  SINCE WE ASSURED INITIAL NZ IN A.
009012,000100: 06,3201           13176                           TCF      -3                                    
009013,000101: 
009014,000102: 06,3202           50001                           INDEX    L                                     
009015,000103: 06,3203           34743                           CA       BIT8       -1                         #  SAVE THE RELEVANT BIT (8 - 1).
009016,000104: 06,3204           54002                           TS       Q                                     
009017,000105: 06,3205           71276                           MASK     PVALVEST                              #  LOOK AT PREVIOUS VALVE STATE BIT.
009018,000106: 06,3206           10000                           CCS      A                                     
009019,000107: 06,3207           13223                           TCF      VOPENED                               #  THE VALVE HAS JUST BEEN OPENED.
009020,000108: 
009021,000109: 06,3210           41262                           CS       CH5MASK                               #  THE VALVE HAS JUST BEEN CLOSED.
009022,000110: 06,3211           50001                           INDEX    L                                     
009023,000111: 06,3212           73242                           MASK     5FAILTAB                              
009024,000112: 06,3213           27262                           ADS      CH5MASK                               #  SET INHIBIT BIT FOR CHANNEL 5 JET.
009025,000113: 
009026,000114: 06,3214           41263                           CS       CH6MASK                               
009027,000115: 06,3215           50001                           INDEX    L                                     
009028,000116: 06,3216           73252                           MASK     6FAILTAB                              
009029,000117: 06,3217           27263                           ADS      CH6MASK                               #  SET INGIBIT BIT FOR CHANNEL 6 JET.
009030,000118: 
009031,000119: 06,3220           30002                           CA       Q                                     
009032,000120: 06,3221           27276                           ADS      PVALVEST                              #  RECORD ACTION TAKEN.
009033,000121: 
009034,000122: 06,3222           13236                           TCF      1/ACCFIX                              #  SET UP 1/ACCJOB AND EXIT.
009035,000123: 

Page 207

009037,000125: 06,3223           50001        VOPENED            INDEX    L                                     #  A VALVE HAS JUST BEEN OPENED.
009038,000126: 06,3224           43242                           CS       5FAILTAB                              
009039,000127: 06,3225           71262                           MASK     CH5MASK                               
009040,000128: 06,3226           55262                           TS       CH5MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 5 JET.
009041,000129: 
009042,000130: 06,3227           50001                           INDEX    L                                     
009043,000131: 06,3230           43252                           CS       6FAILTAB                              
009044,000132: 06,3231           71263                           MASK     CH6MASK                               
009045,000133: 06,3232           55263                           TS       CH6MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 6 JET.
009046,000134: 
009047,000135: 06,3233           40002                           CS       Q                                     
009048,000136: 06,3234           71276                           MASK     PVALVEST                              
009049,000137: 06,3235           55276                           TS       PVALVEST                              #  RECORD ACTION TAKEN.
009050,000138: 
009051,000139: 06,3236           37714        1/ACCFIX           CAF      PRIO27                                #  SET UP 1/ACCS SO THAT THE SWITCH CURVES
009052,000140: 06,3237           05072                           TC       NOVAC                                 #    FOR TJETLAW CAN BE MODIFIED IF CH5MASK
009053,000141: 06,3240  E6,1537                                  EBANK=   AOSQ                                  #    HAS BEEN ALTERED.
009054,000142: 06,3240           02454 40106                     2CADR    1/ACCJOB                              
009055,000143: 
009056,000144: 06,3242           15270                           TCF      RCSMONEX                              #  EXIT.
009057,000145: 
009058,000146: 06,3243                        5FAILTAB           EQUALS   -1                                    #  CH 5 JET BIT CORRESPONDING TO CH 32 BIT:
009059,000147: 06,3243           00040                           OCT      00040                                 #  8
009060,000148: 06,3244           00020                           OCT      00020                                 #  7
009061,000149: 06,3245           00100                           OCT      00100                                 #  6
009062,000150: 06,3246           00200                           OCT      00200                                 #  5
009063,000151: 06,3247           00010                           OCT      00010                                 #  4
009064,000152: 06,3250           00001                           OCT      00001                                 #  3
009065,000153: 06,3251           00004                           OCT      00004                                 #  2
009066,000154: 06,3252           00002                           OCT      00002                                 #  1
009067,000155: 
009068,000156: 06,3253                        6FAILTAB           EQUALS   -1                                    #  CH 6 JET BIT CORRESPONDING TO CH 32 BIT:
009069,000157: 06,3253           00010                           OCT      00010                                 #  8
009070,000158: 06,3254           00020                           OCT      00020                                 #  7
009071,000159: 06,3255           00004                           OCT      00004                                 #  6
009072,000160: 06,3256           00200                           OCT      00200                                 #  5
009073,000161: 06,3257           00001                           OCT      00001                                 #  4
009074,000162: 06,3260           00002                           OCT      00002                                 #  3
009075,000163: 06,3261           00040                           OCT      00040                                 #  2
009076,000164: 06,3262           00100                           OCT      00100                                 #  1

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