Source Code

These source-code files were transcribed from a printout in Don Eyles's personal collection, scanned by archive.org, and financially sponsored by Linden Sims. A team of volunteers performed the transcription and proof-reading. The scanned page images are available at the Virtual AGC Project website, as well as higher-quality (but much larger) images at the Virtual AGC Project's collection in the Internet Archive. Report any problems by creating "issues" at the Virtual AGC Project's GitHub Repository.

Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 56 OF AGC PROGRAM ZERLINA BY ZOROASTER
	9:12 OCT. 21,1970
Note that the date is the date of the printout, not the date of the program revision.

064272,000002:                                                                                                  ## Copyright:   Public domain.
064273,000003:                                                                                                  ## Filename:    TRIM_GIMBAL_CONTROL_SYSTEM.agc
064274,000004:                                                                                                  ## Purpose:     A log section of Zerlina 56, the final revision of
064275,000005:                                                                                                  ##              Don Eyles's offline development program for the variable 
064276,000006:                                                                                                  ##              guidance period servicer. It also includes a new P66 with LPD 
064277,000007:                                                                                                  ##              (Landing Point Designator) capability, based on an idea of John 
064278,000008:                                                                                                  ##              Young's. Neither of these advanced features were actually flown,
064279,000009:                                                                                                  ##              but Zerlina was also the birthplace of other big improvements to
064280,000010:                                                                                                  ##              Luminary including the terrain model and new (Luminary 1E)
064281,000011:                                                                                                  ##              analog display programs. Zerlina was branched off of Luminary 145,
064282,000012:                                                                                                  ##              and revision 56 includes all changes up to and including Luminary
064283,000013:                                                                                                  ##              183. It is therefore quite close to the Apollo 14 program,
064284,000014:                                                                                                  ##              Luminary 178, where not modified with new features.
064285,000015:                                                                                                  ## Reference:   pp. 1460-1472
064286,000016:                                                                                                  ## Assembler:   yaYUL
064287,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
064288,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
064289,000019:                                                                                                  ## Mod history: 2017-07-28 MAS  Created from Luminary 210.
064290,000020:                                                                                                  ##              2017-08-29 MAS  Updated for Zerlina 56.
064291,000021: 

Page 1460

064293,000023: 21,3001                                           BANK     21                                    
064294,000024: 21,3001  E6,1450                                  EBANK=   QDIFF                                 
064295,000025: 21,2000                                           SETLOC   DAPS4                                 
064296,000026: 21,2000                                           BANK                                           
064297,000027: 
064298,000028: 21,3001                                           COUNT*   $$/DAPGT                              
064299,000029: 
064300,000030:                                                                                                  #  CONTROL REACHES THIS POINT UNDER EITHER OF THE FOLLOWING TWO CONDITIONS ONCE THE DESCENT ENGINE AND THE DIGITAL
064301,000031:                                                                                                  #  AUTOPILOT ARE BOTH ON:
064302,000032:                                                                                                  #           A) THE TRIM GIMBAL CONTROL LAW WAS ON DURING THE PREVIOUS Q,R-AXIS TIME5 INTERRUPT (OR THE DAPIDLER
064303,000033:                                                                                                  #              INITIALIZATION WAS SET FOR TRIM GIMBAL CONTROL AND THIS IS THE FIRST PASS), OR
064304,000034:                                                                                                  #           B) THE Q,R-AXES RCS AUTOPILOT DETERMINED THAT THE VEHICLE WAS ENTERING (OR HAD JUST ENTERED) A COAST
064305,000035:                                                                                                  #              ZONE WITH A SMALL OFFSET ANGULAR ACCELERATION.
064306,000036: 
064307,000037:                                                                                                  #  GTS IS THE ENTRY TO THE GIMBAL TRIM SYSTEM FOR CONTROLLING ATTITUDE ERRORS AND RATES AS WELL AS ACCELERATIONS.
064308,000038: 
064309,000039: 21,3001           37761        GTS                CAF      NEGONE                                #  MAKE THE NEXT PASS THROUGH THE DAP BE
064310,000040: 21,3002           55630                           TS       COTROLER                              #    THROUGH RCS CONTROL,
064311,000041: 21,3003           34751                           CAF      FOUR                                  #    AND ENSURE THAT IT IS NOT A SKIP.
064312,000042: 21,3004           55534                           TS       SKIPU                                 
064313,000043: 21,3005           55535                           TS       SKIPV                                 
064314,000044: 
064315,000045: 21,3006           34752                           CAF      TWO                                   
064316,000046: 21,3007           55632                           TS       INGTS                                 #  SET INDICATOR OF GTS CONTROL POSITIVE.
064317,000047: 21,3010           55631                           TS       QGIMTIMR                              #  SET TIMERS TO 200 MSEC TO AVOID BOTH
064318,000048: 21,3011           55633                           TS       RGIMTIMR                              #  RUNAWAY AND INTERFERENCE BY NULLING.
064319,000049: 
064320,000050:                                                                                                  #  THE DRIVE SETTING ALGORITHM
064321,000051: 
064322,000052:                                                                                                  #  DEL = SGN(OMEGA + ALPHA*ABS(ALPHA)/(2*K))
064323,000053: 
064324,000054:                                                                                                  #                                              2               1/2                  2       3/2
064325,000055:                                                                                                  #  NEGUSUM = ERROR*K + ALPHA*(DEL*OMEGA + ALPHA /(3*K)) + DEL*K   (DEL*OMEGA + ALPHA /(2*K))
064326,000056: 
064327,000057:                                                                                                  #  DRIVE = -SGN(NEGUSUM)
064328,000058: 
064329,000059: 21,3012           30021                           CA       SR                                    #  SAVE THE SR.  SHIFT IT LEFT TO CORRECT
064330,000060: 21,3013           60000                           AD       A                                     #  FOR THE RIGHT SHIFT DUE TO EDITING.
064331,000061: 21,3014           55505                           TS       SAVESR                                
064332,000062: 
064333,000063: 21,3015           34752        GTSGO+DN           CAF      TWO                                   #  SET INDEXER FOR R-AXIS CALCULATIONS.
064334,000064: 21,3016           13020                           TCF      GOQTRIMG   +1                         
064335,000065: 
064336,000066: 21,3017           34755        GOQTRIMG           CAF      ZERO                                  #  SET INDEXER FOR Q-AXIS CALCULATIONS
064337,000067: 21,3020           55747                           TS       QRCNTR                                
064338,000068: 
064339,000069: 21,3021           51747                           INDEX    QRCNTR                                #  AOS SCALED AT PI/2
064340,000070: 21,3022           31536                           CA       AOSQ                                  
064341,000071: 21,3023           00006                           EXTEND                                         
064342,000072: 21,3024           74752                           MP       BIT2                                  #  RESCALE AOS TO PI/4
064343,000073: 

Page 1461

064345,000075: 21,3025           00006                           EXTEND                                         
064346,000076: 21,3026           13032                           BZF      GTSQAXIS   -3                         #  USE FULL SCALE FOR LARGER AOS ESTIMATES.
064347,000077: 
064348,000078: 21,3027           50000                           INDEX    A                                     
064349,000079: 21,3030           44734                           CS       LIMITS                                #  LIMITS +1 CONTAINS NEGMAX.
064350,000080: 21,3031           56001                           XCH      L                                     #  LIMITS -1 CONTAINS POSMAX.
064351,000081: 
064352,000082: 21,3032           11747                           CCS      QRCNTR                                #  PICK UP RATE FOR THIS AXIS.  RATE CELLS
064353,000083: 21,3033           50000                           INDEX    A                                     #  ARE ADJACENT, NOT SEPARATED.  AT PI/4
064354,000084: 21,3034           31436                           CA       EDOTQ                                 
064355,000085: 21,3035           53743        GTSQAXIS           DXCH     WCENTRAL                              
064356,000086: 
064357,000087: 21,3036           51747                           INDEX    QRCNTR                                #  COLLECT K FOR THIS AXIS
064358,000088: 21,3037           31504                           CA       KQ                                    
064359,000089: 21,3040           55740                           TS       KCENTRAL                              
064360,000090: 
064361,000091: 21,3041           00006                           EXTEND                                         #  CONTROL AUTHORITY  ZERO.  AVOID DRIVING
064362,000092: 21,3042           13500                           BZF      POSDRIVE   +1                         #  ENGINE BELL TO THE STOPS.
064363,000093: 
064364,000094: 21,3043           51747                           INDEX    QRCNTR                                #  QDIFF, RDIFF ARE STORED IN D.P.
064365,000095: 21,3044           31450                           CAE      QDIFF                                 
064366,000096: 
064367,000097: 21,3045           00006        ALGORTHM           EXTEND                                         #  Q(R)DIFF IS THETA (ERROR) SCALED AT PI.
064368,000098: 21,3046           71740                           MP       KCENTRAL                              #  FORM K*ERROR AT PI(2)/2(8), IN D.P.
064369,000099: 21,3047           23736                           LXCH     K2THETA                               
064370,000100: 21,3050           00006                           EXTEND                                         
064371,000101: 21,3051           74747                           MP       BIT5                                  #  RESCALE TO 4*PI(2)
064372,000102: 21,3052           53737                           DXCH     K2THETA                               
064373,000103: 21,3053           00006                           EXTEND                                         
064374,000104: 21,3054           74747                           MP       BIT5                                  #  FIRST TERM OF NEGUSUM IN K2THETA.
064375,000105: 21,3055           27737                           ADS      K2THETA    +1                         #  NO CARRY NEEDED    D.P. AT 4*PI(2)
064376,000106: 
064377,000107: 21,3056           41743                           CS       ACENTRAL                              #  FORM ALPHA(2)/(2*K) AT 16*PI, IN D.P.,
064378,000108: 21,3057           00006                           EXTEND                                         #  LIMITING QUOTIENT TO AVOID OVERFLOW.
064379,000109: 21,3060           74736                           MP       BIT14                                 #  -ALPHA/2 IN A, SCALED AT PI/4
064380,000110: 21,3061           00006                           EXTEND                                         
064381,000111: 21,3062           71743                           MP       ACENTRAL                              #  -ALPHA(2)/2 IN A,L, SCALED AT PI(2)/16
064382,000112: 21,3063           61740                           AD       KCENTRAL                              
064383,000113: 21,3064           00006                           EXTEND                                         
064384,000114: 21,3065           63102                           BZMF     HUGEQUOT                              #  K-ALPHA(2)/2 SHOULD BE PNZ FO DIVISION
064385,000115: 
064386,000116: 21,3066           00006                           EXTEND                                         
064387,000117: 21,3067           40001                           DCS      A                                     #  ALPHA(2)/2 - K
064388,000118: 21,3070           61740                           AD       KCENTRAL                              
064389,000119: 21,3071           00006                           EXTEND                                         
064390,000120: 21,3072           11740                           DV       KCENTRAL                              #  HIGH ORDER OF QUOTIENT.
064391,000121: 21,3073           57745                           XCH      A2CNTRAL                              
064392,000122: 21,3074           30001                           CA       L                                     #  SHIFT UP THE REMAINDER.
064393,000123: 21,3075           22007                           LXCH     7                                     #  ZERO LOW-ORDER DIVIDEND.
064394,000124: 21,3076           00006                           EXTEND                                         

Page 1462

064396,000126: 21,3077           11740                           DV       KCENTRAL                              
064397,000127: 21,3100           57746                           XCH      A2CNTRAL   +1                         #  QUOTIENT STORED AT 16*PI, D.P.
064398,000128: 21,3101           13105                           TCF      HAVEQUOT                              
064399,000129: 
064400,000130: 21,3102           34733        HUGEQUOT           CA       POSMAX                                
064401,000131: 21,3103           54001                           TS       L                                     
064402,000132: 21,3104           53746                           DXCH     A2CNTRAL                              #  LIMITED QUOTIENT STORED AT 16*PI, D.P.
064403,000133: 
064404,000134: 21,3105           31742        HAVEQUOT           CA       WCENTRAL                              
064405,000135: 21,3106           00006                           EXTEND                                         
064406,000136: 21,3107           74743                           MP       BIT9                                  #  RESCALE OMEGA AT 16*PI IN D.P.
064407,000137: 21,3110           53742                           DXCH     K2CNTRAL                              #  LOWER WORD OVERLAYS OMEGA IN WCENTRAL
064408,000138: 
064409,000139: 21,3111           00006                           EXTEND                                         
064410,000140: 21,3112           31742                           DCA      K2CNTRAL                              
064411,000141: 21,3113           53751                           DXCH     FUNCTION                              
064412,000142: 
064413,000143: 21,3114           31743                           CA       ACENTRAL                              #  GET ALPHA*ABS(ALPHA)/(2*K)
064414,000144: 21,3115           00006                           EXTEND                                         
064415,000145: 21,3116           63122                           BZMF     +4                                    
064416,000146: 
064417,000147: 21,3117           00006                           EXTEND                                         
064418,000148: 21,3120           31746                           DCA      A2CNTRAL                              
064419,000149: 21,3121           13124                           TCF      +3                                    
064420,000150: 
064421,000151: 21,3122           00006                           EXTEND                                         
064422,000152: 21,3123           41746                           DCS      A2CNTRAL                              
064423,000153: 
064424,000154: 21,3124           21751                           DAS      FUNCTION                              #  OMEGA + ALPHA*ABS(ALPHA)/2*K) AT 16*PI
064425,000155: 
064426,000156: 21,3125           11750                           CCS      FUNCTION                              #  DEL = +1 FOR FUNCT1 GREATER THAN ZERO.
064427,000157: 21,3126           13132                           TCF      POSFNCT1                              #  OTHERWISE DEL = -1
064428,000158: 21,3127           13131                           TCF      +2                                    
064429,000159: 21,3130           13134                           TCF      NEGFNCT1                              
064430,000160: 
064431,000161: 21,3131           11751                           CCS      FUNCTION   +1                         #  USE LOW ORDER WORD SINCE HIGH IS ZERO
064432,000162: 21,3132           34753        POSFNCT1           CAF      BIT1                                  
064433,000163: 21,3133           13135                           TCF      +2                                    
064434,000164: 21,3134           44753        NEGFNCT1           CS       BIT1                                  
064435,000165: 21,3135           55744                           TS       DEL                                   
064436,000166: 
064437,000167: 21,3136           11744                           CCS      DEL                                   #  REPLACE OMEGA BY DEL*OMEGA
064438,000168: 21,3137           13151                           TCF      FUNCT2                                #  POSITIVE DEL VALUE.  PROCEED.
064439,000169: 21,3140           13142                           TCF      DEFUNCT                               
064440,000170: 21,3141           13146                           TCF      NEGFNCT2                              
064441,000171: 
064442,000172: 21,3142           55741        DEFUNCT            TS       K2CNTRAL                              
064443,000173: 21,3143           55742                           TS       K2CNTRAL   +1                         
064444,000174: 21,3144           13151                           TCF      FUNCT2                                
064445,000175: 

Page 1463

064447,000177: 21,3145           65252        NEG1/3             DEC      -.33333                               
064448,000178: 
064449,000179: 21,3146           00006        NEGFNCT2           EXTEND                                         
064450,000180: 21,3147           41742                           DCS      K2CNTRAL                              
064451,000181: 21,3150           53742                           DXCH     K2CNTRAL                              
064452,000182: 
064453,000183: 21,3151           00006        FUNCT2             EXTEND                                         
064454,000184: 21,3152           31746                           DCA      A2CNTRAL                              
064455,000185: 21,3153           21742                           DAS      K2CNTRAL                              #  DEL*OMEGA + ALPHA(2)/(2*K) AT 16*PI,D.P.
064456,000186: 
064457,000187: 21,3154           31745        FUNCT3             CA       A2CNTRAL                              
064458,000188: 21,3155           00006                           EXTEND                                         
064459,000189: 21,3156           73145                           MP       NEG1/3                                
064460,000190: 21,3157           53746                           DXCH     A2CNTRAL                              
064461,000191: 21,3160           30001                           CA       L                                     
064462,000192: 21,3161           00006                           EXTEND                                         
064463,000193: 21,3162           73145                           MP       NEG1/3                                
064464,000194: 21,3163           27746                           ADS      A2CNTRAL   +1                         
064465,000195: 21,3164           54001                           TS       L                                     
064466,000196: 21,3165           13167                           TCF      +2                                    #  A2CNTRAL NOW CONTAINS  -ALPHA(2)/(6*K),
064467,000197: 21,3166           27745                           ADS      A2CNTRAL                              #  SCALED AT 16*PI, IN D.P.
064468,000198: 
064469,000199: 21,3167           00006                           EXTEND                                         
064470,000200: 21,3170           31742                           DCA      K2CNTRAL                              #  DEL*OMEGA + ALPHA(2)/(3*K) IN A2CNTRAL,
064471,000201: 21,3171           21746                           DAS      A2CNTRAL                              #  SCALED AT 16*PI, D.P.
064472,000202: 
064473,000203: 21,3172           31745                           CA       A2CNTRAL                              
064474,000204: 21,3173           00006                           EXTEND                                         
064475,000205: 21,3174           71743                           MP       ACENTRAL                              
064476,000206: 21,3175           21737                           DAS      K2THETA                               
064477,000207: 21,3176           31746                           CA       A2CNTRAL   +1                         
064478,000208: 21,3177           00006                           EXTEND                                         
064479,000209: 21,3200           71743                           MP       ACENTRAL                              #  ACENTRAL MAY NOW BE OVERLAID.
064480,000210: 21,3201           27737                           ADS      K2THETA    +1                         
064481,000211: 21,3202           54001                           TS       L                                     
064482,000212: 21,3203           13205                           TCF      +2                                    #  TWO TERMS OF NEGUSUM ACCUMULATED, SO FAR
064483,000213: 21,3204           27736                           ADS      K2THETA                               #  SCALED AT 4*PI(2), IN D.P.
064484,000214: 
064485,000215: 21,3205           31741        GETROOT            CA       K2CNTRAL                              #  K*(DEL*OMEGA + ALPHA(2)/(2*K)) IS THE
064486,000216: 21,3206           00006                           EXTEND                                         #  TERM FOR WHICH A SQUARE ROOT IS NEEDED.
064487,000217: 21,3207           71740                           MP       KCENTRAL                              #  K AT PI/2(8)
064488,000218: 21,3210           53751                           DXCH     FUNCTION                              
064489,000219: 21,3211           31742                           CA       K2CNTRAL   +1                         
064490,000220: 21,3212           00006                           EXTEND                                         
064491,000221: 21,3213           71740                           MP       KCENTRAL                              
064492,000222: 21,3214           27751                           ADS      FUNCTION   +1                         
064493,000223: 21,3215           54001                           TS       L                                     
064494,000224: 21,3216           13220                           TCF      +2                                    
064495,000225: 21,3217           27750                           ADS      FUNCTION                              #  DESIRED TERM IN FUNCTION, AT PI(2)/16

Page 1464

064497,000227: 21,3220           11744                           CCS      DEL                                   
064498,000228: 21,3221           13426                           TCF      RSTOFGTS                              
064499,000229: 21,3222           13470                           TCF      NEGUSUM                               
064500,000230: 21,3223           13225                           TCF      NEGATE                                
064501,000231: 21,3224           13470                           TCF      NEGUSUM                               
064502,000232: 
064503,000233: 21,3225           00006        NEGATE             EXTEND                                         
064504,000234: 21,3226           41742                           DCS      K2CNTRAL                              
064505,000235: 21,3227           53742                           DXCH     K2CNTRAL                              
064506,000236: 21,3230           13426                           TCF      RSTOFGTS                              
064507,000237: 
064508,000238: 16,3740                                           BANK     16                                    
064509,000239: 16,3740  E6,1501                                  EBANK=   NEGUQ                                 
064510,000240: 16,2000                                           SETLOC   DAPS1                                 
064511,000241: 16,2000                                           BANK                                           
064512,000242: 
064513,000243:                                                                                                  #  THE WRCHN12 SUBROUTINE SETS BITS 9,10,11,12 OF CHANNEL 12 ON THE BASIS OF THE CONTENTS OF NEGUQ,NEGUR WHICH ARE
064514,000244:                                                                                                  #  THE NEGATIVES OF THE DESIRED ACCELERATION CHANGES.  ACDT+C12 SETS Q(R)ACCDOT TO REFLECT THE NEW DRIVES.
064515,000245: 
064516,000246:                                                                                                  #  WARNING:  ACDT+C12 AND WRCHN12 MUST BE CALLED WITH INTERRUPT INHIBITED.
064517,000247: 
064518,000248: 16,3740           07400        BGIM               OCTAL    07400                                 
064519,000249: 16,3741     0066               CHNL12             EQUALS   ITEMP6                                
064520,000250: 16,3741           41501        ACDT+C12           CS       NEGUQ                                 
064521,000251: 16,3742           00006                           EXTEND                                         #  GIMBAL DRIVE REQUESTS.
064522,000252: 16,3743           71507                           MP       ACCDOTQ                               
064523,000253: 16,3744           23510                           LXCH     QACCDOT                               
064524,000254: 16,3745           41503                           CS       NEGUR                                 
064525,000255: 16,3746           00006                           EXTEND                                         
064526,000256: 16,3747           71511                           MP       ACCDOTR                               
064527,000257: 16,3750           23512                           LXCH     RACCDOT                               
064528,000258: 
064529,000259: 16,3751           11501                           CCS      NEGUQ                                 
064530,000260: 16,3752           34742                           CAF      BIT10                                 
064531,000261: 16,3753           13755                           TCF      +2                                    
064532,000262: 16,3754           34743                           CAF      BIT9                                  
064533,000263: 16,3755           54066                           TS       CHNL12                                
064534,000264: 
064535,000265: 16,3756           11503                           CCS      NEGUR                                 
064536,000266: 16,3757           34740                           CAF      BIT12                                 
064537,000267: 16,3760           13762                           TCF      +2                                    
064538,000268: 16,3761           34741                           CAF      BIT11                                 
064539,000269: 16,3762           26066                           ADS      CHNL12                                #  (STORED RESULT NOT USED AT PRESENT)
064540,000270: 
064541,000271: 16,3763           43740                           CS       BGIM                                  
064542,000272: 16,3764           00006                           EXTEND                                         
064543,000273: 16,3765           02012                           RAND     CHAN12                                
064544,000274: 16,3766           60066                           AD       CHNL12                                
064545,000275: 16,3767           00006                           EXTEND                                         
064546,000276: 16,3770           01012                           WRITE    CHAN12                                
064547,000277: 

Page 1465

064549,000279: 16,3771           44747                           CS       CALLGMBL                              #  TURN OFF REQUEST FOR ACDT+C12 EXECUTION.
064550,000280: 16,3772           71262                           MASK     RCSFLAGS                              
064551,000281: 16,3773           55262                           TS       RCSFLAGS                              
064552,000282: 
064553,000283: 16,3774           00002                           TC       Q                                     #  RETURN TO CALLER.
064554,000284: 
064555,000285: 21,3231                                           BANK     21                                    
064556,000286: 21,3231  E6,1450                                  EBANK=   QDIFF                                 
064557,000287: 21,2000                                           SETLOC   DAPS4                                 
064558,000288: 21,2000                                           BANK                                           
064559,000289: 

Page 1466

064561,000291:                                                                                                  #  SUBROUTINE TIMEGMBL:  MOD 0,  OCTOBER 1967, CRAIG WORK
064562,000292: 
064563,000293:                                                                                                  #  TIMEGMBL COMPUTES THE DRIVE TIME NEEDED FOR THE TRIM GIMBAL TO POSITION THE DESCENT ENGINE NOZZLE SO AS TO NULL
064564,000294:                                                                                                  #  THE OFFSET ANGULAR ACCELERATION ABOUT THE Q (OR R) AXIS.  INSTEAD OF USING AOSQ(R), TIMEGMBL USES .4*AOSQ(R),
064565,000295:                                                                                                  #  SCALED AT PI/8.                         FOR EACH AXIS, THE DRIVE TIME IS COMPUTED AS ABS(ALPHA/ACCDOT).  A ZERO
064566,000296:                                                                                                  #  ALPHA OR ACCDOT OR A ZERO QUOTIENT TURNS OFF THE GIMBAL DRIVE IMMEDIATELY.  OTHERWISE, THE GIMBAL IS TURNED ON
064567,000297:                                                                                                  #  DRIVING IN THE CORRECT DIRECTION. THE Q(R)GIMTIMR IS SET TO TERMINATE THE DRIVE AND Q(R)ACCDOT
064568,000298:                                                                                                  #  IS STORED TO REFLECT THE NEW ACCELERATION DERIVATIVE.  NEGUQ(R) WILL CONTAIN +1,+0,-1 FOR A Q(R)ACCDOT VALUE
064569,000299:                                                                                                  #  WHICH IS NEGATIVE, ZERO, OR POSITIVE.
064570,000300: 
064571,000301:                                                                                                  #  INPUTS:  AOSQ,AOSR, SCALED AT P1/2, AND ACCDOTQ, ACCDOTR AT PI/2(7).    PI/2(7).
064572,000302: 
064573,000303:                                                                                                  #  OUTPUTS:   NEW GIMBAL DRIVE BITS IN CHANNEL 12,NEGUQ,NEGUR,QACCDOT AND RACCDOT, THE LAST SCALED AT PI/2(7).
064574,000304:                                                                                                  #             Q(R)GIMTIMR WILL BE SET TO TIME AND TERMINATE GIMBAL DRIVE(S)
064575,000305: 
064576,000306:                                                                                                  #  DEBRIS:  A,L,Q, ITEMPS 2,3,6, RUPTREG2 AND ACDT+C12 DEBRIS.
064577,000307: 
064578,000308:                                                                                                  #  EXITS:  VIA TC Q.
064579,000309: 
064580,000310:                                                                                                  #  ALARMS, ABORTS, :  NONE
064581,000311: 
064582,000312:                                                                                                  #  SUBROUTINES:  ACDT+C12, IBNKCALL
064583,000313: 
064584,000314:                                                                                                  #  WARNING:  THIS SUBROUTINE WRITES INTO CHANNEL 12 AND USES THE ITEMPS.  THEREFORE IT MAY ONLY BE CALLED WITH
064585,000315:                                                                                                  #  INTERRUPT INHIBITED.
064586,000316: 
064587,000317:                                                                                                  #  ERASABLE STORAGE CONFIGURATION (NEEDED BY THE INDEXING METHODS):
064588,000318: 
064589,000319:                                                                                                  #                                          NEGUQ    ERASE    +2            NEGATIVE OF Q-AXIS GIMBAL DRIVE
064590,000320:                                                                                                  #                                          (SPWORD) EQUALS  NEGUQ +1       ANY S.P. ERASABLE NUMBER, NOW THRSTCMD
064591,000321:                                                                                                  #                                          NEGUR    EQUALS  NEGUQ +2       NEGATIVE OF R-AXIS GIMBAL DRIVE
064592,000322: 
064593,000323:                                                                                                  #                                          ACCDOTQ  ERASE    +2            Q-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
064594,000324:                                                                                                  #                                          (SPWORD) EQUALS  ACCDOTQ +1     ANY S.P. ERASABLE NUMBER  NOW QACCDOT
064595,000325:                                                                                                  #                                          ACCDOTR  EQUALS  ACCDOTQ +2     R-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
064596,000326:                                                                                                  #                                                                          ACCDOTQ,ACCDOTR ARE MAGNITUDES.
064597,000327:                                                                                                  #                                          AOSQ     ERASE   +4             Q-AXIS ACC.,D.P. AT PI/2 R/SEC(2)
064598,000328:                                                                                                  #                                          AOSR     EQUALS  AOSQ +2        R-AXIS ACCELERATION SCALED AT PI/2 R/S2
064599,000329: 
064600,000330: 21,3231     0066               QRNDXER            EQUALS   ITEMP6                                
064601,000331: 21,3231           23146        OCT23146           OCTAL    23146                                 #  DECIMAL .6
064602,000332: 21,3232     0063               NZACCDOT           EQUALS   ITEMP3                                
064603,000333: 
064604,000334: 21,3232           34753        TIMEGMBL           CAF      ONE                                   #  INITIALIZE ALLOWGTS.
064605,000335: 21,3233           55502                           TS       ALLOWGTS                              
064606,000336: 
064607,000337: 21,3234           34752                           CAF      TWO                                   #  SET UP LOOP FOR R AXIS.
064608,000338: 21,3235           22002                           LXCH     Q                                     #  SAVE RETURN ADDRESS.
064609,000339: 21,3236           22071                           LXCH     RUPTREG2                              

Page 1467

064611,000341: 21,3237           13241                           TCF      +2                                    
064612,000342: 21,3240           34755        TIMQGMBL           CAF      ZERO                                  #  NOW DO THE Q-AXIS
064613,000343: 21,3241           54066                           TS       QRNDXER                               
064614,000344: 21,3242           50066                           INDEX    QRNDXER                               
064615,000345: 21,3243           31507                           CA       ACCDOTQ                               #  ACCDOT IS PRESUMED TO BE AT PI/2(7).
064616,000346: 21,3244           00006                           EXTEND                                         
064617,000347: 21,3245           63315                           BZMF     TGOFFNOW                              #  IS ACCDOT LESS THAN OR EQUAL TO 0?
064618,000348: 21,3246           54063                           TS       NZACCDOT                              #  NO.  STORE NON-ZERO, POSITIVE ACCDOT.
064619,000349: 
064620,000350: 21,3247           50066        ALPHATRY           INDEX    QRNDXER                               
064621,000351: 21,3250           41536                           CS       AOSQ                                  
064622,000352: 21,3251           00006                           EXTEND                                         
064623,000353: 21,3252           13315                           BZF      TGOFFNOW                              #  IS ALPHA ZERO?
064624,000354: 
064625,000355: 21,3253           54002                           TS       Q                                     #  SAVE A COPY OF  -AOS.
064626,000356: 21,3254           00006                           EXTEND                                         #  NO.  RESCALE FOR TIMEGMBL USE.
064627,000357: 21,3255           73231                           MP       OCT23146                              #  OCTAL 23146 IS DECIMAL .6
064628,000358: 21,3256           60002                           AD       Q                                     #  -1.6*AOS AT PI/2 = -.4*AOS AT PI/8.
064629,000359: 21,3257           54001                           TS       L                                     #  WAS THERE OVERFLOW?
064630,000360: 21,3260           13265                           TCF      SETNEGU                               #  NO.  COMPUTE DRIVE TIME.
064631,000361: 
064632,000362: 21,3261           40000                           CS       A                                     #  RECOVER  -SGN(AOS) IN THE A REGISTER.
064633,000363: 21,3262           50066                           INDEX    QRNDXER                               #  YES.  START DRIVE WITHOUT WAITLIST.
064634,000364: 21,3263           57501                           XCH      NEGUQ                                 
064635,000365: 21,3264           13321                           TCF      NOTALLOW                              #  KNOCK DOWN THE ALLOWGTS FLAG.
064636,000366: 
064637,000367: 21,3265           00006        SETNEGU            EXTEND                                         
064638,000368: 21,3266           63273                           BZMF     POSALPH                               
064639,000369: 
064640,000370: 21,3267           40000                           COM                                            
064641,000371: 21,3270           54062                           TS       ITEMP2                                #  STORE  -ABS(.4*AOS) SCALED AT PI/8.
064642,000372: 21,3271           44753                           CS       BIT1                                  
064643,000373: 21,3272           13275                           TCF      POSALPH    +2                         
064644,000374: 21,3273           54062        POSALPH            TS       ITEMP2                                #  STORE  -ABS(.4*AOS) SCALED AT PI/8.
064645,000375: 21,3274           34753                           CA       BIT1                                  
064646,000376: 21,3275           50066                 +2        INDEX    QRNDXER                               #  SGN(AOS) INTO NEGU
064647,000377: 21,3276           55501                           TS       NEGUQ                                 #  STORE SGN(APLHA) AS NEGU
064648,000378: 
064649,000379: 21,3277           30063                           CA       NZACCDOT                              
064650,000380: 21,3300           00006                           EXTEND                                         
064651,000381: 21,3301           74740                           MP       BIT12                                 #  2*ACCDOT, SCALED AT PI/8.
064652,000382: 21,3302           60062                           AD       ITEMP2                                #  -ABS(ALPHA) + 2*ACCDOT, AT PI/8.
064653,000383: 21,3303           00006                           EXTEND                                         
064654,000384: 21,3304           63321                           BZMF     NOTALLOW                              #  IS DRIVE TIME MORE THAN TWO SECONDS?
064655,000385: 21,3305           40062                           CS       ITEMP2                                #  NO.  COMPUTE DRIVE TIME.
064656,000386: 21,3306           00006                           EXTEND                                         #  ABS(ALPHA) AT PI/8.
064657,000387: 21,3307           73342                           MP       OCT00240                              #  DECIMAL 10/1024
064658,000388: 21,3310           00006                           EXTEND                                         #  QUOTIENT IS DRIVE TIME AT WAITLIST.
064659,000389: 21,3311           10063                           DV       NZACCDOT                              #  ABS(ALPHA)/ACCDOT AT 2(14)/100
064660,000390: 

Page 1468

064662,000392: 21,3312           00006                           EXTEND                                         
064663,000393: 21,3313           13315                           BZF      TGOFFNOW                              #  DRIVE TIME MUST BE GREATER THAN ZERO.
064664,000394: 
064665,000395: 21,3314           13327                           TCF      DRIVEON                               
064666,000396: 
064667,000397: 21,3315           34755        TGOFFNOW           CAF      ZERO                                  #  TURN OFF GIMBAL NOW.
064668,000398: 21,3316           50066                           INDEX    QRNDXER                               
064669,000399: 21,3317           55501                           TS       NEGUQ                                 
064670,000400: 
064671,000401: 21,3320           13331                           TCF      DONEYET                               
064672,000402: 
064673,000403: 21,3321           36010        NOTALLOW           CAF      OCT31                                 
064674,000404: 21,3322           50066                           INDEX    QRNDXER                               
064675,000405: 21,3323           55631                           TS       QGIMTIMR                              
064676,000406: 21,3324           34755                           CAF      ZERO                                  #  DRIVE TIME IS MORE THAN 2 SECONDS, SO
064677,000407: 21,3325           55502                           TS       ALLOWGTS                              #  DO NOT PERMIT FURTHER GTS ATTITUDE-RATE
064678,000408:                                                                                                  #  CONTROL UNTIL AOSTASK APPROVES.
064679,000409: 21,3326           13331                           TCF      DONEYET                               #  NO WAITLIST CALL IS MADE.
064680,000410: 
064681,000411: 21,3327           50066        DRIVEON            INDEX    QRNDXER                               
064682,000412: 21,3330           55631                           TS       QGIMTIMR                              #  CHOOSE Q OR R AXIS.
064683,000413: 
064684,000414: 21,3331           10066        DONEYET            CCS      QRNDXER                               
064685,000415: 21,3332           13240                           TCF      TIMQGMBL                              
064686,000416: 
064687,000417: 21,3333           52073                           DXCH     RUPTREG3                              #  PROTECT IBNKCALL ERASABLES.  ACDT+C12
064688,000418: 21,3334           52063                           DXCH     ITEMP2                                #  LEAVES ITEMPS2,3 ALONE.
064689,000419: 
064690,000420: 21,3335           04674                           TC       IBNKCALL                              #  TURN OF CHANNEL BITS, SET Q(R)ACCDOTS.
064691,000421: 21,3336           35741                           CADR     ACDT+C12                              
064692,000422: 
064693,000423: 21,3337           52063                           DXCH     ITEMP2                                #  RESTORE ERASABLES FOR IBNKCALL.
064694,000424: 21,3340           52073                           DXCH     RUPTREG3                              
064695,000425: 
064696,000426: 21,3341           00071                           TC       RUPTREG2                              #  RETURN TO CALLER.
064697,000427: 
064698,000428: 21,3342           00240        OCT00240           OCTAL    00240                                 #  DECIMAL 10/1024
064699,000429: 

Page 1469

064701,000431:                                                                                                  #  THE FOLLOWING SECTION IS A CONTINUATION OF THE TRIM GIMBAL CONTROL FROM THE LAST GTS ENTRY. THE QUANTITY NEGUSUM
064702,000432:                                                                                                  #  IS COMPUTED FOR EACH AXIS (Q,R), .707*DEL*FUNCTION(3/2) + K2THETA = NEGUSUM.  NEW DRIVES ARE ENTERED TO CH 12.
064703,000433: 
064704,000434:                                                                                                  #  THE SUBROUTINE GTSQRT ACCEPTS A DOUBLE PRECISION VALUE IN FUNCTION, FUNCTION +1 AND RETURNS A SINGLE-PRECISION
064705,000435:                                                                                                  #  SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF THE ARGUMENT.  ALSO, THE CELL SHFTFLAG CONTAINS A BINARY
064706,000436:                                                                                                  #  EXPONENT S, SUCH THAT THE SQUARE ROOT (RETURNED IN THE A REGISTER) MUST BE SHIFTED RIGHT (MULTIPLIED BY 2 TO THE
064707,000437:                                                                                                  #  POWER (-S)) IN ORDER TO BE THE TRUE SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF FUNCTION, FUNCTION +1.
064708,000438:                                                                                                  #  SQUARE ROOT ERROR IS NOT MORE THAN 2 IN THE 14TH SIGNIFICANT BIT.  CELLS CLOBBERED ARE A,L,SHFTFLAG,ININDEX,
064709,000439:                                                                                                  #  HALFARG,SCRATCH,SR,FUNCTION, FUNCTION +1.  GTSQRT IS CALLED BY TC GTSQRT AND RETURNS VIA TC Q OR TC FUNCTION +1.
064710,000440:                                                                                                  #  ZERO OR NEGATIVE ARGUMENTS YIELD ZERO FOR SQUARE ROOTS.
064711,000441: 
064712,000442: 21,3343           11750        GTSQRT             CCS      FUNCTION                              
064713,000443: 21,3344           13362                           TCF      GOODARG                               #  FUNCTION IS POSITIVE.  TAKE SQUARE ROOT.
064714,000444: 21,3345           13347                           TCF      +2                                    #  HIGH ORDER WORD IS ZERO.  TRY THE LOWER.
064715,000445: 21,3346           13353                           TCF      ZEROOT                                #  NEGATIVE.  USE ZERO FOR 1/2 POWER.
064716,000446: 
064717,000447: 21,3347           31751                           CA       FUNCTION   +1                         
064718,000448: 21,3350           00006                           EXTEND                                         
064719,000449: 21,3351           63353                           BZMF     ZEROOT                                
064720,000450: 
064721,000451: 21,3352           13356                           TCF      ZEROHIGH                              #  PROCEED.
064722,000452: 21,3353           34755        ZEROOT             CA       ZERO                                  
064723,000453: 21,3354           55740                           TS       SHFTFLAG                              
064724,000454: 21,3355           00002                           TC       Q                                     
064725,000455: 
064726,000456: 21,3356           57750        ZEROHIGH           XCH      FUNCTION                              #  14 MOST SIGNIFICANT BITS ARE IN THE
064727,000457: 21,3357           57751                           XCH      FUNCTION   +1                         #  LOWER WORD.  EXCHANGE THEM.
064728,000458: 21,3360           34757                           CA       SEVEN                                 
064729,000459: 21,3361           13363                           TCF      GOODARG    +1                         
064730,000460: 
064731,000461: 21,3362           34755        GOODARG            CA       ZERO                                  
064732,000462: 21,3363           55740                           TS       SHFTFLAG                              
064733,000463: 21,3364           35752                           CA       TWELVE                                #  INITIALIZE THE SCALING LOOP.
064734,000464: 21,3365           55743                           TS       ININDEX                               
064735,000465: 21,3366           13375                           TCF      SCALLOOP                              
064736,000466: 
064737,000467: 21,3367           31750        SCALSTRT           CA       FUNCTION                              
064738,000468: 21,3370           13411                           TCF      SCALDONE                              
064739,000469: 
064740,000470: 21,3371           37760        MULBUSH            CA       NEG2                                  #  IF ARG IS NOT LESS THAN 1/4, INDEX IS
064741,000471: 21,3372           27743                           ADS      ININDEX                               #  ZERO, INDICATING NO SHIFT NEEDED.
064742,000472: 21,3373           00006                           EXTEND                                         #  BRANCH IF ARG IS NOT LESS THAN 1/4.
064743,000473: 21,3374           63367                           BZMF     SCALSTRT                              #  OTHERWISE COMPARE ARG WITH A REFERENCE
064744,000474:                                                                                                  #  WHICH IS 4 TIMES LARGER THAN THE LAST.
064745,000475: 21,3375           41750        SCALLOOP           CS       FUNCTION                              
064746,000476: 21,3376           51743                           INDEX    ININDEX                               
064747,000477: 21,3377           64735                           AD       BIT15                                 #  REFERENCE MAGNITUDE LESS OR EQUAL TO 1/4
064748,000478: 21,3400           00006                           EXTEND                                         
064749,000479: 21,3401           63371                           BZMF     MULBUSH                               #  IF ARG IS NOT LESS THAN REFERENCE, GO
064750,000480:                                                                                                  #  AROUND THE MULBERRY BUSH ONCE MORE.
064751,000481: 

Page 1470

064753,000483: 21,3402           51743                           INDEX    ININDEX                               
064754,000484: 21,3403           34735                           CA       BIT15                                 #  THIS IS THE SCALE MAGNITUDE
064755,000485: 21,3404           57746                           XCH      HALFARG                               #  2**(-ININDEX) IS THE SHIFT DIVISOR.
064756,000486: 21,3405           00006                           EXTEND                                         #  RESCALE ARGUMENT.
064757,000487: 21,3406           31751                           DCA      FUNCTION                              
064758,000488: 21,3407           00006                           EXTEND                                         
064759,000489: 21,3410           11746                           DV       HALFARG                               
064760,000490:                                                                                                  #  ININDEX AND SHFTFLAG PRESERVE INFO FOR
064761,000491: 
064762,000492:                                                                                                  #  RESCALING AFTER ROOT PROCESS.
064763,000493: 21,3411           00006        SCALDONE           EXTEND                                         
064764,000494: 21,3412           23751                           QXCH     FUNCTION   +1                         #  SAVE Q FOR RETURN
064765,000495: 21,3413           00006                           EXTEND                                         
064766,000496: 21,3414           74736                           MP       BIT14                                 
064767,000497: 21,3415           55746                           TS       HALFARG                               
064768,000498: 21,3416           74737                           MASK     BIT13                                 
064769,000499: 21,3417           10000                           CCS      A                                     
064770,000500: 21,3420           33536                           CA       OCT11276                              
064771,000501: 21,3421           63534                           AD       ROOTHALF                              #  INITIAL GUESS IS ROOT 1/2 OR POSMAX
064772,000502: 
064773,000503: 21,3422           03540                           TC       ROOTCYCL                              
064774,000504: 21,3423           03540                           TC       ROOTCYCL                              
064775,000505: 21,3424           03540                           TC       ROOTCYCL                              
064776,000506: 
064777,000507: 21,3425           01751                           TC       FUNCTION   +1                         
064778,000508: 
064779,000509:                                                                                                  #  ****************************************************************************************************************
064780,000510: 
064781,000511: 
064782,000512: 21,3426           03343        RSTOFGTS           TC       GTSQRT                                
064783,000513: 21,3427           57741        PRODUCT            XCH      K2CNTRAL                              
064784,000514: 21,3430           00006                           EXTEND                                         
064785,000515: 21,3431           71741                           MP       K2CNTRAL                              
064786,000516: 21,3432           53742                           DXCH     K2CNTRAL                              
064787,000517: 21,3433           00006                           EXTEND                                         #              THE PRODUCT OF
064788,000518: 21,3434           70001                           MP       L                                     #   1/2                   2       1/2
064789,000519: 21,3435           27742                           ADS      K2CNTRAL   +1                         #  K   *(DEL*OMEGA + ALPHA /(2*K))
064790,000520: 21,3436           54001                           TS       L                                     #                  AND
064791,000521: 21,3437           13441                           TCF      +2                                    #                         2
064792,000522: 21,3440           27741                           ADS      K2CNTRAL                              #   DEL*(DEL*OMEGA + ALPHA /(2*K)) NOW IN
064793,000523:                                                                                                  #  K2CNTRAL
064794,000524: 
064795,000525: 21,3441           31743        DOSHIFT            CA       ININDEX                               
064796,000526: 21,3442           00006                           EXTEND                                         #  MULTIPLY IN THE FACTOR 2(-S), RETURNED
064797,000527: 21,3443           74736                           MP       BIT14                                 #  BY THE GTSQRT SUBROUTINE
064798,000528: 21,3444           27740                           ADS      SHFTFLAG                              
064799,000529: 21,3445           00006                           EXTEND                                         
064800,000530: 21,3446           13465                           BZF      ADDITIN                               
064801,000531: 21,3447           51740                           INDEX    SHFTFLAG                              
064802,000532: 21,3450           34735                           CA       BIT15                                 

Page 1471

064804,000534: 21,3451           57741                           XCH      K2CNTRAL                              
064805,000535: 21,3452           00006                           EXTEND                                         
064806,000536: 21,3453           71741                           MP       K2CNTRAL                              
064807,000537: 21,3454           21737                           DAS      K2THETA                               
064808,000538: 21,3455           57741                           XCH      K2CNTRAL                              
064809,000539: 21,3456           00006                           EXTEND                                         
064810,000540: 21,3457           71742                           MP       K2CNTRAL   +1                         
064811,000541: 21,3460           27737                           ADS      K2THETA    +1                         
064812,000542: 21,3461           54001                           TS       L                                     
064813,000543: 21,3462           13464                           TCF      +2                                    
064814,000544: 21,3463           27736                           ADS      K2THETA                               
064815,000545: 
064816,000546: 21,3464           13470                           TCF      NEGUSUM                               
064817,000547: 
064818,000548: 21,3465           00006        ADDITIN            EXTEND                                         
064819,000549: 21,3466           31742                           DCA      K2CNTRAL                              
064820,000550: 21,3467           21737                           DAS      K2THETA                               #  NOW ADD IN THE K2THETA TERM.
064821,000551: 21,3470           11736        NEGUSUM            CCS      K2THETA                               #  TEST SIGN OF HIGH ORDER PART.
064822,000552: 21,3471           13475                           TCF      NEGDRIVE                              
064823,000553: 21,3472           13474                           TCF      +2                                    
064824,000554: 21,3473           13477                           TCF      POSDRIVE                              
064825,000555: 
064826,000556: 21,3474           11737                           CCS      K2THETA    +1                         #  SIGN TEST FOR LOW ORDER PART.
064827,000557: 21,3475           34753        NEGDRIVE           CA       BIT1                                  
064828,000558: 21,3476           13500                           TCF      +2                                    #  STOP GIMBAL DRIVE FOR A ZERO NEGUSUM.
064829,000559: 21,3477           44753        POSDRIVE           CS       BIT1                                  
064830,000560: 21,3500           54001                           TS       L                                     #  SAVE FOR DRIVE REVERSAL TEST.
064831,000561: 21,3501           51747                           INDEX    QRCNTR                                
064832,000562: 21,3502           57501                           XCH      NEGUQ                                 
064833,000563: 
064834,000564: 21,3503           00006                           EXTEND                                         
064835,000565: 21,3504           70001                           MP       L                                     #  MULTIPLY OLD NEGU AND NEW NEGU.
064836,000566: 21,3505           10001                           CCS      L                                     
064837,000567: 21,3506           13523                           TCF      LOUPE                                 #  NON-ZERO GIMBAL DRIVE BEING CONTINUED.
064838,000568: 
064839,000569: 21,3507           13520                           TCF      ZEROLOUP                              #  NO REVERSAL PROBLEM HERE.
064840,000570: 
064841,000571: 21,3510           13512                           TCF      REVERSAL                              #  NON-ZERO GIMBAL DRIVE BEING REVERSED.
064842,000572: 21,3511           13520                           TCF      ZEROLOUP                              #  NO REVERSAL PROBLEM HERE.
064843,000573: 
064844,000574: 21,3512           51747        REVERSAL           INDEX    QRCNTR                                #  A ZERO-DRIVE PAUSE IS NEEDED HERE.  ZERO
064845,000575: 21,3513           55510                           TS       QACCDOT                               #  IS IN A REGISTER FROM CCS ON (-1).
064846,000576: 21,3514           51747                           INDEX    QRCNTR                                
064847,000577: 21,3515           43535                           CS       GMBLBITA                              
064848,000578: 21,3516           00006                           EXTEND                                         
064849,000579: 21,3517           03012                           WAND     CHAN12                                
064850,000580: 
064851,000581: 21,3520           41262        ZEROLOUP           CS       RCSFLAGS                              #  SET UP REQUEST FOR ACDT+C12 CALL.
064852,000582: 21,3521           74747                           MASK     CALLGMBL                              
064853,000583: 21,3522           27262                           ADS      RCSFLAGS                              
064854,000584: 

Page 1472

064856,000586: 21,3523           11747        LOUPE              CCS      QRCNTR                                #  HAVE BOTH AXES BEEN PROCESSED?
064857,000587: 21,3524           13017                           TCF      GOQTRIMG                              #  NO.  DO Q AXIS NEXT.
064858,000588: 
064859,000589: 21,3525           31505                           CA       SAVESR                                #  RESTORE THE SR
064860,000590: 21,3526           54021                           TS       SR                                    
064861,000591: 
064862,000592: 21,3527           00006        GOCLOSE            EXTEND                                         #  TERMINATE THE JASK.
064863,000593: 21,3530           33533                           DCA      CLOSEADR                              
064864,000594: 21,3531           52006                           DTCB                                           
064865,000595: 
064866,000596: 21,3532  E6,1536                                  EBANK=   AOSQ                                  
064867,000597: 21,3532           03270 36106  CLOSEADR           2CADR    CLOSEOUT                              #  TERMINATE THE JASK.
064868,000598: 
064869,000599: 21,3534     5752               TWELVE             EQUALS   OCT14                                 
064870,000600: 21,3534           26501        ROOTHALF           OCTAL    26501                                 #  SQUARE ROOT OF 1/2
064871,000601: 21,3535           01400        GMBLBITA           OCTAL    01400                                 #  INDEXED WRT GMBLBITB   DO NOT MOVE******
064872,000602: 21,3536           11276        OCT11276           OCTAL    11276                                 #  POSMAX - ROOTHALF
064873,000603: 21,3537           06000        GMBLBITB           OCTAL    06000                                 #  INDEXED WRT GMBLBITA   DO NOT MOVE******
064874,000604: 
064875,000605:                                                                                                  #  SUBROUTINE ROOTCYCL:  BY CRAIG WORK,3 APRIL 68
064876,000606:                                                                                                  #  ROOTCYCL IS A SUBROUTINE WHICH EXECUTES ONE NEWTON SQUARE ROOT ALGORITHM ITERATION.  THE INITIAL GUESS AT THE
064877,000607:                                                                                                  #  SQUARE ROOT IS PRESUMED TO BE IN THE A REGISTER AND ONE-HALF THE SQUARE IS TAKEN FROM HALFARG.  THE NEW APPROXI-
064878,000608:                                                                                                  #  MATION TO THE SQUARE ROOT IS RETURNED IN THE A REGISTER.  DEBRIS:   A,L,SR,SCRATCH.  ROOTCYCL IS CALLED FROM
064879,000609:                                                                                                  #  LOCATION (LOC) BY A TC ROOTCYCL, AND RETURNS (TC Q) TO LOC +1.
064880,000610: 
064881,000611:                                                                                                  #  WARNING:  IF THE INITIAL GUESS IS NOT GREATER THAN THE SQUARE, DIVIDE OR ADD OVERFLOW IS A REAL POSSIBILITY.
064882,000612: 
064883,000613: 21,3540           55745        ROOTCYCL           TS       SCRATCH                               #  STORE X
064884,000614: 21,3541           54021                           TS       SR                                    #  X/2 NOW IN SR
064885,000615: 21,3542           31746                           CA       HALFARG                               #  ARG/2 IN THE A REG
064886,000616: 21,3543           22007                           ZL                                             #  PREPARE FOR DIVISION
064887,000617: 21,3544           00006                           EXTEND                                         
064888,000618: 21,3545           11745                           DV       SCRATCH                               #  (ARG/X)/2
064889,000619: 21,3546           60021                           AD       SR                                    #  (X + ARG/X)/2 IN THE A REG
064890,000620: 21,3547           00002                           TC       Q                                     

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