Source Code

This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the second release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 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.

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

Page 190

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

Page 191

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

Page 192

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

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