Source Code

This is an attempt to recreate Luminary 99 Rev 2, otherwise known as LUM99R2, from Luminary 99 Rev 1 and ephemeris data from Luminary 116. The differences are confined to the last 10-12 lines of the CONTROLLED CONSTANTS. Luminary 99 Rev 1 source-code was transcribed from a printout in the MIT Museum, while Luminary 116 source code was transcribed from a printout belonging to Don Eyles. AGC developer James Kernan, the "rope mother" for the Apollo 11 Lunar Module's AGC, explains as follows: "At the last minute, Dan Lickly, our chief engineer, appeared with ephemerides updates and it took two tries to get it right. The result was that we created Lum99 Revision 1 and Lum99 Revision 2." It is suspected that the former is what's in the MIT Museum, and the latter is what we are trying to recreate here. As for which revision actually flew in Apollo 11, all of the other available surviving evidence points to Rev 1 rather than to Rev 2, so we're just not sure!

008126,000002:                                                                                                  ## Copyright:   Public domain.
008127,000003:                                                                                                  ## Filename:    AGS_INITIALIZATION.agc
008128,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
008129,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
008130,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
008131,000007:                                                                                                  ## Assembler:   yaYUL
008132,000008:                                                                                                  ## Contact:     Hartmuth Gutsche <hgutsche@xplornet.com>.
008133,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
008134,000010:                                                                                                  ## Pages:       206-210
008135,000011:                                                                                                  ## Mod history: 2009-05-19 HG   Transcribed from page images.
008136,000012:                                                                                                  ##              2016-12-13 RSB  Proofed text comments with octopus/ProoferComments
008137,000013:                                                                                                  ##                              and corrected the errors found.
008138,000014:                                                                                                  ##              2017-03-03 RSB  Snapshot of Luminary 99 Rev 1. 
008139,000015:                                                                                                  ##              2017-03-14 RSB  Comment-text fixes identified in 5-way
008140,000016:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
008141,000017: 

Page 206

008143,000019: 
008144,000020:                                                                                                  #  PROGRAM NAME:  AGS INITIALIZATION (R47)
008145,000021: 
008146,000022:                                                                                                  #  WRITTEN BY:  RHODE/KILROY/FOLLETT
008147,000023: 
008148,000024:                                                                                                  #  MOD NO. :     0
008149,000025:                                                                                                  #  DATE:         23 MARCH 1967
008150,000026:                                                                                                  #  MOD BY:       KILROY
008151,000027: 
008152,000028:                                                                                                  #  MOD NO.:      1
008153,000029:                                                                                                  #  DATE:         28 OCTOBER 1967
008154,000030:                                                                                                  #  MOD BY:       FOLLETT
008155,000031: 
008156,000032:                                                                                                  #  FUNCT. DESC.: (1) TO PROVIDE THE AGS ABORT ELECTRONICS ASSEMBLY (AEA) WITH THE LEM AND CSM STATE VECTORS
008157,000033:                                                                                                  #                (POSITION,VELOCITY,TIME) IN LEM IMU COORDINATES BY MEANS OF THE LGC DIGITAL DOWNLINK.
008158,000034: 
008159,000035:                                                                                                  #                (2) TO ZERO THE ICDU, LGC AND AEA GIMBAL ANGLE COUNTERS SIMULTANEOUSLY IN ORDER TO ESTABLISH A
008160,000036:                                                                                                  #                COMMON ZERO REFERENCE FOR THE MEASUREMENT OF GIMBAL (EULER) ANGLES WHICH DEFINE LEM ATTITUDE
008161,000037: 
008162,000038:                                                                                                  #                (3) TO ESTABLISH THE GROUND ELAPSED TIME OF AEA CLOCK ZERO.  (IF AN AEA CLOCK ZERO IS
008163,000039:                                                                                                  #                REQUESTED DURING THIS PROGRAM
008164,000040: 
008165,000041:                                                                                                  #  LOG SECTION:  AGS INITIALIZATION
008166,000042: 
008167,000043:                                                                                                  #  CALLING SEQ:  PROGRAM IS ENTERED WHEN ASTRONAUT KEYS V47E ON DSKY.
008168,000044:                                                                                                  #                R47 MAY BE CALLED AT ANY TIME EXCEPT WHEN ANOTHER EXTENDED VERB IS IN PROGRESS
008169,000045: 
008170,000046:                                                                                                  #  SUBROUTINES
008171,000047:                                                                                                  #  CALLED:
008172,000048: 
008173,000049:                                                                                                  #  NORMAL EXIT:  ENDEXT
008174,000050: 
008175,000051:                                                                                                  #  ALARM/ABORT:  ALARM - BAD REFSMMAT - CODE:220
008176,000052:                                                                                                  #                OPERATOR ERROR IF V47 SELECTED DURING ANOTHER EXTENDED VERB.
008177,000053: 
008178,000054:                                                                                                  #  ERASABLES
008179,000055:                                                                                                  #  USED:         SAMPTIME        (2)     TIME OF :ENTER: KEYSTROKE
008180,000056:                                                                                                  #                AGSK            (2)     GROUND ELAPSED TIME OF THE AEA CLOCK :ZERO:
008181,000057:                                                                                                  #                AGSBUFF         (140)   CONTAINS AGS INITIALIZATION DATA (SEE :OUTPUT: BELOW)
008182,000058:                                                                                                  #                AGSWORD         (1)     PREVIOUS DOWNLIST SAVED HERE
008183,000059: 
008184,000060: 05,2447  E4,1600                                  EBANK=   AGSBUFF                               
008185,000061: 
008186,000062: 40,2000                                           BANK     40                                    
008187,000063: 32,2000                                           SETLOC   R47                                   
008188,000064: 32,2000                                           BANK                                           
008189,000065: 
008190,000066: 32,2005                                           COUNT*   $$/R47                                
008191,000067: 
008192,000068: 32,2005           34737        AGSINIT            CAF      REFSMBIT                              
008193,000069: 32,2006           70077                           MASK     FLAGWRD3                              #  CHECK REFSMFLG.
008194,000070: 32,2007           10000                           CCS      A                                     

Page 207

008196,000072: 32,2010           02017                           TC       REDSPTEM                              #  REFSMMAT IS OK
008197,000073: 32,2011           05567                           TC       ALARM                                 #  REFSMMAT IS BAD
008198,000074: 32,2012           00220                           OCT      220                                   
008199,000075: 32,2013           05472                           TC       ENDEXT                                
008200,000076: 
008201,000077: 32,2014           00006        NEWAGS             EXTEND                                         
008202,000078: 32,2015           30014                           DCA      SAMPTIME                              #  TIME OF THE :ENTER: KEYSTROKE
008203,000079: 32,2016           53421                           DXCH     AGSK                                  #  BECOMES NEW AEA CLOCK :ZERO:
008204,000080: 
008205,000081: 32,2017           00006        REDSPTEM           EXTEND                                         
008206,000082: 32,2020           31421                           DCA      AGSK                                  
008207,000083: 32,2021           53052                           DXCH     DSPTEMX                               
008208,000084: 32,2022           32172        AGSDISPK           CAF      V06N16                                
008209,000085: 32,2023           04616                           TC       BANKCALL                              #  R1 = 00XXX. HRS., R2 = 000XX MIN.,
008210,000086: 32,2024           20334                           CADR     GOMARKF                               #  R3 = 0XX.XX SEC.
008211,000087: 32,2025           05472                           TC       ENDEXT                                #  TERMINATE RETURN
008212,000088: 32,2026           02036                           TC       AGSVCALC                              #  PROCEED RETURN
008213,000089: 32,2027           44746                           CS       BIT6                                  #  IS ENTER VIA A V32
008214,000090: 32,2030           60154                           AD       MPAC                                  
008215,000091: 32,2031           00006                           EXTEND                                         
008216,000092: 32,2032           12014                           BZF      NEWAGS                                #  YES, USE KEYSTROKE TIME FOR NEW AGSK
008217,000093: 
008218,000094: 32,2033           00006                           EXTEND                                         #  NO, NEW AGSK LOADED VIA V25
008219,000095: 32,2034           31052                           DCA      DSPTEMX                               #  LOADED INTO DSPTEMX BY KEYING
008220,000096: 32,2035           02016                           TC       REDSPTEM   -1                         #  V25E FOLLOWED BY HRS.,MINS.,SECS.
008221,000097:                                                                                                  #  DISPLAY THE NEW K
008222,000098: 
008223,000099: 32,2036           06037        AGSVCALC           TC       INTPRET                               
008224,000100: 32,2037           77614                           SET                                            
008225,000101: 32,2040           01076                                    NODOFLAG                              #  DONT ALLOW V37
008226,000102: 32,2041           77414                           SET      EXIT                                  
008227,000103: 32,2042           02076                                    XDSPFLAG                              
008228,000104: 
008229,000105: 32,2043           32172                           CAF      V06N16                                
008230,000106: 32,2044           04616                           TC       BANKCALL                              
008231,000107: 32,2045           20620                           CADR     EXDSPRET                              
008232,000108: 
008233,000109: 32,2046           06037                           TC       INTPRET                               #  EXTRAPOLATE LEM AND CSM STATE VECTORS
008234,000110: 32,2047           77634                           RTB                                            #  TO THE PRESENT TIME
008235,000111: 32,2050           21573                                    LOADTIME                              #  LOAD MPAC WITH TIME2,TIME1
008236,000112: 32,2051           34041                           STCALL   TDEC1                                 #  CALCULATE LEM STATE VECTOR
008237,000113: 32,2052           27057                                    LEMPREC                               
008238,000114: 32,2053           77624                           CALL                                           #  CALL ROUTINE TO CONVERT TO SM COORDS AND
008239,000115: 32,2054           64132                                    SCALEVEC                              #  PROVIDE PROPER SCALING
008240,000116: 32,2055           16201                           STODL    AGSBUFF                               #  (LEMPREC AND CSMPREC LEAVE TDEC1 IN TAT)
008241,000117: 32,2056           00015                                    TAT                                   #  TAT = TIME TO WHICH RATT1 AND VATT1 ARE
008242,000118: 32,2057           34041                           STCALL   TDEC1                                 #  COMPUTED (CSEC SINCE CLOCK START B-28).
008243,000119: 32,2060           27043                                    CSMPREC                               #  CALCULATE CSM STATE VECTOR FOR SAME TIME
008244,000120: 32,2061           77624                           CALL                                           
008245,000121: 32,2062           64132                                    SCALEVEC                              

Page 208

008247,000123: 32,2063           16207                           STODL    AGSBUFF    +6                         
008248,000124: 32,2064           00015                                    TAT                                   
008249,000125: 32,2065           56225                           DSU      DDV                                   #  CALCULATE AND STORE THE TIME
008250,000126: 32,2066           02021                                    AGSK                                  
008251,000127: 32,2067           24175                                    TSCALE                                
008252,000128: 32,2070           02215                           STORE    AGSBUFF    +12D                       
008253,000129: 32,2071           77776                           EXIT                                           
008254,000130: 
008255,000131: 32,2072           34753                           CAF      LAGSLIST                              
008256,000132: 32,2073           54332                           TS       DNLSTCOD                              
008257,000133: 
008258,000134: 32,2074           32176                           CAF      20SEC                                 #  DELAY FOR 20 SEC WHILE THE AGS
008259,000135: 32,2075           04616                           TC       BANKCALL                              #  DOWNLIST IS TRANSMITTED
008260,000136: 32,2076           01735                           CADR     DELAYJOB                              
008261,000137: 
008262,000138: 32,2077           31324                           CA       AGSWORD                               
008263,000139: 32,2100           54332                           TS       DNLSTCOD                              #  RETURN TO THE OLD DOWNLIST
008264,000140: 32,2101           34744                           CAF      IMUSEBIT                              
008265,000141: 32,2102           70074                           MASK     FLAGWRD0                              #  CHECK IMUSE FLAG.
008266,000142: 32,2103           10000                           CCS      A                                     
008267,000143: 32,2104           02122                           TC       AGSEND                                #  IMU IS BEING USED - DO NOT ZERO
008268,000144: 32,2105           11304        CKSTALL            CCS      IMUCADR                               #  CHECK FOR IMU USAGE WHICH AVOIDS THE
008269,000145: 32,2106           12111                           TCF      +3                                    #  IMUSE BIT:  I.E., IMU COMPENSATION.
008270,000146: 32,2107           12115                           TCF      +6                                    #  FREE.  GO AHEAD WITH THE IMU ZERO.
008271,000147: 32,2110           12111                           TCF      +1                                    
008272,000148: 32,2111           34363                 +3        CAF      TEN                                   #  WAIT .1 SEC AND TRY AGAIN.
008273,000149: 32,2112           04616                           TC       BANKCALL                              
008274,000150: 32,2113           01735                           CADR     DELAYJOB                              
008275,000151: 32,2114           12105                           TCF      CKSTALL                               
008276,000152: 
008277,000153: 32,2115           04616                 +6        TC       BANKCALL                              #  IMU IS NOT IN USE
008278,000154: 32,2116           16714                           CADR     IMUZERO                               #  SET IMU ZERO DISCRETE FOR 320MSECS
008279,000155: 32,2117           04616                           TC       BANKCALL                              #  WAIT 3 SEC FOR COUNTERS TO INCREMENT
008280,000156: 32,2120           17716                           CADR     IMUSTALL                              
008281,000157: 32,2121           02122                           TC       AGSEND                                
008282,000158: 32,2122           05516        AGSEND             TC       DOWNFLAG                              #  ALLOW V37
008283,000159: 32,2123           00054                           ADRES    NODOFLAG                              
008284,000160: 
008285,000161: 32,2124           32173                           CAF      V50N16                                
008286,000162: 32,2125           04616                           TC       BANKCALL                              
008287,000163: 32,2126           20342                           CADR     GOMARK3                               
008288,000164: 32,2127           15472                           TCF      ENDEXT                                
008289,000165: 32,2130           15472                           TCF      ENDEXT                                
008290,000166: 32,2131           05472                           TC       ENDEXT                                
008291,000167: 
008292,000168: 32,2132           64375        SCALEVEC           VLOAD    MXV                                   
008293,000169: 32,2133           00025                                    VATT1                                 
008294,000170: 32,2134           01734                                    REFSMMAT                              
008295,000171: 32,2135           72561                           VXSC     VSL2                                  
008296,000172: 32,2136           24202                                    VSCALE                                

Page 209

008298,000174: 32,2137           53255                           VAD      VAD                                   #  THIS SECTION ROUNDS THE VECTOR, AND
008299,000175: 32,2140           24204                                    AGSRND1                               #  CORRECTS FOR THE FACT THAT THE AGS
008300,000176: 32,2141           24212                                    AGSRND2                               #  IS A 2 S COMPLIMENT MACHINE WHILE THE
008301,000177: 32,2142           77634                           RTB                                            #  LGC IS A 1 S COMPLIMENT MACHINE.
008302,000178: 32,2143           21772                                    VECSGNAG                              
008303,000179: 32,2144           24025                           STOVL    VATT1                                 
008304,000180: 32,2145           00017                                    RATT1                                 
008305,000181: 32,2146           74321                           MXV      VXSC                                  
008306,000182: 32,2147           01734                                    REFSMMAT                              
008307,000183: 32,2150           24200                                    RSCALE                                
008308,000184: 32,2151           53212                           VSL8     VAD                                   #  AGAIN THIS SECTION ROUNDS.  TWO VECTORS
008309,000185: 32,2152           24204                                    AGSRND1                               #  ARE ADDED TO DEFEAT ALSIGNAG IN THE
008310,000186: 32,2153           47055                           VAD      RTB                                   #  CASE OF A HIGH-ORDER ZERO COUPLED WITH
008311,000187: 32,2154           24212                                    AGSRND2                               #  A LOW ORDER NEGATIVE PART.
008312,000188: 32,2155           21772                                    VECSGNAG                              
008313,000189: 32,2156           77750                           LXA,1                                          
008314,000190: 32,2157           00024                                    VATT1                                 
008315,000191: 32,2160           72130                           SXA,1    LXA,1                                 
008316,000192: 32,2161           00155                                    MPAC       +1                         
008317,000193: 32,2162           00026                                    VATT1      +2                         
008318,000194: 32,2163           72130                           SXA,1    LXA,1                                 
008319,000195: 32,2164           00160                                    MPAC       +4                         
008320,000196: 32,2165           00030                                    VATT1      +4                         
008321,000197: 32,2166           43530                           SXA,1    RVQ                                   
008322,000198: 32,2167           00162                                    MPAC       +6                         
008323,000199: 
008324,000200: 32,2170     4753               LAGSLIST           =        ONE                                   
008325,000201: 32,2170           00216        V01N14             VN       0114                                  
008326,000202: 32,2171           14400        V50N00A            VN       5000                                  
008327,000203: 32,2172     6010               V00N25             EQUALS   OCT31                                 
008328,000204: 32,2172           01420        V06N16             VN       0616                                  
008329,000205: 32,2173     4242               V00N34             EQUALS   34DEC                                 
008330,000206: 32,2173           14420        V50N16             VN       5016                                  
008331,000207: 32,2174           03100 00000  TSCALE             2DEC     100        B-10                       #  CSEC TO SEC SCALE FACTOR
008332,000208: 32,2176           03720        20SEC              DEC      2000       B-14                       
008333,000209: 32,2177           15077 05041  RSCALE             2DEC     3.280839   B-3                        #  METERS TO FEET SCALE FACTOR
008334,000210: 32,2201           24402 25724  VSCALE             2DEC     3.280839   E2         B-9             #  METERS/CS TO FEET/SEC SCALE FACTOR
008335,000211: 32,2203           00000 60000  AGSRND1            2OCT     0000060000                            
008336,000212: 32,2205           00000 60000                     2OCT     0000060000                            
008337,000213: 32,2207           00000 60000                     2OCT     0000060000                            
008338,000214: 32,2211           00000 37777  AGSRND2            2OCT     0000037777                            
008339,000215: 32,2213           00000 37777                     2OCT     0000037777                            

Page 210

008341,000217: 32,2215           00000 37777                     2OCT     0000037777                            
008342,000218: 
008343,000219: 32,2217  30,2000                                  SBANK=   LOWSUPER                              #  FOR SUBSEQUENT LOW 2CADRS.
008344,000220: 

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