Source Code

This source code is very close to the Apollo Guidance Computer software for the Apollo 13 Lunar module. This revision of the Luminary 131 program is from December of 1969, whereas there was a later revision in January of 1970, and still another revision in February, which is the code that flew on the mission. As far as this transcription is concerned, it was originally from a copy made in 1991 of a printout from the collection of AGC developer Don Eyles for collector David Craig. It was subsequently scanned by Gary Neff, reprocessed for online presentation at the now-discontinued History of Recent Science and Technology (HRST) website of MIT's Dibner Institute (the full-quality scans being discarded in the process), and finally transcribed by Ron Burkey for the Virtual AGC Project. Although a high-quality replacement scan for a completely illegible page was later provided by Gary Neff, the reduced legibility of the reprocessed HRST posting nevertheless caused many errors to be introduced into the transcription. Accordingly, a second scan of the same physical printout was made in 2017 for the Virtual AGC Project's collection at the Internet Archive, and used to correct the transcription errors. All of the scanned materials mentioned, as well as other Luminary 131 related material, are available online. Don Eyles apprently made additional hand-written notes in printout between 1991 and 2017, so the two scans are not identical in that respect. The page-headings in the printout read, in part:
	GAP:  ASSEMBLE REVISION 131 OF AGC PROGRAM LUMINARY BY NASA 2021112-091
	17:53 DEC. 19, 1969
Note that the date is the date the printout was made, not the date on which the program revision was released, although these happen to be very close together.

062204,000002:                                                                                                  ## Copyright:   Public domain.
062205,000003:                                                                                                  ## Filename:    TRIM_GIMBAL_CNTROL_SYSTEM.agc
062206,000004:                                                                                                  ## Purpose:     A section of Luminary 1C, revision 131.
062207,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
062208,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13.
062209,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
062210,000008:                                                                                                  ##              that the code format has been changed to conform to the
062211,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
062212,000010:                                                                                                  ##              original YUL assembler.
062213,000011:                                                                                                  ## Reference:   pp. 1464-1476
062214,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
062215,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
062216,000014:                                                                                                  ## Mod history: 06/08/03 RSB.   Began transcribing.
062217,000015:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
062218,000016:                                                                                                  ##              2010-10-25 JL   Indentation fixes.
062219,000017:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
062220,000018:                                                                                                  ##                              original hardcopy, as opposed to the PDF page
062221,000019:                                                                                                  ##                              numbers in 1701.pdf.
062222,000020:                                                                                                  ##              2017-02-28 RSB  Proofed comment text using octopus/ProoferComments.
062223,000021:                                                                                                  ##              2017-03-14 RSB  Comment-text fixes noted in proofing Luminary 116.
062224,000022: 

Page 1464

062226,000024: 21,3076                                           BANK     21                                    
062227,000025: 21,3076  E6,1450                                  EBANK=   QDIFF                                 
062228,000026: 21,2000                                           SETLOC   DAPS4                                 
062229,000027: 21,2000                                           BANK                                           
062230,000028: 
062231,000029: 21,3076                                           COUNT*   $$/DAPGT                              
062232,000030: 
062233,000031:                                                                                                  #  CONTROL REACHES THIS POINT UNDER EITHER OF THE FOLLOWING TWO CONDITIONS ONCE THE DESCENT ENGINE AND THE DIGITAL
062234,000032:                                                                                                  #  AUTOPILOT ARE BOTH ON:
062235,000033:                                                                                                  #        A) THE TRIM GIMBAL CONTROL LAW WAS ON DURING THE PREVIOUS Q,R-AXIS TIME5 INTERRUPT (OR THE DAPIDLER
062236,000034:                                                                                                  #           INITIALIZATION WAS SET FOR TRIM GIMBAL CONTROL AND THIS IS THE FIRST PASS), OR
062237,000035:                                                                                                  #        B) THE Q,R-AXES RCS AUTOPILOT DETERMINED THAT THE VEHICLE WAS ENTERING (OR HAD JUST ENTERED) A COAST
062238,000036:                                                                                                  #           ZONE WITH A SMALL OFFSET ANGULAR ACCELERATION.
062239,000037:                                                                                                  #  GTS IS THE ENTRY TO THE GIMBAL TRIM SYSTEM FOR CONTROLLING ATTITUDE ERRORS AND RATES AS WELL AS ACCELERATIONS.
062240,000038: 
062241,000039: 21,3076           37752        GTS                CAF      NEGONE                                #  MAKE THE NEXT PASS THROUGH THE DAP BE
062242,000040: 21,3077           55630                           TS       COTROLER                              #        THROUGH RCS CONTROL,
062243,000041: 21,3100           34751                           CAF      FOUR                                  #        AND ENSURE THAT IT IS NOT A SKIP.
062244,000042: 21,3101           55534                           TS       SKIPU                                 
062245,000043: 21,3102           55535                           TS       SKIPV                                 
062246,000044: 
062247,000045: 21,3103           34752                           CAF      TWO                                   
062248,000046: 21,3104           55632                           TS       INGTS                                 #  SET INDICATOR OF GTS CONTROL POSITIVE.
062249,000047: 21,3105           55631                           TS       QGIMTIMR                              #  SET TIMERS TO 200 MSEC TO AVOID BOTH
062250,000048: 21,3106           55633                           TS       RGIMTIMR                              #  RUNAWAY AND INTERFERENCE BY NULLING.
062251,000049: 
062252,000050:                                                                                                  #  THE DRIVE SETTING ALGORITHM
062253,000051:                                                                                                  #        DEL = SGN(OMEGA + ALPHA*ABS(ALPHA)/(2*K))
062254,000052:                                                                                                  #                                                    2               1/2                  2       3/2
062255,000053:                                                                                                  #        NEGUSUM = ERROR*K + ALPHA*(DEL*OMEGA + ALPHA /(3*K)) + DEL*K   (DEL*OMEGA + ALPHA /(2*K))
062256,000054:                                                                                                  #        DRIVE = -SGN(NEGUSUM)
062257,000055: 
062258,000056: 21,3107           30021                           CA       SR                                    #  SAVE THE SR.  SHIFT IT LEFT TO CORRECT
062259,000057: 21,3110           60000                           AD       A                                     #  FOR THE RIGHT SHIFT DUE TO EDITING.
062260,000058: 21,3111           55505                           TS       SAVESR                                
062261,000059: 
062262,000060: 21,3112           34752        GTSGO+DN           CAF      TWO                                   #  SET INDEXER FOR R-AXIS CALCULATIONS.
062263,000061: 21,3113           13115                           TCF      GOQTRIMG   +1                         
062264,000062: 
062265,000063: 21,3114           34755        GOQTRIMG           CAF      ZERO                                  #  SET INDEXER FOR Q-AXIS CALCULATIONS
062266,000064: 21,3115           55747                           TS       QRCNTR                                
062267,000065: 
062268,000066: 21,3116           51747                           INDEX    QRCNTR                                #  AOS SCALED AT PI/2
062269,000067: 21,3117           31536                           CA       AOSQ                                  
062270,000068: 21,3120           00006                           EXTEND                                         
062271,000069: 21,3121           74752                           MP       BIT2                                  #  RESCALE AOS TO PI/4

Page 1465

062273,000071: 21,3122           00006                           EXTEND                                         
062274,000072: 21,3123           13127                           BZF      GTSQAXIS   -3                         #  USE FULL SCALE FOR LARGER AOS ESTIMATES.
062275,000073: 
062276,000074: 21,3124           50000                           INDEX    A                                     
062277,000075: 21,3125           44734                           CS       LIMITS                                #  LIMITS +1 CONTAINS NEGMAX.
062278,000076: 21,3126           56001                           XCH      L                                     #  LIMITS -1 CONTAINS POSMAX.
062279,000077: 
062280,000078: 21,3127           11747                           CCS      QRCNTR                                #  PICK UP RATE FOR THIS AXIS.  RATE CELLS
062281,000079: 21,3130           50000                           INDEX    A                                     #  ARE ADJACENT, NOT SEPARATED.  AT PI/4
062282,000080: 21,3131           31436                           CA       EDOTQ                                 
062283,000081: 21,3132           53743        GTSQAXIS           DXCH     WCENTRAL                              
062284,000082: 
062285,000083: 21,3133           51747                           INDEX    QRCNTR                                #  COLLECT K FOR THIS AXIS
062286,000084: 21,3134           31504                           CA       KQ                                    
062287,000085: 21,3135           55740                           TS       KCENTRAL                              
062288,000086: 
062289,000087: 21,3136           00006                           EXTEND                                         #  CONTROL AUTHORITY ZERO.  AVOID DRIVING
062290,000088: 21,3137           13575                           BZF      POSDRIVE   +1                         #  ENGINE BELL TO THE STOPS.
062291,000089: 
062292,000090: 21,3140           51747                           INDEX    QRCNTR                                #  QDIFF, RDIFF ARE STORED IN D.P.
062293,000091: 21,3141           31450                           CAE      QDIFF                                 
062294,000092: 
062295,000093: 21,3142           00006        ALGORTHM           EXTEND                                         #  Q(R)DIFF IS THETA (ERROR) SCALED AT PI.
062296,000094: 21,3143           71740                           MP       KCENTRAL                              #  FORM K*ERROR AT PI(2)/2(8), IN D.P.
062297,000095: 21,3144           23736                           LXCH     K2THETA                               
062298,000096: 21,3145           00006                           EXTEND                                         
062299,000097: 21,3146           74747                           MP       BIT5                                  #  RESCALE TO 4*PI(2)
062300,000098: 21,3147           53737                           DXCH     K2THETA                               
062301,000099: 21,3150           00006                           EXTEND                                         
062302,000100: 21,3151           74747                           MP       BIT5                                  #  FIRST TERM OF NEGUSUM IN K2THETA.
062303,000101: 21,3152           27737                           ADS      K2THETA    +1                         #  NO CARRY NEEDED       D.P. AT 4*PI(2)
062304,000102: 
062305,000103: 21,3153           41743                           CS       ACENTRAL                              #  FORM ALPHA(2)/(2*K) AT 16*PI, IN D.P.,
062306,000104: 21,3154           00006                           EXTEND                                         #  LIMITING QUOTIENT TO AVOID OVERFLOW.
062307,000105: 21,3155           74736                           MP       BIT14                                 #  -ALPHA/2 IN A, SCALED AT PI/4
062308,000106: 21,3156           00006                           EXTEND                                         
062309,000107: 21,3157           71743                           MP       ACENTRAL                              #  -ALPHA(2)/2 IN A,L, SCALED AT PI(2)/16
062310,000108: 21,3160           61740                           AD       KCENTRAL                              
062311,000109: 21,3161           00006                           EXTEND                                         
062312,000110: 21,3162           63177                           BZMF     HUGEQUOT                              #  K-ALPHA(2)/2 SHOULD BE PNZ FO DIVISION
062313,000111: 
062314,000112: 21,3163           00006                           EXTEND                                         
062315,000113: 21,3164           40001                           DCS      A                                     #  ALPHA(2)/2 - K
062316,000114: 21,3165           61740                           AD       KCENTRAL                              
062317,000115: 21,3166           00006                           EXTEND                                         
062318,000116: 21,3167           11740                           DV       KCENTRAL                              #  HIGH ORDER OF QUOTIENT.
062319,000117: 21,3170           57745                           XCH      A2CNTRAL                              
062320,000118: 21,3171           30001                           CA       L                                     #  SHIFT UP THE REMAINDER.
062321,000119: 21,3172           22007                           LXCH     7                                     #  ZERO LOW-ORDER DIVIDEND.
062322,000120: 21,3173           00006                           EXTEND                                         

Page 1466

062324,000122: 21,3174           11740                           DV       KCENTRAL                              
062325,000123: 21,3175           57746                           XCH      A2CNTRAL   +1                         #  QUOTIENT STORED AT 16*PI, D.P.
062326,000124: 21,3176           13202                           TCF      HAVEQUOT                              
062327,000125: 
062328,000126: 21,3177           34733        HUGEQUOT           CA       POSMAX                                
062329,000127: 21,3200           54001                           TS       L                                     
062330,000128: 21,3201           53746                           DXCH     A2CNTRAL                              #  LIMITED QUOTIENT STORED AT 16*PI, D.P.
062331,000129: 
062332,000130: 21,3202           31742        HAVEQUOT           CA       WCENTRAL                              
062333,000131: 21,3203           00006                           EXTEND                                         
062334,000132: 21,3204           74743                           MP       BIT9                                  #  RESCALE OMEGA AT 16*PI IN D.P.
062335,000133: 21,3205           53742                           DXCH     K2CNTRAL                              #  LOWER WORD OVERLAYS OMEGA IN WCENTRAL
062336,000134: 
062337,000135: 21,3206           00006                           EXTEND                                         
062338,000136: 21,3207           31742                           DCA      K2CNTRAL                              
062339,000137: 21,3210           53751                           DXCH     FUNCTION                              
062340,000138: 
062341,000139: 21,3211           31743                           CA       ACENTRAL                              #  GET ALPHA*ABS(ALPHA)/(2*K)
062342,000140: 21,3212           00006                           EXTEND                                         
062343,000141: 21,3213           63217                           BZMF     +4                                    
062344,000142: 
062345,000143: 21,3214           00006                           EXTEND                                         
062346,000144: 21,3215           31746                           DCA      A2CNTRAL                              
062347,000145: 21,3216           13221                           TCF      +3                                    
062348,000146: 
062349,000147: 21,3217           00006                           EXTEND                                         
062350,000148: 21,3220           41746                           DCS      A2CNTRAL                              
062351,000149: 
062352,000150: 21,3221           21751                           DAS      FUNCTION                              #  OMEGA + ALPHA*ABS(ALPHA)/2*K) AT 16*PI
062353,000151: 
062354,000152: 21,3222           11750                           CCS      FUNCTION                              #  DEL = +1 FOR FUNCT1 GREATER THAN ZERO.
062355,000153: 21,3223           13227                           TCF      POSFNCT1                              #  OTHERWISE DEL = -1
062356,000154: 21,3224           13226                           TCF      +2                                    
062357,000155: 21,3225           13231                           TCF      NEGFNCT1                              
062358,000156: 
062359,000157: 21,3226           11751                           CCS      FUNCTION   +1                         #  USE LOW ORDER WORD SINCE HIGH IS ZERO
062360,000158: 21,3227           34753        POSFNCT1           CAF      BIT1                                  
062361,000159: 21,3230           13232                           TCF      +2                                    
062362,000160: 21,3231           44753        NEGFNCT1           CS       BIT1                                  
062363,000161: 21,3232           55744                           TS       DEL                                   
062364,000162: 
062365,000163: 21,3233           11744                           CCS      DEL                                   #  REPLACE OMEGA BY DEL*OMEGA
062366,000164: 21,3234           13246                           TCF      FUNCT2                                #  POSITIVE DEL VALUE.  PROCEED.
062367,000165: 21,3235           13237                           TCF      DEFUNCT                               
062368,000166: 21,3236           13243                           TCF      NEGFNCT2                              
062369,000167: 
062370,000168: 21,3237           55741        DEFUNCT            TS       K2CNTRAL                              
062371,000169: 21,3240           55742                           TS       K2CNTRAL   +1                         
062372,000170: 21,3241           13246                           TCF      FUNCT2                                
062373,000171: 

Page 1467

062375,000173: 21,3242           65252        NEG1/3             DEC      -.33333                               
062376,000174: 
062377,000175: 21,3243           00006        NEGFNCT2           EXTEND                                         
062378,000176: 21,3244           41742                           DCS      K2CNTRAL                              
062379,000177: 21,3245           53742                           DXCH     K2CNTRAL                              
062380,000178: 
062381,000179: 21,3246           00006        FUNCT2             EXTEND                                         
062382,000180: 21,3247           31746                           DCA      A2CNTRAL                              
062383,000181: 21,3250           21742                           DAS      K2CNTRAL                              #  DEL*OMEGA + ALPHA(2)/(2*K) AT 16*PI, D.P.
062384,000182: 
062385,000183: 21,3251           31745        FUNCT3             CA       A2CNTRAL                              
062386,000184: 21,3252           00006                           EXTEND                                         
062387,000185: 21,3253           73242                           MP       NEG1/3                                
062388,000186: 21,3254           53746                           DXCH     A2CNTRAL                              
062389,000187: 21,3255           30001                           CA       L                                     
062390,000188: 21,3256           00006                           EXTEND                                         
062391,000189: 21,3257           73242                           MP       NEG1/3                                
062392,000190: 21,3260           27746                           ADS      A2CNTRAL   +1                         
062393,000191: 21,3261           54001                           TS       L                                     
062394,000192: 21,3262           13264                           TCF      +2                                    #  A2CNTRAL NOW CONTAINS -ALPHA(2)/(6*K),
062395,000193: 21,3263           27745                           ADS      A2CNTRAL                              #  SCALED AT 16*PI, IN D.P.
062396,000194: 
062397,000195: 21,3264           00006                           EXTEND                                         
062398,000196: 21,3265           31742                           DCA      K2CNTRAL                              #  DEL*OMEGA + ALPHA(2)/(3*K) IN A2CNTRAL,
062399,000197: 21,3266           21746                           DAS      A2CNTRAL                              #  SCALED AT 16*PI, D.P.
062400,000198: 
062401,000199: 21,3267           31745                           CA       A2CNTRAL                              
062402,000200: 21,3270           00006                           EXTEND                                         
062403,000201: 21,3271           71743                           MP       ACENTRAL                              
062404,000202: 21,3272           21737                           DAS      K2THETA                               
062405,000203: 21,3273           31746                           CA       A2CNTRAL   +1                         
062406,000204: 21,3274           00006                           EXTEND                                         
062407,000205: 21,3275           71743                           MP       ACENTRAL                              #  ACENTRAL MAY NOW BE OVERLAID.
062408,000206: 21,3276           27737                           ADS      K2THETA    +1                         
062409,000207: 21,3277           54001                           TS       L                                     
062410,000208: 21,3300           13302                           TCF      +2                                    #  TWO TERMS OF NEGUSUM ACCUMULATED, SO FAR
062411,000209: 21,3301           27736                           ADS      K2THETA                               #  SCALED AT 4*PI(2), IN D.P.
062412,000210: 
062413,000211: 21,3302           31741        GETROOT            CA       K2CNTRAL                              #  K*(DEL*OMEGA + ALPHA(2)/(2*K)) IS THE
062414,000212: 21,3303           00006                           EXTEND                                         #  TERM FOR WHICH A SQUARE ROOT IS NEEDED.
062415,000213: 21,3304           71740                           MP       KCENTRAL                              #  K AT PI/2(8)
062416,000214: 21,3305           53751                           DXCH     FUNCTION                              
062417,000215: 21,3306           31742                           CA       K2CNTRAL   +1                         
062418,000216: 21,3307           00006                           EXTEND                                         
062419,000217: 21,3310           71740                           MP       KCENTRAL                              
062420,000218: 21,3311           27751                           ADS      FUNCTION   +1                         
062421,000219: 21,3312           54001                           TS       L                                     
062422,000220: 21,3313           13315                           TCF      +2                                    
062423,000221: 21,3314           27750                           ADS      FUNCTION                              #  DESIRED TERM IN FUNCTION, AT PI(2)/16

Page 1468

062425,000223: 21,3315           11744                           CCS      DEL                                   
062426,000224: 21,3316           13523                           TCF      RSTOFGTS                              
062427,000225: 21,3317           13565                           TCF      NEGUSUM                               
062428,000226: 21,3320           13322                           TCF      NEGATE                                
062429,000227: 21,3321           13565                           TCF      NEGUSUM                               
062430,000228: 
062431,000229: 21,3322           00006        NEGATE             EXTEND                                         
062432,000230: 21,3323           41742                           DCS      K2CNTRAL                              
062433,000231: 21,3324           53742                           DXCH     K2CNTRAL                              
062434,000232: 21,3325           13523                           TCF      RSTOFGTS                              
062435,000233: 
062436,000234: 16,3741                                           BANK     16                                    
062437,000235: 16,3741  E6,1501                                  EBANK=   NEGUQ                                 
062438,000236: 16,2000                                           SETLOC   DAPS1                                 
062439,000237: 16,2000                                           BANK                                           
062440,000238: 
062441,000239:                                                                                                  #  THE WRCHN12 SUBROUTINE SETS BITS 9,10,11,12 OF CHANNEL 12 ON THE BASIS OF THE CONTENTS OF NEGUQ,NEGUR WHICH ARE
062442,000240:                                                                                                  #  THE NEGATIVES OF THE DESIRED ACCELERATION CHANGES.  ACDT+C12 SETS Q(R)ACCDOT TO REFLECT THE NEW DRIVES.
062443,000241: 
062444,000242:                                                                                                  #  WARNING:  ACDT+C12 AND WRCHN12 MUST BE CALLED WITH INTERRUPT INHIBITED.
062445,000243: 
062446,000244: 16,3741           07400        BGIM               OCTAL    07400                                 
062447,000245: 16,3742     0066               CHNL12             EQUALS   ITEMP6                                
062448,000246: 16,3742           41501        ACDT+C12           CS       NEGUQ                                 
062449,000247: 16,3743           00006                           EXTEND                                         #  GIMBAL DRIVE REQUESTS.
062450,000248: 16,3744           71507                           MP       ACCDOTQ                               
062451,000249: 16,3745           23510                           LXCH     QACCDOT                               
062452,000250: 16,3746           41503                           CS       NEGUR                                 
062453,000251: 16,3747           00006                           EXTEND                                         
062454,000252: 16,3750           71511                           MP       ACCDOTR                               
062455,000253: 16,3751           23512                           LXCH     RACCDOT                               
062456,000254: 
062457,000255: 16,3752           11501                           CCS      NEGUQ                                 
062458,000256: 16,3753           34742                           CAF      BIT10                                 
062459,000257: 16,3754           13756                           TCF      +2                                    
062460,000258: 16,3755           34743                           CAF      BIT9                                  
062461,000259: 16,3756           54066                           TS       CHNL12                                
062462,000260: 
062463,000261: 16,3757           11503                           CCS      NEGUR                                 
062464,000262: 16,3760           34740                           CAF      BIT12                                 
062465,000263: 16,3761           13763                           TCF      +2                                    
062466,000264: 16,3762           34741                           CAF      BIT11                                 
062467,000265: 16,3763           26066                           ADS      CHNL12                                #  (STORED RESULT NOT USED AT PRESENT)
062468,000266: 
062469,000267: 16,3764           43741                           CS       BGIM                                  
062470,000268: 16,3765           00006                           EXTEND                                         
062471,000269: 16,3766           02012                           RAND     CHAN12                                
062472,000270: 16,3767           60066                           AD       CHNL12                                
062473,000271: 16,3770           00006                           EXTEND                                         
062474,000272: 16,3771           01012                           WRITE    CHAN12                                

Page 1469

062476,000274: 16,3772           44747                           CS       CALLGMBL                              #  TURN OFF REQUEST FOR ACDT+C12 EXECUTION.
062477,000275: 16,3773           71262                           MASK     RCSFLAGS                              
062478,000276: 16,3774           55262                           TS       RCSFLAGS                              
062479,000277: 
062480,000278: 16,3775           00002                           TC       Q                                     #  RETURN TO CALLER.
062481,000279: 
062482,000280: 21,3326                                           BANK     21                                    
062483,000281: 21,3326  E6,1450                                  EBANK=   QDIFF                                 
062484,000282: 21,2000                                           SETLOC   DAPS4                                 
062485,000283: 21,2000                                           BANK                                           
062486,000284: 

Page 1470

062488,000286:                                                                                                  #  SUBROUTINE TIMEGMBL:  MOD 0, OCTOBER 1967, CRAIG WORK
062489,000287: 
062490,000288:                                                                                                  #  TIMEGMBL COMPUTES THE DRIVE TIME NEEDED FOR THE TRIM GIMBAL TO POSITION THE DESCENT ENGINE NOZZLE SO AS TO NULL
062491,000289:                                                                                                  #  THE OFFSET ANGULAR ACCELERATION ABOUT THE Q (OR R) AXIS.  INSTEAD OF USING AOSQ(R), TIMEGMBL USES .4*AOSQ(R),
062492,000290:                                                                                                  #  SCALED AT PI/8.  FOR EACH AXIS, THE DRIVE TIME IS COMPUTED AS ABS(ALPHA/ACCDOT).  A ZERO
062493,000291:                                                                                                  #  ALPHA OR ACCDOT OR A ZERO QUOTIENT TURNS OFF THE GIMBAL DRIVE IMMEDIATELY.  OTHERWISE, THE GIMBAL IS TURNED ON
062494,000292:                                                                                                  #  DRIVING IN THE CORRECT DIRECTION.  THE Q(R)GIMTIMR IS SET TO TERMINATE THE DRIVE AND Q(R)ACCDOT
062495,000293:                                                                                                  #  IS STORED TO REFLECT THE NEW ACCELERATION DERIVATIVE.  NEGUQ(R) WILL CONTAIN +1,+0,-1 FOR A Q(R)ACCDOT VALUE
062496,000294:                                                                                                  #  WHICH IS NEGATIVE, ZERO, OR POSITIVE.
062497,000295: 
062498,000296:                                                                                                  #  INPUTS:       AOSQ,AOSR, SCALED AT P1/2, AND ACCDOTQ, ACCDOTR AT PI/2(7).     PI/2(7).
062499,000297: 
062500,000298:                                                                                                  #  OUTPUTS:      NEW GIMBAL DRIVE BITS IN CHANNEL 12, NEGUQ, NEGUR, QACCDOT AND RACCDOT, THE LAST SCALED AT PI/2(7).
062501,000299:                                                                                                  #                Q(R)GIMTIMR WILL BE SET TO TIME AND TERMINATE GIMBAL DRIVE(S)
062502,000300: 
062503,000301:                                                                                                  #  DEBRIS:       A, L, Q, ITEMPS 2, 3, 6, RUPTREG2 AND ACDT+C12 DEBRIS.
062504,000302: 
062505,000303:                                                                                                  #  EXITS:        VIA TC Q.
062506,000304: 
062507,000305:                                                                                                  #  ALARMS, ABORTS, :  NONE
062508,000306: 
062509,000307:                                                                                                  #  SUBROUTINES:  ACDT+C12, IBNKCALL
062510,000308: 
062511,000309:                                                                                                  #  WARNING:      THIS SUBROUTINE WRITES INTO CHANNEL 12 AND USES THE ITEMPS.  THEREFORE IT MAY ONLY BE CALLED WITH
062512,000310:                                                                                                  #                INTERRUPT INHIBITED.
062513,000311: 
062514,000312:                                                                                                  #  ERASABLE STORAGE CONFIGURATION (NEEDED BY THE INDEXING METHODS):
062515,000313:                                                                                                  #        NEGUQ           ERASE   +2              NEGATIVE OF Q-AXIS GIMBAL DRIVE
062516,000314:                                                                                                  #        (SPWORD)        EQUALS  NEGUQ +1        ANY S.P. ERASABLE NUMBER, NOW THRSTCMD
062517,000315:                                                                                                  #        NEGUR           EQUALS  NEGUQ +2        NEGATIVE OF R-AXIS GIMBAL DRIVE
062518,000316:                                                                                                  #        ACCDOTQ         ERASE   +2              Q-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
062519,000317:                                                                                                  #        (SPWORD)        EQUALS  ACCDOTQ +1      ANY S.P. ERASABLE NUMBER NOW QACCDOT
062520,000318:                                                                                                  #        ACCDOTR         EQUALS  ACCDOTQ +2      R-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
062521,000319:                                                                                                  #                                                ACCDOTQ, ACCDOTR ARE MAGNITUDES.
062522,000320:                                                                                                  #        AOSQ            ERASE   +4              Q-AXIS ACC., D.P. AT PI/2 R/SEC(2)
062523,000321:                                                                                                  #        AOSR            EQUALS  AOSQ +2         R-AXIS ACCELERATION SCALED AT PI/2 R/S2
062524,000322: 
062525,000323: 21,3326     0066               QRNDXER            EQUALS   ITEMP6                                
062526,000324: 21,3326           23146        OCT23146           OCTAL    23146                                 #  DECIMAL .6
062527,000325: 21,3327     0063               NZACCDOT           EQUALS   ITEMP3                                
062528,000326: 
062529,000327: 21,3327           34753        TIMEGMBL           CAF      ONE                                   #  INITIALIZE ALLOWGTS.
062530,000328: 21,3330           55502                           TS       ALLOWGTS                              
062531,000329: 
062532,000330: 21,3331           34752                           CAF      TWO                                   #  SET UP LOOP FOR R AXIS.
062533,000331: 21,3332           22002                           LXCH     Q                                     #  SAVE RETURN ADDRESS.
062534,000332: 21,3333           22071                           LXCH     RUPTREG2                              

Page 1471

062536,000334: 21,3334           13336                           TCF      +2                                    
062537,000335: 21,3335           34755        TIMQGMBL           CAF      ZERO                                  #  NOW DO THE Q-AXIS
062538,000336: 21,3336           54066                           TS       QRNDXER                               
062539,000337: 21,3337           50066                           INDEX    QRNDXER                               
062540,000338: 21,3340           31507                           CA       ACCDOTQ                               #  ACCDOT IS PRESUMED TO BE AT PI/2(7).
062541,000339: 21,3341           00006                           EXTEND                                         
062542,000340: 21,3342           63412                           BZMF     TGOFFNOW                              #  IS ACCDOT LESS THAN OR EQUAL TO 0?
062543,000341: 21,3343           54063                           TS       NZACCDOT                              #  NO.  STORE NON-ZERO, POSITIVE ACCDOT.
062544,000342: 
062545,000343: 21,3344           50066        ALPHATRY           INDEX    QRNDXER                               
062546,000344: 21,3345           41536                           CS       AOSQ                                  
062547,000345: 21,3346           00006                           EXTEND                                         
062548,000346: 21,3347           13412                           BZF      TGOFFNOW                              #  IS ALPHA ZERO?
062549,000347: 
062550,000348: 21,3350           54002                           TS       Q                                     #  SAVE A COPY OF -AOS.
062551,000349: 21,3351           00006                           EXTEND                                         #  NO.  RESCALE FOR TIMEGMBL USE.
062552,000350: 21,3352           73326                           MP       OCT23146                              #  OCTAL 23146 IS DECIMAL .6
062553,000351: 21,3353           60002                           AD       Q                                     #  -1.6*AOS AT PI/2 = -.4*AOS AT PI/8.
062554,000352: 21,3354           54001                           TS       L                                     #  WAS THERE OVERFLOW?
062555,000353: 21,3355           13362                           TCF      SETNEGU                               #  NO.  COMPUTE DRIVE TIME.
062556,000354: 
062557,000355: 21,3356           40000                           CS       A                                     #  RECOVER -SGN(AOS) IN THE A REGISTER.
062558,000356: 21,3357           50066                           INDEX    QRNDXER                               #  YES.  START DRIVE WITHOUT WAITLIST.
062559,000357: 21,3360           57501                           XCH      NEGUQ                                 
062560,000358: 21,3361           13416                           TCF      NOTALLOW                              #  KNOCK DOWN THE ALLOWGTS FLAG.
062561,000359: 
062562,000360: 21,3362           00006        SETNEGU            EXTEND                                         
062563,000361: 21,3363           63370                           BZMF     POSALPH                               
062564,000362: 
062565,000363: 21,3364           40000                           COM                                            
062566,000364: 21,3365           54062                           TS       ITEMP2                                #  STORE -ABS(.4*AOS) SCALED AT PI/8.
062567,000365: 21,3366           44753                           CS       BIT1                                  
062568,000366: 21,3367           13372                           TCF      POSALPH    +2                         
062569,000367: 21,3370           54062        POSALPH            TS       ITEMP2                                #  STORE -ABS(.4*AOS) SCALED AT PI/8.
062570,000368: 21,3371           34753                           CA       BIT1                                  
062571,000369: 21,3372           50066                 +2        INDEX    QRNDXER                               #  SGN(AOS) INTO NEGU
062572,000370: 21,3373           55501                           TS       NEGUQ                                 #  STORE SGN(APLHA) AS NEGU
062573,000371: 
062574,000372: 21,3374           30063                           CA       NZACCDOT                              
062575,000373: 21,3375           00006                           EXTEND                                         
062576,000374: 21,3376           74740                           MP       BIT12                                 #  2*ACCDOT, SCALED AT PI/8.
062577,000375: 21,3377           60062                           AD       ITEMP2                                #  -ABS(ALPHA) + 2*ACCDOT, AT PI/8.
062578,000376: 21,3400           00006                           EXTEND                                         
062579,000377: 21,3401           63416                           BZMF     NOTALLOW                              #  IS DRIVE TIME MORE THAN TWO SECONDS?
062580,000378: 21,3402           40062                           CS       ITEMP2                                #  NO.  COMPUTE DRIVE TIME.
062581,000379: 21,3403           00006                           EXTEND                                         #  ABS(ALPHA) AT PI/8.
062582,000380: 21,3404           73437                           MP       OCT00240                              #  DECIMAL 10/1024
062583,000381: 21,3405           00006                           EXTEND                                         #  QUOTIENT IS DRIVE TIME AT WAITLIST.
062584,000382: 21,3406           10063                           DV       NZACCDOT                              #  ABS(ALPHA)/ACCDOT AT 2(14)/100

Page 1472

062586,000384: 21,3407           00006                           EXTEND                                         
062587,000385: 21,3410           13412                           BZF      TGOFFNOW                              #  DRIVE TIME MUST BE GREATER THAN ZERO.
062588,000386: 
062589,000387: 21,3411           13424                           TCF      DRIVEON                               
062590,000388: 
062591,000389: 21,3412           34755        TGOFFNOW           CAF      ZERO                                  #  TURN OFF GIMBAL NOW.
062592,000390: 21,3413           50066                           INDEX    QRNDXER                               
062593,000391: 21,3414           55501                           TS       NEGUQ                                 
062594,000392: 
062595,000393: 21,3415           13426                           TCF      DONEYET                               
062596,000394: 
062597,000395: 21,3416           36010        NOTALLOW           CAF      OCT31                                 
062598,000396: 21,3417           50066                           INDEX    QRNDXER                               
062599,000397: 21,3420           55631                           TS       QGIMTIMR                              
062600,000398: 21,3421           34755                           CAF      ZERO                                  #  DRIVE TIME IS MORE THAN 2 SECONDS, SO
062601,000399: 21,3422           55502                           TS       ALLOWGTS                              #  DO NOT PERMIT FURTHER GTS ATTITUDE-RATE
062602,000400:                                                                                                  #  CONTROL UNTIL AOSTASK APPROVES.
062603,000401: 21,3423           13426                           TCF      DONEYET                               #  NO WAITLIST CALL IS MADE.
062604,000402: 
062605,000403: 21,3424           50066        DRIVEON            INDEX    QRNDXER                               
062606,000404: 21,3425           55631                           TS       QGIMTIMR                              #  CHOOSE Q OR R AXIS.
062607,000405: 
062608,000406: 21,3426           10066        DONEYET            CCS      QRNDXER                               
062609,000407: 21,3427           13335                           TCF      TIMQGMBL                              
062610,000408: 
062611,000409: 21,3430           52073                           DXCH     RUPTREG3                              #  PROTECT IBNKCALL ERASABLES.  ACDT+C12
062612,000410: 21,3431           52063                           DXCH     ITEMP2                                #  LEAVES ITEMPS2,3 ALONE.
062613,000411: 
062614,000412: 21,3432           04674                           TC       IBNKCALL                              #  TURN OF CHANNEL BITS, SET Q(R)ACCDOTS.
062615,000413: 21,3433           35742                           CADR     ACDT+C12                              
062616,000414: 
062617,000415: 21,3434           52063                           DXCH     ITEMP2                                #  RESTORE ERASABLES FOR IBNKCALL.
062618,000416: 21,3435           52073                           DXCH     RUPTREG3                              
062619,000417: 
062620,000418: 21,3436           00071                           TC       RUPTREG2                              #  RETURN TO CALLER.
062621,000419: 
062622,000420: 21,3437           00240        OCT00240           OCTAL    00240                                 #  DECIMAL 10/1024
062623,000421: 

Page 1473

062625,000423:                                                                                                  #  THE FOLLOWING SECTION IS A CONTINUATION OF THE TRIM GIMBAL CONTROL FROM THE LAST GTS ENTRY.  THE QUANTITY NEGUSUM
062626,000424:                                                                                                  #  IS COMPUTED FOR EACH AXIS (Q,R), .707*DEL*FUNCTION(3/2) + K2THETA = NEGUSUM.  NEW DRIVES ARE ENTERED TO CH 12.
062627,000425: 
062628,000426:                                                                                                  #  THE SUBROUTINE GTSQRT ACCEPTS A DOUBLE PRECISION VALUE IN FUNCTION, FUNCTION +1 AND RETURNS A SINGLE-PRECISION
062629,000427:                                                                                                  #  SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF THE ARGUMENT.  ALSO, THE CELL SHFTFLAG CONTAINS A BINARY
062630,000428:                                                                                                  #  EXPONENT S, SUCH THAT THE SQUARE ROOT (RETURNED IN THE A REGISTER) MUST BE SHIFTED RIGHT (MULTIPLIED BY 2 TO THE
062631,000429:                                                                                                  #  POWER (-S)) IN ORDER TO BE THE TRUE SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF FUNCTION, FUNCTION +1.
062632,000430:                                                                                                  #  SQUARE ROOT ERROR IS NOT MORE THAN 2 IN THE 14TH SIGNIFICANT BIT.  CELLS CLOBBERED ARE A, L, SHFTFLAG, ININDEX,
062633,000431:                                                                                                  #  HALFARG, SCRATCH, SR, FUNCTION, FUNCTION +1.  GTSQRT IS CALLED BY TC GTSQRT AND RETURNS VIA TC Q OR TC FUNCTION +1.
062634,000432:                                                                                                  #  ZERO OR NEGATIVE ARGUMENTS YIELD ZERO FOR SQUARE ROOTS.
062635,000433: 
062636,000434: 21,3440           11750        GTSQRT             CCS      FUNCTION                              
062637,000435: 21,3441           13457                           TCF      GOODARG                               #  FUNCTION IS POSITIVE.  TAKE SQUARE ROOT.
062638,000436: 21,3442           13444                           TCF      +2                                    #  HIGH ORDER WORD IS ZERO.  TRY THE LOWER.
062639,000437: 21,3443           13450                           TCF      ZEROOT                                #  NEGATIVE.  USE ZERO FOR 1/2 POWER.
062640,000438: 
062641,000439: 21,3444           31751                           CA       FUNCTION   +1                         
062642,000440: 21,3445           00006                           EXTEND                                         
062643,000441: 21,3446           63450                           BZMF     ZEROOT                                
062644,000442: 
062645,000443: 21,3447           13453                           TCF      ZEROHIGH                              #  PROCEED.
062646,000444: 21,3450           34755        ZEROOT             CA       ZERO                                  
062647,000445: 21,3451           55740                           TS       SHFTFLAG                              
062648,000446: 21,3452           00002                           TC       Q                                     
062649,000447: 
062650,000448: 21,3453           57750        ZEROHIGH           XCH      FUNCTION                              #  14 MOST SIGNIFICANT BITS ARE IN THE
062651,000449: 21,3454           57751                           XCH      FUNCTION   +1                         #  LOWER WORD.  EXCHANGE THEM.
062652,000450: 21,3455           34757                           CA       SEVEN                                 
062653,000451: 21,3456           13460                           TCF      GOODARG    +1                         
062654,000452: 
062655,000453: 21,3457           34755        GOODARG            CA       ZERO                                  
062656,000454: 21,3460           55740                           TS       SHFTFLAG                              
062657,000455: 21,3461           35741                           CA       TWELVE                                #  INITIALIZE THE SCALING LOOP.
062658,000456: 21,3462           55743                           TS       ININDEX                               
062659,000457: 21,3463           13472                           TCF      SCALLOOP                              
062660,000458: 
062661,000459: 21,3464           31750        SCALSTRT           CA       FUNCTION                              
062662,000460: 21,3465           13506                           TCF      SCALDONE                              
062663,000461: 
062664,000462: 21,3466           37751        MULBUSH            CA       NEG2                                  #  IF ARG IS NOT LESS THAN 1/4, INDEX IS
062665,000463: 21,3467           27743                           ADS      ININDEX                               #  ZERO, INDICATING NO SHIFT NEEDED.
062666,000464: 21,3470           00006                           EXTEND                                         #  BRANCH IF ARG IS NOT LESS THAN 1/4.
062667,000465: 21,3471           63464                           BZMF     SCALSTRT                              #  OTHERWISE COMPARE ARG WITH A REFERENCE
062668,000466:                                                                                                  #  WHICH IS 4 TIMES LARGER THAN THE LAST.
062669,000467: 21,3472           41750        SCALLOOP           CS       FUNCTION                              
062670,000468: 21,3473           51743                           INDEX    ININDEX                               
062671,000469: 21,3474           64735                           AD       BIT15                                 #  REFERENCE MAGNITUDE LESS OR EQUAL TO 1/4
062672,000470: 21,3475           00006                           EXTEND                                         
062673,000471: 21,3476           63466                           BZMF     MULBUSH                               #  IF ARG IS NOT LESS THAN REFERENCE, GO
062674,000472:                                                                                                  #  AROUND THE MULBERRY BUSH ONCE MORE.

Page 1474

062676,000474: 21,3477           51743                           INDEX    ININDEX                               
062677,000475: 21,3500           34735                           CA       BIT15                                 #  THIS IS THE SCALE MAGNITUDE
062678,000476: 21,3501           57746                           XCH      HALFARG                               #  2**(-ININDEX) IS THE SHIFT DIVISOR.
062679,000477: 21,3502           00006                           EXTEND                                         #  RESCALE ARGUMENT.
062680,000478: 21,3503           31751                           DCA      FUNCTION                              
062681,000479: 21,3504           00006                           EXTEND                                         
062682,000480: 21,3505           11746                           DV       HALFARG                               
062683,000481:                                                                                                  #  ININDEX AND SHFTFLAG PRESERVE INFO FOR
062684,000482:                                                                                                  #  RESCALING AFTER ROOT PROCESS.
062685,000483: 21,3506           00006        SCALDONE           EXTEND                                         
062686,000484: 21,3507           23751                           QXCH     FUNCTION   +1                         #  SAVE Q FOR RETURN
062687,000485: 21,3510           00006                           EXTEND                                         
062688,000486: 21,3511           74736                           MP       BIT14                                 
062689,000487: 21,3512           55746                           TS       HALFARG                               
062690,000488: 21,3513           74737                           MASK     BIT13                                 
062691,000489: 21,3514           10000                           CCS      A                                     
062692,000490: 21,3515           33633                           CA       OCT11276                              
062693,000491: 21,3516           63631                           AD       ROOTHALF                              #  INITIAL GUESS IS ROOT 1/2 OR POSMAX
062694,000492: 21,3517           03635                           TC       ROOTCYCL                              
062695,000493: 21,3520           03635                           TC       ROOTCYCL                              
062696,000494: 21,3521           03635                           TC       ROOTCYCL                              
062697,000495: 21,3522           01751                           TC       FUNCTION   +1                         
062698,000496: 
062699,000497:                                                                                                  #  ****************************************************************************************************************
062700,000498: 
062701,000499: 21,3523           03440        RSTOFGTS           TC       GTSQRT                                
062702,000500: 21,3524           57741        PRODUCT            XCH      K2CNTRAL                              
062703,000501: 21,3525           00006                           EXTEND                                         
062704,000502: 21,3526           71741                           MP       K2CNTRAL                              
062705,000503: 21,3527           53742                           DXCH     K2CNTRAL                              
062706,000504: 21,3530           00006                           EXTEND                                         #                THE PRODUCT OF
062707,000505: 21,3531           70001                           MP       L                                     #   1/2                   2       1/2
062708,000506: 21,3532           27742                           ADS      K2CNTRAL   +1                         #  K   *(DEL*OMEGA + ALPHA /(2*K))
062709,000507: 21,3533           54001                           TS       L                                     #                      AND
062710,000508: 21,3534           13536                           TCF      +2                                    #                        2
062711,000509: 21,3535           27741                           ADS      K2CNTRAL                              #   DEL*(DEL*OMEGA + ALPHA /(2*K)) NOW IN 
062712,000510:                                                                                                  #  K2CNTRAL
062713,000511: 
062714,000512: 21,3536           31743        DOSHIFT            CA       ININDEX                               
062715,000513: 21,3537           00006                           EXTEND                                         #  MULTIPLY IN THE FACTOR 2(-S), RETURNED
062716,000514: 21,3540           74736                           MP       BIT14                                 #  BY THE GTSQRT SUBROUTINE
062717,000515: 21,3541           27740                           ADS      SHFTFLAG                              
062718,000516: 21,3542           00006                           EXTEND                                         
062719,000517: 21,3543           13562                           BZF      ADDITIN                               
062720,000518: 21,3544           51740                           INDEX    SHFTFLAG                              
062721,000519: 21,3545           34735                           CA       BIT15                                 

Page 1475

062723,000521: 21,3546           57741                           XCH      K2CNTRAL                              
062724,000522: 21,3547           00006                           EXTEND                                         
062725,000523: 21,3550           71741                           MP       K2CNTRAL                              
062726,000524: 21,3551           21737                           DAS      K2THETA                               
062727,000525: 21,3552           57741                           XCH      K2CNTRAL                              
062728,000526: 21,3553           00006                           EXTEND                                         
062729,000527: 21,3554           71742                           MP       K2CNTRAL   +1                         
062730,000528: 21,3555           27737                           ADS      K2THETA    +1                         
062731,000529: 21,3556           54001                           TS       L                                     
062732,000530: 21,3557           13561                           TCF      +2                                    
062733,000531: 21,3560           27736                           ADS      K2THETA                               
062734,000532: 
062735,000533: 21,3561           13565                           TCF      NEGUSUM                               
062736,000534: 
062737,000535: 21,3562           00006        ADDITIN            EXTEND                                         
062738,000536: 21,3563           31742                           DCA      K2CNTRAL                              
062739,000537: 21,3564           21737                           DAS      K2THETA                               #  NOW ADD IN THE K2THETA TERM.
062740,000538: 21,3565           11736        NEGUSUM            CCS      K2THETA                               #  TEST SIGN OF HIGH ORDER PART.
062741,000539: 21,3566           13572                           TCF      NEGDRIVE                              
062742,000540: 21,3567           13571                           TCF      +2                                    
062743,000541: 21,3570           13574                           TCF      POSDRIVE                              
062744,000542: 
062745,000543: 21,3571           11737                           CCS      K2THETA    +1                         #  SIGN TEST FOR LOW ORDER PART.
062746,000544: 21,3572           34753        NEGDRIVE           CA       BIT1                                  
062747,000545: 21,3573           13575                           TCF      +2                                    #  STOP GIMBAL DRIVE FOR A ZERO NEGUSUM.
062748,000546: 21,3574           44753        POSDRIVE           CS       BIT1                                  
062749,000547: 21,3575           54001                           TS       L                                     #  SAVE FOR DRIVE REVERSAL TEST.
062750,000548: 21,3576           51747                           INDEX    QRCNTR                                
062751,000549: 21,3577           57501                           XCH      NEGUQ                                 
062752,000550: 
062753,000551: 21,3600           00006                           EXTEND                                         
062754,000552: 21,3601           70001                           MP       L                                     #  MULTIPLY OLD NEGU AND NEW NEGU.
062755,000553: 21,3602           10001                           CCS      L                                     
062756,000554: 21,3603           13620                           TCF      LOUPE                                 #  NON-ZERO GIMBAL DRIVE BEING CONTINUED.
062757,000555: 
062758,000556: 21,3604           13615                           TCF      ZEROLOUP                              #  NO REVERSAL PROBLEM HERE.
062759,000557: 
062760,000558: 21,3605           13607                           TCF      REVERSAL                              #  NON-ZERO GIMBAL DRIVE BEING REVERSED.
062761,000559: 21,3606           13615                           TCF      ZEROLOUP                              #  NO REVERSAL PROBLEM HERE.
062762,000560: 
062763,000561: 21,3607           51747        REVERSAL           INDEX    QRCNTR                                #  A ZERO-DRIVE PAUSE IS NEEDED HERE.  ZERO
062764,000562: 21,3610           55510                           TS       QACCDOT                               #  IS IN A REGISTER FROM CCS ON (-1).
062765,000563: 21,3611           51747                           INDEX    QRCNTR                                
062766,000564: 21,3612           43632                           CS       GMBLBITA                              
062767,000565: 21,3613           00006                           EXTEND                                         
062768,000566: 21,3614           03012                           WAND     CHAN12                                
062769,000567: 
062770,000568: 21,3615           41262        ZEROLOUP           CS       RCSFLAGS                              #  SET UP REQUEST FOR ACDT+C12 CALL.
062771,000569: 21,3616           74747                           MASK     CALLGMBL                              
062772,000570: 21,3617           27262                           ADS      RCSFLAGS                              

Page 1476

062774,000572: 21,3620           11747        LOUPE              CCS      QRCNTR                                #  HAVE BOTH AXES BEEN PROCESSED?
062775,000573: 21,3621           13114                           TCF      GOQTRIMG                              #  NO.  DO Q AXIS NEXT.
062776,000574: 
062777,000575: 21,3622           31505                           CA       SAVESR                                #  RESTORE THE SR
062778,000576: 21,3623           54021                           TS       SR                                    
062779,000577: 
062780,000578: 21,3624           00006        GOCLOSE            EXTEND                                         #  TERMINATE THE JASK.
062781,000579: 21,3625           33630                           DCA      CLOSEADR                              
062782,000580: 21,3626           52006                           DTCB                                           
062783,000581: 
062784,000582: 21,3627  E6,1536                                  EBANK=   AOSQ                                  
062785,000583: 21,3627           03270 36106  CLOSEADR           2CADR    CLOSEOUT                              #  TERMINATE THE JASK.
062786,000584: 
062787,000585: 21,3631     5741               TWELVE             EQUALS   OCT14                                 
062788,000586: 21,3631           26501        ROOTHALF           OCTAL    26501                                 #  SQUARE ROOT OF 1/2
062789,000587: 21,3632           01400        GMBLBITA           OCTAL    01400                                 #  INDEXED WRT GMBLBITB  DO NOT MOVE ******
062790,000588: 21,3633           11276        OCT11276           OCTAL    11276                                 #  POSMAX - ROOTHALF
062791,000589: 21,3634           06000        GMBLBITB           OCTAL    06000                                 #  INDEXED WRT GMBLBITA  DO NOT MOVE ******
062792,000590: 
062793,000591:                                                                                                  #  SUBROUTINE ROOTCYCL:  BY CRAIG WORK, 3 APRIL 68
062794,000592: 
062795,000593:                                                                                                  #  ROOTCYCL IS A SUBROUTINE WHICH EXECUTES ONE NEWTON SQUARE ROOT ALGORITHM ITERATION.  THE INITIAL GUESS AT THE
062796,000594:                                                                                                  #  SQUARE ROOT IS PRESUMED TO BE IN THE A REGISTER AND ONE-HALF THE SQUARE IS TAKEN FROM HALFARG.  THE NEW APPROXI-
062797,000595:                                                                                                  #  MATION TO THE SQUARE ROOT IS RETURNED IN THE A REGISTER.  DEBRIS:  A, L, SR, SCRATCH.  ROOTCYCL IS CALLED FROM
062798,000596:                                                                                                  #  LOCATION (LOC) BY A TC ROOTCYCL, AND RETURNS (TC Q) TO LOC +1.
062799,000597: 
062800,000598:                                                                                                  #  WARNING:  IF THE INITIAL GUESS IS NOT GREATER THAN THE SQUARE, DIVIDE OR ADD OVERFLOW IS A REAL POSSIBILITY.
062801,000599: 
062802,000600: 21,3635           55745        ROOTCYCL           TS       SCRATCH                               #  STORE X
062803,000601: 21,3636           54021                           TS       SR                                    #  X/2 NOW IN SR
062804,000602: 21,3637           31746                           CA       HALFARG                               #  ARG/2 IN THE A REG
062805,000603: 21,3640           22007                           ZL                                             #  PREPARE FOR DIVISION
062806,000604: 21,3641           00006                           EXTEND                                         
062807,000605: 21,3642           11745                           DV       SCRATCH                               #  (ARG/X)/2
062808,000606: 21,3643           60021                           AD       SR                                    #  (X + ARG/X)/2 IN THE A REG
062809,000607: 21,3644           00002                           TC       Q                                     
062810,000608: 
062811,000609: 

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