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.

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

Page 709

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

Page 710

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

Page 711

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

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