Source Code

These source-code files derive from a printout of Luminary 210 (Apollo 15-17 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Jim Lawton, and transcribed to source code by a team of volunteers. This colorized, syntax-highlighted form was created by assembling that transcribed source code. Note that the full page images are available on the Virtual AGC project page at archive.org, while reduced-size images are presented at the VirtualAGC project website. Report or fix any transcription errors at the Virtual AGC project code repository.

Notations on the program listing read, in part:

	GAP: ASSEMBLE REVISION 210 OF AGC PROGRAM LUMINARY 
	BY NASA 2021112-161 17:11 MAR. 19,1971
Note that the date is the date of the printout, not the date of the program revision.

063848,000002:                                                                                                  ## Copyright:   Public domain.
063849,000003:                                                                                                  ## Filename:    TRIM_GIMBAL_CONTROL_SYSTEM.agc
063850,000004:                                                                                                  ## Purpose:     A section of Luminary revision 210.
063851,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
063852,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 15-17.
063853,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
063854,000008:                                                                                                  ##              that the code format has been changed to conform to the
063855,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
063856,000010:                                                                                                  ##              original YUL assembler.
063857,000011:                                                                                                  ## Reference:   pp. 1470-1482
063858,000012:                                                                                                  ## Assembler:   yaYUL
063859,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
063860,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
063861,000015:                                                                                                  ## Mod history: 2016-11-17 JL   Created from Luminary131 version.
063862,000016:                                                                                                  ##              2016-12-26 RSB  Comment-text proofed using ProoferComments
063863,000017:                                                                                                  ##                              and corrected errors found.
063864,000018: 

Page 1470

063866,000020: 21,3027                                           BANK     21                                    
063867,000021: 21,3027  E6,1450                                  EBANK=   QDIFF                                 
063868,000022: 21,2000                                           SETLOC   DAPS4                                 
063869,000023: 21,2000                                           BANK                                           
063870,000024: 
063871,000025: 21,3027                                           COUNT*   $$/DAPGT                              
063872,000026: 
063873,000027:                                                                                                  #  CONTROL REACHES THIS POINT UNDER EITHER OF THE FOLLOWING TWO CONDITIONS ONCE THE DESCENT ENGINE AND THE DIGITAL
063874,000028:                                                                                                  #  AUTOPILOT ARE BOTH ON:
063875,000029:                                                                                                  #           A) THE TRIM GIMBAL CONTROL LAW WAS ON DURING THE PREVIOUS Q,R-AXIS TIME5 INTERRUPT (OR THE DAPIDLER
063876,000030:                                                                                                  #              INITIALIZATION WAS SET FOR TRIM GIMBAL CONTROL AND THIS IS THE FIRST PASS), OR
063877,000031:                                                                                                  #           B) THE Q,R-AXES RCS AUTOPILOT DETERMINED THAT THE VEHICLE WAS ENTERING (OR HAD JUST ENTERED) A COAST
063878,000032:                                                                                                  #              ZONE WITH A SMALL OFFSET ANGULAR ACCELERATION.
063879,000033: 
063880,000034:                                                                                                  #  GTS IS THE ENTRY TO THE GIMBAL TRIM SYSTEM FOR CONTROLLING ATTITUDE ERRORS AND RATES AS WELL AS ACCELERATIONS.
063881,000035: 
063882,000036: 21,3027           37770        GTS                CAF      NEGONE                                #  MAKE THE NEXT PASS THROUGH THE DAP BE
063883,000037: 21,3030           55630                           TS       COTROLER                              #    THROUGH RCS CONTROL,
063884,000038: 21,3031           34742                           CAF      FOUR                                  #    AND ENSURE THAT IT IS NOT A SKIP.
063885,000039: 21,3032           55534                           TS       SKIPU                                 
063886,000040: 21,3033           55535                           TS       SKIPV                                 
063887,000041: 
063888,000042: 21,3034           34743                           CAF      TWO                                   
063889,000043: 21,3035           55632                           TS       INGTS                                 #  SET INDICATOR OF GTS CONTROL POSITIVE.
063890,000044: 21,3036           55631                           TS       QGIMTIMR                              #  SET TIMERS TO 200 MSEC TO AVOID BOTH
063891,000045: 21,3037           55633                           TS       RGIMTIMR                              #  RUNAWAY AND INTERFERENCE BY NULLING.
063892,000046: 
063893,000047:                                                                                                  #  THE DRIVE SETTING ALGORITHM
063894,000048: 
063895,000049:                                                                                                  #  DEL = SGN(OMEGA + ALPHA*ABS(ALPHA)/(2*K))
063896,000050: 
063897,000051:                                                                                                  #                                              2               1/2                  2       3/2
063898,000052:                                                                                                  #  NEGUSUM = ERROR*K + ALPHA*(DEL*OMEGA + ALPHA /(3*K)) + DEL*K   (DEL*OMEGA + ALPHA /(2*K))
063899,000053: 
063900,000054:                                                                                                  #  DRIVE = -SGN(NEGUSUM)
063901,000055: 
063902,000056: 21,3040           30021                           CA       SR                                    #  SAVE THE SR.  SHIFT IT LEFT TO CORRECT
063903,000057: 21,3041           60000                           AD       A                                     #  FOR THE RIGHT SHIFT DUE TO EDITING.
063904,000058: 21,3042           55505                           TS       SAVESR                                
063905,000059: 
063906,000060: 21,3043           34743        GTSGO+DN           CAF      TWO                                   #  SET INDEXER FOR R-AXIS CALCULATIONS.
063907,000061: 21,3044           13046                           TCF      GOQTRIMG   +1                         
063908,000062: 
063909,000063: 21,3045           34746        GOQTRIMG           CAF      ZERO                                  #  SET INDEXER FOR Q-AXIS CALCULATIONS
063910,000064: 21,3046           55747                           TS       QRCNTR                                
063911,000065: 
063912,000066: 21,3047           51747                           INDEX    QRCNTR                                #  AOS SCALED AT PI/2
063913,000067: 21,3050           31536                           CA       AOSQ                                  
063914,000068: 21,3051           00006                           EXTEND                                         
063915,000069: 21,3052           74743                           MP       BIT2                                  #  RESCALE AOS TO PI/4
063916,000070: 

Page 1471

063918,000072: 21,3053           00006                           EXTEND                                         
063919,000073: 21,3054           13060                           BZF      GTSQAXIS   -3                         #  USE FULL SCALE FOR LARGER AOS ESTIMATES.
063920,000074: 
063921,000075: 21,3055           50000                           INDEX    A                                     
063922,000076: 21,3056           44725                           CS       LIMITS                                #  LIMITS +1 CONTAINS NEGMAX.
063923,000077: 21,3057           56001                           XCH      L                                     #  LIMITS -1 CONTAINS POSMAX.
063924,000078: 
063925,000079: 21,3060           11747                           CCS      QRCNTR                                #  PICK UP RATE FOR THIS AXIS.  RATE CELLS
063926,000080: 21,3061           50000                           INDEX    A                                     #  ARE ADJACENT, NOT SEPARATED.  AT PI/4
063927,000081: 21,3062           31436                           CA       EDOTQ                                 
063928,000082: 21,3063           53743        GTSQAXIS           DXCH     WCENTRAL                              
063929,000083: 
063930,000084: 21,3064           51747                           INDEX    QRCNTR                                #  COLLECT K FOR THIS AXIS
063931,000085: 21,3065           31504                           CA       KQ                                    
063932,000086: 21,3066           55740                           TS       KCENTRAL                              
063933,000087: 
063934,000088: 21,3067           00006                           EXTEND                                         #  CONTROL AUTHORITY  ZERO.  AVOID DRIVING
063935,000089: 21,3070           13526                           BZF      POSDRIVE   +1                         #  ENGINE BELL TO THE STOPS.
063936,000090: 
063937,000091: 21,3071           51747                           INDEX    QRCNTR                                #  QDIFF, RDIFF ARE STORED IN D.P.
063938,000092: 21,3072           31450                           CAE      QDIFF                                 
063939,000093: 
063940,000094: 21,3073           00006        ALGORTHM           EXTEND                                         #  Q(R)DIFF IS THETA (ERROR) SCALED AT PI.
063941,000095: 21,3074           71740                           MP       KCENTRAL                              #  FORM K*ERROR AT PI(2)/2(8), IN D.P.
063942,000096: 21,3075           23736                           LXCH     K2THETA                               
063943,000097: 21,3076           00006                           EXTEND                                         
063944,000098: 21,3077           74740                           MP       BIT5                                  #  RESCALE TO 4*PI(2)
063945,000099: 21,3100           53737                           DXCH     K2THETA                               
063946,000100: 21,3101           00006                           EXTEND                                         
063947,000101: 21,3102           74740                           MP       BIT5                                  #  FIRST TERM OF NEGUSUM IN K2THETA.
063948,000102: 21,3103           27737                           ADS      K2THETA    +1                         #  NO CARRY NEEDED    D.P. AT 4*PI(2)
063949,000103: 
063950,000104: 21,3104           41743                           CS       ACENTRAL                              #  FORM ALPHA(2)/(2*K) AT 16*PI, IN D.P.,
063951,000105: 21,3105           00006                           EXTEND                                         #  LIMITING QUOTIENT TO AVOID OVERFLOW.
063952,000106: 21,3106           74727                           MP       BIT14                                 #  -ALPHA/2 IN A, SCALED AT PI/4
063953,000107: 21,3107           00006                           EXTEND                                         
063954,000108: 21,3110           71743                           MP       ACENTRAL                              #  -ALPHA(2)/2 IN A,L, SCALED AT PI(2)/16
063955,000109: 21,3111           61740                           AD       KCENTRAL                              
063956,000110: 21,3112           00006                           EXTEND                                         
063957,000111: 21,3113           63130                           BZMF     HUGEQUOT                              #  K-ALPHA(2)/2 SHOULD BE PNZ FO DIVISION
063958,000112: 
063959,000113: 21,3114           00006                           EXTEND                                         
063960,000114: 21,3115           40001                           DCS      A                                     #  ALPHA(2)/2 - K
063961,000115: 21,3116           61740                           AD       KCENTRAL                              
063962,000116: 21,3117           00006                           EXTEND                                         
063963,000117: 21,3120           11740                           DV       KCENTRAL                              #  HIGH ORDER OF QUOTIENT.
063964,000118: 21,3121           57745                           XCH      A2CNTRAL                              
063965,000119: 21,3122           30001                           CA       L                                     #  SHIFT UP THE REMAINDER.
063966,000120: 21,3123           22007                           LXCH     7                                     #  ZERO LOW-ORDER DIVIDEND.
063967,000121: 21,3124           00006                           EXTEND                                         
063968,000122: 

Page 1472

063970,000124: 21,3125           11740                           DV       KCENTRAL                              
063971,000125: 21,3126           57746                           XCH      A2CNTRAL   +1                         #  QUOTIENT STORED AT 16*PI, D.P.
063972,000126: 21,3127           13133                           TCF      HAVEQUOT                              
063973,000127: 
063974,000128: 21,3130           34724        HUGEQUOT           CA       POSMAX                                
063975,000129: 21,3131           54001                           TS       L                                     
063976,000130: 21,3132           53746                           DXCH     A2CNTRAL                              #  LIMITED QUOTIENT STORED AT 16*PI, D.P.
063977,000131: 
063978,000132: 21,3133           31742        HAVEQUOT           CA       WCENTRAL                              
063979,000133: 21,3134           00006                           EXTEND                                         
063980,000134: 21,3135           74734                           MP       BIT9                                  #  RESCALE OMEGA AT 16*PI IN D.P.
063981,000135: 21,3136           53742                           DXCH     K2CNTRAL                              #  LOWER WORD OVERLAYS OMEGA IN WCENTRAL
063982,000136: 
063983,000137: 21,3137           00006                           EXTEND                                         
063984,000138: 21,3140           31742                           DCA      K2CNTRAL                              
063985,000139: 21,3141           53751                           DXCH     FUNCTION                              
063986,000140: 
063987,000141: 21,3142           31743                           CA       ACENTRAL                              #  GET ALPHA*ABS(ALPHA)/(2*K)
063988,000142: 21,3143           00006                           EXTEND                                         
063989,000143: 21,3144           63150                           BZMF     +4                                    
063990,000144: 
063991,000145: 21,3145           00006                           EXTEND                                         
063992,000146: 21,3146           31746                           DCA      A2CNTRAL                              
063993,000147: 21,3147           13152                           TCF      +3                                    
063994,000148: 
063995,000149: 21,3150           00006                           EXTEND                                         
063996,000150: 21,3151           41746                           DCS      A2CNTRAL                              
063997,000151: 
063998,000152: 21,3152           21751                           DAS      FUNCTION                              #  OMEGA + ALPHA*ABS(ALPHA)/2*K) AT 16*PI
063999,000153: 
064000,000154: 21,3153           11750                           CCS      FUNCTION                              #  DEL = +1 FOR FUNCT1 GREATER THAN ZERO.
064001,000155: 21,3154           13160                           TCF      POSFNCT1                              #  OTHERWISE DEL = -1
064002,000156: 21,3155           13157                           TCF      +2                                    
064003,000157: 21,3156           13162                           TCF      NEGFNCT1                              
064004,000158: 
064005,000159: 21,3157           11751                           CCS      FUNCTION   +1                         #  USE LOW ORDER WORD SINCE HIGH IS ZERO
064006,000160: 21,3160           34744        POSFNCT1           CAF      BIT1                                  
064007,000161: 21,3161           13163                           TCF      +2                                    
064008,000162: 21,3162           44744        NEGFNCT1           CS       BIT1                                  
064009,000163: 21,3163           55744                           TS       DEL                                   
064010,000164: 
064011,000165: 21,3164           11744                           CCS      DEL                                   #  REPLACE OMEGA BY DEL*OMEGA
064012,000166: 21,3165           13177                           TCF      FUNCT2                                #  POSITIVE DEL VALUE.  PROCEED.
064013,000167: 21,3166           13170                           TCF      DEFUNCT                               
064014,000168: 21,3167           13174                           TCF      NEGFNCT2                              
064015,000169: 
064016,000170: 21,3170           55741        DEFUNCT            TS       K2CNTRAL                              
064017,000171: 21,3171           55742                           TS       K2CNTRAL   +1                         
064018,000172: 21,3172           13177                           TCF      FUNCT2                                
064019,000173: 

Page 1473

064021,000175: 21,3173           65252        NEG1/3             DEC      -.33333                               
064022,000176: 
064023,000177: 21,3174           00006        NEGFNCT2           EXTEND                                         
064024,000178: 21,3175           41742                           DCS      K2CNTRAL                              
064025,000179: 21,3176           53742                           DXCH     K2CNTRAL                              
064026,000180: 
064027,000181: 21,3177           00006        FUNCT2             EXTEND                                         
064028,000182: 21,3200           31746                           DCA      A2CNTRAL                              
064029,000183: 21,3201           21742                           DAS      K2CNTRAL                              #  DEL*OMEGA + ALPHA(2)/(2*K) AT 16*PI, D.P.
064030,000184: 
064031,000185: 21,3202           31745        FUNCT3             CA       A2CNTRAL                              
064032,000186: 21,3203           00006                           EXTEND                                         
064033,000187: 21,3204           73173                           MP       NEG1/3                                
064034,000188: 21,3205           53746                           DXCH     A2CNTRAL                              
064035,000189: 21,3206           30001                           CA       L                                     
064036,000190: 21,3207           00006                           EXTEND                                         
064037,000191: 21,3210           73173                           MP       NEG1/3                                
064038,000192: 21,3211           27746                           ADS      A2CNTRAL   +1                         
064039,000193: 21,3212           54001                           TS       L                                     
064040,000194: 21,3213           13215                           TCF      +2                                    #  A2CNTRAL NOW CONTAINS  -ALPHA(2)/(6*K),
064041,000195: 21,3214           27745                           ADS      A2CNTRAL                              #  SCALED AT 16*PI, IN D.P.
064042,000196: 
064043,000197: 21,3215           00006                           EXTEND                                         
064044,000198: 21,3216           31742                           DCA      K2CNTRAL                              #  DEL*OMEGA + ALPHA(2)/(3*K) IN A2CNTRAL,
064045,000199: 21,3217           21746                           DAS      A2CNTRAL                              #  SCALED AT 16*PI, D.P.
064046,000200: 
064047,000201: 21,3220           31745                           CA       A2CNTRAL                              
064048,000202: 21,3221           00006                           EXTEND                                         
064049,000203: 21,3222           71743                           MP       ACENTRAL                              
064050,000204: 21,3223           21737                           DAS      K2THETA                               
064051,000205: 21,3224           31746                           CA       A2CNTRAL   +1                         
064052,000206: 21,3225           00006                           EXTEND                                         
064053,000207: 21,3226           71743                           MP       ACENTRAL                              #  ACENTRAL MAY NOW BE OVERLAID.
064054,000208: 21,3227           27737                           ADS      K2THETA    +1                         
064055,000209: 21,3230           54001                           TS       L                                     
064056,000210: 21,3231           13233                           TCF      +2                                    #  TWO TERMS OF NEGUSUM ACCUMULATED, SO FAR
064057,000211: 21,3232           27736                           ADS      K2THETA                               #  SCALED AT 4*PI(2), IN D.P.
064058,000212: 
064059,000213: 21,3233           31741        GETROOT            CA       K2CNTRAL                              #  K*(DEL*OMEGA + ALPHA(2)/(2*K)) IS THE
064060,000214: 21,3234           00006                           EXTEND                                         #  TERM FOR WHICH A SQUARE ROOT IS NEEDED.
064061,000215: 21,3235           71740                           MP       KCENTRAL                              #  K AT PI/2(8)
064062,000216: 21,3236           53751                           DXCH     FUNCTION                              
064063,000217: 21,3237           31742                           CA       K2CNTRAL   +1                         
064064,000218: 21,3240           00006                           EXTEND                                         
064065,000219: 21,3241           71740                           MP       KCENTRAL                              
064066,000220: 21,3242           27751                           ADS      FUNCTION   +1                         
064067,000221: 21,3243           54001                           TS       L                                     
064068,000222: 21,3244           13246                           TCF      +2                                    
064069,000223: 21,3245           27750                           ADS      FUNCTION                              #  DESIRED TERM IN FUNCTION, AT PI(2)/16

Page 1474

064071,000225: 21,3246           11744                           CCS      DEL                                   
064072,000226: 21,3247           13454                           TCF      RSTOFGTS                              
064073,000227: 21,3250           13516                           TCF      NEGUSUM                               
064074,000228: 21,3251           13253                           TCF      NEGATE                                
064075,000229: 21,3252           13516                           TCF      NEGUSUM                               
064076,000230: 
064077,000231: 21,3253           00006        NEGATE             EXTEND                                         
064078,000232: 21,3254           41742                           DCS      K2CNTRAL                              
064079,000233: 21,3255           53742                           DXCH     K2CNTRAL                              
064080,000234: 21,3256           13454                           TCF      RSTOFGTS                              
064081,000235: 
064082,000236: 16,3736                                           BANK     16                                    
064083,000237: 16,3736  E6,1501                                  EBANK=   NEGUQ                                 
064084,000238: 16,2000                                           SETLOC   DAPS1                                 
064085,000239: 16,2000                                           BANK                                           
064086,000240: 
064087,000241:                                                                                                  #  THE WRCHN12 SUBROUTINE SETS BITS 9,10,11,12 OF CHANNEL 12 ON THE BASIS OF THE CONTENTS OF NEGUQ,NEGUR WHICH ARE
064088,000242:                                                                                                  #  THE NEGATIVES OF THE DESIRED ACCELERATION CHANGES.  ACDT+C12 SETS Q(R)ACCDOT TO REFLECT THE NEW DRIVES.
064089,000243: 
064090,000244:                                                                                                  #  WARNING:  ACDT+C12 AND WRCHN12 MUST BE CALLED WITH INTERRUPT INHIBITED.
064091,000245: 
064092,000246: 16,3736           07400        BGIM               OCTAL    07400                                 
064093,000247: 16,3737     0066               CHNL12             EQUALS   ITEMP6                                
064094,000248: 16,3737           41501        ACDT+C12           CS       NEGUQ                                 
064095,000249: 16,3740           00006                           EXTEND                                         #  GIMBAL DRIVE REQUESTS.
064096,000250: 16,3741           71507                           MP       ACCDOTQ                               
064097,000251: 16,3742           23510                           LXCH     QACCDOT                               
064098,000252: 16,3743           41503                           CS       NEGUR                                 
064099,000253: 16,3744           00006                           EXTEND                                         
064100,000254: 16,3745           71511                           MP       ACCDOTR                               
064101,000255: 16,3746           23512                           LXCH     RACCDOT                               
064102,000256: 
064103,000257: 16,3747           11501                           CCS      NEGUQ                                 
064104,000258: 16,3750           34733                           CAF      BIT10                                 
064105,000259: 16,3751           13753                           TCF      +2                                    
064106,000260: 16,3752           34734                           CAF      BIT9                                  
064107,000261: 16,3753           54066                           TS       CHNL12                                
064108,000262: 
064109,000263: 16,3754           11503                           CCS      NEGUR                                 
064110,000264: 16,3755           34731                           CAF      BIT12                                 
064111,000265: 16,3756           13760                           TCF      +2                                    
064112,000266: 16,3757           34732                           CAF      BIT11                                 
064113,000267: 16,3760           26066                           ADS      CHNL12                                #  (STORED RESULT NOT USED AT PRESENT)
064114,000268: 
064115,000269: 16,3761           43736                           CS       BGIM                                  
064116,000270: 16,3762           00006                           EXTEND                                         
064117,000271: 16,3763           02012                           RAND     CHAN12                                
064118,000272: 16,3764           60066                           AD       CHNL12                                
064119,000273: 16,3765           00006                           EXTEND                                         
064120,000274: 16,3766           01012                           WRITE    CHAN12                                
064121,000275: 

Page 1475

064123,000277: 16,3767           44740                           CS       CALLGMBL                              #  TURN OFF REQUEST FOR ACDT+C12 EXECUTION.
064124,000278: 16,3770           71774                           MASK     RCSFLAGS                              
064125,000279: 16,3771           55774                           TS       RCSFLAGS                              
064126,000280: 
064127,000281: 16,3772           00002                           TC       Q                                     #  RETURN TO CALLER.
064128,000282: 
064129,000283: 21,3257                                           BANK     21                                    
064130,000284: 21,3257  E6,1450                                  EBANK=   QDIFF                                 
064131,000285: 21,2000                                           SETLOC   DAPS4                                 
064132,000286: 21,2000                                           BANK                                           
064133,000287: 

Page 1476

064135,000289:                                                                                                  #  SUBROUTINE TIMEGMBL:  MOD 0,  OCTOBER 1967, CRAIG WORK
064136,000290: 
064137,000291:                                                                                                  #  TIMEGMBL COMPUTES THE DRIVE TIME NEEDED FOR THE TRIM GIMBAL TO POSITION THE DESCENT ENGINE NOZZLE SO AS TO NULL
064138,000292:                                                                                                  #  THE OFFSET ANGULAR ACCELERATION ABOUT THE Q (OR R) AXIS.  INSTEAD OF USING AOSQ(R), TIMEGMBL USES .4*AOSQ(R),
064139,000293:                                                                                                  #  SCALED AT PI/8.                         FOR EACH AXIS, THE DRIVE TIME IS COMPUTED AS ABS(ALPHA/ACCDOT).  A ZERO
064140,000294:                                                                                                  #  ALPHA OR ACCDOT OR A ZERO QUOTIENT TURNS OFF THE GIMBAL DRIVE IMMEDIATELY.  OTHERWISE, THE GIMBAL IS TURNED ON
064141,000295:                                                                                                  #  DRIVING IN THE CORRECT DIRECTION. THE Q(R)GIMTIMR IS SET TO TERMINATE THE DRIVE AND Q(R)ACCDOT
064142,000296:                                                                                                  #  IS STORED TO REFLECT THE NEW ACCELERATION DERIVATIVE.  NEGUQ(R) WILL CONTAIN +1,+0,-1 FOR A Q(R)ACCDOT VALUE
064143,000297:                                                                                                  #  WHICH IS NEGATIVE, ZERO, OR POSITIVE.
064144,000298: 
064145,000299:                                                                                                  #  INPUTS:  AOSQ,AOSR, SCALED AT P1/2, AND ACCDOTQ, ACCDOTR AT PI/2(7).    PI/2(7).
064146,000300: 
064147,000301:                                                                                                  #  OUTPUTS:   NEW GIMBAL DRIVE BITS IN CHANNEL 12,NEGUQ,NEGUR,QACCDOT AND RACCDOT, THE LAST SCALED AT PI/2(7).
064148,000302:                                                                                                  #             Q(R)GIMTIMR WILL BE SET TO TIME AND TERMINATE GIMBAL DRIVE(S)
064149,000303: 
064150,000304:                                                                                                  #  DEBRIS:  A,L,Q, ITEMPS 2,3,6, RUPTREG2 AND ACDT+C12 DEBRIS.
064151,000305: 
064152,000306:                                                                                                  #  EXITS:  VIA TC Q.
064153,000307: 
064154,000308:                                                                                                  #  ALARMS, ABORTS, :  NONE
064155,000309: 
064156,000310:                                                                                                  #  SUBROUTINES:  ACDT+C12, IBNKCALL
064157,000311: 
064158,000312:                                                                                                  #  WARNING:  THIS SUBROUTINE WRITES INTO CHANNEL 12 AND USES THE ITEMPS.  THEREFORE IT MAY ONLY BE CALLED WITH
064159,000313:                                                                                                  #  INTERRUPT INHIBITED.
064160,000314: 
064161,000315:                                                                                                  #  ERASABLE STORAGE CONFIGURATION (NEEDED BY THE INDEXING METHODS):
064162,000316: 
064163,000317:                                                                                                  #                                          NEGUQ    ERASE    +2            NEGATIVE OF Q-AXIS GIMBAL DRIVE
064164,000318:                                                                                                  #                                          (SPWORD) EQUALS  NEGUQ +1       ANY S.P. ERASABLE NUMBER, NOW THRSTCMD
064165,000319:                                                                                                  #                                          NEGUR    EQUALS  NEGUQ +2       NEGATIVE OF R-AXIS GIMBAL DRIVE
064166,000320: 
064167,000321:                                                                                                  #                                          ACCDOTQ  ERASE    +2            Q-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
064168,000322:                                                                                                  #                                          (SPWORD) EQUALS  ACCDOTQ +1     ANY S.P. ERASABLE NUMBER  NOW QACCDOT
064169,000323:                                                                                                  #                                          ACCDOTR  EQUALS  ACCDOTQ +2     R-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
064170,000324:                                                                                                  #                                                                          ACCDOTQ,ACCDOTR ARE MAGNITUDES.
064171,000325:                                                                                                  #                                          AOSQ     ERASE   +4             Q-AXIS ACC.,D.P. AT PI/2 R/SEC(2)
064172,000326:                                                                                                  #                                          AOSR     EQUALS  AOSQ +2        R-AXIS ACCELERATION SCALED AT PI/2 R/S2
064173,000327: 
064174,000328: 21,3257     0066               QRNDXER            EQUALS   ITEMP6                                
064175,000329: 21,3257           23146        OCT23146           OCTAL    23146                                 #  DECIMAL .6
064176,000330: 21,3260     0063               NZACCDOT           EQUALS   ITEMP3                                
064177,000331: 
064178,000332: 21,3260           34744        TIMEGMBL           CAF      ONE                                   #  INITIALIZE ALLOWGTS.
064179,000333: 21,3261           55502                           TS       ALLOWGTS                              
064180,000334: 
064181,000335: 21,3262           34743                           CAF      TWO                                   #  SET UP LOOP FOR R AXIS.
064182,000336: 21,3263           22002                           LXCH     Q                                     #  SAVE RETURN ADDRESS.
064183,000337: 21,3264           22071                           LXCH     RUPTREG2                              
064184,000338: 

Page 1477

064186,000340: 21,3265           13267                           TCF      +2                                    
064187,000341: 21,3266           34746        TIMQGMBL           CAF      ZERO                                  #  NOW DO THE Q-AXIS
064188,000342: 21,3267           54066                           TS       QRNDXER                               
064189,000343: 21,3270           50066                           INDEX    QRNDXER                               
064190,000344: 21,3271           31507                           CA       ACCDOTQ                               #  ACCDOT IS PRESUMED TO BE AT PI/2(7).
064191,000345: 21,3272           00006                           EXTEND                                         
064192,000346: 21,3273           63343                           BZMF     TGOFFNOW                              #  IS ACCDOT LESS THAN OR EQUAL TO 0?
064193,000347: 21,3274           54063                           TS       NZACCDOT                              #  NO.  STORE NON-ZERO, POSITIVE ACCDOT.
064194,000348: 
064195,000349: 21,3275           50066        ALPHATRY           INDEX    QRNDXER                               
064196,000350: 21,3276           41536                           CS       AOSQ                                  
064197,000351: 21,3277           00006                           EXTEND                                         
064198,000352: 21,3300           13343                           BZF      TGOFFNOW                              #  IS ALPHA ZERO?
064199,000353: 
064200,000354: 21,3301           54002                           TS       Q                                     #  SAVE A COPY OF -AOS.
064201,000355: 21,3302           00006                           EXTEND                                         #  NO.  RESCALE FOR TIMEGMBL USE.
064202,000356: 21,3303           73257                           MP       OCT23146                              #  OCTAL 23146 IS DECIMAL .6
064203,000357: 21,3304           60002                           AD       Q                                     #  -1.6*AOS AT PI/2 = -.4*AOS AT PI/8.
064204,000358: 21,3305           54001                           TS       L                                     #  WAS THERE OVERFLOW?
064205,000359: 21,3306           13313                           TCF      SETNEGU                               #  NO.  COMPUTE DRIVE TIME.
064206,000360: 
064207,000361: 21,3307           40000                           CS       A                                     #  RECOVER  -SGN(AOS) IN THE A REGISTER.
064208,000362: 21,3310           50066                           INDEX    QRNDXER                               #  YES.  START DRIVE WITHOUT WAITLIST.
064209,000363: 21,3311           57501                           XCH      NEGUQ                                 
064210,000364: 21,3312           13347                           TCF      NOTALLOW                              #  KNOCK DOWN THE ALLOWGTS FLAG.
064211,000365: 
064212,000366: 21,3313           00006        SETNEGU            EXTEND                                         
064213,000367: 21,3314           63321                           BZMF     POSALPH                               
064214,000368: 
064215,000369: 21,3315           40000                           COM                                            
064216,000370: 21,3316           54062                           TS       ITEMP2                                #  STORE  -ABS(.4*AOS) SCALED AT PI/8.
064217,000371: 21,3317           44744                           CS       BIT1                                  
064218,000372: 21,3320           13323                           TCF      POSALPH    +2                         
064219,000373: 21,3321           54062        POSALPH            TS       ITEMP2                                #  STORE  -ABS(.4*AOS) SCALED AT PI/8.
064220,000374: 21,3322           34744                           CA       BIT1                                  
064221,000375: 21,3323           50066                 +2        INDEX    QRNDXER                               #  SGN(AOS) INTO NEGU
064222,000376: 21,3324           55501                           TS       NEGUQ                                 #  STORE SGN(APLHA) AS NEGU
064223,000377: 
064224,000378: 21,3325           30063                           CA       NZACCDOT                              
064225,000379: 21,3326           00006                           EXTEND                                         
064226,000380: 21,3327           74731                           MP       BIT12                                 #  2*ACCDOT, SCALED AT PI/8.
064227,000381: 21,3330           60062                           AD       ITEMP2                                #  -ABS(ALPHA) + 2*ACCDOT, AT PI/8.
064228,000382: 21,3331           00006                           EXTEND                                         
064229,000383: 21,3332           63347                           BZMF     NOTALLOW                              #  IS DRIVE TIME MORE THAN TWO SECONDS?
064230,000384: 21,3333           40062                           CS       ITEMP2                                #  NO.  COMPUTE DRIVE TIME.
064231,000385: 21,3334           00006                           EXTEND                                         #  ABS(ALPHA) AT PI/8.
064232,000386: 21,3335           73370                           MP       OCT00240                              #  DECIMAL 10/1024
064233,000387: 21,3336           00006                           EXTEND                                         #  QUOTIENT IS DRIVE TIME AT WAITLIST.
064234,000388: 21,3337           10063                           DV       NZACCDOT                              #  ABS(ALPHA)/ACCDOT AT 2(14)/100
064235,000389: 

Page 1478

064237,000391: 21,3340           00006                           EXTEND                                         
064238,000392: 21,3341           13343                           BZF      TGOFFNOW                              #  DRIVE TIME MUST BE GREATER THAN ZERO.
064239,000393: 
064240,000394: 21,3342           13355                           TCF      DRIVEON                               
064241,000395: 
064242,000396: 21,3343           34746        TGOFFNOW           CAF      ZERO                                  #  TURN OFF GIMBAL NOW.
064243,000397: 21,3344           50066                           INDEX    QRNDXER                               
064244,000398: 21,3345           55501                           TS       NEGUQ                                 
064245,000399: 
064246,000400: 21,3346           13357                           TCF      DONEYET                               
064247,000401: 
064248,000402: 21,3347           36010        NOTALLOW           CAF      OCT31                                 
064249,000403: 21,3350           50066                           INDEX    QRNDXER                               
064250,000404: 21,3351           55631                           TS       QGIMTIMR                              
064251,000405: 21,3352           34746                           CAF      ZERO                                  #  DRIVE TIME IS MORE THAN 2 SECONDS, SO
064252,000406: 21,3353           55502                           TS       ALLOWGTS                              #  DO NOT PERMIT FURTHER GTS ATTITUDE-RATE
064253,000407:                                                                                                  #  CONTROL UNTIL AOSTASK APPROVES.
064254,000408: 21,3354           13357                           TCF      DONEYET                               #  NO WAITLIST CALL IS MADE.
064255,000409: 
064256,000410: 21,3355           50066        DRIVEON            INDEX    QRNDXER                               
064257,000411: 21,3356           55631                           TS       QGIMTIMR                              #  CHOOSE Q OR R AXIS.
064258,000412: 
064259,000413: 21,3357           10066        DONEYET            CCS      QRNDXER                               
064260,000414: 21,3360           13266                           TCF      TIMQGMBL                              
064261,000415: 
064262,000416: 21,3361           52073                           DXCH     RUPTREG3                              #  PROTECT IBNKCALL ERASABLES.  ACDT+C12
064263,000417: 21,3362           52063                           DXCH     ITEMP2                                #  LEAVES ITEMPS2,3 ALONE.
064264,000418: 
064265,000419: 21,3363           04665                           TC       IBNKCALL                              #  TURN OF CHANNEL BITS, SET Q(R)ACCDOTS.
064266,000420: 21,3364           35737                           CADR     ACDT+C12                              
064267,000421: 
064268,000422: 21,3365           52063                           DXCH     ITEMP2                                #  RESTORE ERASABLES FOR IBNKCALL.
064269,000423: 21,3366           52073                           DXCH     RUPTREG3                              
064270,000424: 
064271,000425: 21,3367           00071                           TC       RUPTREG2                              #  RETURN TO CALLER.
064272,000426: 
064273,000427: 21,3370           00240        OCT00240           OCTAL    00240                                 #  DECIMAL 10/1024
064274,000428: 

Page 1479

064276,000430:                                                                                                  #  THE FOLLOWING SECTION IS A CONTINUATION OF THE TRIM GIMBAL CONTROL FROM THE LAST GTS ENTRY. THE QUANTITY NEGUSUM
064277,000431:                                                                                                  #  IS COMPUTED FOR EACH AXIS (Q,R), .707*DEL*FUNCTION(3/2) + K2THETA = NEGUSUM.  NEW DRIVES ARE ENTERED TO CH 12.
064278,000432: 
064279,000433:                                                                                                  #  THE SUBROUTINE GTSQRT ACCEPTS A DOUBLE PRECISION VALUE IN FUNCTION, FUNCTION +1 AND RETURNS A SINGLE-PRECISION
064280,000434:                                                                                                  #  SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF THE ARGUMENT.  ALSO, THE CELL SHFTFLAG CONTAINS A BINARY
064281,000435:                                                                                                  #  EXPONENT S, SUCH THAT THE SQUARE ROOT (RETURNED IN THE A REGISTER) MUST BE SHIFTED RIGHT (MULTIPLIED BY 2 TO THE
064282,000436:                                                                                                  #  POWER (-S)) IN ORDER TO BE THE TRUE SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF FUNCTION, FUNCTION +1.
064283,000437:                                                                                                  #  SQUARE ROOT ERROR IS NOT MORE THAN 2 IN THE 14TH SIGNIFICANT BIT.  CELLS CLOBBERED ARE A,L,SHFTFLAG,ININDEX,
064284,000438:                                                                                                  #  HALFARG,SCRATCH,SR,FUNCTION, FUNCTION +1.  GTSQRT IS CALLED BY TC GTSQRT AND RETURNS VIA TC Q OR TC FUNCTION +1.
064285,000439:                                                                                                  #  ZERO OR NEGATIVE ARGUMENTS YIELD ZERO FOR SQUARE ROOTS.
064286,000440: 
064287,000441: 21,3371           11750        GTSQRT             CCS      FUNCTION                              
064288,000442: 21,3372           13410                           TCF      GOODARG                               #  FUNCTION IS POSITIVE.  TAKE SQUARE ROOT.
064289,000443: 21,3373           13375                           TCF      +2                                    #  HIGH ORDER WORD IS ZERO.  TRY THE LOWER.
064290,000444: 21,3374           13401                           TCF      ZEROOT                                #  NEGATIVE.  USE ZERO FOR 1/2 POWER.
064291,000445: 
064292,000446: 21,3375           31751                           CA       FUNCTION   +1                         
064293,000447: 21,3376           00006                           EXTEND                                         
064294,000448: 21,3377           63401                           BZMF     ZEROOT                                
064295,000449: 
064296,000450: 21,3400           13404                           TCF      ZEROHIGH                              #  PROCEED.
064297,000451: 21,3401           34746        ZEROOT             CA       ZERO                                  
064298,000452: 21,3402           55740                           TS       SHFTFLAG                              
064299,000453: 21,3403           00002                           TC       Q                                     
064300,000454: 
064301,000455: 21,3404           57750        ZEROHIGH           XCH      FUNCTION                              #  14 MOST SIGNIFICANT BITS ARE IN THE
064302,000456: 21,3405           57751                           XCH      FUNCTION   +1                         #  LOWER WORD.  EXCHANGE THEM.
064303,000457: 21,3406           34750                           CA       SEVEN                                 
064304,000458: 21,3407           13411                           TCF      GOODARG    +1                         
064305,000459: 
064306,000460: 21,3410           34746        GOODARG            CA       ZERO                                  
064307,000461: 21,3411           55740                           TS       SHFTFLAG                              
064308,000462: 21,3412           35745                           CA       TWELVE                                #  INITIALIZE THE SCALING LOOP.
064309,000463: 21,3413           55743                           TS       ININDEX                               
064310,000464: 21,3414           13423                           TCF      SCALLOOP                              
064311,000465: 
064312,000466: 21,3415           31750        SCALSTRT           CA       FUNCTION                              
064313,000467: 21,3416           13437                           TCF      SCALDONE                              
064314,000468: 
064315,000469: 21,3417           37767        MULBUSH            CA       NEG2                                  #  IF ARG IS NOT LESS THAN 1/4, INDEX IS
064316,000470: 21,3420           27743                           ADS      ININDEX                               #  ZERO, INDICATING NO SHIFT NEEDED.
064317,000471: 21,3421           00006                           EXTEND                                         #  BRANCH IF ARG IS NOT LESS THAN 1/4.
064318,000472: 21,3422           63415                           BZMF     SCALSTRT                              #  OTHERWISE COMPARE ARG WITH A REFERENCE
064319,000473:                                                                                                  #  WHICH IS 4 TIMES LARGER THAN THE LAST.
064320,000474: 21,3423           41750        SCALLOOP           CS       FUNCTION                              
064321,000475: 21,3424           51743                           INDEX    ININDEX                               
064322,000476: 21,3425           64726                           AD       BIT15                                 #  REFERENCE MAGNITUDE LESS OR EQUAL TO 1/4
064323,000477: 21,3426           00006                           EXTEND                                         
064324,000478: 21,3427           63417                           BZMF     MULBUSH                               #  IF ARG IS NOT LESS THAN REFERENCE, GO
064325,000479:                                                                                                  #  AROUND THE MULBERRY BUSH ONCE MORE.
064326,000480: 

Page 1480

064328,000482: 21,3430           51743                           INDEX    ININDEX                               
064329,000483: 21,3431           34726                           CA       BIT15                                 #  THIS IS THE SCALE MAGNITUDE
064330,000484: 21,3432           57746                           XCH      HALFARG                               #  2**(-ININDEX) IS THE SHIFT DIVISOR.
064331,000485: 21,3433           00006                           EXTEND                                         #  RESCALE ARGUMENT.
064332,000486: 21,3434           31751                           DCA      FUNCTION                              
064333,000487: 21,3435           00006                           EXTEND                                         
064334,000488: 21,3436           11746                           DV       HALFARG                               
064335,000489:                                                                                                  #  ININDEX AND SHFTFLAG PRESERVE INFO FOR
064336,000490: 
064337,000491:                                                                                                  #  RESCALING AFTER ROOT PROCESS.
064338,000492: 21,3437           00006        SCALDONE           EXTEND                                         
064339,000493: 21,3440           23751                           QXCH     FUNCTION   +1                         #  SAVE Q FOR RETURN
064340,000494: 21,3441           00006                           EXTEND                                         
064341,000495: 21,3442           74727                           MP       BIT14                                 
064342,000496: 21,3443           55746                           TS       HALFARG                               
064343,000497: 21,3444           74730                           MASK     BIT13                                 
064344,000498: 21,3445           10000                           CCS      A                                     
064345,000499: 21,3446           33564                           CA       OCT11276                              
064346,000500: 21,3447           63562                           AD       ROOTHALF                              #  INITIAL GUESS IS ROOT 1/2 OR POSMAX
064347,000501: 
064348,000502: 21,3450           03566                           TC       ROOTCYCL                              
064349,000503: 21,3451           03566                           TC       ROOTCYCL                              
064350,000504: 21,3452           03566                           TC       ROOTCYCL                              
064351,000505: 
064352,000506: 21,3453           01751                           TC       FUNCTION   +1                         
064353,000507: 
064354,000508:                                                                                                  #  ****************************************************************************************************************
064355,000509: 
064356,000510: 
064357,000511: 21,3454           03371        RSTOFGTS           TC       GTSQRT                                
064358,000512: 21,3455           57741        PRODUCT            XCH      K2CNTRAL                              
064359,000513: 21,3456           00006                           EXTEND                                         
064360,000514: 21,3457           71741                           MP       K2CNTRAL                              
064361,000515: 21,3460           53742                           DXCH     K2CNTRAL                              
064362,000516: 21,3461           00006                           EXTEND                                         #              THE PRODUCT OF
064363,000517: 21,3462           70001                           MP       L                                     #   1/2                   2       1/2
064364,000518: 21,3463           27742                           ADS      K2CNTRAL   +1                         #  K   *(DEL*OMEGA + ALPHA /(2*K))
064365,000519: 21,3464           54001                           TS       L                                     #                   AND
064366,000520: 21,3465           13467                           TCF      +2                                    #                         2
064367,000521: 21,3466           27741                           ADS      K2CNTRAL                              #   DEL*(DEL*OMEGA + ALPHA /(2*K)) NOW IN
064368,000522:                                                                                                  #  K2CNTRAL
064369,000523: 
064370,000524: 21,3467           31743        DOSHIFT            CA       ININDEX                               
064371,000525: 21,3470           00006                           EXTEND                                         #  MULTIPLY IN THE FACTOR 2(-S), RETURNED
064372,000526: 21,3471           74727                           MP       BIT14                                 #  BY THE GTSQRT SUBROUTINE
064373,000527: 21,3472           27740                           ADS      SHFTFLAG                              
064374,000528: 21,3473           00006                           EXTEND                                         
064375,000529: 21,3474           13513                           BZF      ADDITIN                               
064376,000530: 21,3475           51740                           INDEX    SHFTFLAG                              
064377,000531: 21,3476           34726                           CA       BIT15                                 
064378,000532: 

Page 1481

064380,000534: 21,3477           57741                           XCH      K2CNTRAL                              
064381,000535: 21,3500           00006                           EXTEND                                         
064382,000536: 21,3501           71741                           MP       K2CNTRAL                              
064383,000537: 21,3502           21737                           DAS      K2THETA                               
064384,000538: 21,3503           57741                           XCH      K2CNTRAL                              
064385,000539: 21,3504           00006                           EXTEND                                         
064386,000540: 21,3505           71742                           MP       K2CNTRAL   +1                         
064387,000541: 21,3506           27737                           ADS      K2THETA    +1                         
064388,000542: 21,3507           54001                           TS       L                                     
064389,000543: 21,3510           13512                           TCF      +2                                    
064390,000544: 21,3511           27736                           ADS      K2THETA                               
064391,000545: 
064392,000546: 21,3512           13516                           TCF      NEGUSUM                               
064393,000547: 
064394,000548: 21,3513           00006        ADDITIN            EXTEND                                         
064395,000549: 21,3514           31742                           DCA      K2CNTRAL                              
064396,000550: 21,3515           21737                           DAS      K2THETA                               #  NOW ADD IN THE K2THETA TERM.
064397,000551: 21,3516           11736        NEGUSUM            CCS      K2THETA                               #  TEST SIGN OF HIGH ORDER PART.
064398,000552: 21,3517           13523                           TCF      NEGDRIVE                              
064399,000553: 21,3520           13522                           TCF      +2                                    
064400,000554: 21,3521           13525                           TCF      POSDRIVE                              
064401,000555: 
064402,000556: 21,3522           11737                           CCS      K2THETA    +1                         #  SIGN TEST FOR LOW ORDER PART.
064403,000557: 21,3523           34744        NEGDRIVE           CA       BIT1                                  
064404,000558: 21,3524           13526                           TCF      +2                                    #  STOP GIMBAL DRIVE FOR A ZERO NEGUSUM.
064405,000559: 21,3525           44744        POSDRIVE           CS       BIT1                                  
064406,000560: 21,3526           54001                           TS       L                                     #  SAVE FOR DRIVE REVERSAL TEST.
064407,000561: 21,3527           51747                           INDEX    QRCNTR                                
064408,000562: 21,3530           57501                           XCH      NEGUQ                                 
064409,000563: 
064410,000564: 21,3531           00006                           EXTEND                                         
064411,000565: 21,3532           70001                           MP       L                                     #  MULTIPLY OLD NEGU AND NEW NEGU.
064412,000566: 21,3533           10001                           CCS      L                                     
064413,000567: 21,3534           13551                           TCF      LOUPE                                 #  NON-ZERO GIMBAL DRIVE BEING CONTINUED.
064414,000568: 
064415,000569: 21,3535           13546                           TCF      ZEROLOUP                              #  NO REVERSAL PROBLEM HERE.
064416,000570: 
064417,000571: 21,3536           13540                           TCF      REVERSAL                              #  NON-ZERO GIMBAL DRIVE BEING REVERSED.
064418,000572: 21,3537           13546                           TCF      ZEROLOUP                              #  NO REVERSAL PROBLEM HERE.
064419,000573: 
064420,000574: 21,3540           51747        REVERSAL           INDEX    QRCNTR                                #  A ZERO-DRIVE PAUSE IS NEEDED HERE.  ZERO
064421,000575: 21,3541           55510                           TS       QACCDOT                               #  IS IN A REGISTER FROM CCS ON (-1).
064422,000576: 21,3542           51747                           INDEX    QRCNTR                                
064423,000577: 21,3543           43563                           CS       GMBLBITA                              
064424,000578: 21,3544           00006                           EXTEND                                         
064425,000579: 21,3545           03012                           WAND     CHAN12                                
064426,000580: 
064427,000581: 21,3546           41774        ZEROLOUP           CS       RCSFLAGS                              #  SET UP REQUEST FOR ACDT+C12 CALL.
064428,000582: 21,3547           74740                           MASK     CALLGMBL                              
064429,000583: 21,3550           27774                           ADS      RCSFLAGS                              
064430,000584: 

Page 1482

064432,000586: 21,3551           11747        LOUPE              CCS      QRCNTR                                #  HAVE BOTH AXES BEEN PROCESSED?
064433,000587: 21,3552           13045                           TCF      GOQTRIMG                              #  NO.  DO Q AXIS NEXT.
064434,000588: 
064435,000589: 21,3553           31505                           CA       SAVESR                                #  RESTORE THE SR
064436,000590: 21,3554           54021                           TS       SR                                    
064437,000591: 
064438,000592: 21,3555           00006        GOCLOSE            EXTEND                                         #  TERMINATE THE JASK.
064439,000593: 21,3556           33561                           DCA      CLOSEADR                              
064440,000594: 21,3557           52006                           DTCB                                           
064441,000595: 
064442,000596: 21,3560  E6,1536                                  EBANK=   AOSQ                                  
064443,000597: 21,3560           03270 36106  CLOSEADR           2CADR    CLOSEOUT                              #  TERMINATE THE JASK.
064444,000598: 
064445,000599: 21,3562     5745               TWELVE             EQUALS   OCT14                                 
064446,000600: 21,3562           26501        ROOTHALF           OCTAL    26501                                 #  SQUARE ROOT OF 1/2
064447,000601: 21,3563           01400        GMBLBITA           OCTAL    01400                                 #  INDEXED WRT GMBLBITB   DO NOT MOVE******
064448,000602: 21,3564           11276        OCT11276           OCTAL    11276                                 #  POSMAX - ROOTHALF
064449,000603: 21,3565           06000        GMBLBITB           OCTAL    06000                                 #  INDEXED WRT GMBLBITA   DO NOT MOVE******
064450,000604: 
064451,000605:                                                                                                  #  SUBROUTINE ROOTCYCL:  BY CRAIG WORK,3 APRIL 68
064452,000606:                                                                                                  #  ROOTCYCL IS A SUBROUTINE WHICH EXECUTES ONE NEWTON SQUARE ROOT ALGORITHM ITERATION.  THE INITIAL GUESS AT THE
064453,000607:                                                                                                  #  SQUARE ROOT IS PRESUMED TO BE IN THE A REGISTER AND ONE-HALF THE SQUARE IS TAKEN FROM HALFARG.  THE NEW APPROXI-
064454,000608:                                                                                                  #  MATION TO THE SQUARE ROOT IS RETURNED IN THE A REGISTER.  DEBRIS:   A,L,SR,SCRATCH.  ROOTCYCL IS CALLED FROM
064455,000609:                                                                                                  #  LOCATION (LOC) BY A TC ROOTCYCL, AND RETURNS (TC Q) TO LOC +1.
064456,000610: 
064457,000611:                                                                                                  #  WARNING:  IF THE INITIAL GUESS IS NOT GREATER THAN THE SQUARE, DIVIDE OR ADD OVERFLOW IS A REAL POSSIBILITY.
064458,000612: 
064459,000613: 21,3566           55745        ROOTCYCL           TS       SCRATCH                               #  STORE X
064460,000614: 21,3567           54021                           TS       SR                                    #  X/2 NOW IN SR
064461,000615: 21,3570           31746                           CA       HALFARG                               #  ARG/2 IN THE A REG
064462,000616: 21,3571           22007                           ZL                                             #  PREPARE FOR DIVISION
064463,000617: 21,3572           00006                           EXTEND                                         
064464,000618: 21,3573           11745                           DV       SCRATCH                               #  (ARG/X)/2
064465,000619: 21,3574           60021                           AD       SR                                    #  (X + ARG/X)/2 IN THE A REG
064466,000620: 21,3575           00002                           TC       Q                                     

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