Source Code

These source-code files are part of a reconstructed copy of Luminary 97, the second release of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software. It was created to fix two incorrect ephemeris constants in Luminary 96, as described by anomaly report LNY-59.

The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memos 83 and 85, using asterisks indicating changed lines in the listing as a guide. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152D. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 97 listing.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

062530,000002:                                                                                                  ## Copyright:   Public domain.
062531,000003:                                                                                                  ## Filename:    TRIM_GIMBAL_CONTROL_SYSTEM.agc
062532,000004:                                                                                                  ## Purpose:     A section of Luminary revision 97.
062533,000005:                                                                                                  ##              It is part of the reconstructed source code for the
062534,000006:                                                                                                  ##              second release of the flight software for the Lunar 
062535,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
062536,000008:                                                                                                  ##              It was created to fix two incorrect ephemeris constants in
062537,000009:                                                                                                  ##              Luminary 96, as described by anomaly report LNY-59.
062538,000010:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
062539,000011:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
062540,000012:                                                                                                  ##              the listing and Luminary Memos #83 and #85, which list 
062541,000013:                                                                                                  ##              changes between Luminary 97 and 98, and 98 and 99. The
062542,000014:                                                                                                  ##              code has been adapted such that the resulting bugger words
062543,000015:                                                                                                  ##              exactly match those specified for Luminary 97 in NASA drawing
062544,000016:                                                                                                  ##              2021152D, which gives relatively high confidence that the
062545,000017:                                                                                                  ##              reconstruction is correct.
062546,000018:                                                                                                  ## Reference:   pp. 1472-1484
062547,000019:                                                                                                  ## Assembler:   yaYUL
062548,000020:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
062549,000021:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
062550,000022:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
062551,000023:                                                                                                  ##              2021-05-30 ABS  GTSGO+DN -> GTSGO+ON
062552,000024: 

Page 1472

062554,000026: 21,3077                                           BANK     21                                    
062555,000027: 21,3077  E6,1450                                  EBANK=   QDIFF                                 
062556,000028: 21,2000                                           SETLOC   DAPS4                                 
062557,000029: 21,2000                                           BANK                                           
062558,000030: 
062559,000031: 21,3077                                           COUNT*   $$/DAPGT                              
062560,000032: 
062561,000033:                                                                                                  #  CONTROL REACHES THIS POINT UNDER EITHER OF THE FOLLOWING TWO CONDITIONS ONCE THE DESCENT ENGINE AND THE DIGITAL
062562,000034:                                                                                                  #  AUTOPILOT ARE BOTH ON:
062563,000035:                                                                                                  #        A) THE TRIM GIMBAL CONTROL LAW WAS ON DURING THE PREVIOUS Q,R-AXIS TIME5 INTERRUPT (OR THE DAPIDLER
062564,000036:                                                                                                  #           INITIALIZATION WAS SET FOR TRIM GIMBAL CONTROL AND THIS IS THE FIRST PASS), OR
062565,000037:                                                                                                  #        B) THE Q,R-AXES RCS AUTOPILOT DETERMINED THAT THE VEHICLE WAS ENTERING (OR HAD JUST ENTERED) A COAST
062566,000038:                                                                                                  #           ZONE WITH A SMALL OFFSET ANGULAR ACCELERATION.
062567,000039:                                                                                                  #  GTS IS THE ENTRY TO THE GIMBAL TRIM SYSTEM FOR CONTROLLING ATTITUDE ERRORS AND RATES AS WELL AS ACCELERATIONS.
062568,000040: 
062569,000041: 21,3077           37747        GTS                CAF      NEGONE                                #  MAKE THE NEXT PASS THROUGH THE DAP BE
062570,000042: 21,3100           55631                           TS       COTROLER                              #        THROUGH RCS CONTROL,
062571,000043: 21,3101           34751                           CAF      FOUR                                  #        AND ENSURE THAT IT IS NOT A SKIP.
062572,000044: 21,3102           55535                           TS       SKIPU                                 
062573,000045: 21,3103           55536                           TS       SKIPV                                 
062574,000046: 
062575,000047: 21,3104           34752                           CAF      TWO                                   
062576,000048: 21,3105           55633                           TS       INGTS                                 #  SET INDICATOR OF GTS CONTROL POSITIVE.
062577,000049: 21,3106           55632                           TS       QGIMTIMR                              #  SET TIMERS TO 200 MSEC TO AVOID BOTH
062578,000050: 21,3107           55634                           TS       RGIMTIMR                              #  RUNAWAY AND INTERFERENCE BY NULLING.
062579,000051: 
062580,000052:                                                                                                  #  THE DRIVE SETTING ALGORITHM
062581,000053: 
062582,000054:                                                                                                  #        DEL = SGN(OMEGA + ALPHA*ABS(ALPHA)/(2*K))
062583,000055:                                                                                                  #                                                    2               1/2                  2       3/2
062584,000056:                                                                                                  #        NEGUSUM = ERROR*K + ALPHA*(DEL*OMEGA + ALPHA /(3*K)) + DEL*K   (DEL*OMEGA + ALPHA /(2*K))
062585,000057: 
062586,000058:                                                                                                  #        DRIVE = -SGN(NEGUSUM)
062587,000059: 
062588,000060: 21,3110           30021                           CA       SR                                    #  SAVE THE SR.  SHIFT IT LEFT TO CORRECT
062589,000061: 21,3111           60000                           AD       A                                     #  FOR THE RIGHT SHIFT DUE TO EDITING.
062590,000062: 21,3112           55505                           TS       SAVESR                                
062591,000063: 
062592,000064: 21,3113           34752        GTSGO+ON           CAF      TWO                                   #  SET INDEXER FOR R-AXIS CALCULATIONS.
062593,000065: 21,3114           13116                           TCF      GOQTRIMG   +1                         
062594,000066: 
062595,000067: 21,3115           34755        GOQTRIMG           CAF      ZERO                                  #  SET INDEXER FOR Q-AXIS CALCULATIONS
062596,000068: 21,3116           55750                           TS       QRCNTR                                
062597,000069: 

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

062604,000076: 21,3117           51750                           INDEX    QRCNTR                                #  AOS SCALED AT PI/2
062605,000077: 21,3120           31537                           CA       AOSQ                                  
062606,000078: 21,3121           00006                           EXTEND                                         
062607,000079: 21,3122           74752                           MP       BIT2                                  #  RESCALE AOS TO PI/4

Page 1473

062609,000081: 21,3123           00006                           EXTEND                                         
062610,000082: 21,3124           13130                           BZF      GTSQAXIS   -3                         #  USE FULL SCALE FOR LARGER AOS ESTIMATES.
062611,000083: 
062612,000084: 21,3125           50000                           INDEX    A                                     
062613,000085: 21,3126           44734                           CS       LIMITS                                #  LIMITS +1 CONTAINS NEGMAX.
062614,000086: 21,3127           56001                           XCH      L                                     #  LIMITS -1 CONTAINS POSMAX.
062615,000087: 
062616,000088: 21,3130           11750                           CCS      QRCNTR                                #  PICK UP RATE FOR THIS AXIS.  RATE CELLS
062617,000089: 21,3131           50000                           INDEX    A                                     #  ARE ADJACENT, NOT SEPARATED.  AT PI/4
062618,000090: 21,3132           31436                           CA       EDOTQ                                 
062619,000091: 21,3133           53744        GTSQAXIS           DXCH     WCENTRAL                              
062620,000092: 
062621,000093: 21,3134           51750                           INDEX    QRCNTR                                #  COLLECT K FOR THIS AXIS
062622,000094: 21,3135           31504                           CA       KQ                                    
062623,000095: 21,3136           55741                           TS       KCENTRAL                              
062624,000096: 
062625,000097: 21,3137           00006                           EXTEND                                         #  CONTROL AUTHORITY ZERO.  AVOID DRIVING
062626,000098: 21,3140           13576                           BZF      POSDRIVE   +1                         #  ENGINE BELL TO THE STOPS.
062627,000099: 
062628,000100: 21,3141           51750                           INDEX    QRCNTR                                #  QDIFF, RDIFF ARE STORED IN D.P.
062629,000101: 21,3142           31450                           CAE      QDIFF                                 
062630,000102: 
062631,000103: 21,3143           00006        ALGORTHM           EXTEND                                         #  Q(R)DIFF IS THETA (ERROR) SCALED AT PI.
062632,000104: 21,3144           71741                           MP       KCENTRAL                              #  FORM K*ERROR AT PI(2)/2(8), IN D.P.
062633,000105: 21,3145           23737                           LXCH     K2THETA                               
062634,000106: 21,3146           00006                           EXTEND                                         
062635,000107: 21,3147           74747                           MP       BIT5                                  #  RESCALE TO 4*PI(2)
062636,000108: 21,3150           53740                           DXCH     K2THETA                               
062637,000109: 21,3151           00006                           EXTEND                                         
062638,000110: 21,3152           74747                           MP       BIT5                                  #  FIRST TERM OF NEGUSUM IN K2THETA.
062639,000111: 21,3153           27740                           ADS      K2THETA    +1                         #  NO CARRY NEEDED       D.P. AT 4*PI(2)
062640,000112: 
062641,000113: 21,3154           41744                           CS       ACENTRAL                              #  FORM ALPHA(2)/(2*K) AT 16*PI, IN D.P.,
062642,000114: 21,3155           00006                           EXTEND                                         #  LIMITING QUOTIENT TO AVOID OVERFLOW.
062643,000115: 21,3156           74736                           MP       BIT14                                 #  -ALPHA/2 IN A, SCALED AT PI/4
062644,000116: 21,3157           00006                           EXTEND                                         
062645,000117: 21,3160           71744                           MP       ACENTRAL                              #  -ALPHA(2)/2 IN A,L, SCALED AT PI(2)/16
062646,000118: 21,3161           61741                           AD       KCENTRAL                              
062647,000119: 21,3162           00006                           EXTEND                                         
062648,000120: 21,3163           63200                           BZMF     HUGEQUOT                              #  K-ALPHA(2)/2 SHOULD BE PNZ FO DIVISION
062649,000121: 
062650,000122: 21,3164           00006                           EXTEND                                         
062651,000123: 21,3165           40001                           DCS      A                                     #  ALPHA(2)/2 - K
062652,000124: 21,3166           61741                           AD       KCENTRAL                              

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

062655,000127: 21,3167           00006                           EXTEND                                         
062656,000128: 21,3170           11741                           DV       KCENTRAL                              #  HIGH ORDER OF QUOTIENT.
062657,000129: 21,3171           57746                           XCH      A2CNTRAL                              
062658,000130: 21,3172           30001                           CA       L                                     #  SHIFT UP THE REMAINDER.
062659,000131: 21,3173           22007                           LXCH     7                                     #  ZERO LOW-ORDER DIVIDEND.
062660,000132: 21,3174           00006                           EXTEND                                         

Page 1474

062662,000134: 21,3175           11741                           DV       KCENTRAL                              
062663,000135: 21,3176           57747                           XCH      A2CNTRAL   +1                         #  QUOTIENT STORED AT 16*PI, D.P.
062664,000136: 21,3177           13203                           TCF      HAVEQUOT                              
062665,000137: 
062666,000138: 21,3200           34733        HUGEQUOT           CA       POSMAX                                
062667,000139: 21,3201           54001                           TS       L                                     
062668,000140: 21,3202           53747                           DXCH     A2CNTRAL                              #  LIMITED QUOTIENT STORED AT 16*PI, D.P.
062669,000141: 
062670,000142: 21,3203           31743        HAVEQUOT           CA       WCENTRAL                              
062671,000143: 21,3204           00006                           EXTEND                                         
062672,000144: 21,3205           74743                           MP       BIT9                                  #  RESCALE OMEGA AT 16*PI IN D.P.
062673,000145: 21,3206           53743                           DXCH     K2CNTRAL                              #  LOWER WORD OVERLAYS OMEGA IN WCENTRAL
062674,000146: 
062675,000147: 21,3207           00006                           EXTEND                                         
062676,000148: 21,3210           31743                           DCA      K2CNTRAL                              
062677,000149: 21,3211           53752                           DXCH     FUNCTION                              
062678,000150: 
062679,000151: 21,3212           31744                           CA       ACENTRAL                              #  GET ALPHA*ABS(ALPHA)/(2*K)
062680,000152: 21,3213           00006                           EXTEND                                         
062681,000153: 21,3214           63220                           BZMF     +4                                    
062682,000154: 
062683,000155: 21,3215           00006                           EXTEND                                         
062684,000156: 21,3216           31747                           DCA      A2CNTRAL                              
062685,000157: 21,3217           13222                           TCF      +3                                    
062686,000158: 
062687,000159: 21,3220           00006                           EXTEND                                         
062688,000160: 21,3221           41747                           DCS      A2CNTRAL                              
062689,000161: 
062690,000162: 21,3222           21752                           DAS      FUNCTION                              #  OMEGA + ALPHA*ABS(ALPHA)/2*K) AT 16*PI
062691,000163: 
062692,000164: 21,3223           11751                           CCS      FUNCTION                              #  DEL = +1 FOR FUNCT1 GREATER THAN ZERO.
062693,000165: 21,3224           13230                           TCF      POSFNCT1                              #  OTHERWISE DEL = -1
062694,000166: 21,3225           13227                           TCF      +2                                    
062695,000167: 21,3226           13232                           TCF      NEGFNCT1                              
062696,000168: 
062697,000169: 21,3227           11752                           CCS      FUNCTION   +1                         #  USE LOW ORDER WORD SINCE HIGH IS ZERO
062698,000170: 21,3230           34753        POSFNCT1           CAF      BIT1                                  
062699,000171: 21,3231           13233                           TCF      +2                                    
062700,000172: 21,3232           44753        NEGFNCT1           CS       BIT1                                  
062701,000173: 21,3233           55745                           TS       DEL                                   
062702,000174: 
062703,000175: 21,3234           11745                           CCS      DEL                                   #  REPLACE OMEGA BY DEL*OMEGA
062704,000176: 21,3235           13247                           TCF      FUNCT2                                #  POSITIVE DEL VALUE.  PROCEED.
062705,000177: 21,3236           13240                           TCF      DEFUNCT                               
062706,000178: 21,3237           13244                           TCF      NEGFNCT2                              
062707,000179: 
062708,000180: 21,3240           55742        DEFUNCT            TS       K2CNTRAL                              
062709,000181: 21,3241           55743                           TS       K2CNTRAL   +1                         
062710,000182: 21,3242           13247                           TCF      FUNCT2                                
062711,000183: 

Page 1475

062713,000185: 21,3243           65252        NEG1/3             DEC      -.33333                               
062714,000186: 
062715,000187: 21,3244           00006        NEGFNCT2           EXTEND                                         
062716,000188: 21,3245           41743                           DCS      K2CNTRAL                              
062717,000189: 21,3246           53743                           DXCH     K2CNTRAL                              
062718,000190: 
062719,000191: 21,3247           00006        FUNCT2             EXTEND                                         
062720,000192: 21,3250           31747                           DCA      A2CNTRAL                              
062721,000193: 21,3251           21743                           DAS      K2CNTRAL                              #  DEL*OMEGA + ALPHA(2)/(2*K) AT 16*PI, D.P.
062722,000194: 
062723,000195: 21,3252           31746        FUNCT3             CA       A2CNTRAL                              
062724,000196: 21,3253           00006                           EXTEND                                         
062725,000197: 21,3254           73243                           MP       NEG1/3                                
062726,000198: 21,3255           53747                           DXCH     A2CNTRAL                              
062727,000199: 21,3256           30001                           CA       L                                     
062728,000200: 21,3257           00006                           EXTEND                                         
062729,000201: 21,3260           73243                           MP       NEG1/3                                
062730,000202: 21,3261           27747                           ADS      A2CNTRAL   +1                         
062731,000203: 21,3262           54001                           TS       L                                     
062732,000204: 21,3263           13265                           TCF      +2                                    #  A2CNTRAL NOW CONTAINS -ALPHA(2)/(6*K),
062733,000205: 21,3264           27746                           ADS      A2CNTRAL                              #  SCALED AT 16*PI, IN D.P.
062734,000206: 
062735,000207: 21,3265           00006                           EXTEND                                         
062736,000208: 21,3266           31743                           DCA      K2CNTRAL                              #  DEL*OMEGA + ALPHA(2)/(3*K) IN A2CNTRAL,
062737,000209: 21,3267           21747                           DAS      A2CNTRAL                              #  SCALED AT 16*PI, D.P.
062738,000210: 
062739,000211: 21,3270           31746                           CA       A2CNTRAL                              
062740,000212: 21,3271           00006                           EXTEND                                         
062741,000213: 21,3272           71744                           MP       ACENTRAL                              
062742,000214: 21,3273           21740                           DAS      K2THETA                               
062743,000215: 21,3274           31747                           CA       A2CNTRAL   +1                         
062744,000216: 21,3275           00006                           EXTEND                                         
062745,000217: 21,3276           71744                           MP       ACENTRAL                              #  ACENTRAL MAY NOW BE OVERLAID.
062746,000218: 21,3277           27740                           ADS      K2THETA    +1                         
062747,000219: 21,3300           54001                           TS       L                                     
062748,000220: 21,3301           13303                           TCF      +2                                    #  TWO TERMS OF NEGUSUM ACCUMULATED, SO FAR
062749,000221: 21,3302           27737                           ADS      K2THETA                               #  SCALED AT 4*PI(2), IN D.P.
062750,000222: 
062751,000223: 21,3303           31742        GETROOT            CA       K2CNTRAL                              #  K*(DEL*OMEGA + ALPHA(2)/(2*K)) IS THE
062752,000224: 21,3304           00006                           EXTEND                                         #  TERM FOR WHICH A SQUARE ROOT IS NEEDED.
062753,000225: 21,3305           71741                           MP       KCENTRAL                              #  K AT PI/2(8)
062754,000226: 21,3306           53752                           DXCH     FUNCTION                              
062755,000227: 21,3307           31743                           CA       K2CNTRAL   +1                         
062756,000228: 21,3310           00006                           EXTEND                                         
062757,000229: 21,3311           71741                           MP       KCENTRAL                              
062758,000230: 21,3312           27752                           ADS      FUNCTION   +1                         
062759,000231: 21,3313           54001                           TS       L                                     
062760,000232: 21,3314           13316                           TCF      +2                                    
062761,000233: 21,3315           27751                           ADS      FUNCTION                              #  DESIRED TERM IN FUNCTION, AT PI(2)/16

Page 1476

062763,000235: 21,3316           11745                           CCS      DEL                                   
062764,000236: 21,3317           13524                           TCF      RSTOFGTS                              
062765,000237: 21,3320           13566                           TCF      NEGUSUM                               
062766,000238: 21,3321           13323                           TCF      NEGATE                                
062767,000239: 21,3322           13566                           TCF      NEGUSUM                               
062768,000240: 
062769,000241: 21,3323           00006        NEGATE             EXTEND                                         
062770,000242: 21,3324           41743                           DCS      K2CNTRAL                              
062771,000243: 21,3325           53743                           DXCH     K2CNTRAL                              
062772,000244: 21,3326           13524                           TCF      RSTOFGTS                              
062773,000245: 
062774,000246: 16,3735                                           BANK     16                                    
062775,000247: 16,3735  E6,1501                                  EBANK=   NEGUQ                                 
062776,000248: 16,2000                                           SETLOC   DAPS1                                 
062777,000249: 16,2000                                           BANK                                           
062778,000250: 
062779,000251:                                                                                                  #  THE WRCHN12 SUBROUTINE SETS BITS 9,10,11,12 OF CHANNEL 12 ON THE BASIS OF THE CONTENTS OF NEGUQ,NEGUR WHICH ARE
062780,000252:                                                                                                  #  THE NEGATIVES OF THE DESIRED ACCELERATION CHANGES.  ACDT+C12 SETS Q(R)ACCDOT TO REFLECT THE NEW DRIVES.
062781,000253: 
062782,000254:                                                                                                  #  WARNING:  ACDT+C12 AND WRCHN12 MUST BE CALLED WITH INTERRUPT INHIBITED.
062783,000255: 
062784,000256: 16,3735           07400        BGIM               OCTAL    07400                                 
062785,000257: 16,3736     0066               CHNL12             EQUALS   ITEMP6                                
062786,000258: 16,3736           41501        ACDT+C12           CS       NEGUQ                                 
062787,000259: 16,3737           00006                           EXTEND                                         #  GIMBAL DRIVE REQUESTS.
062788,000260: 16,3740           71507                           MP       ACCDOTQ                               
062789,000261: 16,3741           23510                           LXCH     QACCDOT                               
062790,000262: 16,3742           41503                           CS       NEGUR                                 
062791,000263: 16,3743           00006                           EXTEND                                         
062792,000264: 16,3744           71511                           MP       ACCDOTR                               
062793,000265: 16,3745           23512                           LXCH     RACCDOT                               
062794,000266: 
062795,000267: 16,3746           11501                           CCS      NEGUQ                                 
062796,000268: 16,3747           34742                           CAF      BIT10                                 
062797,000269: 16,3750           13752                           TCF      +2                                    
062798,000270: 16,3751           34743                           CAF      BIT9                                  
062799,000271: 16,3752           54066                           TS       CHNL12                                
062800,000272: 
062801,000273: 16,3753           11503                           CCS      NEGUR                                 
062802,000274: 16,3754           34740                           CAF      BIT12                                 
062803,000275: 16,3755           13757                           TCF      +2                                    
062804,000276: 16,3756           34741                           CAF      BIT11                                 
062805,000277: 16,3757           26066                           ADS      CHNL12                                #  (STORED RESULT NOT USED AT PRESENT)
062806,000278: 
062807,000279: 16,3760           43735                           CS       BGIM                                  
062808,000280: 16,3761           00006                           EXTEND                                         
062809,000281: 16,3762           02012                           RAND     CHAN12                                
062810,000282: 16,3763           60066                           AD       CHNL12                                
062811,000283: 16,3764           00006                           EXTEND                                         
062812,000284: 16,3765           01012                           WRITE    CHAN12                                

Page 1477

062814,000286: 16,3766           44747                           CS       CALLGMBL                              #  TURN OFF REQUEST FOR ACDT+C12 EXECUTION.
062815,000287: 16,3767           71273                           MASK     RCSFLAGS                              
062816,000288: 16,3770           55273                           TS       RCSFLAGS                              
062817,000289: 
062818,000290: 16,3771           00002                           TC       Q                                     #  RETURN TO CALLER.
062819,000291: 
062820,000292: 21,3327                                           BANK     21                                    
062821,000293: 21,3327  E6,1450                                  EBANK=   QDIFF                                 
062822,000294: 21,2000                                           SETLOC   DAPS4                                 
062823,000295: 21,2000                                           BANK                                           
062824,000296: 

Page 1478

062826,000298:                                                                                                  #  SUBROUTINE TIMEGMBL:  MOD 0, OCTOBER 1967, CRAIG WORK
062827,000299: 
062828,000300:                                                                                                  #  TIMEGMBL COMPUTES THE DRIVE TIME NEEDED FOR THE TRIM GIMBAL TO POSITION THE DESCENT ENGINE NOZZLE SO AS TO NULL
062829,000301:                                                                                                  #  THE OFFSET ANGULAR ACCELERATION ABOUT THE Q (OR R) AXIS.  INSTEAD OF USING AOSQ(R), TIMEGMBL USES .4*AOSQ(R),
062830,000302:                                                                                                  #  SCALED AT PI/8.  FOR EACH AXIS, THE DRIVE TIME IS COMPUTED AS ABS(ALPHA/ACCDOT).  A ZERO
062831,000303:                                                                                                  #  ALPHA OR ACCDOT OR A ZERO QUOTIENT TURNS OFF THE GIMBAL DRIVE IMMEDIATELY.  OTHERWISE, THE GIMBAL IS TURNED ON
062832,000304:                                                                                                  #  DRIVING IN THE CORRECT DIRECTION.  THE Q(R)GIMTIMR IS SET TO TERMINATE THE DRIVE AND Q(R)ACCDOT
062833,000305:                                                                                                  #  IS STORED TO REFLECT THE NEW ACCELERATION DERIVATIVE.  NEGUQ(R) WILL CONTAIN +1,+0,-1 FOR A Q(R)ACCDOT VALUE
062834,000306:                                                                                                  #  WHICH IS NEGATIVE, ZERO, OR POSITIVE.
062835,000307: 
062836,000308:                                                                                                  #  INPUTS:       AOSQ,AOSR, SCALED AT P1/2, AND ACCDOTQ, ACCDOTR AT PI/2(7).     PI/2(7).
062837,000309: 
062838,000310:                                                                                                  #  OUTPUTS:      NEW GIMBAL DRIVE BITS IN CHANNEL 12, NEGUQ, NEGUR, QACCDOT AND RACCDOT, THE LAST SCALED AT PI/2(7).
062839,000311:                                                                                                  #                Q(R)GIMTIMR WILL BE SET TO TIME AND TERMINATE GIMBAL DRIVE(S)
062840,000312: 
062841,000313:                                                                                                  #  DEBRIS:       A, L, Q, ITEMPS 2, 3, 6, RUPTREG2 AND ACDT+C12 DEBRIS.
062842,000314: 
062843,000315:                                                                                                  #  EXITS:        VIA TC Q.
062844,000316: 
062845,000317:                                                                                                  #  ALARMS, ABORTS, :  NONE
062846,000318: 
062847,000319:                                                                                                  #  SUBROUTINES:  ACDT+C12, IBNKCALL
062848,000320: 
062849,000321:                                                                                                  #  WARNING:      THIS SUBROUTINE WRITES INTO CHANNEL 12 AND USES THE ITEMPS.  THEREFORE IT MAY ONLY BE CALLED WITH
062850,000322:                                                                                                  #                INTERRUPT INHIBITED.
062851,000323: 
062852,000324:                                                                                                  #  ERASABLE STORAGE CONFIGURATION (NEEDED BY THE INDEXING METHODS):
062853,000325:                                                                                                  #        NEGUQ           ERASE   +2              NEGATIVE OF Q-AXIS GIMBAL DRIVE
062854,000326:                                                                                                  #        (SPWORD)        EQUALS  NEGUQ +1        ANY S.P. ERASABLE NUMBER, NOW THRSTCMD
062855,000327:                                                                                                  #        NEGUR           EQUALS  NEGUQ +2        NEGATIVE OF R-AXIS GIMBAL DRIVE
062856,000328:                                                                                                  #        ACCDOTQ         ERASE   +2              Q-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
062857,000329:                                                                                                  #        (SPWORD)        EQUALS  ACCDOTQ +1      ANY S.P. ERASABLE NUMBER NOW QACCDOT
062858,000330:                                                                                                  #        ACCDOTR         EQUALS  ACCDOTQ +2      R-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
062859,000331:                                                                                                  #                                                ACCDOTQ, ACCDOTR ARE MAGNITUDES.
062860,000332:                                                                                                  #        AOSQ            ERASE   +4              Q-AXIS ACC., D.P. AT PI/2 R/SEC(2)
062861,000333:                                                                                                  #        AOSR            EQUALS  AOSQ +2         R-AXIS ACCELERATION SCALED AT PI/2 R/S2
062862,000334: 
062863,000335: 21,3327     0066               QRNDXER            EQUALS   ITEMP6                                
062864,000336: 21,3327           23146        OCT23146           OCTAL    23146                                 #  DECIMAL .6
062865,000337: 21,3330     0063               NZACCDOT           EQUALS   ITEMP3                                
062866,000338: 
062867,000339: 21,3330           34753        TIMEGMBL           CAF      ONE                                   #  INITIALIZE ALLOWGTS.
062868,000340: 21,3331           55502                           TS       ALLOWGTS                              
062869,000341: 
062870,000342: 21,3332           34752                           CAF      TWO                                   #  SET UP LOOP FOR R AXIS.
062871,000343: 21,3333           22002                           LXCH     Q                                     #  SAVE RETURN ADDRESS.
062872,000344: 21,3334           22071                           LXCH     RUPTREG2                              

Page 1479

062874,000346: 21,3335           13337                           TCF      +2                                    
062875,000347: 21,3336           34755        TIMQGMBL           CAF      ZERO                                  #  NOW DO THE Q-AXIS
062876,000348: 21,3337           54066                           TS       QRNDXER                               
062877,000349: 21,3340           50066                           INDEX    QRNDXER                               
062878,000350: 21,3341           31507                           CA       ACCDOTQ                               #  ACCDOT IS PRESUMED TO BE AT PI/2(7).
062879,000351: 21,3342           00006                           EXTEND                                         
062880,000352: 21,3343           63413                           BZMF     TGOFFNOW                              #  IS ACCDOT LESS THAN OR EQUAL TO 0?
062881,000353: 21,3344           54063                           TS       NZACCDOT                              #  NO.  STORE NON-ZERO, POSITIVE ACCDOT.
062882,000354: 
062883,000355: 21,3345           50066        ALPHATRY           INDEX    QRNDXER                               
062884,000356: 21,3346           41537                           CS       AOSQ                                  
062885,000357: 21,3347           00006                           EXTEND                                         
062886,000358: 21,3350           13413                           BZF      TGOFFNOW                              #  IS ALPHA ZERO?
062887,000359: 
062888,000360: 21,3351           54002                           TS       Q                                     #  SAVE A COPY OF -AOS.
062889,000361: 21,3352           00006                           EXTEND                                         #  NO.  RESCALE FOR TIMEGMBL USE.
062890,000362: 21,3353           73327                           MP       OCT23146                              #  OCTAL 23146 IS DECIMAL .6
062891,000363: 21,3354           60002                           AD       Q                                     #  -1.6*AOS AT PI/2 = -.4*AOS AT PI/8.
062892,000364: 21,3355           54001                           TS       L                                     #  WAS THERE OVERFLOW?
062893,000365: 21,3356           13363                           TCF      SETNEGU                               #  NO.  COMPUTE DRIVE TIME.
062894,000366: 
062895,000367: 21,3357           40000                           CS       A                                     #  RECOVER -SGN(AOS) IN THE A REGISTER.
062896,000368: 21,3360           50066                           INDEX    QRNDXER                               #  YES.  START DRIVE WITHOUT WAITLIST.
062897,000369: 21,3361           57501                           XCH      NEGUQ                                 
062898,000370: 21,3362           13417                           TCF      NOTALLOW                              #  KNOCK DOWN THE ALLOWGTS FLAG.
062899,000371: 
062900,000372: 21,3363           00006        SETNEGU            EXTEND                                         
062901,000373: 21,3364           63371                           BZMF     POSALPH                               
062902,000374: 
062903,000375: 21,3365           40000                           COM                                            
062904,000376: 21,3366           54062                           TS       ITEMP2                                #  STORE -ABS(.4*AOS) SCALED AT PI/8.
062905,000377: 21,3367           44753                           CS       BIT1                                  
062906,000378: 21,3370           13373                           TCF      POSALPH    +2                         
062907,000379: 21,3371           54062        POSALPH            TS       ITEMP2                                #  STORE -ABS(.4*AOS) SCALED AT PI/8.
062908,000380: 21,3372           34753                           CA       BIT1                                  
062909,000381: 21,3373           50066                 +2        INDEX    QRNDXER                               #  SGN(AOS) INTO NEGU
062910,000382: 21,3374           55501                           TS       NEGUQ                                 #  STORE SGN(APLHA) AS NEGU
062911,000383: 
062912,000384: 21,3375           30063                           CA       NZACCDOT                              
062913,000385: 21,3376           00006                           EXTEND                                         
062914,000386: 21,3377           74740                           MP       BIT12                                 #  2*ACCDOT, SCALED AT PI/8.
062915,000387: 21,3400           60062                           AD       ITEMP2                                #  -ABS(ALPHA) + 2*ACCDOT, AT PI/8.
062916,000388: 21,3401           00006                           EXTEND                                         
062917,000389: 21,3402           63417                           BZMF     NOTALLOW                              #  IS DRIVE TIME MORE THAN TWO SECONDS?
062918,000390: 21,3403           40062                           CS       ITEMP2                                #  NO.  COMPUTE DRIVE TIME.
062919,000391: 21,3404           00006                           EXTEND                                         #  ABS(ALPHA) AT PI/8.
062920,000392: 21,3405           73440                           MP       OCT00240                              #  DECIMAL 10/1024
062921,000393: 21,3406           00006                           EXTEND                                         #  QUOTIENT IS DRIVE TIME AT WAITLIST.
062922,000394: 21,3407           10063                           DV       NZACCDOT                              #  ABS(ALPHA)/ACCDOT AT 2(14)/100

Page 1480

062924,000396: 21,3410           00006                           EXTEND                                         
062925,000397: 21,3411           13413                           BZF      TGOFFNOW                              #  DRIVE TIME MUST BE GREATER THAN ZERO.
062926,000398: 
062927,000399: 21,3412           13425                           TCF      DRIVEON                               
062928,000400: 
062929,000401: 21,3413           34755        TGOFFNOW           CAF      ZERO                                  #  TURN OFF GIMBAL NOW.
062930,000402: 21,3414           50066                           INDEX    QRNDXER                               
062931,000403: 21,3415           55501                           TS       NEGUQ                                 
062932,000404: 
062933,000405: 21,3416           13427                           TCF      DONEYET                               
062934,000406: 
062935,000407: 21,3417           36010        NOTALLOW           CAF      OCT31                                 
062936,000408: 21,3420           50066                           INDEX    QRNDXER                               
062937,000409: 21,3421           55632                           TS       QGIMTIMR                              
062938,000410: 21,3422           34755                           CAF      ZERO                                  #  DRIVE TIME IS MORE THAN 2 SECONDS, SO
062939,000411: 21,3423           55502                           TS       ALLOWGTS                              #  DO NOT PERMIT FURTHER GTS ATTITUDE-RATE
062940,000412:                                                                                                  #  CONTROL UNTIL AOSTASK APPROVES.
062941,000413: 21,3424           13427                           TCF      DONEYET                               #  NO WAITLIST CALL IS MADE.
062942,000414: 
062943,000415: 21,3425           50066        DRIVEON            INDEX    QRNDXER                               
062944,000416: 21,3426           55632                           TS       QGIMTIMR                              #  CHOOSE Q OR R AXIS.
062945,000417: 
062946,000418: 21,3427           10066        DONEYET            CCS      QRNDXER                               
062947,000419: 21,3430           13336                           TCF      TIMQGMBL                              
062948,000420: 
062949,000421: 21,3431           52073                           DXCH     RUPTREG3                              #  PROTECT IBNKCALL ERASABLES.  ACDT+C12
062950,000422: 21,3432           52063                           DXCH     ITEMP2                                #  LEAVES ITEMPS2,3 ALONE.
062951,000423: 
062952,000424: 21,3433           04674                           TC       IBNKCALL                              #  TURN OF CHANNEL BITS, SET Q(R)ACCDOTS.
062953,000425: 21,3434           35736                           CADR     ACDT+C12                              
062954,000426: 
062955,000427: 21,3435           52063                           DXCH     ITEMP2                                #  RESTORE ERASABLES FOR IBNKCALL.
062956,000428: 21,3436           52073                           DXCH     RUPTREG3                              
062957,000429: 
062958,000430: 21,3437           00071                           TC       RUPTREG2                              #  RETURN TO CALLER.
062959,000431: 
062960,000432: 21,3440           00240        OCT00240           OCTAL    00240                                 #  DECIMAL 10/1024
062961,000433: 

Page 1481

062963,000435:                                                                                                  #  THE FOLLOWING SECTION IS A CONTINUATION OF THE TRIM GIMBAL CONTROL FROM THE LAST GTS ENTRY.  THE QUANTITY NEGUSUM
062964,000436:                                                                                                  #  IS COMPUTED FOR EACH AXIS (Q,R), .707*DEL*FUNCTION(3/2) + K2THETA = NEGUSUM.  NEW DRIVES ARE ENTERED TO CH 12.
062965,000437: 
062966,000438:                                                                                                  #  THE SUBROUTINE GTSQRT ACCEPTS A DOUBLE PRECISION VALUE IN FUNCTION, FUNCTION +1 AND RETURNS A SINGLE-PRECISION
062967,000439:                                                                                                  #  SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF THE ARGUMENT.  ALSO, THE CELL SHFTFLAG CONTAINS A BINARY
062968,000440:                                                                                                  #  EXPONENT S, SUCH THAT THE SQUARE ROOT (RETURNED IN THE A REGISTER) MUST BE SHIFTED RIGHT (MULTIPLIED BY 2 TO THE
062969,000441:                                                                                                  #  POWER (-S)) IN ORDER TO BE THE TRUE SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF FUNCTION, FUNCTION +1.
062970,000442:                                                                                                  #  SQUARE ROOT ERROR IS NOT MORE THAN 2 IN THE 14TH SIGNIFICANT BIT.  CELLS CLOBBERED ARE A, L, SHFTFLAG, ININDEX,
062971,000443:                                                                                                  #  HALFARG, SCRATCH, SR, FUNCTION, FUNCTION +1.  GTSQRT IS CALLED BY TC GTSQRT AND RETURNS VIA TC Q OR TC FUNCTION +1.
062972,000444:                                                                                                  #  ZERO OR NEGATIVE ARGUMENTS YIELD ZERO FOR SQUARE ROOTS.
062973,000445: 
062974,000446: 21,3441           11751        GTSQRT             CCS      FUNCTION                              
062975,000447: 21,3442           13460                           TCF      GOODARG                               #  FUNCTION IS POSITIVE.  TAKE SQUARE ROOT.
062976,000448: 21,3443           13445                           TCF      +2                                    #  HIGH ORDER WORD IS ZERO.  TRY THE LOWER.
062977,000449: 21,3444           13451                           TCF      ZEROOT                                #  NEGATIVE.  USE ZERO FOR 1/2 POWER.
062978,000450: 
062979,000451: 21,3445           31752                           CA       FUNCTION   +1                         
062980,000452: 21,3446           00006                           EXTEND                                         
062981,000453: 21,3447           63451                           BZMF     ZEROOT                                
062982,000454: 
062983,000455: 21,3450           13454                           TCF      ZEROHIGH                              #  PROCEED.
062984,000456: 21,3451           34755        ZEROOT             CA       ZERO                                  
062985,000457: 21,3452           55741                           TS       SHFTFLAG                              
062986,000458: 21,3453           00002                           TC       Q                                     
062987,000459: 
062988,000460: 21,3454           57751        ZEROHIGH           XCH      FUNCTION                              #  14 MOST SIGNIFICANT BITS ARE IN THE
062989,000461: 21,3455           57752                           XCH      FUNCTION   +1                         #  LOWER WORD.  EXCHANGE THEM.
062990,000462: 21,3456           34757                           CA       SEVEN                                 
062991,000463: 21,3457           13461                           TCF      GOODARG    +1                         
062992,000464: 
062993,000465: 21,3460           34755        GOODARG            CA       ZERO                                  
062994,000466: 21,3461           55741                           TS       SHFTFLAG                              
062995,000467: 21,3462           35751                           CA       TWELVE                                #  INITIALIZE THE SCALING LOOP.
062996,000468: 21,3463           55744                           TS       ININDEX                               
062997,000469: 21,3464           13473                           TCF      SCALLOOP                              
062998,000470: 
062999,000471: 21,3465           31751        SCALSTRT           CA       FUNCTION                              
063000,000472: 21,3466           13507                           TCF      SCALDONE                              
063001,000473: 
063002,000474: 21,3467           37746        MULBUSH            CA       NEG2                                  #  IF ARG IS NOT LESS THAN 1/4, INDEX IS
063003,000475: 21,3470           27744                           ADS      ININDEX                               #  ZERO, INDICATING NO SHIFT NEEDED.
063004,000476: 21,3471           00006                           EXTEND                                         #  BRANCH IF ARG IS NOT LESS THAN 1/4.
063005,000477: 21,3472           63465                           BZMF     SCALSTRT                              #  OTHERWISE COMPARE ARG WITH A REFERENCE
063006,000478:                                                                                                  #  WHICH IS 4 TIMES LARGER THAN THE LAST.
063007,000479: 21,3473           41751        SCALLOOP           CS       FUNCTION                              
063008,000480: 21,3474           51744                           INDEX    ININDEX                               
063009,000481: 21,3475           64735                           AD       BIT15                                 #  REFERENCE MAGNITUDE LESS OR EQUAL TO 1/4
063010,000482: 21,3476           00006                           EXTEND                                         
063011,000483: 21,3477           63467                           BZMF     MULBUSH                               #  IF ARG IS NOT LESS THAN REFERENCE, GO
063012,000484:                                                                                                  #  AROUND THE MULBERRY BUSH ONCE MORE.

Page 1482

063014,000486: 21,3500           51744                           INDEX    ININDEX                               
063015,000487: 21,3501           34735                           CA       BIT15                                 #  THIS IS THE SCALE MAGNITUDE
063016,000488: 21,3502           57747                           XCH      HALFARG                               #  2**(-ININDEX) IS THE SHIFT DIVISOR.
063017,000489: 21,3503           00006                           EXTEND                                         #  RESCALE ARGUMENT.
063018,000490: 21,3504           31752                           DCA      FUNCTION                              
063019,000491: 21,3505           00006                           EXTEND                                         
063020,000492: 21,3506           11747                           DV       HALFARG                               
063021,000493:                                                                                                  #  ININDEX AND SHFTFLAG PRESERVE INFO FOR
063022,000494:                                                                                                  #  RESCALING AFTER ROOT PROCESS.
063023,000495: 21,3507           00006        SCALDONE           EXTEND                                         
063024,000496: 21,3510           23752                           QXCH     FUNCTION   +1                         #  SAVE Q FOR RETURN
063025,000497: 21,3511           00006                           EXTEND                                         
063026,000498: 21,3512           74736                           MP       BIT14                                 
063027,000499: 21,3513           55747                           TS       HALFARG                               
063028,000500: 21,3514           74737                           MASK     BIT13                                 
063029,000501: 21,3515           10000                           CCS      A                                     
063030,000502: 21,3516           33634                           CA       OCT11276                              
063031,000503: 21,3517           63632                           AD       ROOTHALF                              #  INITIAL GUESS IS ROOT 1/2 OR POSMAX
063032,000504: 21,3520           03636                           TC       ROOTCYCL                              
063033,000505: 21,3521           03636                           TC       ROOTCYCL                              
063034,000506: 21,3522           03636                           TC       ROOTCYCL                              
063035,000507: 21,3523           01752                           TC       FUNCTION   +1                         
063036,000508: 
063037,000509:                                                                                                  #  ****************************************************************************************************************
063038,000510: 
063039,000511: 21,3524           03441        RSTOFGTS           TC       GTSQRT                                
063040,000512: 21,3525           57742        PRODUCT            XCH      K2CNTRAL                              
063041,000513: 21,3526           00006                           EXTEND                                         
063042,000514: 21,3527           71742                           MP       K2CNTRAL                              
063043,000515: 21,3530           53743                           DXCH     K2CNTRAL                              
063044,000516: 21,3531           00006                           EXTEND                                         #                THE PRODUCT OF
063045,000517: 21,3532           70001                           MP       L                                     #   1/2                   2       1/2
063046,000518: 21,3533           27743                           ADS      K2CNTRAL   +1                         #  K   *(DEL*OMEGA + ALPHA /(2*K))
063047,000519: 21,3534           54001                           TS       L                                     #                      AND
063048,000520: 21,3535           13537                           TCF      +2                                    #                        2
063049,000521: 21,3536           27742                           ADS      K2CNTRAL                              #  DEL*(DEL*OMEGA + ALPHA /(2*K)) NOW IN 
063050,000522:                                                                                                  #  K2CNTRAL
063051,000523: 
063052,000524: 21,3537           31744        DOSHIFT            CA       ININDEX                               
063053,000525: 21,3540           00006                           EXTEND                                         #  MULTIPLY IN THE FACTOR 2(-S), RETURNED
063054,000526: 21,3541           74736                           MP       BIT14                                 #  BY THE GTSQRT SUBROUTINE
063055,000527: 21,3542           27741                           ADS      SHFTFLAG                              
063056,000528: 21,3543           00006                           EXTEND                                         
063057,000529: 21,3544           13563                           BZF      ADDITIN                               
063058,000530: 21,3545           51741                           INDEX    SHFTFLAG                              
063059,000531: 21,3546           34735                           CA       BIT15                                 

Page 1483

063061,000533: 21,3547           57742                           XCH      K2CNTRAL                              
063062,000534: 21,3550           00006                           EXTEND                                         
063063,000535: 21,3551           71742                           MP       K2CNTRAL                              
063064,000536: 21,3552           21740                           DAS      K2THETA                               
063065,000537: 21,3553           57742                           XCH      K2CNTRAL                              
063066,000538: 21,3554           00006                           EXTEND                                         
063067,000539: 21,3555           71743                           MP       K2CNTRAL   +1                         
063068,000540: 21,3556           27740                           ADS      K2THETA    +1                         
063069,000541: 21,3557           54001                           TS       L                                     
063070,000542: 21,3560           13562                           TCF      +2                                    
063071,000543: 21,3561           27737                           ADS      K2THETA                               
063072,000544: 
063073,000545: 21,3562           13566                           TCF      NEGUSUM                               
063074,000546: 
063075,000547: 21,3563           00006        ADDITIN            EXTEND                                         
063076,000548: 21,3564           31743                           DCA      K2CNTRAL                              
063077,000549: 21,3565           21740                           DAS      K2THETA                               #  NOW ADD IN THE K2THETA TERM.
063078,000550: 21,3566           11737        NEGUSUM            CCS      K2THETA                               #  TEST SIGN OF HIGH ORDER PART.
063079,000551: 21,3567           13573                           TCF      NEGDRIVE                              
063080,000552: 21,3570           13572                           TCF      +2                                    
063081,000553: 21,3571           13575                           TCF      POSDRIVE                              
063082,000554: 
063083,000555: 21,3572           11740                           CCS      K2THETA    +1                         #  SIGN TEST FOR LOW ORDER PART.
063084,000556: 21,3573           34753        NEGDRIVE           CA       BIT1                                  
063085,000557: 21,3574           13576                           TCF      +2                                    #  STOP GIMBAL DRIVE FOR A ZERO NEGUSUM.
063086,000558: 21,3575           44753        POSDRIVE           CS       BIT1                                  
063087,000559: 21,3576           54001                           TS       L                                     #  SAVE FOR DRIVE REVERSAL TEST.
063088,000560: 21,3577           51750                           INDEX    QRCNTR                                
063089,000561: 21,3600           57501                           XCH      NEGUQ                                 
063090,000562: 
063091,000563: 21,3601           00006                           EXTEND                                         
063092,000564: 21,3602           70001                           MP       L                                     #  MULTIPLY OLD NEGU AND NEW NEGU.
063093,000565: 21,3603           10001                           CCS      L                                     
063094,000566: 21,3604           13621                           TCF      LOUPE                                 #  NON-ZERO GIMBAL DRIVE BEING CONTINUED.
063095,000567: 
063096,000568: 21,3605           13616                           TCF      ZEROLOUP                              #  NO REVERSAL PROBLEM HERE.
063097,000569: 
063098,000570: 21,3606           13610                           TCF      REVERSAL                              #  NON-ZERO GIMBAL DRIVE BEING REVERSED.
063099,000571: 21,3607           13616                           TCF      ZEROLOUP                              #  NO REVERSAL PROBLEM HERE.
063100,000572: 
063101,000573: 21,3610           51750        REVERSAL           INDEX    QRCNTR                                #  A ZERO-DRIVE PAUSE IS NEEDED HERE.  ZERO
063102,000574: 21,3611           55510                           TS       QACCDOT                               #  IS IN A REGISTER FROM CCS ON (-1).
063103,000575: 21,3612           51750                           INDEX    QRCNTR                                
063104,000576: 21,3613           43633                           CS       GMBLBITA                              
063105,000577: 21,3614           00006                           EXTEND                                         
063106,000578: 21,3615           03012                           WAND     CHAN12                                
063107,000579: 
063108,000580: 21,3616           41273        ZEROLOUP           CS       RCSFLAGS                              #  SET UP REQUEST FOR ACDT+C12 CALL.
063109,000581: 21,3617           74747                           MASK     CALLGMBL                              
063110,000582: 21,3620           27273                           ADS      RCSFLAGS                              

Page 1484

063112,000584: 21,3621           11750        LOUPE              CCS      QRCNTR                                #  HAVE BOTH AXES BEEN PROCESSED?
063113,000585: 21,3622           13115                           TCF      GOQTRIMG                              #  NO.  DO Q AXIS NEXT.
063114,000586: 
063115,000587: 21,3623           31505                           CA       SAVESR                                #  RESTORE THE SR
063116,000588: 21,3624           54021                           TS       SR                                    
063117,000589: 
063118,000590: 21,3625           00006        GOCLOSE            EXTEND                                         #  TERMINATE THE JASK.
063119,000591: 21,3626           33631                           DCA      CLOSEADR                              
063120,000592: 21,3627           52006                           DTCB                                           
063121,000593: 
063122,000594: 21,3630  E6,1537                                  EBANK=   AOSQ                                  
063123,000595: 21,3630           03236 36106  CLOSEADR           2CADR    CLOSEOUT                              #  TERMINATE THE JASK.
063124,000596: 
063125,000597: 21,3632     5751               TWELVE             EQUALS   OCT14                                 
063126,000598: 21,3632           26501        ROOTHALF           OCTAL    26501                                 #  SQUARE ROOT OF 1/2
063127,000599: 21,3633           01400        GMBLBITA           OCTAL    01400                                 #  INDEXED WRT GMBLBITB  DO NOT MOVE ******
063128,000600: 21,3634           11276        OCT11276           OCTAL    11276                                 #  POSMAX - ROOTHALF
063129,000601: 21,3635           06000        GMBLBITB           OCTAL    06000                                 #  INDEXED WRT GMBLBITA  DO NOT MOVE ******
063130,000602: 
063131,000603:                                                                                                  #  SUBROUTINE ROOTCYCL:  BY CRAIG WORK, 3 APRIL 68
063132,000604: 
063133,000605:                                                                                                  #  ROOTCYCL IS A SUBROUTINE WHICH EXECUTES ONE NEWTON SQUARE ROOT ALGORITHM ITERATION.  THE INITIAL GUESS AT THE
063134,000606:                                                                                                  #  SQUARE ROOT IS PRESUMED TO BE IN THE A REGISTER AND ONE-HALF THE SQUARE IS TAKEN FROM HALFARG.  THE NEW APPROXI-
063135,000607:                                                                                                  #  MATION TO THE SQUARE ROOT IS RETURNED IN THE A REGISTER.  DEBRIS:  A, L, SR, SCRATCH.  ROOTCYCL IS CALLED FROM
063136,000608:                                                                                                  #  LOCATION (LOC) BY A TC ROOTCYCL, AND RETURNS (TC Q) TO LOC +1.
063137,000609: 
063138,000610:                                                                                                  #  WARNING:  IF THE INITIAL GUESS IS NOT GREATER THAN THE SQUARE, DIVIDE OR ADD OVERFLOW IS A REAL POSSIBILITY.
063139,000611: 
063140,000612: 21,3636           55746        ROOTCYCL           TS       SCRATCH                               #  STORE X
063141,000613: 21,3637           54021                           TS       SR                                    #  X/2 NOW IN SR
063142,000614: 21,3640           31747                           CA       HALFARG                               #  ARG/2 IN THE A REG
063143,000615: 21,3641           22007                           ZL                                             #  PREPARE FOR DIVISION
063144,000616: 21,3642           00006                           EXTEND                                         
063145,000617: 21,3643           11746                           DV       SCRATCH                               #  (ARG/X)/2
063146,000618: 21,3644           60021                           AD       SR                                    #  (X + ARG/X)/2 IN THE A REG
063147,000619: 21,3645           00002                           TC       Q                                     
063148,000620: 
063149,000621: 

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