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.

034442,000002:                                                                                                  ## Copyright:   Public domain.
034443,000003:                                                                                                  ## Filename:    THROTTLE_CONTROL_ROUTINES.agc
034444,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
034445,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
034446,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
034447,000007:                                                                                                  ## Assembler:   yaYUL
034448,000008:                                                                                                  ## Contact:     HARTMUTH GUTSCHE <hgutsche@xplornet.com>.
034449,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
034450,000010:                                                                                                  ## Pages:       793-797
034451,000011:                                                                                                  ## Mod history: 2009-05-20 HG   Transcribed from page images.
034452,000012:                                                                                                  ##              2010-12-31 JL   Fixed page number comments.
034453,000013:                                                                                                  ##              2016-12-16 RSB  Proofed text comments with octopus/ProoferComments
034454,000014:                                                                                                  ##                              and corrected the errors found.
034455,000015:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
034456,000016:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
034457,000017: 
034458,000018:                                                                                                  ## This source code has been transcribed or otherwise adapted from
034459,000019:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
034460,000020:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
034461,000021:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
034462,000022:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
034463,000023:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
034464,000024:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
034465,000025:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
034466,000026:                                                                                                  ## actually created.
034467,000027:                                                                                                  ##
034468,000028:                                                                                                  ## Notations on the hardcopy document read, in part:
034469,000029:                                                                                                  ##
034470,000030:                                                                                                  ##      Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
034471,000031:                                                                                                  ##      16:27 JULY 14, 1969 
034472,000032: 

Page 793

034474,000034: 31,2216                                           BANK     31                                    
034475,000035: 31,2000                                           SETLOC   FTHROT                                
034476,000036: 31,2000                                           BANK                                           
034477,000037: 31,2216  E7,1612                                  EBANK=   PIF                                   
034478,000038: 31,2216                                           COUNT*   $$/THROT                              
034479,000039: 
034480,000040:                                                                                                  #  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
034481,000041:                                                                                                  #  HERE FC, DESIRED THRUST, AND FP, PRESENT THRUST, UNWEIGHTED, ARE COMPUTED.
034482,000042: 
034483,000043: 31,2216           31246        THROTTLE           CA       ABDELV                                #  COMPUTE PRESENT ACCELERATION IN UNITS OF
034484,000044: 31,2217           00006                           EXTEND                                         #  2(-4) M/CS/CS, SAVING SERVICER TROUBLE
034485,000045: 31,2220           72417                           MP       /AF/CNST                              
034486,000046: 31,2221           00006                 +3        EXTEND                                         
034487,000047: 31,2222           23607                           QXCH     RTNHOLD                               
034488,000048: 31,2223           02400        AFDUMP             TC       MASSMULT                              
034489,000049: 31,2224           53470                           DXCH     FP                                    #  FP = PRESENT THRUST
034490,000050: 31,2225           00006                           EXTEND                                         
034491,000051: 31,2226           31464                           DCA      /AFC/                                 
034492,000052: 31,2227           02400                           TC       MASSMULT                              
034493,000053: 31,2230           55615                           TS       FC                                    #  FC = THRUST DESIRED BY GUIDANCE
034494,000054: 31,2231           53466                           DXCH     FCODD                                 #  FCODD = WHAT IT IS GOING TO GET
034495,000055: 
034496,000056:                                                                                                  #  IF IT HAS BEEN LESS THAN 3 SECONDS SINCE THE LAST THROTTLING, AUGMENT FP USING THE FWEIGHT CALCULATED THEN.
034497,000057: 
034498,000058: 31,2232           41617                           CS       TTHROT                                #  THIS CODING ASSUMES A FLATOUT WITHIN
034499,000059: 31,2233           60025                           AD       TIME1                                 #        80 SECONDS BEFORE FIRST THROTTLE CALL
034500,000060: 31,2234           74733                           MASK     POSMAX                                
034501,000061: 31,2235           40000                           COM                                            
034502,000062: 31,2236           65002                           AD       3SECS                                 
034503,000063: 31,2237           00006                           EXTEND                                         
034504,000064: 31,2240           62244                           BZMF     WHERETO                               #  BRANCH IF (TIME1-TTHROT +1) > 3 SECONDS
034505,000065: 31,2241           00006                           EXTEND                                         
034506,000066: 31,2242           31611                           DCA      FWEIGHT                               
034507,000067: 31,2243           21470                           DAS      FP                                    
034508,000068: 
034509,000069:                                                                                                  #      THIS LOGIC DETERMINES THE THROTTLING IN THE REGION 10% - 94%.  THE MANUAL THROTTLE, NOMINALLY SET AT
034510,000070:                                                                                                  #  MINIMUM BY ASTRONAUT OR MISSION CONTROL PROGRAMS, PROVIDES THE LOWER BOUND.  A STOP IN THE THROTTLE HARDWARE
034511,000071:                                                                                                  #  PROVIDES THE UPPER.
034512,000072: 
034513,000073: 31,2244           35014        WHERETO            CA       EBANK5                                #  INITIALIZE L*WCR*T AND H*GHCR*T FROM
034514,000074: 31,2245           54003                           TS       EBANK                                 #        PAD LOADED ERASABLES IN W-MATRIX

Page 794

034516,000076: 31,2246  E5,1506                                  EBANK=   LOWCRIT                               
034517,000077: 31,2246           00006                           EXTEND                                         
034518,000078: 31,2247           31507                           DCA      LOWCRIT                               
034519,000079: 31,2250           52131                           DXCH     L*WCR*T                               
034520,000080: 31,2251           35016                           CA       EBANK7                                
034521,000081: 31,2252           54003                           TS       EBANK                                 
034522,000082: 31,2253  E7,1612                                  EBANK=   PIF                                   
034523,000083: 31,2253           44755                           CS       ZERO                                  #  INITIALIZE PIFPSET
034524,000084: 31,2254           55606                           TS       PIFPSET                               
034525,000085: 31,2255           40131                           CS       H*GHCR*T                              
034526,000086: 31,2256           61620                           AD       FCOLD                                 
034527,000087: 31,2257           00006                           EXTEND                                         
034528,000088: 31,2260           62272                           BZMF     LOWFCOLD                              #  BRANCH IF FCOLD < OR = HIGHCRIT
034529,000089: 31,2261           40130                           CS       L*WCR*T                               
034530,000090: 31,2262           61465                           AD       FCODD                                 
034531,000091: 31,2263           00006                           EXTEND                                         
034532,000092: 31,2264           62267                           BZMF     FCOMPSET                              #  BRANCH IF FC < OR = LOWCRIT
034533,000093: 31,2265           31467                           CA       FP                                    #  SEE NOTE 1
034534,000094: 31,2266           12277                           TCF      FLATOUT1                              
034535,000095: 
034536,000096: 31,2267           42002        FCOMPSET           CS       FMAXODD                               #  SEE NOTE 2
034537,000097: 31,2270           61467                           AD       FP                                    
034538,000098: 31,2271           12301                           TCF      FLATOUT2                              
034539,000099: 
034540,000100: 31,2272           40131        LOWFCOLD           CS       H*GHCR*T                              
034541,000101: 31,2273           61465                           AD       FCODD                                 
034542,000102: 31,2274           00006                           EXTEND                                         
034543,000103: 31,2275           62302                           BZMF     DOPIF                                 #  BRANCH IF FC < OR = HIGHCRIT
034544,000104: 
034545,000105: 31,2276           32003                           CA       FMAXPOS                               #  NO:  THROTTLE-UP
034546,000106: 31,2277           53466        FLATOUT1           DXCH     FCODD                                 
034547,000107: 31,2300           34737                           CA       FEXTRA                                
034548,000108: 31,2301           55606        FLATOUT2           TS       PIFPSET                               
034549,000109: 
034550,000110:                                                                                                  #  NOTE 1        FC IS SET EQUAL TO FP SO PIF WILL BE ZERO.  THIS IS DESIRABLE
034551,000111:                                                                                                  #                AS THERE IS ACTUALLY NO THROTTLE CHANGE.
034552,000112: 
034553,000113:                                                                                                  #  NOTE2         HERE, SINCE WE ARE ABOUT TO RETURN TO THE THROTTLEABLE REGION
034554,000114:                                                                                                  #                (BELOW 55%) THE QUANTITY -(FMAXODD-FP) IS COMPUTED AND PUT
034555,000115:                                                                                                  #                INTO PIFPSET TO COMPENSATE FOR THE DIFFERENCE BETWEEN THE
034556,000116:                                                                                                  #                NUMBER OF BITS CORRESPONDING TO FULL THROTTLE (FMAXODD) AND THE
034557,000117:                                                                                                  #                NUMBER CORRESPONDING TO ACTUAL THRUST (FP).  THUS THE TOTAL
034558,000118:                                                                                                  #                THROTTLE COMMAND PIF = FC - FP - (FMAXODD - FP) = FC - FMAXODD.
034559,000119: 
034560,000120: 31,2302           03740        DOPIF              TC       FASTCHNG                              
034561,000121: 31,2303           00006                           EXTEND                                         
034562,000122: 31,2304           31466                           DCA      FCODD                                 
034563,000123: 31,2305           55620                           TS       FCOLD                                 
034564,000124: 31,2306           53613                           DXCH     PIF                                   
034565,000125: 31,2307           00006                           EXTEND                                         

Page 795

034567,000127: 31,2310           41470                           DCS      FP                                    
034568,000128: 31,2311           21613                           DAS      PIF                                   #  PIF = FC - FP, NEVER EQUALS +0
034569,000129: 
034570,000130: 31,2312           31612        DOIT               CA       PIF                                   
034571,000131: 31,2313           61606                           AD       PIFPSET                               #  ADD IN PIFPSET, WITHOUT CHANGING PIF
034572,000132: 31,2314           55614                           TS       PSEUDO55                              
034573,000133: 31,2315           54055                           TS       THRUST                                
034574,000134: 31,2316           34750                           CAF      BIT4                                  
034575,000135: 31,2317           00006                           EXTEND                                         
034576,000136: 31,2320           05014                           WOR      CHAN14                                
034577,000137: 31,2321           30025                           CA       TIME1                                 
034578,000138: 31,2322           55617                           TS       TTHROT                                
034579,000139: 
034580,000140:                                                                                                  #  SINCE /AF/ IS NOT AN INSTANTANEOUS ACCELERATION, BUT RATHER AN "AVERAGE" OF THE ACCELERATION LEVELS DURING
034581,000141:                                                                                                  #  THE PRECEEDING PIPA INTERVAL, AND SINCE FP IS COMPUTED DIRECTLY FROM /AF/, FP IN ORDER TO CORRESPOND TO THE
034582,000142:                                                                                                  #  ACTUAL THRUST LEVEL AT THE END OF THE INTERVAL MUST BE WEIGHTED BY
034583,000143: 
034584,000144:                                                                                                  #                  PIF(PPROCESS + TL)     PIF /PIF/
034585,000145:                                                                                                  #        FWEIGHT = ------------------ + -------------
034586,000146:                                                                                                  #                       PGUID           2 PGUID FRATE
034587,000147: 
034588,000148:                                                                                                  #  WHERE PPROCESS IS THE TIME BETWEEN PIPA READING AND THE START OF THROTTLING, PGUID IS THE GUIDANCE PERIOD, AND
034589,000149:                                                                                                  #  FRATE IS THE THROTTLING RATE (32 UNITS PER CENTISECOND).  PGUID IS EITHER 1 OR 2 SECONDS.  THE "TL" IN THE
034590,000150:                                                                                                  #  FIRST TERM REPRESENTS THE ENGINE'S RESPONSE LAG.  HERE FWEIGHT IS COMPUTED FOR USE NEXT PASS.
034591,000151: 
034592,000152: 31,2323           31762                           CA       THISTPIP   +1                         #  INITIALIZE FWEIGHT COMP AS IF FOR P66
034593,000153: 31,2324           54130                           TS       BUF                                   
034594,000154: 
034595,000155: 31,2325           41011                           CS       MODREG                                #  ARE WE IN FACT IN P66?
034596,000156: 31,2326           62501                           AD       DEC66                                 
034597,000157: 31,2327           00006                           EXTEND                                         
034598,000158: 31,2330           12335                           BZF      FWCOMP                                #  YES
034599,000159: 
034600,000160: 31,2331           31235                           CA       PIPTIME    +1                         #  NO:  INITIALIZE FOR TWO SECOND PERIOD
034601,000161: 31,2332           54130                           TS       BUF                                   
034602,000162: 31,2333           35003                           CAF      4SECS                                 
034603,000163: 31,2334           12336                           TCF      FWCOMP     +1                         
034604,000164: 
034605,000165: 31,2335           35000        FWCOMP             CAF      2SECS                                 
034606,000166: 31,2336           54002                 +1        TS       Q                                     
034607,000167: 31,2337           00006                           EXTEND                                         
034608,000168: 31,2340           74746                           MP       BIT6                                  
034609,000169: 31,2341           22131                           LXCH     BUF        +1                         
034610,000170: 31,2342           40130                           CS       BUF                                   #  TIME OF LAST PIPA READING.
034611,000171: 31,2343           60025                           AD       TIME1                                 
034612,000172: 31,2344           62004                           AD       THROTLAG                              #  COMPENSATE FOR ENGINE RESPONSE LAG
034613,000173: 31,2345           74357                           MASK     LOW8                                  #  MAKE SURE SMALL AND POSITIVE
034614,000174: 31,2346           22007                           ZL                                             
034615,000175: 31,2347           00006                           EXTEND                                         

Page 796

034617,000177: 31,2350           10002                           DV       Q                                     
034618,000178: 31,2351           00006                           EXTEND                                         
034619,000179: 31,2352           71612                           MP       PIF                                   
034620,000180: 31,2353           60000                           DOUBLE                                         
034621,000181: 31,2354           53611                           DXCH     FWEIGHT                               
034622,000182: 31,2355           11612                           CCS      PIF                                   
034623,000183: 31,2356           64753                           AD       ONE                                   
034624,000184: 31,2357           12361                           TCF      +2                                    
034625,000185: 31,2360           64753                           AD       ONE                                   
034626,000186: 31,2361           00006                           EXTEND                                         
034627,000187: 31,2362           71612                           MP       PIF                                   
034628,000188: 31,2363           00006                           EXTEND                                         
034629,000189: 31,2364           10131                           DV       BUF        +1                         
034630,000190: 31,2365           22007                           ZL                                             
034631,000191: 31,2366           21611                           DAS      FWEIGHT                               
034632,000192: 
034633,000193: 31,2367           01607        THDUMP             TC       RTNHOLD                               
034634,000194: 
034635,000195:                                                                                                  #  FLATOUT THROTTLES UP THE DESCENT ENGINE, AND IS CALLED AS A BASIC SUBROUTINE.
034636,000196: 
034637,000197: 31,2370           34737        FLATOUT            CAF      BIT13                                 #  4096 PULSES
034638,000198: 31,2371           55606        WHATOUT            TS       PIFPSET                               #  USE PIFPSET SO FWEIGHT WILL BE ZERO
034639,000199: 31,2372           44755                           CS       ZERO                                  
034640,000200: 31,2373           55620                           TS       FCOLD                                 
034641,000201: 31,2374           55612                           TS       PIF                                   
034642,000202: 31,2375           00006                           EXTEND                                         
034643,000203: 31,2376           23607                           QXCH     RTNHOLD                               
034644,000204: 31,2377           12312                           TCF      DOIT                                  
034645,000205: 
034646,000206:                                                                                                  #  MASSMULT SCALES ACCELERATION, ARRIVING IN A AND L IN UNITS OF 2(-4) M/CS/CS, TO FORCE IN PULSE UNITS.
034647,000207: 
034648,000208: 31,2400           00006        MASSMULT           EXTEND                                         
034649,000209: 31,2401           22130                           QXCH     BUF                                   
034650,000210: 31,2402           52155                           DXCH     MPAC                                  
034651,000211: 31,2403           07103                           TC       DMP                                   
034652,000212: 31,2404           01244                           ADRES    MASS                                  
034653,000213: 31,2405           07103                           TC       DMP                                   #  LEAVES PROPERLY SCALED FORCE IM MPAC
034654,000214: 31,2406           02005                           ADRES    SCALEFAC                              
034655,000215: 31,2407           07257                           TC       TPAGREE                               
034656,000216: 31,2410           30154                           CA       MPAC                                  
034657,000217: 31,2411           00006                           EXTEND                                         
034658,000218: 31,2412           12415                           BZF      +3                                    
034659,000219: 31,2413           34733                           CAF      POSMAX                                
034660,000220: 31,2414           00130                           TC       BUF                                   
034661,000221: 31,2415           52156                           DXCH     MPAC       +1                         
034662,000222: 31,2416           00130                           TC       BUF                                   

Page 797

034664,000224:                                                                                                  #  CONSTANTS:-
034665,000225: 
034666,000226: 31,2417     4737               FEXTRA             =        BIT13                                 #  FEXT +5.13309020 E+4
034667,000227: 
034668,000228: 31,2417           04143        /AF/CNST           DEC      .13107                                
034669,000229: 
034670,000230:                                                                                                  #  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

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