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.

063640,000002:                                                                                                  ## Copyright:   Public domain.
063641,000003:                                                                                                  ## Filename:    TRIM_GIMBAL_CNTROL_SYSTEM.agc
063642,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
063643,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
063644,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
063645,000007:                                                                                                  ## Assembler:   yaYUL
063646,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
063647,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
063648,000010:                                                                                                  ## Pages:       1472-1485
063649,000011:                                                                                                  ## Mod history: 2009-05-27 RSB  Adapted from the corresponding 
063650,000012:                                                                                                  ##                              Luminary131 file, using page 
063651,000013:                                                                                                  ##                              images from Luminary 1A.
063652,000014:                                                                                                  ##              2011-01-06 JL   Fixed pseudo-label indentation.
063653,000015:                                                                                                  ##              2016-12-18 RSB  Proofed text comments with octopus/ProoferComments
063654,000016:                                                                                                  ##                              and corrected the errors found.
063655,000017:                                                                                                  ##              2017-03-14 RSB  Comment-text fixes noted in proofing Luminary 116.
063656,000018:                                                                                                  ##              2021-05-30 ABS  GTSGO+DN -> GTSGO+ON
063657,000019: 
063658,000020:                                                                                                  ## This source code has been transcribed or otherwise adapted from
063659,000021:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
063660,000022:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
063661,000023:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
063662,000024:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
063663,000025:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
063664,000026:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
063665,000027:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
063666,000028:                                                                                                  ## actually created.
063667,000029:                                                                                                  ##
063668,000030:                                                                                                  ## Notations on the hardcopy document read, in part:
063669,000031:                                                                                                  ##
063670,000032:                                                                                                  ##      Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
063671,000033:                                                                                                  ##      16:27 JULY 14, 1969 
063672,000034: 

Page 1472

063674,000036: 21,3077                                           BANK     21                                    
063675,000037: 21,3077  E6,1450                                  EBANK=   QDIFF                                 
063676,000038: 21,2000                                           SETLOC   DAPS4                                 
063677,000039: 21,2000                                           BANK                                           
063678,000040: 
063679,000041: 21,3077                                           COUNT*   $$/DAPGT                              
063680,000042: 
063681,000043:                                                                                                  #  CONTROL REACHES THIS POINT UNDER EITHER OF THE FOLLOWING TWO CONDITIONS ONCE THE DESCENT ENGINE AND THE DIGITAL
063682,000044:                                                                                                  #  AUTOPILOT ARE BOTH ON:
063683,000045:                                                                                                  #        A) THE TRIM GIMBAL CONTROL LAW WAS ON DURING THE PREVIOUS Q,R-AXIS TIME5 INTERRUPT (OR THE DAPIDLER
063684,000046:                                                                                                  #           INITIALIZATION WAS SET FOR TRIM GIMBAL CONTROL AND THIS IS THE FIRST PASS), OR
063685,000047:                                                                                                  #        B) THE Q,R-AXES RCS AUTOPILOT DETERMINED THAT THE VEHICLE WAS ENTERING (OR HAD JUST ENTERED) A COAST
063686,000048:                                                                                                  #           ZONE WITH A SMALL OFFSET ANGULAR ACCELERATION.
063687,000049:                                                                                                  #  GTS IS THE ENTRY TO THE GIMBAL TRIM SYSTEM FOR CONTROLLING ATTITUDE ERRORS AND RATES AS WELL AS ACCELERATIONS.
063688,000050: 
063689,000051: 21,3077           37747        GTS                CAF      NEGONE                                #  MAKE THE NEXT PASS THROUGH THE DAP BE
063690,000052: 21,3100           55631                           TS       COTROLER                              #        THROUGH RCS CONTROL,
063691,000053: 21,3101           34751                           CAF      FOUR                                  #        AND ENSURE THAT IT IS NOT A SKIP.
063692,000054: 21,3102           55535                           TS       SKIPU                                 
063693,000055: 21,3103           55536                           TS       SKIPV                                 
063694,000056: 
063695,000057: 21,3104           34752                           CAF      TWO                                   
063696,000058: 21,3105           55633                           TS       INGTS                                 #  SET INDICATOR OF GTS CONTROL POSITIVE.
063697,000059: 21,3106           55632                           TS       QGIMTIMR                              #  SET TIMERS TO 200 MSEC TO AVOID BOTH
063698,000060: 21,3107           55634                           TS       RGIMTIMR                              #  RUNAWAY AND INTERFERENCE BY NULLING.
063699,000061: 
063700,000062:                                                                                                  #  THE DRIVE SETTING ALGORITHM
063701,000063: 
063702,000064:                                                                                                  #        DEL = SGN(OMEGA + ALPHA*ABS(ALPHA)/(2*K))
063703,000065:                                                                                                  #                                                    2               1/2                  2       3/2
063704,000066:                                                                                                  #        NEGUSUM = ERROR*K + ALPHA*(DEL*OMEGA + ALPHA /(3*K)) + DEL*K   (DEL*OMEGA + ALPHA /(2*K))
063705,000067: 
063706,000068:                                                                                                  #        DRIVE = -SGN(NEGUSUM)
063707,000069: 
063708,000070: 21,3110           30021                           CA       SR                                    #  SAVE THE SR.  SHIFT IT LEFT TO CORRECT
063709,000071: 21,3111           60000                           AD       A                                     #  FOR THE RIGHT SHIFT DUE TO EDITING.
063710,000072: 21,3112           55505                           TS       SAVESR                                
063711,000073: 
063712,000074: 21,3113           34752        GTSGO+ON           CAF      TWO                                   #  SET INDEXER FOR R-AXIS CALCULATIONS.
063713,000075: 21,3114           13116                           TCF      GOQTRIMG   +1                         
063714,000076: 
063715,000077: 21,3115           34755        GOQTRIMG           CAF      ZERO                                  #  SET INDEXER FOR Q-AXIS CALCULATIONS
063716,000078: 21,3116           55750                           TS       QRCNTR                                
063717,000079: 

RSB 2016 — Everything between this line and the corresponding line below was missing in the Luminary 099 print-out from the MIT Museum (from which the remainder of the source-code was transcribed), presumably due to some problem with the printer. It has been filled in from snapshots of page 1472 and 1473 of a different Luminary 99 print-out, thoughtfully made for us by Don Eyles.

063724,000086: 21,3117           51750                           INDEX    QRCNTR                                #  AOS SCALED AT PI/2
063725,000087: 21,3120           31537                           CA       AOSQ                                  
063726,000088: 21,3121           00006                           EXTEND                                         
063727,000089: 21,3122           74752                           MP       BIT2                                  #  RESCALE AOS TO PI/4

Page 1473

063729,000091: 21,3123           00006                           EXTEND                                         
063730,000092: 21,3124           13130                           BZF      GTSQAXIS   -3                         #  USE FULL SCALE FOR LARGER AOS ESTIMATES.
063731,000093: 
063732,000094: 21,3125           50000                           INDEX    A                                     
063733,000095: 21,3126           44734                           CS       LIMITS                                #  LIMITS +1 CONTAINS NEGMAX.
063734,000096: 21,3127           56001                           XCH      L                                     #  LIMITS -1 CONTAINS POSMAX.
063735,000097: 
063736,000098: 21,3130           11750                           CCS      QRCNTR                                #  PICK UP RATE FOR THIS AXIS.  RATE CELLS
063737,000099: 21,3131           50000                           INDEX    A                                     #  ARE ADJACENT, NOT SEPARATED.  AT PI/4
063738,000100: 21,3132           31436                           CA       EDOTQ                                 
063739,000101: 21,3133           53744        GTSQAXIS           DXCH     WCENTRAL                              
063740,000102: 
063741,000103: 21,3134           51750                           INDEX    QRCNTR                                #  COLLECT K FOR THIS AXIS
063742,000104: 21,3135           31504                           CA       KQ                                    
063743,000105: 21,3136           55741                           TS       KCENTRAL                              
063744,000106: 
063745,000107: 21,3137           00006                           EXTEND                                         #  CONTROL AUTHORITY ZERO.  AVOID DRIVING
063746,000108: 21,3140           13576                           BZF      POSDRIVE   +1                         #  ENGINE BELL TO THE STOPS.
063747,000109: 
063748,000110: 21,3141           51750                           INDEX    QRCNTR                                #  QDIFF, RDIFF ARE STORED IN D.P.
063749,000111: 21,3142           31450                           CAE      QDIFF                                 
063750,000112: 
063751,000113: 21,3143           00006        ALGORTHM           EXTEND                                         #  Q(R)DIFF IS THETA (ERROR) SCALED AT PI.
063752,000114: 21,3144           71741                           MP       KCENTRAL                              #  FORM K*ERROR AT PI(2)/2(8), IN D.P.
063753,000115: 21,3145           23737                           LXCH     K2THETA                               
063754,000116: 21,3146           00006                           EXTEND                                         
063755,000117: 21,3147           74747                           MP       BIT5                                  #  RESCALE TO 4*PI(2)
063756,000118: 21,3150           53740                           DXCH     K2THETA                               
063757,000119: 21,3151           00006                           EXTEND                                         
063758,000120: 21,3152           74747                           MP       BIT5                                  #  FIRST TERM OF NEGUSUM IN K2THETA.
063759,000121: 21,3153           27740                           ADS      K2THETA    +1                         #  NO CARRY NEEDED       D.P. AT 4*PI(2)
063760,000122: 
063761,000123: 21,3154           41744                           CS       ACENTRAL                              #  FORM ALPHA(2)/(2*K) AT 16*PI, IN D.P.,
063762,000124: 21,3155           00006                           EXTEND                                         #  LIMITING QUOTIENT TO AVOID OVERFLOW.
063763,000125: 21,3156           74736                           MP       BIT14                                 #  -ALPHA/2 IN A, SCALED AT PI/4
063764,000126: 21,3157           00006                           EXTEND                                         
063765,000127: 21,3160           71744                           MP       ACENTRAL                              #  -ALPHA(2)/2 IN A,L, SCALED AT PI(2)/16
063766,000128: 21,3161           61741                           AD       KCENTRAL                              
063767,000129: 21,3162           00006                           EXTEND                                         
063768,000130: 21,3163           63200                           BZMF     HUGEQUOT                              #  K-ALPHA(2)/2 SHOULD BE PNZ FO DIVISION
063769,000131: 
063770,000132: 21,3164           00006                           EXTEND                                         
063771,000133: 21,3165           40001                           DCS      A                                     #  ALPHA(2)/2 - K
063772,000134: 21,3166           61741                           AD       KCENTRAL                              

RSB 2016 — End of material from Don Eyles's printout. The non-blank portion of page 1473 continues below:

063775,000137: 21,3167           00006                           EXTEND                                         
063776,000138: 21,3170           11741                           DV       KCENTRAL                              #  HIGH ORDER OF QUOTIENT.
063777,000139: 21,3171           57746                           XCH      A2CNTRAL                              
063778,000140: 21,3172           30001                           CA       L                                     #  SHIFT UP THE REMAINDER.
063779,000141: 21,3173           22007                           LXCH     7                                     #  ZERO LOW-ORDER DIVIDEND.
063780,000142: 21,3174           00006                           EXTEND                                         

Page 1474

063782,000144: 21,3175           11741                           DV       KCENTRAL                              
063783,000145: 21,3176           57747                           XCH      A2CNTRAL   +1                         #  QUOTIENT STORED AT 16*PI, D.P.
063784,000146: 21,3177           13203                           TCF      HAVEQUOT                              
063785,000147: 
063786,000148: 21,3200           34733        HUGEQUOT           CA       POSMAX                                
063787,000149: 21,3201           54001                           TS       L                                     
063788,000150: 21,3202           53747                           DXCH     A2CNTRAL                              #  LIMITED QUOTIENT STORED AT 16*PI, D.P.
063789,000151: 
063790,000152: 21,3203           31743        HAVEQUOT           CA       WCENTRAL                              
063791,000153: 21,3204           00006                           EXTEND                                         
063792,000154: 21,3205           74743                           MP       BIT9                                  #  RESCALE OMEGA AT 16*PI IN D.P.
063793,000155: 21,3206           53743                           DXCH     K2CNTRAL                              #  LOWER WORD OVERLAYS OMEGA IN WCENTRAL
063794,000156: 
063795,000157: 21,3207           00006                           EXTEND                                         
063796,000158: 21,3210           31743                           DCA      K2CNTRAL                              
063797,000159: 21,3211           53752                           DXCH     FUNCTION                              
063798,000160: 
063799,000161: 21,3212           31744                           CA       ACENTRAL                              #  GET ALPHA*ABS(ALPHA)/(2*K)
063800,000162: 21,3213           00006                           EXTEND                                         
063801,000163: 21,3214           63220                           BZMF     +4                                    
063802,000164: 
063803,000165: 21,3215           00006                           EXTEND                                         
063804,000166: 21,3216           31747                           DCA      A2CNTRAL                              
063805,000167: 21,3217           13222                           TCF      +3                                    
063806,000168: 
063807,000169: 21,3220           00006                           EXTEND                                         
063808,000170: 21,3221           41747                           DCS      A2CNTRAL                              
063809,000171: 
063810,000172: 21,3222           21752                           DAS      FUNCTION                              #  OMEGA + ALPHA*ABS(ALPHA)/2*K) AT 16*PI
063811,000173: 
063812,000174: 21,3223           11751                           CCS      FUNCTION                              #  DEL = +1 FOR FUNCT1 GREATER THAN ZERO.
063813,000175: 21,3224           13230                           TCF      POSFNCT1                              #  OTHERWISE DEL = -1
063814,000176: 21,3225           13227                           TCF      +2                                    
063815,000177: 21,3226           13232                           TCF      NEGFNCT1                              
063816,000178: 
063817,000179: 21,3227           11752                           CCS      FUNCTION   +1                         #  USE LOW ORDER WORD SINCE HIGH IS ZERO
063818,000180: 21,3230           34753        POSFNCT1           CAF      BIT1                                  
063819,000181: 21,3231           13233                           TCF      +2                                    
063820,000182: 21,3232           44753        NEGFNCT1           CS       BIT1                                  
063821,000183: 21,3233           55745                           TS       DEL                                   
063822,000184: 
063823,000185: 21,3234           11745                           CCS      DEL                                   #  REPLACE OMEGA BY DEL*OMEGA
063824,000186: 21,3235           13247                           TCF      FUNCT2                                #  POSITIVE DEL VALUE.  PROCEED.
063825,000187: 21,3236           13240                           TCF      DEFUNCT                               
063826,000188: 21,3237           13244                           TCF      NEGFNCT2                              
063827,000189: 
063828,000190: 21,3240           55742        DEFUNCT            TS       K2CNTRAL                              
063829,000191: 21,3241           55743                           TS       K2CNTRAL   +1                         
063830,000192: 21,3242           13247                           TCF      FUNCT2                                
063831,000193: 

Page 1475

063833,000195: 21,3243           65252        NEG1/3             DEC      -.33333                               
063834,000196: 
063835,000197: 21,3244           00006        NEGFNCT2           EXTEND                                         
063836,000198: 21,3245           41743                           DCS      K2CNTRAL                              
063837,000199: 21,3246           53743                           DXCH     K2CNTRAL                              
063838,000200: 
063839,000201: 21,3247           00006        FUNCT2             EXTEND                                         
063840,000202: 21,3250           31747                           DCA      A2CNTRAL                              
063841,000203: 21,3251           21743                           DAS      K2CNTRAL                              #  DEL*OMEGA + ALPHA(2)/(2*K) AT 16*PI, D.P.
063842,000204: 
063843,000205: 21,3252           31746        FUNCT3             CA       A2CNTRAL                              
063844,000206: 21,3253           00006                           EXTEND                                         
063845,000207: 21,3254           73243                           MP       NEG1/3                                
063846,000208: 21,3255           53747                           DXCH     A2CNTRAL                              
063847,000209: 21,3256           30001                           CA       L                                     
063848,000210: 21,3257           00006                           EXTEND                                         
063849,000211: 21,3260           73243                           MP       NEG1/3                                
063850,000212: 21,3261           27747                           ADS      A2CNTRAL   +1                         
063851,000213: 21,3262           54001                           TS       L                                     
063852,000214: 21,3263           13265                           TCF      +2                                    #  A2CNTRAL NOW CONTAINS -ALPHA(2)/(6*K),
063853,000215: 21,3264           27746                           ADS      A2CNTRAL                              #  SCALED AT 16*PI, IN D.P.
063854,000216: 
063855,000217: 21,3265           00006                           EXTEND                                         
063856,000218: 21,3266           31743                           DCA      K2CNTRAL                              #  DEL*OMEGA + ALPHA(2)/(3*K) IN A2CNTRAL,
063857,000219: 21,3267           21747                           DAS      A2CNTRAL                              #  SCALED AT 16*PI, D.P.
063858,000220: 
063859,000221: 21,3270           31746                           CA       A2CNTRAL                              
063860,000222: 21,3271           00006                           EXTEND                                         
063861,000223: 21,3272           71744                           MP       ACENTRAL                              
063862,000224: 21,3273           21740                           DAS      K2THETA                               
063863,000225: 21,3274           31747                           CA       A2CNTRAL   +1                         
063864,000226: 21,3275           00006                           EXTEND                                         
063865,000227: 21,3276           71744                           MP       ACENTRAL                              #  ACENTRAL MAY NOW BE OVERLAID.
063866,000228: 21,3277           27740                           ADS      K2THETA    +1                         
063867,000229: 21,3300           54001                           TS       L                                     
063868,000230: 21,3301           13303                           TCF      +2                                    #  TWO TERMS OF NEGUSUM ACCUMULATED, SO FAR
063869,000231: 21,3302           27737                           ADS      K2THETA                               #  SCALED AT 4*PI(2), IN D.P.
063870,000232: 
063871,000233: 21,3303           31742        GETROOT            CA       K2CNTRAL                              #  K*(DEL*OMEGA + ALPHA(2)/(2*K)) IS THE
063872,000234: 21,3304           00006                           EXTEND                                         #  TERM FOR WHICH A SQUARE ROOT IS NEEDED.
063873,000235: 21,3305           71741                           MP       KCENTRAL                              #  K AT PI/2(8)
063874,000236: 21,3306           53752                           DXCH     FUNCTION                              
063875,000237: 21,3307           31743                           CA       K2CNTRAL   +1                         
063876,000238: 21,3310           00006                           EXTEND                                         
063877,000239: 21,3311           71741                           MP       KCENTRAL                              
063878,000240: 21,3312           27752                           ADS      FUNCTION   +1                         
063879,000241: 21,3313           54001                           TS       L                                     
063880,000242: 21,3314           13316                           TCF      +2                                    
063881,000243: 21,3315           27751                           ADS      FUNCTION                              #  DESIRED TERM IN FUNCTION, AT PI(2)/16

Page 1476

063883,000245: 21,3316           11745                           CCS      DEL                                   
063884,000246: 21,3317           13524                           TCF      RSTOFGTS                              
063885,000247: 21,3320           13566                           TCF      NEGUSUM                               
063886,000248: 21,3321           13323                           TCF      NEGATE                                
063887,000249: 21,3322           13566                           TCF      NEGUSUM                               
063888,000250: 
063889,000251: 21,3323           00006        NEGATE             EXTEND                                         
063890,000252: 21,3324           41743                           DCS      K2CNTRAL                              
063891,000253: 21,3325           53743                           DXCH     K2CNTRAL                              
063892,000254: 21,3326           13524                           TCF      RSTOFGTS                              
063893,000255: 
063894,000256: 16,3735                                           BANK     16                                    
063895,000257: 16,3735  E6,1501                                  EBANK=   NEGUQ                                 
063896,000258: 16,2000                                           SETLOC   DAPS1                                 
063897,000259: 16,2000                                           BANK                                           
063898,000260: 
063899,000261:                                                                                                  #  THE WRCHN12 SUBROUTINE SETS BITS 9,10,11,12 OF CHANNEL 12 ON THE BASIS OF THE CONTENTS OF NEGUQ,NEGUR WHICH ARE
063900,000262:                                                                                                  #  THE NEGATIVES OF THE DESIRED ACCELERATION CHANGES.  ACDT+C12 SETS Q(R)ACCDOT TO REFLECT THE NEW DRIVES.
063901,000263: 
063902,000264:                                                                                                  #  WARNING:  ACDT+C12 AND WRCHN12 MUST BE CALLED WITH INTERRUPT INHIBITED.
063903,000265: 
063904,000266: 16,3735           07400        BGIM               OCTAL    07400                                 
063905,000267: 16,3736     0066               CHNL12             EQUALS   ITEMP6                                
063906,000268: 16,3736           41501        ACDT+C12           CS       NEGUQ                                 
063907,000269: 16,3737           00006                           EXTEND                                         #  GIMBAL DRIVE REQUESTS.
063908,000270: 16,3740           71507                           MP       ACCDOTQ                               
063909,000271: 16,3741           23510                           LXCH     QACCDOT                               
063910,000272: 16,3742           41503                           CS       NEGUR                                 
063911,000273: 16,3743           00006                           EXTEND                                         
063912,000274: 16,3744           71511                           MP       ACCDOTR                               
063913,000275: 16,3745           23512                           LXCH     RACCDOT                               
063914,000276: 
063915,000277: 16,3746           11501                           CCS      NEGUQ                                 
063916,000278: 16,3747           34742                           CAF      BIT10                                 
063917,000279: 16,3750           13752                           TCF      +2                                    
063918,000280: 16,3751           34743                           CAF      BIT9                                  
063919,000281: 16,3752           54066                           TS       CHNL12                                
063920,000282: 
063921,000283: 16,3753           11503                           CCS      NEGUR                                 
063922,000284: 16,3754           34740                           CAF      BIT12                                 
063923,000285: 16,3755           13757                           TCF      +2                                    
063924,000286: 16,3756           34741                           CAF      BIT11                                 
063925,000287: 16,3757           26066                           ADS      CHNL12                                #  (STORED RESULT NOT USED AT PRESENT)
063926,000288: 
063927,000289: 16,3760           43735                           CS       BGIM                                  
063928,000290: 16,3761           00006                           EXTEND                                         
063929,000291: 16,3762           02012                           RAND     CHAN12                                
063930,000292: 16,3763           60066                           AD       CHNL12                                
063931,000293: 16,3764           00006                           EXTEND                                         
063932,000294: 16,3765           01012                           WRITE    CHAN12                                

Page 1477

063934,000296: 16,3766           44747                           CS       CALLGMBL                              #  TURN OFF REQUEST FOR ACDT+C12 EXECUTION.
063935,000297: 16,3767           71273                           MASK     RCSFLAGS                              
063936,000298: 16,3770           55273                           TS       RCSFLAGS                              
063937,000299: 
063938,000300: 16,3771           00002                           TC       Q                                     #  RETURN TO CALLER.
063939,000301: 
063940,000302: 21,3327                                           BANK     21                                    
063941,000303: 21,3327  E6,1450                                  EBANK=   QDIFF                                 
063942,000304: 21,2000                                           SETLOC   DAPS4                                 
063943,000305: 21,2000                                           BANK                                           
063944,000306: 

Page 1478

063946,000308:                                                                                                  #  SUBROUTINE TIMEGMBL:  MOD 0, OCTOBER 1967, CRAIG WORK
063947,000309: 
063948,000310:                                                                                                  #  TIMEGMBL COMPUTES THE DRIVE TIME NEEDED FOR THE TRIM GIMBAL TO POSITION THE DESCENT ENGINE NOZZLE SO AS TO NULL
063949,000311:                                                                                                  #  THE OFFSET ANGULAR ACCELERATION ABOUT THE Q (OR R) AXIS.  INSTEAD OF USING AOSQ(R), TIMEGMBL USES .4*AOSQ(R),
063950,000312:                                                                                                  #  SCALED AT PI/8.  FOR EACH AXIS, THE DRIVE TIME IS COMPUTED AS ABS(ALPHA/ACCDOT).  A ZERO
063951,000313:                                                                                                  #  ALPHA OR ACCDOT OR A ZERO QUOTIENT TURNS OFF THE GIMBAL DRIVE IMMEDIATELY.  OTHERWISE, THE GIMBAL IS TURNED ON
063952,000314:                                                                                                  #  DRIVING IN THE CORRECT DIRECTION.  THE Q(R)GIMTIMR IS SET TO TERMINATE THE DRIVE AND Q(R)ACCDOT
063953,000315:                                                                                                  #  IS STORED TO REFLECT THE NEW ACCELERATION DERIVATIVE.  NEGUQ(R) WILL CONTAIN +1,+0,-1 FOR A Q(R)ACCDOT VALUE
063954,000316:                                                                                                  #  WHICH IS NEGATIVE, ZERO, OR POSITIVE.
063955,000317: 
063956,000318:                                                                                                  #  INPUTS:       AOSQ,AOSR, SCALED AT P1/2, AND ACCDOTQ, ACCDOTR AT PI/2(7).     PI/2(7).
063957,000319: 
063958,000320:                                                                                                  #  OUTPUTS:      NEW GIMBAL DRIVE BITS IN CHANNEL 12, NEGUQ, NEGUR, QACCDOT AND RACCDOT, THE LAST SCALED AT PI/2(7).
063959,000321:                                                                                                  #                Q(R)GIMTIMR WILL BE SET TO TIME AND TERMINATE GIMBAL DRIVE(S)
063960,000322: 
063961,000323:                                                                                                  #  DEBRIS:       A, L, Q, ITEMPS 2, 3, 6, RUPTREG2 AND ACDT+C12 DEBRIS.
063962,000324: 
063963,000325:                                                                                                  #  EXITS:        VIA TC Q.
063964,000326: 
063965,000327:                                                                                                  #  ALARMS, ABORTS, :  NONE
063966,000328: 
063967,000329:                                                                                                  #  SUBROUTINES:  ACDT+C12, IBNKCALL
063968,000330: 
063969,000331:                                                                                                  #  WARNING:      THIS SUBROUTINE WRITES INTO CHANNEL 12 AND USES THE ITEMPS.  THEREFORE IT MAY ONLY BE CALLED WITH
063970,000332:                                                                                                  #                INTERRUPT INHIBITED.
063971,000333: 
063972,000334:                                                                                                  #  ERASABLE STORAGE CONFIGURATION (NEEDED BY THE INDEXING METHODS):
063973,000335:                                                                                                  #        NEGUQ           ERASE   +2              NEGATIVE OF Q-AXIS GIMBAL DRIVE
063974,000336:                                                                                                  #        (SPWORD)        EQUALS  NEGUQ +1        ANY S.P. ERASABLE NUMBER, NOW THRSTCMD
063975,000337:                                                                                                  #        NEGUR           EQUALS  NEGUQ +2        NEGATIVE OF R-AXIS GIMBAL DRIVE
063976,000338:                                                                                                  #        ACCDOTQ         ERASE   +2              Q-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
063977,000339:                                                                                                  #        (SPWORD)        EQUALS  ACCDOTQ +1      ANY S.P. ERASABLE NUMBER NOW QACCDOT
063978,000340:                                                                                                  #        ACCDOTR         EQUALS  ACCDOTQ +2      R-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
063979,000341:                                                                                                  #                                                ACCDOTQ, ACCDOTR ARE MAGNITUDES.
063980,000342:                                                                                                  #        AOSQ            ERASE   +4              Q-AXIS ACC., D.P. AT PI/2 R/SEC(2)
063981,000343:                                                                                                  #        AOSR            EQUALS  AOSQ +2         R-AXIS ACCELERATION SCALED AT PI/2 R/S2
063982,000344: 
063983,000345: 21,3327     0066               QRNDXER            EQUALS   ITEMP6                                
063984,000346: 21,3327           23146        OCT23146           OCTAL    23146                                 #  DECIMAL .6
063985,000347: 21,3330     0063               NZACCDOT           EQUALS   ITEMP3                                
063986,000348: 
063987,000349: 21,3330           34753        TIMEGMBL           CAF      ONE                                   #  INITIALIZE ALLOWGTS.
063988,000350: 21,3331           55502                           TS       ALLOWGTS                              
063989,000351: 
063990,000352: 21,3332           34752                           CAF      TWO                                   #  SET UP LOOP FOR R AXIS.
063991,000353: 21,3333           22002                           LXCH     Q                                     #  SAVE RETURN ADDRESS.
063992,000354: 21,3334           22071                           LXCH     RUPTREG2                              

Page 1479

063994,000356: 21,3335           13337                           TCF      +2                                    
063995,000357: 21,3336           34755        TIMQGMBL           CAF      ZERO                                  #  NOW DO THE Q-AXIS
063996,000358: 21,3337           54066                           TS       QRNDXER                               
063997,000359: 21,3340           50066                           INDEX    QRNDXER                               
063998,000360: 21,3341           31507                           CA       ACCDOTQ                               #  ACCDOT IS PRESUMED TO BE AT PI/2(7).
063999,000361: 21,3342           00006                           EXTEND                                         
064000,000362: 21,3343           63413                           BZMF     TGOFFNOW                              #  IS ACCDOT LESS THAN OR EQUAL TO 0?
064001,000363: 21,3344           54063                           TS       NZACCDOT                              #  NO.  STORE NON-ZERO, POSITIVE ACCDOT.
064002,000364: 
064003,000365: 21,3345           50066        ALPHATRY           INDEX    QRNDXER                               
064004,000366: 21,3346           41537                           CS       AOSQ                                  
064005,000367: 21,3347           00006                           EXTEND                                         
064006,000368: 21,3350           13413                           BZF      TGOFFNOW                              #  IS ALPHA ZERO?
064007,000369: 
064008,000370: 21,3351           54002                           TS       Q                                     #  SAVE A COPY OF -AOS.
064009,000371: 21,3352           00006                           EXTEND                                         #  NO.  RESCALE FOR TIMEGMBL USE.
064010,000372: 21,3353           73327                           MP       OCT23146                              #  OCTAL 23146 IS DECIMAL .6
064011,000373: 21,3354           60002                           AD       Q                                     #  -1.6*AOS AT PI/2 = -.4*AOS AT PI/8.
064012,000374: 21,3355           54001                           TS       L                                     #  WAS THERE OVERFLOW?
064013,000375: 21,3356           13363                           TCF      SETNEGU                               #  NO.  COMPUTE DRIVE TIME.
064014,000376: 
064015,000377: 21,3357           40000                           CS       A                                     #  RECOVER -SGN(AOS) IN THE A REGISTER.
064016,000378: 21,3360           50066                           INDEX    QRNDXER                               #  YES.  START DRIVE WITHOUT WAITLIST.
064017,000379: 21,3361           57501                           XCH      NEGUQ                                 
064018,000380: 21,3362           13417                           TCF      NOTALLOW                              #  KNOCK DOWN THE ALLOWGTS FLAG.
064019,000381: 
064020,000382: 21,3363           00006        SETNEGU            EXTEND                                         
064021,000383: 21,3364           63371                           BZMF     POSALPH                               
064022,000384: 
064023,000385: 21,3365           40000                           COM                                            
064024,000386: 21,3366           54062                           TS       ITEMP2                                #  STORE -ABS(.4*AOS) SCALED AT PI/8.
064025,000387: 21,3367           44753                           CS       BIT1                                  
064026,000388: 21,3370           13373                           TCF      POSALPH    +2                         
064027,000389: 21,3371           54062        POSALPH            TS       ITEMP2                                #  STORE -ABS(.4*AOS) SCALED AT PI/8.
064028,000390: 21,3372           34753                           CA       BIT1                                  
064029,000391: 21,3373           50066                 +2        INDEX    QRNDXER                               #  SGN(AOS) INTO NEGU
064030,000392: 21,3374           55501                           TS       NEGUQ                                 #  STORE SGN(APLHA) AS NEGU
064031,000393: 
064032,000394: 21,3375           30063                           CA       NZACCDOT                              
064033,000395: 21,3376           00006                           EXTEND                                         
064034,000396: 21,3377           74740                           MP       BIT12                                 #  2*ACCDOT, SCALED AT PI/8.
064035,000397: 21,3400           60062                           AD       ITEMP2                                #  -ABS(ALPHA) + 2*ACCDOT, AT PI/8.
064036,000398: 21,3401           00006                           EXTEND                                         
064037,000399: 21,3402           63417                           BZMF     NOTALLOW                              #  IS DRIVE TIME MORE THAN TWO SECONDS?
064038,000400: 21,3403           40062                           CS       ITEMP2                                #  NO.  COMPUTE DRIVE TIME.
064039,000401: 21,3404           00006                           EXTEND                                         #  ABS(ALPHA) AT PI/8.
064040,000402: 21,3405           73440                           MP       OCT00240                              #  DECIMAL 10/1024
064041,000403: 21,3406           00006                           EXTEND                                         #  QUOTIENT IS DRIVE TIME AT WAITLIST.
064042,000404: 21,3407           10063                           DV       NZACCDOT                              #  ABS(ALPHA)/ACCDOT AT 2(14)/100

Page 1480

064044,000406: 21,3410           00006                           EXTEND                                         
064045,000407: 21,3411           13413                           BZF      TGOFFNOW                              #  DRIVE TIME MUST BE GREATER THAN ZERO.
064046,000408: 
064047,000409: 21,3412           13425                           TCF      DRIVEON                               
064048,000410: 
064049,000411: 21,3413           34755        TGOFFNOW           CAF      ZERO                                  #  TURN OFF GIMBAL NOW.
064050,000412: 21,3414           50066                           INDEX    QRNDXER                               
064051,000413: 21,3415           55501                           TS       NEGUQ                                 
064052,000414: 
064053,000415: 21,3416           13427                           TCF      DONEYET                               
064054,000416: 
064055,000417: 21,3417           36010        NOTALLOW           CAF      OCT31                                 
064056,000418: 21,3420           50066                           INDEX    QRNDXER                               
064057,000419: 21,3421           55632                           TS       QGIMTIMR                              
064058,000420: 21,3422           34755                           CAF      ZERO                                  #  DRIVE TIME IS MORE THAN 2 SECONDS, SO
064059,000421: 21,3423           55502                           TS       ALLOWGTS                              #  DO NOT PERMIT FURTHER GTS ATTITUDE-RATE
064060,000422:                                                                                                  #  CONTROL UNTIL AOSTASK APPROVES.
064061,000423: 21,3424           13427                           TCF      DONEYET                               #  NO WAITLIST CALL IS MADE.
064062,000424: 
064063,000425: 21,3425           50066        DRIVEON            INDEX    QRNDXER                               
064064,000426: 21,3426           55632                           TS       QGIMTIMR                              #  CHOOSE Q OR R AXIS.
064065,000427: 
064066,000428: 21,3427           10066        DONEYET            CCS      QRNDXER                               
064067,000429: 21,3430           13336                           TCF      TIMQGMBL                              
064068,000430: 
064069,000431: 21,3431           52073                           DXCH     RUPTREG3                              #  PROTECT IBNKCALL ERASABLES.  ACDT+C12
064070,000432: 21,3432           52063                           DXCH     ITEMP2                                #  LEAVES ITEMPS2,3 ALONE.
064071,000433: 
064072,000434: 21,3433           04674                           TC       IBNKCALL                              #  TURN OF CHANNEL BITS, SET Q(R)ACCDOTS.
064073,000435: 21,3434           35736                           CADR     ACDT+C12                              
064074,000436: 
064075,000437: 21,3435           52063                           DXCH     ITEMP2                                #  RESTORE ERASABLES FOR IBNKCALL.
064076,000438: 21,3436           52073                           DXCH     RUPTREG3                              
064077,000439: 
064078,000440: 21,3437           00071                           TC       RUPTREG2                              #  RETURN TO CALLER.
064079,000441: 
064080,000442: 21,3440           00240        OCT00240           OCTAL    00240                                 #  DECIMAL 10/1024
064081,000443: 

Page 1481

064083,000445:                                                                                                  #  THE FOLLOWING SECTION IS A CONTINUATION OF THE TRIM GIMBAL CONTROL FROM THE LAST GTS ENTRY.  THE QUANTITY NEGUSUM
064084,000446:                                                                                                  #  IS COMPUTED FOR EACH AXIS (Q,R), .707*DEL*FUNCTION(3/2) + K2THETA = NEGUSUM.  NEW DRIVES ARE ENTERED TO CH 12.
064085,000447: 
064086,000448:                                                                                                  #  THE SUBROUTINE GTSQRT ACCEPTS A DOUBLE PRECISION VALUE IN FUNCTION, FUNCTION +1 AND RETURNS A SINGLE-PRECISION
064087,000449:                                                                                                  #  SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF THE ARGUMENT.  ALSO, THE CELL SHFTFLAG CONTAINS A BINARY
064088,000450:                                                                                                  #  EXPONENT S, SUCH THAT THE SQUARE ROOT (RETURNED IN THE A REGISTER) MUST BE SHIFTED RIGHT (MULTIPLIED BY 2 TO THE
064089,000451:                                                                                                  #  POWER (-S)) IN ORDER TO BE THE TRUE SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF FUNCTION, FUNCTION +1.
064090,000452:                                                                                                  #  SQUARE ROOT ERROR IS NOT MORE THAN 2 IN THE 14TH SIGNIFICANT BIT.  CELLS CLOBBERED ARE A, L, SHFTFLAG, ININDEX,
064091,000453:                                                                                                  #  HALFARG, SCRATCH, SR, FUNCTION, FUNCTION +1.  GTSQRT IS CALLED BY TC GTSQRT AND RETURNS VIA TC Q OR TC FUNCTION +1.
064092,000454:                                                                                                  #  ZERO OR NEGATIVE ARGUMENTS YIELD ZERO FOR SQUARE ROOTS.
064093,000455: 
064094,000456: 21,3441           11751        GTSQRT             CCS      FUNCTION                              
064095,000457: 21,3442           13460                           TCF      GOODARG                               #  FUNCTION IS POSITIVE.  TAKE SQUARE ROOT.
064096,000458: 21,3443           13445                           TCF      +2                                    #  HIGH ORDER WORD IS ZERO.  TRY THE LOWER.
064097,000459: 21,3444           13451                           TCF      ZEROOT                                #  NEGATIVE.  USE ZERO FOR 1/2 POWER.
064098,000460: 
064099,000461: 21,3445           31752                           CA       FUNCTION   +1                         
064100,000462: 21,3446           00006                           EXTEND                                         
064101,000463: 21,3447           63451                           BZMF     ZEROOT                                
064102,000464: 
064103,000465: 21,3450           13454                           TCF      ZEROHIGH                              #  PROCEED.
064104,000466: 21,3451           34755        ZEROOT             CA       ZERO                                  
064105,000467: 21,3452           55741                           TS       SHFTFLAG                              
064106,000468: 21,3453           00002                           TC       Q                                     
064107,000469: 
064108,000470: 21,3454           57751        ZEROHIGH           XCH      FUNCTION                              #  14 MOST SIGNIFICANT BITS ARE IN THE
064109,000471: 21,3455           57752                           XCH      FUNCTION   +1                         #  LOWER WORD.  EXCHANGE THEM.
064110,000472: 21,3456           34757                           CA       SEVEN                                 
064111,000473: 21,3457           13461                           TCF      GOODARG    +1                         
064112,000474: 
064113,000475: 21,3460           34755        GOODARG            CA       ZERO                                  
064114,000476: 21,3461           55741                           TS       SHFTFLAG                              
064115,000477: 21,3462           35751                           CA       TWELVE                                #  INITIALIZE THE SCALING LOOP.
064116,000478: 21,3463           55744                           TS       ININDEX                               
064117,000479: 21,3464           13473                           TCF      SCALLOOP                              
064118,000480: 
064119,000481: 21,3465           31751        SCALSTRT           CA       FUNCTION                              
064120,000482: 21,3466           13507                           TCF      SCALDONE                              
064121,000483: 
064122,000484: 21,3467           37746        MULBUSH            CA       NEG2                                  #  IF ARG IS NOT LESS THAN 1/4, INDEX IS
064123,000485: 21,3470           27744                           ADS      ININDEX                               #  ZERO, INDICATING NO SHIFT NEEDED.
064124,000486: 21,3471           00006                           EXTEND                                         #  BRANCH IF ARG IS NOT LESS THAN 1/4.
064125,000487: 21,3472           63465                           BZMF     SCALSTRT                              #  OTHERWISE COMPARE ARG WITH A REFERENCE
064126,000488:                                                                                                  #  WHICH IS 4 TIMES LARGER THAN THE LAST.
064127,000489: 21,3473           41751        SCALLOOP           CS       FUNCTION                              
064128,000490: 21,3474           51744                           INDEX    ININDEX                               
064129,000491: 21,3475           64735                           AD       BIT15                                 #  REFERENCE MAGNITUDE LESS OR EQUAL TO 1/4
064130,000492: 21,3476           00006                           EXTEND                                         
064131,000493: 21,3477           63467                           BZMF     MULBUSH                               #  IF ARG IS NOT LESS THAN REFERENCE, GO
064132,000494:                                                                                                  #  AROUND THE MULBERRY BUSH ONCE MORE.

Page 1482

064134,000496: 21,3500           51744                           INDEX    ININDEX                               
064135,000497: 21,3501           34735                           CA       BIT15                                 #  THIS IS THE SCALE MAGNITUDE
064136,000498: 21,3502           57747                           XCH      HALFARG                               #  2**(-ININDEX) IS THE SHIFT DIVISOR.
064137,000499: 21,3503           00006                           EXTEND                                         #  RESCALE ARGUMENT.
064138,000500: 21,3504           31752                           DCA      FUNCTION                              
064139,000501: 21,3505           00006                           EXTEND                                         
064140,000502: 21,3506           11747                           DV       HALFARG                               
064141,000503:                                                                                                  #  ININDEX AND SHFTFLAG PRESERVE INFO FOR
064142,000504:                                                                                                  #  RESCALING AFTER ROOT PROCESS.
064143,000505: 21,3507           00006        SCALDONE           EXTEND                                         
064144,000506: 21,3510           23752                           QXCH     FUNCTION   +1                         #  SAVE Q FOR RETURN
064145,000507: 21,3511           00006                           EXTEND                                         
064146,000508: 21,3512           74736                           MP       BIT14                                 
064147,000509: 21,3513           55747                           TS       HALFARG                               
064148,000510: 21,3514           74737                           MASK     BIT13                                 
064149,000511: 21,3515           10000                           CCS      A                                     
064150,000512: 21,3516           33634                           CA       OCT11276                              
064151,000513: 21,3517           63632                           AD       ROOTHALF                              #  INITIAL GUESS IS ROOT 1/2 OR POSMAX
064152,000514: 21,3520           03636                           TC       ROOTCYCL                              
064153,000515: 21,3521           03636                           TC       ROOTCYCL                              
064154,000516: 21,3522           03636                           TC       ROOTCYCL                              
064155,000517: 21,3523           01752                           TC       FUNCTION   +1                         
064156,000518: 
064157,000519:                                                                                                  #  ****************************************************************************************************************
064158,000520: 
064159,000521: 21,3524           03441        RSTOFGTS           TC       GTSQRT                                
064160,000522: 21,3525           57742        PRODUCT            XCH      K2CNTRAL                              
064161,000523: 21,3526           00006                           EXTEND                                         
064162,000524: 21,3527           71742                           MP       K2CNTRAL                              
064163,000525: 21,3530           53743                           DXCH     K2CNTRAL                              
064164,000526: 21,3531           00006                           EXTEND                                         #                THE PRODUCT OF
064165,000527: 21,3532           70001                           MP       L                                     #   1/2                   2       1/2
064166,000528: 21,3533           27743                           ADS      K2CNTRAL   +1                         #  K   *(DEL*OMEGA + ALPHA /(2*K))
064167,000529: 21,3534           54001                           TS       L                                     #                      AND
064168,000530: 21,3535           13537                           TCF      +2                                    #                        2
064169,000531: 21,3536           27742                           ADS      K2CNTRAL                              #  DEL*(DEL*OMEGA + ALPHA /(2*K)) NOW IN 
064170,000532:                                                                                                  #  K2CNTRAL
064171,000533: 
064172,000534: 21,3537           31744        DOSHIFT            CA       ININDEX                               
064173,000535: 21,3540           00006                           EXTEND                                         #  MULTIPLY IN THE FACTOR 2(-S), RETURNED
064174,000536: 21,3541           74736                           MP       BIT14                                 #  BY THE GTSQRT SUBROUTINE
064175,000537: 21,3542           27741                           ADS      SHFTFLAG                              
064176,000538: 21,3543           00006                           EXTEND                                         
064177,000539: 21,3544           13563                           BZF      ADDITIN                               
064178,000540: 21,3545           51741                           INDEX    SHFTFLAG                              
064179,000541: 21,3546           34735                           CA       BIT15                                 

Page 1483

064181,000543: 21,3547           57742                           XCH      K2CNTRAL                              
064182,000544: 21,3550           00006                           EXTEND                                         
064183,000545: 21,3551           71742                           MP       K2CNTRAL                              
064184,000546: 21,3552           21740                           DAS      K2THETA                               
064185,000547: 21,3553           57742                           XCH      K2CNTRAL                              
064186,000548: 21,3554           00006                           EXTEND                                         
064187,000549: 21,3555           71743                           MP       K2CNTRAL   +1                         
064188,000550: 21,3556           27740                           ADS      K2THETA    +1                         
064189,000551: 21,3557           54001                           TS       L                                     
064190,000552: 21,3560           13562                           TCF      +2                                    
064191,000553: 21,3561           27737                           ADS      K2THETA                               
064192,000554: 
064193,000555: 21,3562           13566                           TCF      NEGUSUM                               
064194,000556: 
064195,000557: 21,3563           00006        ADDITIN            EXTEND                                         
064196,000558: 21,3564           31743                           DCA      K2CNTRAL                              
064197,000559: 21,3565           21740                           DAS      K2THETA                               #  NOW ADD IN THE K2THETA TERM.
064198,000560: 21,3566           11737        NEGUSUM            CCS      K2THETA                               #  TEST SIGN OF HIGH ORDER PART.
064199,000561: 21,3567           13573                           TCF      NEGDRIVE                              
064200,000562: 21,3570           13572                           TCF      +2                                    
064201,000563: 21,3571           13575                           TCF      POSDRIVE                              
064202,000564: 
064203,000565: 21,3572           11740                           CCS      K2THETA    +1                         #  SIGN TEST FOR LOW ORDER PART.
064204,000566: 21,3573           34753        NEGDRIVE           CA       BIT1                                  
064205,000567: 21,3574           13576                           TCF      +2                                    #  STOP GIMBAL DRIVE FOR A ZERO NEGUSUM.
064206,000568: 21,3575           44753        POSDRIVE           CS       BIT1                                  
064207,000569: 21,3576           54001                           TS       L                                     #  SAVE FOR DRIVE REVERSAL TEST.
064208,000570: 21,3577           51750                           INDEX    QRCNTR                                
064209,000571: 21,3600           57501                           XCH      NEGUQ                                 
064210,000572: 
064211,000573: 21,3601           00006                           EXTEND                                         
064212,000574: 21,3602           70001                           MP       L                                     #  MULTIPLY OLD NEGU AND NEW NEGU.
064213,000575: 21,3603           10001                           CCS      L                                     
064214,000576: 21,3604           13621                           TCF      LOUPE                                 #  NON-ZERO GIMBAL DRIVE BEING CONTINUED.
064215,000577: 
064216,000578: 21,3605           13616                           TCF      ZEROLOUP                              #  NO REVERSAL PROBLEM HERE.
064217,000579: 
064218,000580: 21,3606           13610                           TCF      REVERSAL                              #  NON-ZERO GIMBAL DRIVE BEING REVERSED.
064219,000581: 21,3607           13616                           TCF      ZEROLOUP                              #  NO REVERSAL PROBLEM HERE.
064220,000582: 
064221,000583: 21,3610           51750        REVERSAL           INDEX    QRCNTR                                #  A ZERO-DRIVE PAUSE IS NEEDED HERE.  ZERO
064222,000584: 21,3611           55510                           TS       QACCDOT                               #  IS IN A REGISTER FROM CCS ON (-1).
064223,000585: 21,3612           51750                           INDEX    QRCNTR                                
064224,000586: 21,3613           43633                           CS       GMBLBITA                              
064225,000587: 21,3614           00006                           EXTEND                                         
064226,000588: 21,3615           03012                           WAND     CHAN12                                
064227,000589: 
064228,000590: 21,3616           41273        ZEROLOUP           CS       RCSFLAGS                              #  SET UP REQUEST FOR ACDT+C12 CALL.
064229,000591: 21,3617           74747                           MASK     CALLGMBL                              
064230,000592: 21,3620           27273                           ADS      RCSFLAGS                              

Page 1484

064232,000594: 21,3621           11750        LOUPE              CCS      QRCNTR                                #  HAVE BOTH AXES BEEN PROCESSED?
064233,000595: 21,3622           13115                           TCF      GOQTRIMG                              #  NO.  DO Q AXIS NEXT.
064234,000596: 
064235,000597: 21,3623           31505                           CA       SAVESR                                #  RESTORE THE SR
064236,000598: 21,3624           54021                           TS       SR                                    
064237,000599: 
064238,000600: 21,3625           00006        GOCLOSE            EXTEND                                         #  TERMINATE THE JASK.
064239,000601: 21,3626           33631                           DCA      CLOSEADR                              
064240,000602: 21,3627           52006                           DTCB                                           
064241,000603: 
064242,000604: 21,3630  E6,1537                                  EBANK=   AOSQ                                  
064243,000605: 21,3630           03236 36106  CLOSEADR           2CADR    CLOSEOUT                              #  TERMINATE THE JASK.
064244,000606: 
064245,000607: 21,3632     5751               TWELVE             EQUALS   OCT14                                 
064246,000608: 21,3632           26501        ROOTHALF           OCTAL    26501                                 #  SQUARE ROOT OF 1/2
064247,000609: 21,3633           01400        GMBLBITA           OCTAL    01400                                 #  INDEXED WRT GMBLBITB  DO NOT MOVE ******
064248,000610: 21,3634           11276        OCT11276           OCTAL    11276                                 #  POSMAX - ROOTHALF
064249,000611: 21,3635           06000        GMBLBITB           OCTAL    06000                                 #  INDEXED WRT GMBLBITA  DO NOT MOVE ******
064250,000612: 
064251,000613:                                                                                                  #  SUBROUTINE ROOTCYCL:  BY CRAIG WORK, 3 APRIL 68
064252,000614: 
064253,000615:                                                                                                  #  ROOTCYCL IS A SUBROUTINE WHICH EXECUTES ONE NEWTON SQUARE ROOT ALGORITHM ITERATION.  THE INITIAL GUESS AT THE
064254,000616:                                                                                                  #  SQUARE ROOT IS PRESUMED TO BE IN THE A REGISTER AND ONE-HALF THE SQUARE IS TAKEN FROM HALFARG.  THE NEW APPROXI-
064255,000617:                                                                                                  #  MATION TO THE SQUARE ROOT IS RETURNED IN THE A REGISTER.  DEBRIS:  A, L, SR, SCRATCH.  ROOTCYCL IS CALLED FROM
064256,000618:                                                                                                  #  LOCATION (LOC) BY A TC ROOTCYCL, AND RETURNS (TC Q) TO LOC +1.
064257,000619: 
064258,000620:                                                                                                  #  WARNING:  IF THE INITIAL GUESS IS NOT GREATER THAN THE SQUARE, DIVIDE OR ADD OVERFLOW IS A REAL POSSIBILITY.
064259,000621: 
064260,000622: 21,3636           55746        ROOTCYCL           TS       SCRATCH                               #  STORE X
064261,000623: 21,3637           54021                           TS       SR                                    #  X/2 NOW IN SR
064262,000624: 21,3640           31747                           CA       HALFARG                               #  ARG/2 IN THE A REG
064263,000625: 21,3641           22007                           ZL                                             #  PREPARE FOR DIVISION
064264,000626: 21,3642           00006                           EXTEND                                         
064265,000627: 21,3643           11746                           DV       SCRATCH                               #  (ARG/X)/2
064266,000628: 21,3644           60021                           AD       SR                                    #  (X + ARG/X)/2 IN THE A REG
064267,000629: 21,3645           00002                           TC       Q                                     
064268,000630: 
064269,000631: 

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