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.

026850,000002:                                                                                                  ## Copyright:   Public domain.
026851,000003:                                                                                                  ## Filename:    P30,P37.agc
026852,000004:                                                                                                  ## Purpose:     Part of the reconstructed source code for LMY99 Rev 0,
026853,000005:                                                                                                  ##              otherwise known as Luminary Rev 99, the second release
026854,000006:                                                                                                  ##              of the Apollo Guidance Computer (AGC) software for Apollo 11.
026855,000007:                                                                                                  ##              It differs from LMY99 Rev 1 (the flown version) only in the
026856,000008:                                                                                                  ##              placement of a single label. The corrections shown here have
026857,000009:                                                                                                  ##              been verified to have the same bank checksums as AGC developer
026858,000010:                                                                                                  ##              Allan Klumpp's copy of Luminary Rev 99, and so are believed
026859,000011:                                                                                                  ##              to be accurate. This file is intended to be a faithful 
026860,000012:                                                                                                  ##              recreation, except that the code format has been changed to 
026861,000013:                                                                                                  ##              conform to the requirements of the yaYUL assembler rather than 
026862,000014:                                                                                                  ##              the original YUL assembler.
026863,000015:                                                                                                  ##
026864,000016:                                                                                                  ## Assembler:   yaYUL
026865,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
026866,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo.
026867,000019:                                                                                                  ## Pages:       614-617
026868,000020:                                                                                                  ## Mod history: 2009-05-17 RSB  Adapted from the corresponding 
026869,000021:                                                                                                  ##                              Luminary131 file, using page 
026870,000022:                                                                                                  ##                              images from Luminary 1A.
026871,000023:                                                                                                  ##              2009-06-05 RSB  Removed 4 lines of code that shouldn't
026872,000024:                                                                                                  ##                              have survived from Luminary 131.
026873,000025:                                                                                                  ##              2016-12-13 RSB  GOTOP00H -> GOTOPOOH
026874,000026:                                                                                                  ##              2016-12-14 RSB  VNP00H -> VNPOOH.
026875,000027:                                                                                                  ##              2016-12-14 RSB  Proofed text comments with octopus/ProoferComments
026876,000028:                                                                                                  ##                              and corrected the errors found.
026877,000029:                                                                                                  ##              2017-08-01 MAS  Created from LMY99 Rev 1.
026878,000030: 
026879,000031:                                                                                                  ## This source code has been transcribed or otherwise adapted from
026880,000032:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
026881,000033:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
026882,000034:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
026883,000035:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
026884,000036:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
026885,000037:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
026886,000038:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
026887,000039:                                                                                                  ## actually created.
026888,000040:                                                                                                  ##
026889,000041:                                                                                                  ## The code has been modified to match LMY99 Revision 0, otherwise
026890,000042:                                                                                                  ## known as Luminary Revision 99, the Apollo 11 software release preceeding
026891,000043:                                                                                                  ## the listing from which it was transcribed. It has been verified to
026892,000044:                                                                                                  ## contain the same bank checksums as AGC developer Allan Klumpp's listing
026893,000045:                                                                                                  ## of Luminary Revision 99 (for which we do not have scans).
026894,000046:                                                                                                  ##
026895,000047:                                                                                                  ## Notations on Allan Klumpp's listing read, in part:
026896,000048:                                                                                                  ##
026897,000049:                                                                                                  ##      ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
026898,000050: 

Page 614

026900,000052:                                                                                                  #  PROGRAM DESCRIPTION P30       DATE 3-6-67
026901,000053: 
026902,000054:                                                                                                  #  MOD.1 BY RAMA AIYAWAR
026903,000055: 
026904,000056:                                                                                                  #  FUNCTIONAL DESCRIPTION
026905,000057:                                                                                                  #        ACCEPT ASTRONAUT INPUTS OF TIG,DELV(LV)
026906,000058:                                                                                                  #        CALL IMU STATUS CHECK ROUTINE (R02)
026907,000059:                                                                                                  #        DISPLAY TIME TO GO, APOGEE, PERIGEE, DELV(MAG), MGA AT IGN
026908,000060:                                                                                                  #        REQUEST BURN PROGRAM
026909,000061: 
026910,000062:                                                                                                  #  CALLING SEQUENCE VIA JOB FROM V37
026911,000063: 
026912,000064:                                                                                                  #  EXIT VIA V37 CALL OR TO GOTOPOOH (V34E)
026913,000065: 
026914,000066:                                                                                                  #  SUBROUTINE CALLS -    FLAGUP, PHASCHNG, BANKCALL, ENDOFJOB, GOFLASH, GOFLASHR
026915,000067:                                                                                                  #                        GOPERF3R, INTPRET, BLANKET, GOTOPOOH, R02BOTH, S30.1,
026916,000068:                                                                                                  #                        TTG/N35, MIDGIM, DISPMGA
026917,000069: 
026918,000070:                                                                                                  #  ERASABLE INITIALIZATION - STATE VECTOR
026919,000071: 
026920,000072:                                                                                                  #  OUTPUT -      RINIT, VINIT, +MGA, VTIG, RTIG, DELVSIN, DELVSAB, DELVSLV, HAPO,
026921,000073:                                                                                                  #                HPER, TTOGO
026922,000074: 
026923,000075:                                                                                                  #  DEBRIS - A, L, MPAC, PUSHLIST
026924,000076: 
026925,000077: 32,2776                                           BANK     32                                    
026926,000078: 35,2000                                           SETLOC   P30S                                  
026927,000079: 35,2000                                           BANK                                           
026928,000080: 35,2000  E4,1652                                  EBANK=   +MGA                                  
026929,000081: 35,2000                                           COUNT*   $$/P30                                
026930,000082: 35,2000           05504        P30                TC       UPFLAG                                #  SET UPDATE FLAG
026931,000083: 35,2001           00027                           ADRES    UPDATFLG                              
026932,000084: 35,2002           05504                           TC       UPFLAG                                #  SET TRACK FLAG
026933,000085: 35,2003           00031                           ADRES    TRACKFLG                              
026934,000086: 
026935,000087: 35,2004           32025        P30N33             CAF      V06N33                                #  T OF IGN
026936,000088: 35,2005           03712                           TC       VNPOOH                                #  RETURNS ON PROCEED, POOH ON TERMINATE
026937,000089: 
026938,000090: 35,2006           33727                           CAF      V06N81                                #  DISPLAY DELTA V (LV)
026939,000091: 35,2007           03712                           TC       VNPOOH                                #        REDISPLAY ON RECYCLE
026940,000092: 
026941,000093: 35,2010           05516                           TC       DOWNFLAG                              #  RESET UPDATE FLAG
026942,000094: 35,2011           00027                           ADRES    UPDATFLG                              
026943,000095: 35,2012           06037                           TC       INTPRET                               
026944,000096: 35,2013           77624                           CALL                                           
026945,000097: 35,2014           70000                                    S30.1                                 
026946,000098: 35,2015           77414                           SET      EXIT                                  
026947,000099: 35,2016           00470                                    UPDATFLG                              
026948,000100: 35,2017           32026        PARAM30            CAF      V06N42                                #  DISPLAY APOGEE,PERIGEE,DELTA V
026949,000101: 35,2020           03712                           TC       VNPOOH                                

Page 615

026951,000103: 
026952,000104: 35,2021           06037                           TC       INTPRET                               
026953,000105: 35,2022           77614                           SETGO                                          
026954,000106: 35,2023           01027                                    XDELVFLG                              #  FOR P40'S: EXTERNAL DELTA-V GUIDANCE.
026955,000107: 35,2024           72540                                    REVN1645                              #  TRKMKCNT, TGO, +MGA  DISPLAY
026956,000108: 
026957,000109: 35,2025           01441        V06N33             VN       0633                                  
026958,000110: 35,2026           01452        V06N42             VN       0642                                  
026959,000111: 

Page 616

026961,000113:                                                                                                  #  PROGRAM DESCRIPTION S30.1     DATE 9NOV66
026962,000114:                                                                                                  #  MOD NO 1                      LOG SECTION P30,P37
026963,000115:                                                                                                  #  MOD BY RAMA AIYAWAR **
026964,000116: 
026965,000117:                                                                                                  #  FUNCTIONAL DESCRIPTION
026966,000118:                                                                                                  #        BASED ON STORED TARGET PARAMETERS (R OF IGNITION (RTIG), V OF
026967,000119:                                                                                                  #        IGNITION (VTIG), TIME OF IGNITION (TIG)), COMPUTE PERIGEE ALTITUDE
026968,000120:                                                                                                  #        APOGEE ALTITUDE AND DELTAV REQUIRED (DELVSIN).
026969,000121: 
026970,000122:                                                                                                  #  CALLING SEQUENCE
026971,000123:                                                                                                  #        L       CALL
026972,000124:                                                                                                  #        L+1             S30.1
026973,000125: 
026974,000126:                                                                                                  #  NORMAL EXIT MODE
026975,000127:                                                                                                  #        AT L+2 OR CALLING SEQUENCE (GOTO L+2)
026976,000128: 
026977,000129:                                                                                                  #  SUBROUTINES CALLED
026978,000130:                                                                                                  #        LEMPREC
026979,000131:                                                                                                  #        PERIAPO
026980,000132: 
026981,000133:                                                                                                  #  ALARM OR ABORT EXIT MODES
026982,000134:                                                                                                  #        NONE
026983,000135: 
026984,000136:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
026985,000137:                                                                                                  #        TIG             TIME OF IGNITION        DP B28CS
026986,000138:                                                                                                  #        DELVSLV         SPECIFIED DELTA-V IN LOCAL VERT.
026987,000139:                                                                                                  #                        COORDS. OF ACTIVE VEHICLE AT
026988,000140:                                                                                                  #                        TIME OF IGNITION        VECTOR B+7 METERS/CS
026989,000141: 
026990,000142:                                                                                                  #  OUTPUT
026991,000143:                                                                                                  #        RTIG            POSITION AT TIG         VECTOR B+29 METERS
026992,000144:                                                                                                  #        VTIG            VELOCITY AT TIG         VECTOR B+29 METERS/CS
026993,000145:                                                                                                  #        PDL 4D          APOGEE ALTITUDE         DP B+29 M, B+27 METERS.
026994,000146:                                                                                                  #        HAPO            APOGEE ALTITUDE         DP B+29 METERS
026995,000147:                                                                                                  #        PDL 8D          PERIGEE ALTITUDE        DP B+29 M, B+27 METERS.
026996,000148:                                                                                                  #        HPER            PERIGEE ALTITUDE        DP B+29 METERS
026997,000149:                                                                                                  #        DELVSIN         SPECIFIED DELTA-V IN INERTIAL
026998,000150:                                                                                                  #                        COORD. OF ACTIVE VEHICLE AT
026999,000151:                                                                                                  #                        TIME OF IGNITION        VECTOR B+7 METERS/CS
027000,000152:                                                                                                  #        DELVSAB         MAG. OF DELVSIN         VECTOR B+7 METERS/CS
027001,000153: 
027002,000154:                                                                                                  #  DEBRIS        QTEMP   TEMP.ERASABLE
027003,000155:                                                                                                  #                QPRET, MPAC
027004,000156:                                                                                                  #                PUSHLIST
027005,000157: 
027006,000158: 34,2000                                           SETLOC   P30S1                                 
027007,000159: 34,2000                                           BANK                                           
027008,000160: 
027009,000161: 34,2000                                           COUNT*   $$/S30S                               
027010,000162: 
027011,000163: 34,2000           71220        S30.1              STQ      DLOAD                                 
027012,000164: 34,2001           03632                                    QTEMP                                 
027013,000165: 34,2002           03442                                    TIG                                   #  TIME IGNITION SCALED AT 2(+28)CS
027014,000166: 34,2003           34041                           STCALL   TDEC1                                 
027015,000167: 34,2004           27057                                    LEMPREC                               #  ENCKE ROUTINE FOR LEM
027016,000168: 
027017,000169: 34,2005           67175                           VLOAD    SXA,2                                 

Page 617

027019,000171: 34,2006           00001                                    RATT                                  
027020,000172: 34,2007           02777                                    RTX2                                  
027021,000173: 34,2010           03642                           STORE    RTIG                                  #  RADIUS VECTOR AT IGNITION TIME
027022,000174: 34,2011           57456                           UNIT     VCOMP                                 
027023,000175: 34,2012           27656                           STOVL    DELVSIN                               #  ZRF/LV IN DELVSIN SCALED AT 2
027024,000176: 34,2013           00007                                    VATT                                  #  VELOCITY VECTOR AT TIG, SCALED 2(7) M/CS
027025,000177: 34,2014           03650                           STORE    VTIG                                  
027026,000178: 34,2015           53435                           VXV      UNIT                                  
027027,000179: 34,2016           03642                                    RTIG                                  
027028,000180: 34,2017           66001                           SETPD    SXA,1                                 
027029,000181: 34,2020           00001                                    0                                     
027030,000182: 34,2021           02776                                    RTX1                                  
027031,000183: 34,2022           47206                           PUSH     VXV                                   #  YRF/LV PDL 0 SCALED AT 2
027032,000184: 34,2023           03656                                    DELVSIN                               
027033,000185: 34,2024           63372                           VSL1     PDVL                                  
027034,000186: 34,2025           63315                           PDVL     PDVL                                  #  YRF/LV PDL 6 SCALED AT 2
027035,000187: 34,2026           03656                                    DELVSIN                               #  ZRF/LV PDL 12D SCALED AT 2
027036,000188: 34,2027           03434                                    DELVSLV                               
027037,000189: 34,2030           76505                           VXM      VSL1                                  
027038,000190: 34,2031           00001                                    0                                     
027039,000191: 34,2032           03656                           STORE    DELVSIN                               #  DELTAV IN INERT. COOR. SCALED TO B+7M/CS
027040,000192: 34,2033           77646                           ABVAL                                          
027041,000193: 34,2034           27664                           STOVL    DELVSAB                               #  DELTA V MAG.
027042,000194: 34,2035           03642                                    RTIG                                  #  (FOR PERIAPO)
027043,000195: 34,2036           53315                           PDVL     VAD                                   #  VREQUIRED = VTIG + DELVSIN (FOR PERIAPO)
027044,000196: 34,2037           03650                                    VTIG                                  
027045,000197: 34,2040           03656                                    DELVSIN                               
027046,000198: 34,2041           77624                           CALL                                           
027047,000199: 34,2042           46316                                    PERIAPO1                              
027048,000200: 34,2043           77624                           CALL                                           
027049,000201: 34,2044           46426                                    SHIFTR1                               #  RESCALE IF NEEDED
027050,000202: 34,2045           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
027051,000203: 34,2046           45636                                    MAXCHK                                
027052,000204: 34,2047           16321                           STODL    HPER                                  #  PERIGEE ALT 2(29) METERS, FOR DISPLAY
027053,000205: 34,2050           00005                                    4D                                    
027054,000206: 34,2051           77624                           CALL                                           
027055,000207: 34,2052           46426                                    SHIFTR1                               #  RESCALE IF NEEDED
027056,000208: 34,2053           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
027057,000209: 34,2054           45636                                    MAXCHK                                
027058,000210: 34,2055           36317                           STCALL   HAPO                                  #  APOGEE ALT 2(29) METERS, FOR DISPLAY
027059,000211: 34,2056           03632                                    QTEMP                                 
027060,000212: 
027061,000213: 

End of include-file P30,P37.agc.  Parent file is MAIN.agc