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.

058422,000002:                                                                                                  ## Copyright:   Public domain.
058423,000003:                                                                                                  ## Filename:    KEYRUPT,_UPRUPT.agc
058424,000004:                                                                                                  ## Purpose:     Part of the reconstructed source code for LMY99 Rev 0,
058425,000005:                                                                                                  ##              otherwise known as Luminary Rev 99, the second release
058426,000006:                                                                                                  ##              of the Apollo Guidance Computer (AGC) software for Apollo 11.
058427,000007:                                                                                                  ##              It differs from LMY99 Rev 1 (the flown version) only in the
058428,000008:                                                                                                  ##              placement of a single label. The corrections shown here have
058429,000009:                                                                                                  ##              been verified to have the same bank checksums as AGC developer
058430,000010:                                                                                                  ##              Allan Klumpp's copy of Luminary Rev 99, and so are believed
058431,000011:                                                                                                  ##              to be accurate. This file is intended to be a faithful 
058432,000012:                                                                                                  ##              recreation, except that the code format has been changed to 
058433,000013:                                                                                                  ##              conform to the requirements of the yaYUL assembler rather than 
058434,000014:                                                                                                  ##              the original YUL assembler.
058435,000015:                                                                                                  ##
058436,000016:                                                                                                  ## Assembler:   yaYUL
058437,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
058438,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo.
058439,000019:                                                                                                  ## Pages:       1338-1340
058440,000020:                                                                                                  ## Mod history: 2009-05-27 RSB  Adapted from the corresponding 
058441,000021:                                                                                                  ##                              Luminary131 file, using page 
058442,000022:                                                                                                  ##                              images from Luminary 1A.
058443,000023:                                                                                                  ##              2016-12-18 RSB  Proofed text comments with octopus/ProoferComments
058444,000024:                                                                                                  ##                              and corrected the errors found.
058445,000025:                                                                                                  ##              2017-08-01 MAS  Created from LMY99 Rev 1.
058446,000026: 
058447,000027:                                                                                                  ## This source code has been transcribed or otherwise adapted from
058448,000028:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
058449,000029:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
058450,000030:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
058451,000031:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
058452,000032:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
058453,000033:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
058454,000034:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
058455,000035:                                                                                                  ## actually created.
058456,000036:                                                                                                  ##
058457,000037:                                                                                                  ## The code has been modified to match LMY99 Revision 0, otherwise
058458,000038:                                                                                                  ## known as Luminary Revision 99, the Apollo 11 software release preceeding
058459,000039:                                                                                                  ## the listing from which it was transcribed. It has been verified to
058460,000040:                                                                                                  ## contain the same bank checksums as AGC developer Allan Klumpp's listing
058461,000041:                                                                                                  ## of Luminary Revision 99 (for which we do not have scans).
058462,000042:                                                                                                  ##
058463,000043:                                                                                                  ## Notations on Allan Klumpp's listing read, in part:
058464,000044:                                                                                                  ##
058465,000045:                                                                                                  ##      ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
058466,000046: 

Page 1338

058468,000048: 14,3774                                           BANK     14                                    
058469,000049: 04,2000                                           SETLOC   KEYRUPT                               
058470,000050: 04,2000                                           BANK                                           
058471,000051: 04,3274                                           COUNT*   $$/KEYUP                              
058472,000052: 
058473,000053: 04,3274           54016        KEYRUPT1           TS       BANKRUPT                              
058474,000054: 04,3275           56002                           XCH      Q                                     
058475,000055: 04,3276           54012                           TS       QRUPT                                 
058476,000056: 04,3277           04400                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
058477,000057: 04,3300           34346                           CAF      LOW5                                  
058478,000058: 04,3301           00006                           EXTEND                                         
058479,000059: 04,3302           02015                           RAND     MNKEYIN                               #  CHECK IF KEYS 5M-1M ON
058480,000060: 04,3303           54073        KEYCOM             TS       RUPTREG4                              
058481,000061: 04,3304           40101                           CS       FLAGWRD5                              
058482,000062: 04,3305           74735                           MASK     DSKYFBIT                              
058483,000063: 04,3306           26101                           ADS      FLAGWRD5                              
058484,000064: 
058485,000065: 04,3307           34355        ACCEPTUP           CAF      CHRPRIO                               #  (NOTE: RUPTREG4 = KEYTEMP1)
058486,000066: 04,3310           05072                           TC       NOVAC                                 
058487,000067: 04,3311     0777                                  EBANK=   DSPCOUNT                              
058488,000068: 04,3311           02077 60101                     2CADR    CHARIN                                
058489,000069: 
058490,000070: 04,3313           30073                           CA       RUPTREG4                              
058491,000071: 04,3314           50064                           INDEX    LOCCTR                                
058492,000072: 04,3315           54154                           TS       MPAC                                  #  LEAVE 5 BIT KEY CDE IN MPAC FOR CHARIN
058493,000073: 04,3316           05270                           TC       RESUME                                
058494,000074: 

Page 1339

058496,000076:                                                                                                  #  UPRUPT PROGRAM
058497,000077: 
058498,000078: 04,3317           54016        UPRUPT             TS       BANKRUPT                              
058499,000079: 04,3320           56002                           XCH      Q                                     
058500,000080: 04,3321           54012                           TS       QRUPT                                 
058501,000081: 04,3322           04400                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
058502,000082: 04,3323           34755                           CAF      ZERO                                  
058503,000083: 04,3324           56045                           XCH      INLINK                                
058504,000084: 04,3325           54073                           TS       KEYTEMP1                              
058505,000085: 04,3326           34751                           CAF      BIT3                                  #  TURN ON UPACT LIGHT
058506,000086: 04,3327           00006                           EXTEND                                         #  (BIT 3 OF CHANNEL 11)
058507,000087: 04,3330           05011                           WOR      DSALMOUT                              
058508,000088: 04,3331           34346        UPRPT1             CAF      LOW5                                  #  TEST FOR TRIPLE CHAR REDUNDANCY
058509,000089: 04,3332           70073                           MASK     KEYTEMP1                              #  LOW5 OF WORD
058510,000090: 04,3333           56073                           XCH      KEYTEMP1                              #  LOW5 INTO KEYTEMP1
058511,000091: 04,3334           00006                           EXTEND                                         
058512,000092: 04,3335           74742                           MP       BIT10                                 #  SHIFT RIGHT 5
058513,000093: 04,3336           54734                           TS       KEYTEMP2                              
058514,000094: 04,3337           74346                           MASK     LOW5                                  #  MID 5
058515,000095: 04,3340           63374                           AD       HI10                                  
058516,000096: 04,3341           03371                           TC       UPTEST                                
058517,000097: 04,3342           34742                           CAF      BIT10                                 
058518,000098: 04,3343           00006                           EXTEND                                         
058519,000099: 04,3344           70734                           MP       KEYTEMP2                              #  SHIFT RIGHT 5
058520,000100: 04,3345           74346                           MASK     LOW5                                  #  HIGH 5
058521,000101: 04,3346           40000                           COM                                            
058522,000102: 04,3347           03371                           TC       UPTEST                                
058523,000103: 
058524,000104: 04,3350           43377        UPCK               CS       ELRCODE                               #  CODE IS GOOD.  IF CODE = 'ERROR RESET',
058525,000105: 04,3351           60073                           AD       KEYTEMP1                              #  CLEAR UPLOCKFL (SET BIT4 OF FLAGWRD7 = 0)
058526,000106: 04,3352           00006                           EXTEND                                         #  IF CODE DOES NOT = 'ERROR RESET', ACCEPT
058527,000107: 04,3353           13361                           BZF      CLUPLOCK                              #  CODE ONLY IF UPLOCKFL IS CLEAR (=0).
058528,000108: 
058529,000109: 04,3354           34750                           CAF      UPLOCBIT                              #  TEST UPLOCKFL FOR 0 OR 1
058530,000110: 04,3355           70103                           MASK     FLAGWRD7                              
058531,000111: 04,3356           10000                           CCS      A                                     
058532,000112: 04,3357           05270                           TC       RESUME                                #  UPLOCKFL = 1
058533,000113: 04,3360           03307                           TC       ACCEPTUP                              #  UPLOCKFL = 0
058534,000114: 
058535,000115: 04,3361           44750        CLUPLOCK           CS       UPLOCBIT                              #  CLEAR UPLOCKFL (I.E., SET BIT 4 OF )
058536,000116: 04,3362           70103                           MASK     FLAGWRD7                              #  FLAGWRD7 = 0)
058537,000117: 04,3363           54103                           TS       FLAGWRD7                              
058538,000118: 04,3364           03307                           TC       ACCEPTUP                              
058539,000119: 
058540,000120:                                                                                                  #  CODE IS BAD
058541,000121: 04,3365           40103        TMFAIL2            CS       FLAGWRD7                              #  LOCK OUT FURTHER UPLINK ACTIVITY
058542,000122: 04,3366           74750                           MASK     UPLOCBIT                              #  (BY SETTING UPLOCKFL = 1) UNTIL
058543,000123: 04,3367           26103                           ADS      FLAGWRD7                              #  'ERROR RESET' IS SENT VIA UPLINK.
058544,000124: 04,3370           05270                           TC       RESUME                                
058545,000125: 04,3371           60073        UPTEST             AD       KEYTEMP1                              

Page 1340

058547,000127: 04,3372           10000                           CCS      A                                     
058548,000128: 04,3373           03365                           TC       TMFAIL2                               
058549,000129: 04,3374           77740        HI10               OCT      77740                                 
058550,000130: 04,3375           03365                           TC       TMFAIL2                               
058551,000131: 04,3376           00002                           TC       Q                                     
058552,000132: 
058553,000133: 04,3377           00022        ELRCODE            OCT      22                                    
058554,000134: 
058555,000135:                                                                                                  #  'UPLINK ACTIVITY LIGHT' IS TURNED OFF BY .....
058556,000136:                                                                                                  #        1.      VBRELDSP
058557,000137:                                                                                                  #        2.      ERROR RESET
058558,000138:                                                                                                  #        3.      UPDATE PROGRAM (P27) ENTERED BY V70,V71,V72, AND V73.
058559,000139:                                                                                                  #                                     -
058560,000140:                                                                                                  #  THE RECEPTION OF A BAD CODE (I.E  CCC FAILURE) LOCKS OUT FURTHER UPLINK ACTIVITY BY SETTING BIT4 OF FLAGWRD7 = 1.
058561,000141:                                                                                                  #  THIS INDICATION WILL BE TRANSFERRED TO THE GROUND BY THE DOWNLINK WHICH DOWNLINKS ALL FLAGWORDS.
058562,000142:                                                                                                  #  WHEN UPLINK ACTIVITY IS LOCKED OUT, IT CAN BE ALLOWED WHEN THE GROUND UPLINKS AND 'ERROR RESET' CODE.
058563,000143:                                                                                                  #  (IT IS RECOMMENDED THAT THE 'ERROR LIGHT RESET' CODE IS PRECEEDED BY 16 BITS THE FIRST OF WHICH IS 1 FOLLOWED
058564,000144:                                                                                                  #  BY 15 ZEROES.  THIS WILL ELIMINATE EXTRANEOUS BITS FROM INLINK WHICH MAY HAVE BEEN LEFT OVER FROM THE ORIGINAL
058565,000145:                                                                                                  #  FAILURE)
058566,000146: 
058567,000147:                                                                                                  #  UPLINK ACTIVITY IS ALSO ALLOWED (UNLOCKED) DURING FRESH START WHEN FRESH START SETS BIT4 OF FLAGWRD7 = 0.
058568,000148: 
058569,000149: 04,3400           44753                           CS       XDSPBIT                               
058570,000150: 

End of include-file KEYRUPT,_UPRUPT.agc.  Parent file is MAIN.agc