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.

030980,000002:                                                                                                  ## Copyright:   Public domain.
030981,000003:                                                                                                  ## Filename:    P76.agc
030982,000004:                                                                                                  ## Purpose:     Part of the reconstructed source code for LMY99 Rev 0,
030983,000005:                                                                                                  ##              otherwise known as Luminary Rev 99, the second release
030984,000006:                                                                                                  ##              of the Apollo Guidance Computer (AGC) software for Apollo 11.
030985,000007:                                                                                                  ##              It differs from LMY99 Rev 1 (the flown version) only in the
030986,000008:                                                                                                  ##              placement of a single label. The corrections shown here have
030987,000009:                                                                                                  ##              been verified to have the same bank checksums as AGC developer
030988,000010:                                                                                                  ##              Allan Klumpp's copy of Luminary Rev 99, and so are believed
030989,000011:                                                                                                  ##              to be accurate. This file is intended to be a faithful 
030990,000012:                                                                                                  ##              recreation, except that the code format has been changed to 
030991,000013:                                                                                                  ##              conform to the requirements of the yaYUL assembler rather than 
030992,000014:                                                                                                  ##              the original YUL assembler.
030993,000015:                                                                                                  ##
030994,000016:                                                                                                  ## Assembler:   yaYUL
030995,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
030996,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo.
030997,000019:                                                                                                  ## Pages:       709-711
030998,000020:                                                                                                  ## Mod history: 2009-05-19 RSB  Adapted from the corresponding 
030999,000021:                                                                                                  ##                              Luminary131 file, using page 
031000,000022:                                                                                                  ##                              images from Luminary 1A.
031001,000023:                                                                                                  ##              2016-12-13 RSB  GOTOP00H -> GOTOPOOH
031002,000024:                                                                                                  ##              2016-12-14 RSB  Proofed text comments with octopus/ProoferComments
031003,000025:                                                                                                  ##                              and corrected the errors found.
031004,000026:                                                                                                  ##              2017-08-01 MAS  Created from LMY99 Rev 1.
031005,000027: 
031006,000028:                                                                                                  ## This source code has been transcribed or otherwise adapted from
031007,000029:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
031008,000030:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
031009,000031:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
031010,000032:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
031011,000033:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
031012,000034:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
031013,000035:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
031014,000036:                                                                                                  ## actually created.
031015,000037:                                                                                                  ##
031016,000038:                                                                                                  ## The code has been modified to match LMY99 Revision 0, otherwise
031017,000039:                                                                                                  ## known as Luminary Revision 99, the Apollo 11 software release preceeding
031018,000040:                                                                                                  ## the listing from which it was transcribed. It has been verified to
031019,000041:                                                                                                  ## contain the same bank checksums as AGC developer Allan Klumpp's listing
031020,000042:                                                                                                  ## of Luminary Revision 99 (for which we do not have scans).
031021,000043:                                                                                                  ##
031022,000044:                                                                                                  ## Notations on Allan Klumpp's listing read, in part:
031023,000045:                                                                                                  ##
031024,000046:                                                                                                  ##      ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
031025,000047: 

Page 709

031027,000049:                                                                                                  #  1)    PROGRAM NAME - TARGET DELTA V PROGRAM (P76).
031028,000050:                                                                                                  #  2)    FUNCTIONAL DESCRIPTION - UPON ENTRY BY ASTRONAUT ACTION, P76 FLASHES DSKY REQUESTS TO THE ASTRONAUT
031029,000051:                                                                                                  #        TO PROVIDE VIA DSKY (1) THE DELTA V TO BE APPLIED TO THE OTHER VEHICLE STATE VECTOR AND (2) THE
031030,000052:                                                                                                  #        TIME (TIG) AT WHICH THE OTHER VEHICLE VELOCITY WAS CHANGED BY EXECUTION OF A THRUSTING MANEUVER. THE
031031,000053:                                                                                                  #        OTHER VEHICLE STATE VECTOR IS INTEGRATED TO TIG AND UPDATED BY THE ADDITION OF DELTA V (DELTA V HAVING
031032,000054:                                                                                                  #        BEEN TRANSFORMED FROM LV TO REF COSYS).  USING INTEGRVS, THE PROGRAM THEN INTEGRATES THE OTHER
031033,000055:                                                                                                  #        VEHICLE STATE VECTOR TO THE STATE VECTOR OF THIS VEHICLE, THUS INSURING THAT THE W-MATRIX AND BOTH VEHICLE
031034,000056:                                                                                                  #        STATES CORRESPOND TO THE SAME TIME.
031035,000057:                                                                                                  #  3)    ERASABLE INITIALIZATION REQUIRED - NONE.
031036,000058:                                                                                                  #  4)    CALLING SEQUENCES AND EXIT MODES - CALLED BY ASTRONAUT REQUEST THRU DSKY V 37 E 76E.
031037,000059:                                                                                                  #        EXITS BY TCF ENDOFJOB.
031038,000060:                                                                                                  #  5)    OUTPUT - OTHER VEHICLE STATE VECTOR INTEGRATED TO TIG AND INCREMENTED BY DELTA V IN REF COSYS.
031039,000061:                                                                                                  #        THE PUSHLIST CONTAINS THE MATRIX BY WHICH THE INPUT DELTA V MUST BE POST-MULTIPLIED TO CONVERT FROM LV
031040,000062:                                                                                                  #        TO REF COSYS.
031041,000063:                                                                                                  #  6)    DEBRIS - OTHER VEHICLE STATE VECTOR.
031042,000064:                                                                                                  #  7)    SUBROUTINES CALLED - BANKCALL, GOXDSPF, CSMPREC (OR LEMPREC), ATOPCSM (OR ATOPLEM), INTSTALL, INTWAKE, PHASCHNG
031043,000065:                                                                                                  #        INTPRET, INTEGRVS, AND MINIRECT.
031044,000066:                                                                                                  #  8)    FLAG USE - MOONFLAG, CMOONFLAG, INTYPFLG, RASFLAG, AND MARKCTR.
031045,000067: 
031046,000068: 30,2061                                           BANK     30                                    
031047,000069: 13,2000                                           SETLOC   P76LOC                                
031048,000070: 13,2000                                           BANK                                           
031049,000071: 
031050,000072: 13,2207                                           COUNT*   $$/P76                                
031051,000073: 
031052,000074: 13,2207  E7,1441                                  EBANK=   TIG                                   
031053,000075: 
031054,000076: 13,2207           05504        P76                TC       UPFLAG                                
031055,000077: 13,2210           00031                           ADRES    TRACKFLG                              
031056,000078: 
031057,000079: 13,2211           06037                           TC       INTPRET                               
031058,000080: 13,2212           77775                           VLOAD                                          
031059,000081: 13,2213           03434                                    DELVLVC                               
031060,000082: 13,2214           02223                           STORE    DELVOV                                
031061,000083: 13,2215           77776                           EXIT                                           
031062,000084: 
031063,000085: 13,2216           32336                           CAF      V06N84                                #  FLASH LAST DELTA V,
031064,000086: 13,2217           04616                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
031065,000087: 13,2220           20476                           CADR     GOFLASH                               
031066,000088: 13,2221           12333                           TCF      ENDP76                                
031067,000089: 13,2222           02224                           TC       +2                                    #  PROCEED
031068,000090: 13,2223           02216                           TC       -5                                    #  STORE DATA AND REPEAT FLASHING
031069,000091: 13,2224           32337                           CAF      V06N84     +1                         #  FLASH VERB 06 NOUN 33, DISPLAY LAST TIG,
031070,000092: 13,2225           04616                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
031071,000093: 13,2226           20476                           CADR     GOFLASH                               
031072,000094: 13,2227           12333                           TCF      ENDP76                                
031073,000095: 13,2230           02232                           TC       +2                                    
031074,000096: 13,2231           02224                           TC       -5                                    
031075,000097: 13,2232           06037                           TC       INTPRET                               #  RETURN TO INTERPRETIVE CODE

Page 710

031077,000099: 13,2233           77745                           DLOAD                                          #  SET D(MPAC)=TIG IN CSEC B28
031078,000100: 13,2234           03442                                    TIG                                   
031079,000101: 13,2235           34041                           STCALL   TDEC1                                 #  SET TDEC1=TIG FOR ORBITAL INTEGRATION
031080,000102: 13,2236           27043                                    OTHPREC                               
031081,000103: 13,2237           53575        COMPMAT            VLOAD    UNIT                                  
031082,000104: 13,2240           00001                                    RATT                                  
031083,000105: 13,2241           77676                           VCOMP                                          #  U(-R)
031084,000106: 13,2242           00031                           STORE    24D                                   #  U(-R) TO 24D
031085,000107: 13,2243           53435                           VXV      UNIT                                  #  U(-R) X V = U(V X R)
031086,000108: 13,2244           00007                                    VATT                                  
031087,000109: 13,2245           00023                           STORE    18D                                   
031088,000110: 13,2246           53435                           VXV      UNIT                                  #  U(V X R) X U(-R) = U((R X V) X R)
031089,000111: 13,2247           00031                                    24D                                   
031090,000112: 13,2250           24015                           STOVL    12D                                   
031091,000113: 13,2251           02223                                    DELVOV                                
031092,000114: 13,2252           76505                           VXM      VSL1                                  #  V(MPAC)=DELTA V IN REFCOSYS
031093,000115: 13,2253           00015                                    12D                                   
031094,000116: 13,2254           77655                           VAD                                            
031095,000117: 13,2255           00007                                    VATT                                  
031096,000118: 13,2256           00007                           STORE    6                                     #  V(PD6)=VATT + DELTA V
031097,000119: 13,2257           77624                           CALL                                           #  PREVENT WOULD-BE USER OF ORBITAL
031098,000120: 13,2260           27414                                    INTSTALL                              #  INTEG FROM INTERFERING WITH UPDATING
031099,000121: 13,2261           77624                           CALL                                           
031100,000122: 13,2262           26340                                    P76SUB1                               
031101,000123: 13,2263           53775                           VLOAD    VSR*                                  
031102,000124: 13,2264           00007                                    6                                     
031103,000125: 13,2265           57176                                    0,2                                   
031104,000126: 13,2266           25543                           STOVL    VCV                                   
031105,000127: 13,2267           00001                                    RATT                                  
031106,000128: 13,2270           77657                           VSR*                                           
031107,000129: 13,2271           57176                                    0,2                                   
031108,000130: 13,2272           15535                           STODL    RCV                                   
031109,000131: 13,2273           03442                                    TIG                                   
031110,000132: 13,2274           01517                           STORE    TET                                   
031111,000133: 13,2275           71214                           CLEAR    DLOAD                                 
031112,000134: 13,2276           01673                                    INTYPFLG                              
031113,000135: 13,2277           01643                                    TETTHIS                               
031114,000136: 13,2300           34041        INTOTHIS           STCALL   TDEC1                                 
031115,000137: 13,2301           27107                                    INTEGRVS                              
031116,000138: 13,2302           77624                           CALL                                           
031117,000139: 13,2303           27414                                    INTSTALL                              
031118,000140: 13,2304           77775                           VLOAD                                          
031119,000141: 13,2305           00017                                    RATT1                                 
031120,000142: 13,2306           01503                           STORE    RRECT                                 
031121,000143: 13,2307           15535                           STODL    RCV                                   
031122,000144: 13,2310           00015                                    TAT                                   
031123,000145: 13,2311           25517                           STOVL    TET                                   
031124,000146: 13,2312           00025                                    VATT1                                 
031125,000147: 13,2313           77624                           CALL                                           
031126,000148: 13,2314           23455                                    MINIRECT                              

Page 711

031128,000150: 13,2315           77776                           EXIT                                           
031129,000151: 13,2316           05353                           TC       PHASCHNG                              
031130,000152: 13,2317           04024                           OCT      04024                                 
031131,000153: 
031132,000154: 13,2320           05504                           TC       UPFLAG                                
031133,000155: 13,2321           00236                           ADRES    REINTFLG                              
031134,000156: 
031135,000157: 13,2322           06037                           TC       INTPRET                               
031136,000158: 13,2323           77624                           CALL                                           
031137,000159: 13,2324           26661                                    ATOPOTH                               
031138,000160: 13,2325           77531                           SSP      EXIT                                  
031139,000161: 13,2326           00053                                    QPRET                                 
031140,000162: 13,2327           26332                                    OUT                                   
031141,000163: 13,2330           04616                           TC       BANKCALL                              #  PERMIT USE OF ORBITAL INTEGRATION
031142,000164: 13,2331           27445                           CADR     INTWAKE1                              
031143,000165: 13,2332           77776        OUT                EXIT                                           
031144,000166: 13,2333           34755        ENDP76             CAF      ZERO                                  
031145,000167: 13,2334           55462                           TS       MARKCTR                               #  CLEAR RR TRACKING MARK COUNTER
031146,000168: 13,2335           16001                           TCF      GOTOPOOH                              
031147,000169: 
031148,000170: 13,2336           01524        V06N84             NV       0684                                  
031149,000171: 13,2337           01441                           NV       0633                                  
031150,000172: 13,2340           43174        P76SUB1            AXT,2    SET                                   
031151,000173: 13,2341           00002                                    2                                     
031152,000174: 13,2342           00063                                    MOONFLAG                              #  SET MEANS MOON IS SPHERE OF INFLUENCE.
031153,000175: 13,2343           77014                           BON      AXT,2                                 
031154,000176: 13,2344           04303                                    CMOONFLG                              #  SET MEANS PERM CM STATE IN LUNAR SPHERE.
031155,000177: 13,2345           00052                                    QPRET                                 
031156,000178: 13,2346           00000                                    0                                     
031157,000179: 13,2347           43414                           CLEAR    RVQ                                   
031158,000180: 13,2350           00263                                    MOONFLAG                              
031159,000181: 
031160,000182: 
031161,000183: 

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