Source Code

This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the third release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 96 and 97. A bug (which had been around since at least Apollo 10, Luminary 69) was discovered in Rev 0 shortly before the Apollo 11 flight, resulting in a last minute revision into Rev 1, which is what actually flew rather than the Rev 0 presented here. A hardcopy of Rev 0 is known to exist — it belonged to AGC developer Allan Klumpp for many years — but unfortunately the Virtual AGC Project has not had access to that hardcopy. Thus the code you see here had been reconstructed (we believe accurately) rather than transcribed. The first step of the reconstruction of the Rev 0 source code was the transcription of the Rev 1 source code from a hardcopy in the MIT Museum collection. The process of reverting the active portion of the source code (i.e., other than program comments) from Rev 1 to Rev 0 was very minor, consisting only of moving the position of the STARTSB1 label in FRESH START AND RESTART. Allan had previously given us the checksums of the memory banks of Rev 0, and we have verified the program presented here has checksums identical to all banks of Allan's listing of Rev 0. The notations on Allan's Rev 0 program listing read, in part:

	GAP:  ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-051

A single program comment is known to differ between Rev 0 and Rev 1, but these are harder to reconstruct and verify than changes to the active portion of the code. Thus it is possible that there are additional differences between the program comments in Rev 0 and Rev 1 that are unknown to us, and therefore are not reflected in the code presented here.

007819,000002:                                                                                                  ## Copyright:   Public domain.
007820,000003:                                                                                                  ## Filename:    RCS_FAILURE_MONITOR.agc
007821,000004:                                                                                                  ## Purpose:     Part of the reconstructed source code for LMY99 Rev 0,
007822,000005:                                                                                                  ##              otherwise known as Luminary Rev 99, the third release
007823,000006:                                                                                                  ##              of the Apollo Guidance Computer (AGC) software for Apollo 11.
007824,000007:                                                                                                  ##              It differs from LMY99 Rev 1 (the flown version) only in the
007825,000008:                                                                                                  ##              placement of a single label. The corrections shown here have
007826,000009:                                                                                                  ##              been verified to have the same bank checksums as AGC developer
007827,000010:                                                                                                  ##              Allan Klumpp's copy of Luminary Rev 99, and so are believed
007828,000011:                                                                                                  ##              to be accurate. This file is intended to be a faithful 
007829,000012:                                                                                                  ##              recreation, except that the code format has been changed to 
007830,000013:                                                                                                  ##              conform to the requirements of the yaYUL assembler rather than 
007831,000014:                                                                                                  ##              the original YUL assembler.
007832,000015:                                                                                                  ##
007833,000016:                                                                                                  ## Assembler:   yaYUL
007834,000017:                                                                                                  ## Contact:     Hartmuth Gutsche <hgutsche@xplornet.com>.
007835,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo.
007836,000019:                                                                                                  ## Pages:       190-192
007837,000020:                                                                                                  ## Mod history: 2009-05-19 HG   Transcribed from page images.
007838,000021:                                                                                                  ##              2016-12-13 RSB  Proofed text comments with octopus/ProoferComments
007839,000022:                                                                                                  ##                              and corrected the errors found.
007840,000023:                                                                                                  ##              2017-03-14 RSB  Comment-text fixes noted in proofing Luminary 116.
007841,000024:                                                                                                  ##              2017-08-01 MAS  Created from LMY99 Rev 1.
007842,000025:                                                                                                  ##              2017-08-18 RSB  Comment-text bug identified in ZERLINA 56.
007843,000026: 
007844,000027:                                                                                                  ## This source code has been transcribed or otherwise adapted from
007845,000028:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
007846,000029:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
007847,000030:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
007848,000031:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
007849,000032:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
007850,000033:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
007851,000034:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
007852,000035:                                                                                                  ## actually created.
007853,000036:                                                                                                  ##
007854,000037:                                                                                                  ## The code has been modified to match LMY99 Revision 0, otherwise
007855,000038:                                                                                                  ## known as Luminary Revision 99, the Apollo 11 software release preceeding
007856,000039:                                                                                                  ## the listing from which it was transcribed. It has been verified to
007857,000040:                                                                                                  ## contain the same bank checksums as AGC developer Allan Klumpp's listing
007858,000041:                                                                                                  ## of Luminary Revision 99 (for which we do not have scans).
007859,000042:                                                                                                  ##
007860,000043:                                                                                                  ## Notations on Allan Klumpp's listing read, in part:
007861,000044:                                                                                                  ##
007862,000045:                                                                                                  ##      ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
007863,000046: 

Page 190

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

Page 191

007917,000100: 06,3156                                           COUNT*   $$/T4RCS                              
007918,000101: 
007919,000102: 06,3156  06,3156               RCSMONIT           EQUALS   RCSMON                                
007920,000103: 
007921,000104: 06,3156           44755        RCSMON             CS       ZERO                                  
007922,000105: 06,3157           00006                           EXTEND                                         
007923,000106: 06,3160           06032                           RXOR     CHAN32                                #  PICK UP + INVERT INVERTED CHANNEL 32.
007924,000107: 06,3161           74357                           MASK     LOW8                                  #  KEEP JET-FAIL BITS ONLY.
007925,000108: 06,3162           54002                           TS       Q                                     
007926,000109: 
007927,000110: 06,3163           41276                           CS       PVALVEST                              #        -   -
007928,000111: 06,3164           70002                           MASK     Q                                     #  FORM PC + PC.
007929,000112: 06,3165           54001                           TS       L                                     #        (P = PREVIOUS ISOLATION VALVE STATE,
007930,000113: 06,3166           40002                           CS       Q                                     #         C = CURRENT VALVE STATE (CH32)).
007931,000114: 06,3167           71276                           MASK     PVALVEST                              
007932,000115: 06,3170           26001                           ADS      L                                     #  RESULT NZ INDICATES ACTION REQUIRED.
007933,000116: 
007934,000117: 06,3171           00006                           EXTEND                                         
007935,000118: 06,3172           15270                           BZF      RCSMONEX                              #  QUIT IF NO ACTION REQUIRED.
007936,000119: 
007937,000120: 06,3173           00006                           EXTEND                                         
007938,000121: 06,3174           74745                           MP       BIT7                                  #  MOVE BITS 8-1 OF A TO 14-7 OF L.
007939,000122: 06,3175           56001                           XCH      L                                     #  ZERO TO L IN THE PROCESS.
007940,000123: 
007941,000124: 06,3176           24001                 -3        INCR     L                                     
007942,000125: 06,3177           60000                           DOUBLE                                         #  BOUND TO GET OVERFLOW IN THIS LOOP,
007943,000126: 06,3200           54000                           OVSK                                           #  SINCE WE ASSURED INITIAL NZ IN A.
007944,000127: 06,3201           13176                           TCF      -3                                    
007945,000128: 
007946,000129: 06,3202           50001                           INDEX    L                                     
007947,000130: 06,3203           34743                           CA       BIT8       -1                         #  SAVE THE RELEVANT BIT (8-1).
007948,000131: 06,3204           54002                           TS       Q                                     
007949,000132: 06,3205           71276                           MASK     PVALVEST                              #  LOOK AT PREVIOUS VALVE STATE BIT.
007950,000133: 06,3206           10000                           CCS      A                                     
007951,000134: 06,3207           13223                           TCF      VOPENED                               #  THE VALVE HAS JUST BEEN OPENED.
007952,000135: 
007953,000136: 06,3210           41262                           CS       CH5MASK                               #  THE VALVE HAS JUST BEEN CLOSED.
007954,000137: 06,3211           50001                           INDEX    L                                     
007955,000138: 06,3212           73242                           MASK     5FAILTAB                              
007956,000139: 06,3213           27262                           ADS      CH5MASK                               #  SET INHIBIT BIT FOR CHANNEL 5 JET.
007957,000140: 
007958,000141: 06,3214           41263                           CS       CH6MASK                               
007959,000142: 06,3215           50001                           INDEX    L                                     
007960,000143: 06,3216           73252                           MASK     6FAILTAB                              
007961,000144: 06,3217           27263                           ADS      CH6MASK                               #  SET INGIBIT BIT FOR CHANNEL 6 JET.
007962,000145: 
007963,000146: 06,3220           30002                           CA       Q                                     
007964,000147: 06,3221           27276                           ADS      PVALVEST                              #  RECORD ACTION TAKEN.
007965,000148: 
007966,000149: 06,3222           13236                           TCF      1/ACCFIX                              #  SET UP 1/ACCJOB AND EXIT.
007967,000150: 

Page 192

007969,000152: 06,3223           50001        VOPENED            INDEX    L                                     #  A VALVE HAS JUST BEEN OPENED.
007970,000153: 06,3224           43242                           CS       5FAILTAB                              
007971,000154: 06,3225           71262                           MASK     CH5MASK                               
007972,000155: 06,3226           55262                           TS       CH5MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 5 JET.
007973,000156: 
007974,000157: 06,3227           50001                           INDEX    L                                     
007975,000158: 06,3230           43252                           CS       6FAILTAB                              
007976,000159: 06,3231           71263                           MASK     CH6MASK                               
007977,000160: 06,3232           55263                           TS       CH6MASK                               #  REMOVE INHIBIT BIT FOR CHANNEL 6 JET.
007978,000161: 
007979,000162: 06,3233           40002                           CS       Q                                     
007980,000163: 06,3234           71276                           MASK     PVALVEST                              
007981,000164: 06,3235           55276                           TS       PVALVEST                              #  RECORD ACTION TAKEN.
007982,000165: 
007983,000166: 06,3236           37715        1/ACCFIX           CAF      PRIO27                                #  SET UP 1/ACCS SO THAT THE SWITCH CURVES
007984,000167: 06,3237           05072                           TC       NOVAC                                 #        FOR TJETLAW CAN BE MODIFIED IF CH5MASK
007985,000168: 06,3240  E6,1537                                  EBANK=   AOSQ                                  #        HAS BEEN ALTERED.
007986,000169: 06,3240           02454 40106                     2CADR    1/ACCJOB                              
007987,000170: 
007988,000171: 06,3242           15270                           TCF      RCSMONEX                              #  EXIT.
007989,000172: 
007990,000173: 06,3243                        5FAILTAB           EQUALS   -1                                    #  CH 5 JET BIT CORRESPONDING TO CH 32 BIT:
007991,000174: 06,3243           00040                           OCT      00040                                 #  8
007992,000175: 06,3244           00020                           OCT      00020                                 #  7
007993,000176: 06,3245           00100                           OCT      00100                                 #  6
007994,000177: 06,3246           00200                           OCT      00200                                 #  5
007995,000178: 06,3247           00010                           OCT      00010                                 #  4
007996,000179: 06,3250           00001                           OCT      00001                                 #  3
007997,000180: 06,3251           00004                           OCT      00004                                 #  2
007998,000181: 06,3252           00002                           OCT      00002                                 #  1
007999,000182: 
008000,000183: 06,3253                        6FAILTAB           EQUALS   -1                                    #  CH 6 JET BIT CORRESPONDING TO CH 32 BIT:
008001,000184: 06,3253           00010                           OCT      00010                                 #  8
008002,000185: 06,3254           00020                           OCT      00020                                 #  7
008003,000186: 06,3255           00004                           OCT      00004                                 #  6
008004,000187: 06,3256           00200                           OCT      00200                                 #  5
008005,000188: 06,3257           00001                           OCT      00001                                 #  4
008006,000189: 06,3260           00002                           OCT      00002                                 #  3
008007,000190: 06,3261           00040                           OCT      00040                                 #  2
008008,000191: 06,3262           00100                           OCT      00100                                 #  1
008009,000192: 
008010,000193: 

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