Source Code

These source-code files were from the printout at the MIT Museum, with many thanks to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing it to us. The printout was digitally photographed by Paul Fjeld. A team of volunteers transcribed the source code manually from these images or, where appropriate, modified already-transcribed but similar source Luminary 131 (Apollo 13) source code to agree with the images from the printout. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 001 OF AGC PROGRAM LMY99 BY NASA 2021112-061
	16:27 JULY 14,1969
Note that the date is the date of the printout, not the date of the program revision.

026408,000002:                                                                                                  ## Copyright:   Public domain.
026409,000003:                                                                                                  ## Filename:    P30_P37.agc
026410,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
026411,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
026412,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
026413,000007:                                                                                                  ## Assembler:   yaYUL
026414,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
026415,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
026416,000010:                                                                                                  ## Pages:       614-617
026417,000011:                                                                                                  ## Mod history: 2009-05-17 RSB  Adapted from the corresponding 
026418,000012:                                                                                                  ##                              Luminary131 file, using page 
026419,000013:                                                                                                  ##                              images from Luminary 1A.
026420,000014:                                                                                                  ##              2009-06-05 RSB  Removed 4 lines of code that shouldn't
026421,000015:                                                                                                  ##                              have survived from Luminary 131.
026422,000016:                                                                                                  ##              2016-12-13 RSB  GOTOP00H -> GOTOPOOH
026423,000017:                                                                                                  ##              2016-12-14 RSB  VNP00H -> VNPOOH.
026424,000018:                                                                                                  ##              2016-12-14 RSB  Proofed text comments with octopus/ProoferComments
026425,000019:                                                                                                  ##                              and corrected the errors found.
026426,000020:                                                                                                  ##
026427,000021:                                                                                                  ## This source code has been transcribed or otherwise adapted from
026428,000022:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
026429,000023:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
026430,000024:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
026431,000025:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
026432,000026:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
026433,000027:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
026434,000028:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
026435,000029:                                                                                                  ## actually created.
026436,000030:                                                                                                  ##
026437,000031:                                                                                                  ## Notations on the hardcopy document read, in part:
026438,000032:                                                                                                  ##
026439,000033:                                                                                                  ##      Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
026440,000034:                                                                                                  ##      16:27 JULY 14, 1969 
026441,000035: 

Page 614

026443,000037:                                                                                                  #  PROGRAM DESCRIPTION P30       DATE 3-6-67
026444,000038: 
026445,000039:                                                                                                  #  MOD.1 BY RAMA AIYAWAR
026446,000040: 
026447,000041:                                                                                                  #  FUNCTIONAL DESCRIPTION
026448,000042:                                                                                                  #        ACCEPT ASTRONAUT INPUTS OF TIG,DELV(LV)
026449,000043:                                                                                                  #        CALL IMU STATUS CHECK ROUTINE (R02)
026450,000044:                                                                                                  #        DISPLAY TIME TO GO, APOGEE, PERIGEE, DELV(MAG), MGA AT IGN
026451,000045:                                                                                                  #        REQUEST BURN PROGRAM
026452,000046: 
026453,000047:                                                                                                  #  CALLING SEQUENCE VIA JOB FROM V37
026454,000048: 
026455,000049:                                                                                                  #  EXIT VIA V37 CALL OR TO GOTOPOOH (V34E)
026456,000050: 
026457,000051:                                                                                                  #  SUBROUTINE CALLS -    FLAGUP, PHASCHNG, BANKCALL, ENDOFJOB, GOFLASH, GOFLASHR
026458,000052:                                                                                                  #                        GOPERF3R, INTPRET, BLANKET, GOTOPOOH, R02BOTH, S30.1,
026459,000053:                                                                                                  #                        TTG/N35, MIDGIM, DISPMGA
026460,000054: 
026461,000055:                                                                                                  #  ERASABLE INITIALIZATION - STATE VECTOR
026462,000056: 
026463,000057:                                                                                                  #  OUTPUT -      RINIT, VINIT, +MGA, VTIG, RTIG, DELVSIN, DELVSAB, DELVSLV, HAPO,
026464,000058:                                                                                                  #                HPER, TTOGO
026465,000059: 
026466,000060:                                                                                                  #  DEBRIS - A, L, MPAC, PUSHLIST
026467,000061: 
026468,000062: 32,2776                                           BANK     32                                    
026469,000063: 35,2000                                           SETLOC   P30S                                  
026470,000064: 35,2000                                           BANK                                           
026471,000065: 35,2000  E4,1652                                  EBANK=   +MGA                                  
026472,000066: 35,2000                                           COUNT*   $$/P30                                
026473,000067: 35,2000           05504        P30                TC       UPFLAG                                #  SET UPDATE FLAG
026474,000068: 35,2001           00027                           ADRES    UPDATFLG                              
026475,000069: 35,2002           05504                           TC       UPFLAG                                #  SET TRACK FLAG
026476,000070: 35,2003           00031                           ADRES    TRACKFLG                              
026477,000071: 
026478,000072: 35,2004           32025        P30N33             CAF      V06N33                                #  T OF IGN
026479,000073: 35,2005           03712                           TC       VNPOOH                                #  RETURNS ON PROCEED, POOH ON TERMINATE
026480,000074: 
026481,000075: 35,2006           33727                           CAF      V06N81                                #  DISPLAY DELTA V (LV)
026482,000076: 35,2007           03712                           TC       VNPOOH                                #        REDISPLAY ON RECYCLE
026483,000077: 
026484,000078: 35,2010           05516                           TC       DOWNFLAG                              #  RESET UPDATE FLAG
026485,000079: 35,2011           00027                           ADRES    UPDATFLG                              
026486,000080: 35,2012           06037                           TC       INTPRET                               
026487,000081: 35,2013           77624                           CALL                                           
026488,000082: 35,2014           70000                                    S30.1                                 
026489,000083: 35,2015           77414                           SET      EXIT                                  
026490,000084: 35,2016           00470                                    UPDATFLG                              
026491,000085: 35,2017           32026        PARAM30            CAF      V06N42                                #  DISPLAY APOGEE,PERIGEE,DELTA V
026492,000086: 35,2020           03712                           TC       VNPOOH                                

Page 615

026494,000088: 
026495,000089: 35,2021           06037                           TC       INTPRET                               
026496,000090: 35,2022           77614                           SETGO                                          
026497,000091: 35,2023           01027                                    XDELVFLG                              #  FOR P40'S: EXTERNAL DELTA-V GUIDANCE.
026498,000092: 35,2024           72540                                    REVN1645                              #  TRKMKCNT, TGO, +MGA  DISPLAY
026499,000093: 
026500,000094: 35,2025           01441        V06N33             VN       0633                                  
026501,000095: 35,2026           01452        V06N42             VN       0642                                  
026502,000096: 

Page 616

026504,000098:                                                                                                  #  PROGRAM DESCRIPTION S30.1     DATE 9NOV66
026505,000099:                                                                                                  #  MOD NO 1                      LOG SECTION P30,P37
026506,000100:                                                                                                  #  MOD BY RAMA AIYAWAR **
026507,000101: 
026508,000102:                                                                                                  #  FUNCTIONAL DESCRIPTION
026509,000103:                                                                                                  #        BASED ON STORED TARGET PARAMETERS (R OF IGNITION (RTIG), V OF
026510,000104:                                                                                                  #        IGNITION (VTIG), TIME OF IGNITION (TIG)), COMPUTE PERIGEE ALTITUDE
026511,000105:                                                                                                  #        APOGEE ALTITUDE AND DELTAV REQUIRED (DELVSIN).
026512,000106: 
026513,000107:                                                                                                  #  CALLING SEQUENCE
026514,000108:                                                                                                  #        L       CALL
026515,000109:                                                                                                  #        L+1             S30.1
026516,000110: 
026517,000111:                                                                                                  #  NORMAL EXIT MODE
026518,000112:                                                                                                  #        AT L+2 OR CALLING SEQUENCE (GOTO L+2)
026519,000113: 
026520,000114:                                                                                                  #  SUBROUTINES CALLED
026521,000115:                                                                                                  #        LEMPREC
026522,000116:                                                                                                  #        PERIAPO
026523,000117: 
026524,000118:                                                                                                  #  ALARM OR ABORT EXIT MODES
026525,000119:                                                                                                  #        NONE
026526,000120: 
026527,000121:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
026528,000122:                                                                                                  #        TIG             TIME OF IGNITION        DP B28CS
026529,000123:                                                                                                  #        DELVSLV         SPECIFIED DELTA-V IN LOCAL VERT.
026530,000124:                                                                                                  #                        COORDS. OF ACTIVE VEHICLE AT
026531,000125:                                                                                                  #                        TIME OF IGNITION        VECTOR B+7 METERS/CS
026532,000126: 
026533,000127:                                                                                                  #  OUTPUT
026534,000128:                                                                                                  #        RTIG            POSITION AT TIG         VECTOR B+29 METERS
026535,000129:                                                                                                  #        VTIG            VELOCITY AT TIG         VECTOR B+29 METERS/CS
026536,000130:                                                                                                  #        PDL 4D          APOGEE ALTITUDE         DP B+29 M, B+27 METERS.
026537,000131:                                                                                                  #        HAPO            APOGEE ALTITUDE         DP B+29 METERS
026538,000132:                                                                                                  #        PDL 8D          PERIGEE ALTITUDE        DP B+29 M, B+27 METERS.
026539,000133:                                                                                                  #        HPER            PERIGEE ALTITUDE        DP B+29 METERS
026540,000134:                                                                                                  #        DELVSIN         SPECIFIED DELTA-V IN INERTIAL
026541,000135:                                                                                                  #                        COORD. OF ACTIVE VEHICLE AT
026542,000136:                                                                                                  #                        TIME OF IGNITION        VECTOR B+7 METERS/CS
026543,000137:                                                                                                  #        DELVSAB         MAG. OF DELVSIN         VECTOR B+7 METERS/CS
026544,000138: 
026545,000139:                                                                                                  #  DEBRIS        QTEMP   TEMP.ERASABLE
026546,000140:                                                                                                  #                QPRET, MPAC
026547,000141:                                                                                                  #                PUSHLIST
026548,000142: 
026549,000143: 34,2000                                           SETLOC   P30S1                                 
026550,000144: 34,2000                                           BANK                                           
026551,000145: 
026552,000146: 34,2000                                           COUNT*   $$/S30S                               
026553,000147: 
026554,000148: 34,2000           71220        S30.1              STQ      DLOAD                                 
026555,000149: 34,2001           03632                                    QTEMP                                 
026556,000150: 34,2002           03442                                    TIG                                   #  TIME IGNITION SCALED AT 2(+28)CS
026557,000151: 34,2003           34041                           STCALL   TDEC1                                 
026558,000152: 34,2004           27057                                    LEMPREC                               #  ENCKE ROUTINE FOR LEM
026559,000153: 
026560,000154: 34,2005           67175                           VLOAD    SXA,2                                 

Page 617

026562,000156: 34,2006           00001                                    RATT                                  
026563,000157: 34,2007           02777                                    RTX2                                  
026564,000158: 34,2010           03642                           STORE    RTIG                                  #  RADIUS VECTOR AT IGNITION TIME
026565,000159: 34,2011           57456                           UNIT     VCOMP                                 
026566,000160: 34,2012           27656                           STOVL    DELVSIN                               #  ZRF/LV IN DELVSIN SCALED AT 2
026567,000161: 34,2013           00007                                    VATT                                  #  VELOCITY VECTOR AT TIG, SCALED 2(7) M/CS
026568,000162: 34,2014           03650                           STORE    VTIG                                  
026569,000163: 34,2015           53435                           VXV      UNIT                                  
026570,000164: 34,2016           03642                                    RTIG                                  
026571,000165: 34,2017           66001                           SETPD    SXA,1                                 
026572,000166: 34,2020           00001                                    0                                     
026573,000167: 34,2021           02776                                    RTX1                                  
026574,000168: 34,2022           47206                           PUSH     VXV                                   #  YRF/LV PDL 0 SCALED AT 2
026575,000169: 34,2023           03656                                    DELVSIN                               
026576,000170: 34,2024           63372                           VSL1     PDVL                                  
026577,000171: 34,2025           63315                           PDVL     PDVL                                  #  YRF/LV PDL 6 SCALED AT 2
026578,000172: 34,2026           03656                                    DELVSIN                               #  ZRF/LV PDL 12D SCALED AT 2
026579,000173: 34,2027           03434                                    DELVSLV                               
026580,000174: 34,2030           76505                           VXM      VSL1                                  
026581,000175: 34,2031           00001                                    0                                     
026582,000176: 34,2032           03656                           STORE    DELVSIN                               #  DELTAV IN INERT. COOR. SCALED TO B+7M/CS
026583,000177: 34,2033           77646                           ABVAL                                          
026584,000178: 34,2034           27664                           STOVL    DELVSAB                               #  DELTA V MAG.
026585,000179: 34,2035           03642                                    RTIG                                  #  (FOR PERIAPO)
026586,000180: 34,2036           53315                           PDVL     VAD                                   #  VREQUIRED = VTIG + DELVSIN (FOR PERIAPO)
026587,000181: 34,2037           03650                                    VTIG                                  
026588,000182: 34,2040           03656                                    DELVSIN                               
026589,000183: 34,2041           77624                           CALL                                           
026590,000184: 34,2042           46316                                    PERIAPO1                              
026591,000185: 34,2043           77624                           CALL                                           
026592,000186: 34,2044           46426                                    SHIFTR1                               #  RESCALE IF NEEDED
026593,000187: 34,2045           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
026594,000188: 34,2046           45636                                    MAXCHK                                
026595,000189: 34,2047           16321                           STODL    HPER                                  #  PERIGEE ALT 2(29) METERS, FOR DISPLAY
026596,000190: 34,2050           00005                                    4D                                    
026597,000191: 34,2051           77624                           CALL                                           
026598,000192: 34,2052           46426                                    SHIFTR1                               #  RESCALE IF NEEDED
026599,000193: 34,2053           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
026600,000194: 34,2054           45636                                    MAXCHK                                
026601,000195: 34,2055           36317                           STCALL   HAPO                                  #  APOGEE ALT 2(29) METERS, FOR DISPLAY
026602,000196: 34,2056           03632                                    QTEMP                                 
026603,000197: 
026604,000198: 

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