Source Code

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

Notations on the program listing read, in part:

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

056538,000002:                                                                                                  ## Copyright:   Public domain.
056539,000003:                                                                                                  ## Filename:    IMU_MODE_SWITCHING_ROUTINES.agc
056540,000004:                                                                                                  ## Purpose:     A section of Luminary revision 210.
056541,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
056542,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 15-17.
056543,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
056544,000008:                                                                                                  ##              that the code format has been changed to conform to the
056545,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
056546,000010:                                                                                                  ##              original YUL assembler.
056547,000011:                                                                                                  ## Reference:   pp. 1306-1334
056548,000012:                                                                                                  ## Assembler:   yaYUL
056549,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
056550,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
056551,000015:                                                                                                  ## Mod history: 2016-11-17 JL   Created from Luminary131 version.
056552,000016:                                                                                                  ##              2016-12-08 MAS  Began transcription
056553,000017:                                                                                                  ##              2016-12-09 MAS  Completed updates for Luminary 210.
056554,000018:                                                                                                  ##              2016-12-11 HG   Fix operand CAGETEST -> CAGETSTG
056555,000019:                                                                                                  ##                                          GYROEXIT -> EXITGYRO
056556,000020:                                                                                                  ##                                          CAGETEST -> COARSTST    
056557,000021:                                                                                                  ##              2016-12-26 RSB  Comment-text proofed using ProoferComments
056558,000022:                                                                                                  ##                              and corrected errors found.
056559,000023:                                                                                                  ##              2017-01-28 RSB  Comment-text fixes identified for Luminary 69.
056560,000024:                                                                                                  ##              2017-03-13 RSB  Comment-text fixes noted in proofing Luminary 116.
056561,000025: 

Page 1306

056563,000027:    4000                                           SETLOC   FFTAG3                                
056564,000028:    4000                                           BANK                                           
056565,000029: 
056566,000030:    5461  E3,1471                                  EBANK=   COMMAND                               
056567,000031: 
056568,000032:                                                                                                  #           FIXED-FIXED ROUTINES.
056569,000033: 
056570,000034:    5461                                           COUNT*   $$/IMODE                              
056571,000035:    5461           34746        ZEROICDU           CAF      ZERO                                  #  ZERO ICDU COUNTERS.
056572,000036:    5462           54032                           TS       CDUX                                  
056573,000037:    5463           54033                           TS       CDUY                                  
056574,000038:    5464           54034                           TS       CDUZ                                  
056575,000039:    5465           00002                           TC       Q                                     
056576,000040: 
056577,000041:    5466     4734               SPSCODE            =        BIT9                                  
056578,000042: 

Page 1307

056580,000044:                                                                                                  #           IMU ZEROING ROUTINE.
056581,000045: 
056582,000046: 11,3776                                           BANK     11                                    
056583,000047: 07,2000                                           SETLOC   MODESW                                
056584,000048: 07,2000                                           BANK                                           
056585,000049: 
056586,000050: 07,2701                                           COUNT*   $$/IMODE                              
056587,000051: 07,2701           00004        IMUZERO            INHINT                                         #  ROUTINE TO ZERO ICDUS.
056588,000052: 07,2702           41035                           CS       DSPTAB     +11D                       #  DONT ZERO CDUS IF IMU IN GIMBAL LOCK AND
056589,000053: 07,2703           74762                           MASK     BITS4&6                               #  COARSE ALIGN (GIMBAL RUNAWAY PROTECTION)
056590,000054: 07,2704           10000                           CCS      A                                     
056591,000055: 07,2705           12711                           TCF      IMUZEROA                              
056592,000056: 
056593,000057: 07,2706           05571                           TC       ALARM                                 #  IF SO.
056594,000058: 07,2707           00206                           OCT      00206                                 
056595,000059: 
056596,000060: 07,2710           13676                           TCF      CAGETSTJ   +4                         #  IMMEDIATE FAILURE.
056597,000061: 
056598,000062: 07,2711           03672        IMUZEROA           TC       CAGETSTJ                              
056599,000063:                                                                                                  #  DELETE
056600,000064: 07,2712           41300                           CS       IMODES33                              #  DISABLE DAP AUTO AND HOLD MODES
056601,000065: 07,2713           74764                           MASK     SUPER011                              #      BIT5 FOR GROUND
056602,000066: 07,2714           27300                           ADS      IMODES33                              
056603,000067: 
056604,000068: 07,2715           41277                           CS       IMODES30                              #  INHIBIT ICDUFAIL AND IMUFAIL (IN CASE WE
056605,000069: 07,2716           75745                           MASK     BITS3&4                               #  JUST CAME OUT OF COARSE ALIGN).
056606,000070: 07,2717           27277                           ADS      IMODES30                              
056607,000071: 
056608,000072: 07,2720           44762                           CS       BITS4&6                               #  SEND ZERO ENCODE WITH COARSE AND ERROR
056609,000073: 07,2721           00006                           EXTEND                                         #  COUNTER DISABLED.
056610,000074: 07,2722           03012                           WAND     CHAN12                                
056611,000075: 
056612,000076: 07,2723           03253                           TC       NOATTOFF                              #  TURN OFF NO ATT LAMP.
056613,000077: 
056614,000078: 07,2724           34740                           CAF      BIT5                                  
056615,000079: 07,2725           00006                           EXTEND                                         
056616,000080: 07,2726           05012                           WOR      CHAN12                                
056617,000081: 
056618,000082: 07,2727           05461                           TC       ZEROICDU                              
056619,000083: 07,2730           34737                           CAF      BIT6                                  #  WAIT 320 MS TO GIVE AGS ADEQUATE TIME TO
056620,000084: 07,2731           05205                           TC       WAITLIST                              #  RECEIVE ITS PULSE TRAIN.
056621,000085: 07,2732  E3,1474                                  EBANK=   CDUIND                                
056622,000086: 07,2732           02744 16103                     2CADR    IMUZERO2                              
056623,000087: 
056624,000088: 07,2734           41277                           CS       IMODES30                              #  SEE IF IMU OPERATING AND ALARM IF NOT.
056625,000089: 07,2735           74734                           MASK     BIT9                                  
056626,000090: 07,2736           10000                           CCS      A                                     
056627,000091: 07,2737           12742                           TCF      MODEEXIT                              

Page 1308

056629,000093: 07,2740           05571                           TC       ALARM                                 
056630,000094: 07,2741           00210                           OCT      210                                   
056631,000095: 
056632,000096: 07,2742           00003        MODEEXIT           RELINT                                         #  GENERAL MODE-SWITCHING EXIT.
056633,000097: 07,2743           14622                           TCF      SWRETURN                              
056634,000098: 
056635,000099: 
056636,000100: 07,2744           03660        IMUZERO2           TC       CAGETEST                              
056637,000101: 07,2745           05461                           TC       ZEROICDU                              #  ZERO CDUX, CDUY, CDUZ
056638,000102: 
056639,000103: 07,2746           44740                           CS       BIT5                                  #  REMOVE ZERO DISCRETE.
056640,000104: 07,2747           00006                           EXTEND                                         
056641,000105: 07,2750           03012                           WAND     CHAN12                                
056642,000106: 
056643,000107: 07,2751           34732                           CAF      BIT11                                 #  WAIT 10 SECS FOR CTRS TO FIND GIMBALS
056644,000108: 07,2752           05226                           TC       VARDELAY                              
056645,000109: 
056646,000110: 07,2753           03660        IMUZERO3           TC       CAGETEST                              
056647,000111: 07,2754           45745                           CS       BITS3&4                               #  REMOVE IMUFAIL AND ICDUFAIL INHIBIT.
056648,000112: 07,2755           71277                           MASK     IMODES30                              
056649,000113: 07,2756           55277                           TS       IMODES30                              
056650,000114: 
056651,000115: 07,2757           44764                           CS       SUPER011                              #  ENABLE DAP AUTO AND HOLD MODES
056652,000116: 07,2760           71300                           MASK     IMODES33                              #      BIT5 FOR GROUND
056653,000117: 07,2761           55300                           TS       IMODES33                              
056654,000118: 
056655,000119: 07,2762           04665                           TC       IBNKCALL                              #  SET ISS WARNING IF EITHER OF ABOVE ARE
056656,000120: 07,2763           14703                           CADR     SETISSW                               #  PRESENT.
056657,000121: 
056658,000122: 07,2764           13633                           TCF      ENDIMU                                
056659,000123: 

Page 1309

056661,000125:                                                                                                  #           IMU COARSE ALIGN MODE.
056662,000126: 
056663,000127: 07,2765           00004        IMUCOARS           INHINT                                         
056664,000128: 07,2766           03672                           TC       CAGETSTJ                              
056665,000129: 07,2767           03131                           TC       SETCOARS                              
056666,000130: 
056667,000131: 07,2770           36263                           CAF      SIX                                   
056668,000132: 07,2771           05205                           TC       WAITLIST                              
056669,000133: 07,2772  E3,1474                                  EBANK=   CDUIND                                
056670,000134: 07,2772           02775 16103                     2CADR    COARS                                 
056671,000135: 
056672,000136: 
056673,000137: 07,2774           12742                           TCF      MODEEXIT                              
056674,000138: 
056675,000139: 07,2775           03660        COARS              TC       CAGETEST                              
056676,000140: 07,2776           34737                           CAF      BIT6                                  #  ENABLE ALL THREE ISS CDU ERROR COUNTERS
056677,000141: 07,2777           00006                           EXTEND                                         
056678,000142: 07,3000           05012                           WOR      CHAN12                                
056679,000143: 
056680,000144: 07,3001           34743                           CAF      TWO                                   #  SET CDU INDICATOR
056681,000145: 07,3002           55474        COARS1             TS       CDUIND                                
056682,000146: 
056683,000147: 07,3003           51474                           INDEX    CDUIND                                #  COMPUTE THETAD - THETAA IN 1:S
056684,000148: 07,3004           30321                           CA       THETAD                                #    COMPLEMENT FORM
056685,000149: 07,3005           00006                           EXTEND                                         
056686,000150: 07,3006           51474                           INDEX    CDUIND                                
056687,000151: 07,3007           20032                           MSU      CDUX                                  
056688,000152: 07,3010           00006                           EXTEND                                         
056689,000153: 07,3011           74730                           MP       BIT13                                 #  SHIFT RIGHT 2
056690,000154: 07,3012           56001                           XCH      L                                     #  ROUND
056691,000155: 07,3013           60000                           DOUBLE                                         
056692,000156: 07,3014           54061                           TS       ITEMP1                                
056693,000157: 07,3015           13017                           TCF      +2                                    
056694,000158: 07,3016           26001                           ADS      L                                     
056695,000159: 
056696,000160: 07,3017           51474                           INDEX    CDUIND                                #  DIFFERENCE TO BE COMPUTED
056697,000161: 07,3020           23471                           LXCH     COMMAND                               
056698,000162: 07,3021           11474                           CCS      CDUIND                                
056699,000163: 07,3022           03002                           TC       COARS1                                
056700,000164: 
056701,000165: 07,3023           34743                           CAF      TWO                                   #  MINIMUM OF 4 MS WAIT
056702,000166: 07,3024           05226                           TC       VARDELAY                              
056703,000167: 

Page 1310

056705,000169: 07,3025           03660        COARS2             TC       CAGETEST                              #  DONT CONTINUE IF CAGED.
056706,000170: 07,3026           54061                           TS       ITEMP1                                #  SETS TO +0.
056707,000171: 07,3027           34743                           CAF      TWO                                   #  SET CDU INDICATOR
056708,000172: 07,3030           55474                 +3        TS       CDUIND                                
056709,000173: 
056710,000174: 07,3031           51474                           INDEX    CDUIND                                
056711,000175: 07,3032           11471                           CCS      COMMAND                               #  NUMBER OF PULSES REQUIRED
056712,000176: 07,3033           03037                           TC       COMPOS                                #  GREATER THAN MAX ALLOWED
056713,000177: 07,3034           03046                           TC       NEXTCDU    +1                         
056714,000178: 07,3035           03104                           TC       COMNEG                                
056715,000179: 07,3036           03046                           TC       NEXTCDU    +1                         
056716,000180: 
056717,000181: 07,3037           63764        COMPOS             AD       -COMMAX                               #  COMMAX = MAX NUMBER OF PULSES ALLOWED
056718,000182: 07,3040           00006                           EXTEND                                         #    MINUS ONE
056719,000183: 07,3041           63114                           BZMF     COMZERO                               
056720,000184: 07,3042           51474                           INDEX    CDUIND                                
056721,000185: 07,3043           55471                           TS       COMMAND                               #  REDUCE COMMAND BY MAX NUMBER OF PULSES
056722,000186: 07,3044           43765                           CS       -COMMAX-                              #    ALLOWED
056723,000187: 
056724,000188: 07,3045           24061        NEXTCDU            INCR     ITEMP1                                
056725,000189: 07,3046           64745                           AD       NEG0                                  
056726,000190: 07,3047           51474                           INDEX    CDUIND                                
056727,000191: 07,3050           54050                           TS       CDUXCMD                               #  SET UP COMMAND REGISTER.
056728,000192: 
056729,000193: 07,3051           11474                           CCS      CDUIND                                
056730,000194: 07,3052           03030                           TC       COARS2     +3                         
056731,000195: 
056732,000196: 07,3053           10061                           CCS      ITEMP1                                #  SEE IF ANY PULSES TO GO OUT.
056733,000197: 07,3054           13120                           TCF      SENDPULS                              
056734,000198: 
056735,000199: 07,3055           05223                           TC       FIXDELAY                              #  WAIT FOR GIMBALS TO SETTLE.
056736,000200: 07,3056           00226                           DEC      150        B-14                       
056737,000201: 
056738,000202: 
056739,000203: 07,3057           34743                           CAF      TWO                                   #  AT END OF COMMAND, CHECK TO SEE THAT
056740,000204: 07,3060           54061        CHKCORS            TS       ITEMP1                                #  GIMBALS ARE WITHIN 2 DEGREES OF THETAD.
056741,000205: 07,3061           50000                           INDEX    A                                     
056742,000206: 07,3062           30032                           CA       CDUX                                  
056743,000207: 07,3063           00006                           EXTEND                                         
056744,000208: 07,3064           50061                           INDEX    ITEMP1                                
056745,000209: 07,3065           20321                           MSU      THETAD                                
056746,000210: 07,3066           10000                           CCS      A                                     
056747,000211: 07,3067           13075                           TCF      COARSERR                              
056748,000212: 07,3070           13072                           TCF      CORSCHK2                              
056749,000213: 07,3071           13075                           TCF      COARSERR                              
056750,000214: 

Page 1311

056752,000216: 07,3072           10061        CORSCHK2           CCS      ITEMP1                                
056753,000217: 07,3073           13060                           TCF      CHKCORS                               
056754,000218: 07,3074           13633                           TCF      ENDIMU                                #  END OF COARSE ALIGNMENT.
056755,000219: 
056756,000220: 07,3075           63103        COARSERR           AD       COARSTOL                              #  2 DEGREES.
056757,000221: 07,3076           00006                           EXTEND                                         
056758,000222: 07,3077           63072                           BZMF     CORSCHK2                              
056759,000223: 
056760,000224: 07,3100           05571                           TC       ALARM                                 #  COARSE ALIGN ERROR.
056761,000225: 07,3101           00211                           OCT      211                                   
056762,000226: 
056763,000227: 07,3102           13656                           TCF      IMUBAD                                
056764,000228: 
056765,000229: 07,3103           77511        COARSTOL           DEC      -.01111                               #  2 DEGREES SCALED AT HALF-REVOLUTIONS
056766,000230: 
056767,000231: 
056768,000232: 07,3104           63764        COMNEG             AD       -COMMAX                               
056769,000233: 07,3105           00006                           EXTEND                                         
056770,000234: 07,3106           63114                           BZMF     COMZERO                               
056771,000235: 07,3107           40000                           COM                                            
056772,000236: 07,3110           51474                           INDEX    CDUIND                                
056773,000237: 07,3111           55471                           TS       COMMAND                               
056774,000238: 07,3112           33765                           CA       -COMMAX-                              
056775,000239: 07,3113           03045                           TC       NEXTCDU                               
056776,000240: 
056777,000241: 07,3114           34746        COMZERO            CAF      ZERO                                  
056778,000242: 07,3115           51474                           INDEX    CDUIND                                
056779,000243: 07,3116           57471                           XCH      COMMAND                               
056780,000244: 07,3117           03045                           TC       NEXTCDU                               
056781,000245: 
056782,000246: 
056783,000247: 07,3120           37761        SENDPULS           CAF      13,14,15                              
056784,000248: 07,3121           00006                           EXTEND                                         
056785,000249: 07,3122           05014                           WOR      CHAN14                                
056786,000250: 07,3123           33766                           CAF      600MS                                 
056787,000251: 07,3124           13024                           TCF      COARS2     -1                         #  THEN TO VARDELAY
056788,000252: 
056789,000253: 07,3125           34737        CA+ECE             CAF      BIT6                                  #  ENABLE ALL THREE ISS CDU ERROR COUNTERS
056790,000254: 07,3126           00006                           EXTEND                                         
056791,000255: 07,3127           05012                           WOR      CHAN12                                
056792,000256: 07,3130           05263                           TC       TASKOVER                              
056793,000257: 

Page 1312

056795,000259: 07,3131           34741        SETCOARS           CAF      BIT4                                  #  BYPASS IF ALREADY IN COARSE ALIGN
056796,000260: 07,3132           00006                           EXTEND                                         
056797,000261: 07,3133           02012                           RAND     CHAN12                                
056798,000262: 07,3134           10000                           CCS      A                                     
056799,000263: 07,3135           00002                           TC       Q                                     
056800,000264: 
056801,000265: 07,3136           44737                           CS       BIT6                                  #  CLEAR ISS ERROR COUNTERS
056802,000266: 07,3137           00006                           EXTEND                                         
056803,000267: 07,3140           03012                           WAND     CHAN12                                
056804,000268: 
056805,000269: 07,3141           44733                           CS       BIT10                                 #  KNOCK DOWN GYRO ACTIVITY
056806,000270: 07,3142           00006                           EXTEND                                         
056807,000271: 07,3143           03014                           WAND     CHAN14                                
056808,000272: 07,3144           44746                           CS       ZERO                                  
056809,000273: 07,3145           54047                           TS       GYROCMD                               
056810,000274: 
056811,000275: 07,3146           34741                           CAF      BIT4                                  #  PUT ISS IN COARSE ALIGN
056812,000276: 07,3147           00006                           EXTEND                                         
056813,000277: 07,3150           05012                           WOR      CHAN12                                
056814,000278: 
056815,000279: 07,3151           41035                           CS       DSPTAB     +11D                       #  TURN ON NO ATT LAMP
056816,000280: 07,3152           73174                           MASK     OCT40010                              
056817,000281: 07,3153           27035                           ADS      DSPTAB     +11D                       
056818,000282: 
056819,000283: 07,3154           41300                           CS       IMODES33                              #  DISABLE DAP AUTO AND HOLD MODES
056820,000284: 07,3155           74737                           MASK     BIT6                                  
056821,000285: 07,3156           27300                           ADS      IMODES33                              
056822,000286: 
056823,000287: 07,3157           41277                           CS       IMODES30                              #  DISABLE IMUFAIL
056824,000288: 07,3160           74741                           MASK     BIT4                                  
056825,000289: 07,3161           27277                           ADS      IMODES30                              
056826,000290: 
056827,000291: 07,3162           44740        RNDREFDR           CS       TRACKBIT                              #  CLEAR TRACK FLAG
056828,000292: 07,3163           70075                           MASK     FLAGWRD1                              
056829,000293: 07,3164           54075                           TS       FLAGWRD1                              
056830,000294: 

The next three instructions are circled.

056832,000296: 07,3165           44726                           CS       DRFTBIT                               #  CLEAR DRIFT FLAG
056833,000297: 07,3166           70076                           MASK     FLAGWRD2                              
056834,000298: 07,3167           54076                           TS       FLAGWRD2                              
056835,000299: 
056836,000300: 07,3170           44730                           CS       REFSMBIT                              #  CLEAR REFSMMAT FLAG
056837,000301: 07,3171           70077                           MASK     FLAGWRD3                              
056838,000302: 07,3172           54077                           TS       FLAGWRD3                              
056839,000303: 
056840,000304: 07,3173           00002                           TC       Q                                     
056841,000305: 
056842,000306: 07,3174           40010        OCT40010           OCT      40010                                 
056843,000307: 

Page 1313

056845,000309:                                                                                                  #           IMU FINE ALIGN MODE SWITCH.
056846,000310: 
056847,000311: 07,3175           00004        IMUFINE            INHINT                                         
056848,000312: 07,3176           03672                           TC       CAGETSTJ                              #  SEE IF IMU BEING CAGED.
056849,000313: 
056850,000314: 07,3177           43763                           CS       BITS4-5                               #  RESET ZERO AND COARSE
056851,000315: 07,3200           00006                           EXTEND                                         
056852,000316: 07,3201           03012                           WAND     CHAN12                                
056853,000317: 
056854,000318: 07,3202           44737                           CS       BIT6                                  #  INSURE DAP AUTO AND HOLD MODES ENABLED
056855,000319: 07,3203           71300                           MASK     IMODES33                              
056856,000320: 07,3204           55300                           TS       IMODES33                              
056857,000321: 
056858,000322: 07,3205           03253                           TC       NOATTOFF                              
056859,000323: 
056860,000324: 07,3206           34733                           CAF      BIT10                                 #  IMU FAIL WAS INHIBITED DURING THE
056861,000325: 07,3207           05205                           TC       WAITLIST                              #  PRESUMABLY PRECEDING COARSE ALIGN. LEAVE
056862,000326: 07,3210  E3,1474                                  EBANK=   CDUIND                                
056863,000327: 07,3210           03221 16103                     2CADR    IFAILOK                               #  IT ON FOR THE FIRST 5 SECS OF FINE ALIGN
056864,000328: 
056865,000329: 
056866,000330: 07,3212           34771                           CAF      2SECS                                 
056867,000331: 07,3213           05205                           TC       WAITLIST                              
056868,000332: 07,3214  E3,1474                                  EBANK=   CDUIND                                
056869,000333: 07,3214           03217 16103                     2CADR    IMUFINED                              
056870,000334: 
056871,000335: 
056872,000336: 07,3216           12742                           TCF      MODEEXIT                              
056873,000337: 
056874,000338: 07,3217           03660        IMUFINED           TC       CAGETEST                              #  SEE THAT NO ONE HAS CAGED THE IMU.
056875,000339: 07,3220           13633                           TCF      ENDIMU                                
056876,000340: 

Page 1314

056878,000342: 07,3221           03665        IFAILOK            TC       CAGETSTQ                              #  ENABLE IMU FIAL UNLESS IMU BEING CAGED.
056879,000343: 07,3222           15263                           TCF      TASKOVER                              #  IT IS.
056880,000344: 
056881,000345: 07,3223           34741                           CAF      BIT4                                  #  DONT RESET IMU FAIL INHIBIT IF SOMEONE
056882,000346: 07,3224           00006                           EXTEND                                         #  HAS GONE INTO COARSE ALIGN.
056883,000347: 07,3225           02012                           RAND     CHAN12                                
056884,000348: 07,3226           10000                           CCS      A                                     
056885,000349: 07,3227           15263                           TCF      TASKOVER                              
056886,000350: 
056887,000351: 07,3230           41277                           CS       IMODES30                              #  RESET IMUFAIL.
056888,000352: 07,3231           74730                           MASK     BIT13                                 
056889,000353: 07,3232           27277                           ADS      IMODES30                              
056890,000354: 07,3233           44741                           CS       BIT4                                  
056891,000355: 07,3234           71277        PFAILOK2           MASK     IMODES30                              
056892,000356: 07,3235           55277                           TS       IMODES30                              
056893,000357: 07,3236           04665                           TC       IBNKCALL                              #  THE ISS WARNING LIGHT MAY COME ON NOW
056894,000358: 07,3237           14703                           CADR     SETISSW                               #  THAT THE INHIBIT HAS BEEN REMOVED.
056895,000359: 07,3240           15263                           TCF      TASKOVER                              
056896,000360: 
056897,000361: 07,3241           03665        PFAILOK            TC       CAGETSTQ                              #  ENABLE PIP FAIL PROG ALARM.
056898,000362: 07,3242           15263                           TCF      TASKOVER                              
056899,000363: 
056900,000364: 07,3243           41277                           CS       IMODES30                              #  RESET IMU AND PIPA FAIL BITS.
056901,000365: 07,3244           74733                           MASK     BIT10                                 
056902,000366: 07,3245           27277                           ADS      IMODES30                              
056903,000367: 
056904,000368: 07,3246           41300                           CS       IMODES33                              
056905,000369: 07,3247           74730                           MASK     BIT13                                 
056906,000370: 07,3250           27300                           ADS      IMODES33                              
056907,000371: 
056908,000372: 07,3251           44740                           CS       BIT5                                  
056909,000373: 07,3252           13234                           TCF      PFAILOK2                              
056910,000374: 
056911,000375: 07,3253           43174        NOATTOFF           CS       OCT40010                              #  SUBROUTINE TO TURN OFF NO ATT LAMP.
056912,000376: 07,3254           71035                           MASK     DSPTAB     +11D                       
056913,000377: 07,3255           64726                           AD       BIT15                                 
056914,000378: 07,3256           55035                           TS       DSPTAB     +11D                       
056915,000379: 07,3257           00002                           TC       Q                                     
056916,000380: 

Page 1315

056918,000382:                                                                                                  #           ROUITNES TO INITIATE AND TERMINATE PROGRAM USE OF THE PIPAS. NO IMUSTALL REQUIRED IN EITHER CASE.
056919,000383: 
056920,000384: 07,3260           44746        PIPUSE             CS       ZERO                                  
056921,000385: 07,3261           54037                           TS       PIPAX                                 
056922,000386: 07,3262           54040                           TS       PIPAY                                 
056923,000387: 07,3263           54041                           TS       PIPAZ                                 
056924,000388: 
056925,000389: 07,3264           03665        PIPUSE1            TC       CAGETSTQ                              #  DO NOT ENABLE PIPA FAIL IF IMU IS CAGED
056926,000390: 07,3265           14622                           TCF      SWRETURN                              
056927,000391: 
056928,000392: 07,3266           00004                           INHINT                                         
056929,000393: 07,3267           44744                           CS       BIT1                                  #  IF PIPA FAILS FROM NOW ON (UNTIL
056930,000394: 07,3270           71277                           MASK     IMODES30                              #  PIPFREE), LIGHT ISS WARNING.
056931,000395: 07,3271           55277                           TS       IMODES30                              
056932,000396: 
056933,000397: 07,3272           04665        PIPFREE2           TC       IBNKCALL                              #  ISS WARNING MIGHT COME ON NOW.
056934,000398: 07,3273           14703                           CADR     SETISSW                               #  (OR GO OFF ON PIPFREE).
056935,000399: 
056936,000400: 07,3274           12742                           TCF      MODEEXIT                              
056937,000401: 
056938,000402: 07,3275           00004        PIPFREE            INHINT                                         #  PROGRAM DONE WITH PIPAS. DONT LIGHT
056939,000403: 07,3276           41277                           CS       IMODES30                              #  ISS WARNING.
056940,000404: 07,3277           74744                           MASK     BIT1                                  
056941,000405: 07,3300           27277                           ADS      IMODES30                              
056942,000406: 
056943,000407: 07,3301           74733                           MASK     BIT10                                 #  IF PIP FAIL ON, DO PROG ALSRM AND RESET
056944,000408: 07,3302           10000                           CCS      A                                     #  ISS WARNING.
056945,000409: 07,3303           12742                           TCF      MODEEXIT                              
056946,000410: 
056947,000411: 07,3304           05571                           TC       ALARM                                 
056948,000412: 07,3305           00212                           OCT      212                                   
056949,000413: 
056950,000414: 07,3306           00004                           INHINT                                         
056951,000415: 
056952,000416: 07,3307           13272                           TCF      PIPFREE2                              
056953,000417: 

Page 1316

056955,000419:                                                                                                  #           THE FOLLOWING ROUTINE TORQUES THE IRIGS ACCORDING TO DOUBLE PRECISION INPUTS IN THE SIX REGISTERS
056956,000420:                                                                                                  #  BEGINNING AT THE ECADR ARRIVING IN A. THE MINIMUM SIZE OF ANY PULSE TRAIN IS 16 PULSES (.25 CDU COUNTS). THE
056957,000421:                                                                                                  #  UNSENT PORTION OF THE COMMAND IS LEFT INTACT IN THE INPUT COMMAND REGISTERS.
056958,000422: 
056959,000423: 07,3310  E3,1400                                  EBANK=   1400                                  #  VARIABLE, ACTUALLY.
056960,000424: 
056961,000425: 07,3310           54161        IMUPULSE           TS       MPAC       +5                         #  SAVE ARRIVING ECADR.
056962,000426: 07,3311           03672                           TC       CAGETSTJ                              #  DONT PROCEED IF IMU BEING CAGED.
056963,000427: 
056964,000428: 07,3312           11311                           CCS      LGYRO                                 #  SEE IF GYROS BUSY.
056965,000429: 07,3313           03354                           TC       GYROBUSY                              #  SLEEP.
056966,000430: 
056967,000431: 07,3314           54156                           TS       MPAC       +2                         
056968,000432: 07,3315           34737                           CAF      BIT6                                  #  ENABLE THE POWER SUPPLY.
056969,000433: 07,3316           00006                           EXTEND                                         
056970,000434: 07,3317           05014                           WOR      CHAN14                                
056971,000435: 
056972,000436: 07,3320           34742                           CAF      FOUR                                  
056973,000437: 07,3321           05205        GWAKE2             TC       WAITLIST                              #  (IF A JOB WAS PUT TO SLEEP, THE POWER
056974,000438: 07,3322  E3,1474                                  EBANK=   CDUIND                                #  SUPPLY IS LEFT ON BY THE WAKING JOB).
056975,000439: 07,3322           03372 16103                     2CADR    STRTGYRO                              
056976,000440: 
056977,000441: 
056978,000442: 07,3324           30161                           CA       MPAC       +5                         #  SET UP EBANK, SAVING CALLER'S EBANK FOR
056979,000443: 07,3325           56003                           XCH      EBANK                                 #  RESTORATION ON RETURN.
056980,000444: 07,3326           56161                           XCH      MPAC       +5                         
056981,000445: 07,3327           55311                           TS       LGYRO                                 #  RESERVES GYROS.
056982,000446: 07,3330           74350                           MASK     LOW8                                  
056983,000447: 07,3331           54061                           TS       ITEMP1                                
056984,000448: 
056985,000449: 07,3332           34743                           CAF      TWO                                   #  FORCE SIGN AGREEMENT ON INPUTS.
056986,000450: 07,3333           54157        GYROAGRE           TS       MPAC       +3                         
056987,000451: 07,3334           60000                           DOUBLE                                         
056988,000452: 07,3335           60061                           AD       ITEMP1                                
056989,000453: 07,3336           54160                           TS       MPAC       +4                         
056990,000454: 07,3337           00006                           EXTEND                                         
056991,000455: 07,3340           50000                           INDEX    A                                     
056992,000456: 07,3341           31401                           DCA      1400                                  
056993,000457: 07,3342           52155                           DXCH     MPAC                                  
056994,000458: 07,3343           07300                           TC       TPAGREE                               
056995,000459: 07,3344           52155                           DXCH     MPAC                                  
056996,000460: 07,3345           50160                           INDEX    MPAC       +4                         
056997,000461: 07,3346           53401                           DXCH     1400                                  
056998,000462: 
056999,000463: 07,3347           10157                           CCS      MPAC       +3                         
057000,000464: 07,3350           13333                           TCF      GYROAGRE                              
057001,000465: 
057002,000466: 07,3351           30161                           CA       MPAC       +5                         #  RESTORE CALLER'S EBANK.
057003,000467: 07,3352           54003                           TS       EBANK                                 
057004,000468: 07,3353           12742                           TCF      MODEEXIT                              
057005,000469: 

Page 1317

057007,000471:                                                                                                  #           ROUTINES TO ALLOW TORQUING BY ONLY ONE JOB AT A TIME.
057008,000472: 
057009,000473: 07,3354           00006        GYROBUSY           EXTEND                                         #  SAVE RETURN 2FCADR.
057010,000474: 07,3355           30134                           DCA      BUF2                                  
057011,000475: 07,3356           52155                           DXCH     MPAC                                  
057012,000476: 07,3357           33371        REGSLEEP           CAF      LGWAKE                                
057013,000477: 07,3360           15124                           TCF      JOBSLEEP                              
057014,000478: 
057015,000479: 07,3361           11311        GWAKE              CCS      LGYRO                                 #  WHEN AWAKENED, SEE IF GYROS STILL BUSY.
057016,000480: 07,3362           13357                           TCF      REGSLEEP                              #  IF SO, SLEEP SOME MORE.
057017,000481: 
057018,000482: 07,3363           54156                           TS       MPAC       +2                         
057019,000483: 07,3364           00006                           EXTEND                                         
057020,000484: 07,3365           30155                           DCA      MPAC                                  
057021,000485: 07,3366           52134                           DXCH     BUF2                                  #  RESTORE SWRETURN INFO.
057022,000486: 07,3367           34744                           CAF      ONE                                   
057023,000487: 07,3370           13321                           TCF      GWAKE2                                
057024,000488: 
057025,000489: 07,3371           17361        LGWAKE             CADR     GWAKE                                 
057026,000490: 

Page 1318

057028,000492:                                                                                                  #           GYRO-TORQUING WAITLIST TASKS.
057029,000493: 
057030,000494: 07,3372           43630        STRTGYRO           CS       GDESELCT                              #  DE-SELECT LAST GYRO.
057031,000495: 07,3373           00006                           EXTEND                                         
057032,000496: 07,3374           03014                           WAND     CHAN14                                
057033,000497: 
057034,000498: 07,3375           03646                           TC       CAGETSTG                              
057035,000499: 
057036,000500: 07,3376           31311        STRTGYR2           CA       LGYRO                                 #  JUMP ON PHASE COUNTER IN BITS 13-14.
057037,000501: 07,3377           00006                           EXTEND                                         
057038,000502: 07,3400           74741                           MP       BIT4                                  
057039,000503: 07,3401           50000                           INDEX    A                                     
057040,000504: 07,3402           13403                           TCF      +1                                    
057041,000505: 07,3403           03420                           TC       GSELECT                               #  =0. DO Y GYRO.
057042,000506: 07,3404           00202                           OCT      00202                                 
057043,000507: 
057044,000508: 07,3405           03420                           TC       GSELECT                               #  =1. DO Z GYRO.
057045,000509: 07,3406           00302                           OCT      00302                                 
057046,000510: 
057047,000511: 07,3407           03416                           TC       GSELECT    -2                         #  =2. DO X GYRO.
057048,000512: 07,3410           00100                           OCT      00100                                 
057049,000513: 
057050,000514: 07,3411           34746                           CAF      ZERO                                  #  =3. DONE
057051,000515: 07,3412           55311                           TS       LGYRO                                 
057052,000516: 07,3413           33371                           CAF      LGWAKE                                #  WAKE A POSSIBLE SLEEPING JOB.
057053,000517: 07,3414           05130                           TC       JOBWAKE                               
057054,000518: 
057055,000519: 07,3415           13217        NORESET            TCF      IMUFINED                              #  DO NOT RESET POWER SUPPLY
057056,000520: 

Page 1319

057058,000522: 07,3416           44742                 -2        CS       FOUR                                  #  SPECIAL ENTRY TO REGRESS LGYRO FOR X.
057059,000523: 07,3417           27311                           ADS      LGYRO                                 
057060,000524: 
057061,000525: 07,3420           50002        GSELECT            INDEX    Q                                     #  SELECT GYRO.
057062,000526: 07,3421           30000                           CAF      0                                     #  PACKED WORD CONTAINS GYRO SELECT BITS
057063,000527: 07,3422           54064                           TS       ITEMP4                                #  AND INCREMENT TO LGYRO.
057064,000528: 07,3423           74750                           MASK     SEVEN                                 
057065,000529: 07,3424           64730                           AD       BIT13                                 
057066,000530: 07,3425           27311                           ADS      LGYRO                                 
057067,000531: 07,3426           54003                           TS       EBANK                                 
057068,000532: 07,3427           74350                           MASK     LOW8                                  
057069,000533: 07,3430           54061                           TS       ITEMP1                                
057070,000534: 
057071,000535: 07,3431           44750                           CS       SEVEN                                 
057072,000536: 07,3432           70064                           MASK     ITEMP4                                
057073,000537: 07,3433           54064                           TS       ITEMP4                                
057074,000538: 
057075,000539: 07,3434           00006                           EXTEND                                         #  MOVE DP COMMAND TO RUPTREGS FOR TESTING.
057076,000540: 07,3435           50061                           INDEX    ITEMP1                                
057077,000541: 07,3436           31401                           DCA      1400                                  
057078,000542: 07,3437           52071                           DXCH     RUPTREG1                              
057079,000543: 
057080,000544: 07,3440           10070                           CCS      RUPTREG1                              
057081,000545: 07,3441           13454                           TCF      MAJ+                                  
057082,000546: 07,3442           13444                           TCF      +2                                    
057083,000547: 07,3443           13611                           TCF      MAJ-                                  
057084,000548: 
057085,000549: 07,3444           10071                           CCS      RUPTREG2                              
057086,000550: 07,3445           13451                           TCF      MIN+                                  
057087,000551: 07,3446           13376                           TCF      STRTGYR2                              
057088,000552: 07,3447           13606                           TCF      MIN-                                  
057089,000553: 07,3450           13376                           TCF      STRTGYR2                              
057090,000554: 

Page 1320

057092,000556: 07,3451           63505        MIN+               AD       -GYROMIN                              #  SMALL POSITIVE COMMAND. SEE IF AT LEAST
057093,000557: 07,3452           00006                           EXTEND                                         #  16 GYRO PULSES.
057094,000558: 07,3453           63376                           BZMF     STRTGYR2                              
057095,000559: 
057096,000560: 07,3454           00006        MAJ+               EXTEND                                         #  DEFINITE POSITIVE OUTPUT.
057097,000561: 07,3455           33632                           DCA      GYROFRAC                              
057098,000562: 07,3456           20071                           DAS      RUPTREG1                              
057099,000563: 
057100,000564: 07,3457           30064                           CA       ITEMP4                                #  SELECT POSITIVE TORQUING FOR THIS GYRO.
057101,000565: 07,3460           00006                           EXTEND                                         
057102,000566: 07,3461           05014                           WOR      CHAN14                                
057103,000567: 
057104,000568: 07,3462           36115                           CAF      LOW7                                  #  LEAVE NUMBER OF POSSIBLE 8192 AUGMENTS
057105,000569: 07,3463           70071                           MASK     RUPTREG2                              #  TO INITIAL COMMAND IN MAJOR PART OF LONG
057106,000570: 07,3464           56071                           XCH      RUPTREG2                              #  TERM STORAGE AND TRUNCATED FRACTION
057107,000571: 07,3465           00006        GMERGE             EXTEND                                         #  IN MINOR PART. THE MAJOR PART WILL BE
057108,000572: 07,3466           74735                           MP       BIT8                                  #  COUNTED DOWN TO ZERO IN THE COURSE OF
057109,000573: 07,3467           54062                           TS       ITEMP2                                #  PUTTING OUT THE ENTIRE COMMAND.
057110,000574: 07,3470           30070                           CA       RUPTREG1                              
057111,000575: 07,3471           00006                           EXTEND                                         
057112,000576: 07,3472           74734                           MP       BIT9                                  
057113,000577: 07,3473           54070                           TS       RUPTREG1                              
057114,000578: 07,3474           30001                           CA       L                                     
057115,000579: 07,3475           00006                           EXTEND                                         
057116,000580: 07,3476           74727                           MP       BIT14                                 
057117,000581: 07,3477           26062                           ADS      ITEMP2                                #  INITIAL COMMAND.
057118,000582: 
057119,000583: 07,3500           00006                           EXTEND                                         #  SEE IF MORE THAN ONE PULSE TRAIN NEEDED
057120,000584: 07,3501           30071                           DCA      RUPTREG1                              #  (MORE THAN 16383 PULSES).
057121,000585: 07,3502           67770                           AD       MINUS1                                
057122,000586: 07,3503           10000                           CCS      A                                     
057123,000587: 07,3504           13552                           TCF      LONGGYRO                              
057124,000588: 07,3505           77601        -GYROMIN           OCT      -176                                  #  MAY BE ADJUSTED TO SPECIFY MINIMUM CMD
057125,000589: 07,3506           13512                           TCF      +4                                    
057126,000590: 
057127,000591: 07,3507           34727                           CAF      BIT14                                 
057128,000592: 07,3510           26062                           ADS      ITEMP2                                
057129,000593: 07,3511           34746                           CAF      ZERO                                  
057130,000594: 
057131,000595: 07,3512           50061                 +4        INDEX    ITEMP1                                
057132,000596: 07,3513           53401                           DXCH     1400                                  

Page 1321

057134,000598: 07,3514           30062                           CA       ITEMP2                                #  ENTIRE COMMAND.
057135,000599: 07,3515           54047        LASTSEG            TS       GYROCMD                               
057136,000600: 07,3516           03641                           TC       COARSTST                              
057137,000601: 
057138,000602: 07,3517           30047                           CA       GYROCMD                               
057139,000603: 07,3520           00006                           EXTEND                                         
057140,000604: 07,3521           74733                           MP       BIT10                                 #  WAITLIST DT
057141,000605: 07,3522           66266                           AD       THREE                                 #  TRUNCATION AND PHASE UNCERTAINTIES.
057142,000606: 07,3523           05205                           TC       WAITLIST                              
057143,000607: 07,3524  E3,1474                                  EBANK=   CDUIND                                
057144,000608: 07,3524           03536 16103                     2CADR    TWOPULSE                              
057145,000609: 
057146,000610: 07,3526           03532        EXITGYRO           TC       GYROEXIT                              
057147,000611: 07,3527           15263                           TCF      TASKOVER                              
057148,000612: 07,3530           34743        OUTPULSE           CA       BIT2                                  
057149,000613: 07,3531           54047                           TS       GYROCMD                               
057150,000614: 07,3532           34733        GYROEXIT           CAF      BIT10                                 
057151,000615: 07,3533           00006                           EXTEND                                         
057152,000616: 07,3534           05014                           WOR      CHAN14                                
057153,000617: 07,3535           00002                           TC       Q                                     
057154,000618: 07,3536           44734        TWOPULSE           CS       BIT9                                  
057155,000619: 07,3537           00006                           EXTEND                                         
057156,000620: 07,3540           03014                           WAND     CHAN14                                
057157,000621: 07,3541           03530                           TC       OUTPULSE                              
057158,000622: 07,3542           34744                           CA       BIT1                                  
057159,000623: 07,3543           05175                           TC       TWIDDLE                               
057160,000624: 07,3544           03372                           ADRES    STRTGYRO                              
057161,000625: 07,3545           34734                           CA       BIT9                                  
057162,000626: 07,3546           00006                           EXTEND                                         
057163,000627: 07,3547           05014                           WOR      CHAN14                                
057164,000628: 07,3550           03530                           TC       OUTPULSE                              
057165,000629: 07,3551           15263                           TCF      TASKOVER                              
057166,000630: 07,3552           50061        LONGGYRO           INDEX    ITEMP1                                
057167,000631: 07,3553           53401                           DXCH     1400                                  
057168,000632: 07,3554           34727                           CAF      BIT14                                 #  8192. INITIAL COMMAND IS AT LEAST 8192.
057169,000633: 07,3555           60062                           AD       ITEMP2                                
057170,000634: 07,3556           54047                           TS       GYROCMD                               
057171,000635: 
057172,000636: 07,3557           00006        AUG3               EXTEND                                         #  GET WAITLIST DT TO TIME WHEN TRAIN IS
057173,000637: 07,3560           74733                           MP       BIT10                                 #  ALMOST OUT.
057174,000638: 07,3561           67766                           AD       NEG3                                  
057175,000639: 07,3562           05205                           TC       WAITLIST                              
057176,000640: 07,3563  E3,1474                                  EBANK=   CDUIND                                
057177,000641: 07,3563           03566 16103                     2CADR    8192AUG                               
057178,000642: 
057179,000643: 07,3565           13526                           TCF      EXITGYRO                              
057180,000644: 07,3566           03641        8192AUG            TC       COARSTST                              
057181,000645: 
057182,000646: 07,3567           31311                           CA       LGYRO                                 #  ADD 8192 PULSES TO GYROCMD
057183,000647: 07,3570           54003                           TS       EBANK                                 

Page 1322

057185,000649: 07,3571           74350                           MASK     LOW8                                  
057186,000650: 07,3572           54061                           TS       ITEMP1                                
057187,000651: 
057188,000652: 07,3573           50061                           INDEX    ITEMP1                                #  SEE IF THIS IS THE LAST AUG.
057189,000653: 07,3574           11400                           CCS      1400                                  
057190,000654: 07,3575           13601                           TCF      AUG2                                  #  MORE TO COME.
057191,000655: 
057192,000656: 07,3576           34727                           CAF      BIT14                                 
057193,000657: 07,3577           26047                           ADS      GYROCMD                               
057194,000658: 07,3600           13516                           TCF      LASTSEG    +1                         
057195,000659: 
057196,000660: 07,3601           50061        AUG2               INDEX    ITEMP1                                
057197,000661: 07,3602           55400                           TS       1400                                  
057198,000662: 07,3603           34727                           CAF      BIT14                                 
057199,000663: 07,3604           26047                           ADS      GYROCMD                               
057200,000664: 07,3605           13557                           TCF      AUG3                                  #  COMPUTE DT.
057201,000665: 

Page 1323

057203,000667: 07,3606           63505        MIN-               AD       -GYROMIN                              #  POSSIBLE NEGATIVE OUTPUT.
057204,000668: 07,3607           00006                           EXTEND                                         
057205,000669: 07,3610           63376                           BZMF     STRTGYR2                              
057206,000670: 
057207,000671: 07,3611           00006        MAJ-               EXTEND                                         #  DEFINITE NEGATIVE OUTPUT.
057208,000672: 07,3612           43632                           DCS      GYROFRAC                              
057209,000673: 07,3613           20071                           DAS      RUPTREG1                              
057210,000674: 
057211,000675: 07,3614           30064                           CA       ITEMP4                                #  SELECT NEGATIVE TORQUING FOR THIS GYRO.
057212,000676: 07,3615           64734                           AD       BIT9                                  
057213,000677: 07,3616           00006                           EXTEND                                         
057214,000678: 07,3617           05014                           WOR      CHAN14                                
057215,000679: 
057216,000680: 07,3620           40070                           CS       RUPTREG1                              #  SET UP RUPTREGS TO FALL INTO GMERGE.
057217,000681: 07,3621           54070                           TS       RUPTREG1                              #  ALL NUMBERS PUT INTO GYROCMD ARE
057218,000682: 07,3622           40071                           CS       RUPTREG2                              #  POSITIVE - BIT9 OF CHAN 14 DETERMINES
057219,000683: 07,3623           76115                           MASK     LOW7                                  #  THE SIGN OF THE COMMAND.
057220,000684: 07,3624           40000                           COM                                            
057221,000685: 07,3625           56071                           XCH      RUPTREG2                              
057222,000686: 07,3626           40000                           COM                                            
057223,000687: 07,3627           13465                           TCF      GMERGE                                
057224,000688: 
057225,000689: 07,3630           01700        GDESELCT           OCT      1700                                  #  TURN OFF SELECT AND ACTIVITY BITS.
057226,000690: 
057227,000691: 07,3631           00000 00034  GYROFRAC           2DEC     .215       B-21                       
057228,000692: 

Page 1324

057230,000694:                                                                                                  #           IMU MODE SWITCHING ROUTINES COME HERE WHEN ACTION COMPLETE.
057231,000695: 
057232,000696: 07,3633           00006        ENDIMU             EXTEND                                         #  MODE IS BAD IF CAGE HAS OCCURED OR IF
057233,000697: 07,3634           00011                           READ     DSALMOUT                              #  ISS WARNING IS ON.
057234,000698: 07,3635           74744                           MASK     BIT1                                  
057235,000699: 07,3636           10000                           CCS      A                                     
057236,000700: 07,3637           13656                           TCF      IMUBAD                                
057237,000701: 
057238,000702: 07,3640           13704        IMUGOOD            TCF      GOODEND                               #  WITH C(A) = 0.
057239,000703: 
057240,000704: 07,3641           34741        COARSTST           CAF      BIT4                                  
057241,000705: 07,3642           00006                           EXTEND                                         
057242,000706: 07,3643           02012                           RAND     CHAN12                                
057243,000707: 07,3644           10000                           CCS      A                                     
057244,000708: 07,3645           13652                           TCF      DONTPULS                              
057245,000709: 
057246,000710: 07,3646           41277        CAGETSTG           CS       IMODES30                              
057247,000711: 07,3647           74737                           MASK     BIT6                                  
057248,000712: 07,3650           10000                           CCS      A                                     
057249,000713: 07,3651           00002                           TC       Q                                     
057250,000714: 
057251,000715: 07,3652           34746        DONTPULS           CAF      ZERO                                  
057252,000716: 07,3653           55311                           TS       LGYRO                                 
057253,000717: 
057254,000718: 07,3654           33371                           CAF      LGWAKE                                
057255,000719: 07,3655           05130                           TC       JOBWAKE                               
057256,000720: 
057257,000721: 07,3656           34746        IMUBAD             CAF      ZERO                                  
057258,000722: 07,3657           13701                           TCF      BADEND                                
057259,000723: 
057260,000724: 07,3660           34737        CAGETEST           CAF      BIT6                                  #  SUBROUTINE TO TERMINATE IMU MODE
057261,000725: 07,3661           71277                           MASK     IMODES30                              #  SWITCH IF IMU HAS BEEN CAGED.
057262,000726: 07,3662           10000                           CCS      A                                     
057263,000727: 07,3663           13656                           TCF      IMUBAD                                #  DIRECTLY.
057264,000728: 07,3664           00002                           TC       Q                                     #  WITH C(A) = +0.
057265,000729: 
057266,000730: 07,3665           41277        CAGETSTQ           CS       IMODES30                              #  SKIP IF IMU NOT BEING CAGED.
057267,000731: 07,3666           74737                           MASK     BIT6                                  
057268,000732: 07,3667           10000                           CCS      A                                     
057269,000733: 07,3670           24002                           INCR     Q                                     
057270,000734: 07,3671           00002                           TC       Q                                     
057271,000735: 
057272,000736: 07,3672           41277        CAGETSTJ           CS       IMODES30                              #  IF DURING MODE SWITCH INITIALIZATION
057273,000737: 07,3673           74737                           MASK     BIT6                                  #  IT IS FOUND THAT THE IMU IS BEING CAGED,
057274,000738: 07,3674           10000                           CCS      A                                     #  SET IMUCADR TO -0 TO INDICATE OPERATION
057275,000739: 07,3675           00002                           TC       Q                                     #  COMPLETE BUT FAILED. RETURN IMMEDIATELY
057276,000740: 
057277,000741: 07,3676           44746                           CS       ZERO                                  #  TO SWRETURN.
057278,000742: 07,3677           55301                           TS       IMUCADR                               
057279,000743: 07,3700           12742                           TCF      MODEEXIT                              
057280,000744: 

Page 1325

057282,000746:                                                                                                  #           GENERALIZED MODE SWITCHING TERMINATION. ENTER AT GOODEND FOR SUCCESSFUL COMPLETION OF AN I/O OPERATION
057283,000747:                                                                                                  #  OR AT BADEND FOR A N UNSUCCESSFUL ONE. C(A) OR ARRIVAL =0 FOR IMU, 1 FOR OPTICS.
057284,000748: 
057285,000749: 07,3701           54071        BADEND             TS       RUPTREG2                              #  DEVICE INDEX.
057286,000750: 07,3702           44746                           CS       ZERO                                  #  FOR FAILURE.
057287,000751: 07,3703           13706                           TCF      GOODEND    +2                         
057288,000752: 
057289,000753: 07,3704           54071        GOODEND            TS       RUPTREG2                              
057290,000754: 07,3705           44744                           CS       ONE                                   #  FOR SUCCESS.
057291,000755: 
057292,000756: 07,3706           54072                           TS       RUPTREG3                              
057293,000757: 07,3707           50071                           INDEX    RUPTREG2                              #  SEE IF USING PROGRAM ASLEEP.
057294,000758: 07,3710           11301                           CCS      MODECADR                              
057295,000759: 07,3711           13715                           TCF      +4                                    #  YES - WAKE IT UP.
057296,000760: 07,3712           13725                           TCF      ENDMODE                               #  IF 0, PROGRAM NOT IN YET.
057297,000761: 
057298,000762: 07,3713           00006                           EXTEND                                         
057299,000763: 07,3714           13726                           BZF      ENDMODE    +1                         #  BZF = TCF IF MODECADR = -0.
057300,000764: 
057301,000765: 07,3715           34746                           CAF      ZERO                                  #  WAKE SLEEPING PROGRAM.
057302,000766: 07,3716           50071                           INDEX    RUPTREG2                              
057303,000767: 07,3717           57301                           XCH      MODECADR                              
057304,000768: 07,3720           05130                           TC       JOBWAKE                               
057305,000769: 
057306,000770: 07,3721           40072                           CS       RUPTREG3                              #  ADVANCE LOC IF SUCCESSFUL.
057307,000771: 07,3722           50064                           INDEX    LOCCTR                                
057308,000772: 07,3723           26164                           ADS      LOC                                   
057309,000773: 
057310,000774: 07,3724           15263                           TCF      TASKOVER                              
057311,000775: 
057312,000776: 07,3725           30072        ENDMODE            CA       RUPTREG3                              #  -0 INDICATES OPERATION COMPLETE BUT
057313,000777: 07,3726           50071                 +1        INDEX    RUPTREG2                              #  UNSUCCESSFUL: -1 INDICATES COMPLETE AND
057314,000778: 07,3727           55301                           TS       MODECADR                              #  SUCCESSFUL.
057315,000779: 07,3730           15263                           TCF      TASKOVER                              
057316,000780: 

Page 1326

057318,000782:                                                                                                  #           GENERAL STALLING ROUTINE. USING PROGRAMS COME HERE TO WAIT FOR I/O COMPLETION.
057319,000783: 
057320,000784:                                                                                                  #  PROGRAM DESCRIPTION                                    DATE- 21 FEB 1967
057321,000785:                                                                                                  #                                            LOG SECTION IMU MODE SWITCHING
057322,000786:                                                                                                  #  MOD BY- R.MELANSON TO ADD DOCUMENTATION       ASSEMBLY SUNDISK  REV.  82
057323,000787: 
057324,000788:                                                                                                  #  FUNCTIONAL DESCRIPTION-
057325,000789:                                                                                                  #    TO DELAY FURTHER EXECUTION OF THE CALLING ROUTINE UNTIL ITS SELECTED
057326,000790:                                                                                                  #    I/O FUNCTION IS COMPLETE.THE FOLLOWING CHECKS ON THE CALLING ROUTINE:S
057327,000791:                                                                                                  #    MODECADR ARE MADE AND ACTED UPON.
057328,000792:                                                                                                  #      1) +0 INDICATES INCOMPLETE I/O OPERATION.CALLING ROUTINE IS PUT TO
057329,000793:                                                                                                  #         SLEEP.
057330,000794:                                                                                                  #      2) -1 INDICATES COMPLETED I/O OPERATION. STALL BYPASSES JOBSLEEP
057331,000795:                                                                                                  #         CALL AND RETURNS TO CALLING ROUTINE AT L+3
057332,000796:                                                                                                  #      3) -0 INDICATES COMPLETED I/O WITH FAILURE. STALL CLEARS MODECADR
057333,000797:                                                                                                  #         AND RETURNS TO CALLING ROUTINE AT L+2.
057334,000798:                                                                                                  #      4) VALUE GREATER THAN 0 INDICATES TWO ROUTINES CALLING FOR USE OF
057335,000799:                                                                                                  #         SAME DEVICE. STALL EXITS TO ABORT WHICH EXECUTES A PROGRAM
057336,000800:                                                                                                  #         RESTART WHICH IN TURN CLEARS ALL MODECADR REGISTERS.
057337,000801: 
057338,000802:                                                                                                  #   CALLING SEQUENCE-
057339,000803:                                                                                                  #    L   TC   BANKCALL
057340,000804:                                                                                                  #    L+1 CADR (ONE OF 5 STALL ADDRESSES I.E. IMUSTALL,OPTSTALL,RADSTALL,
057341,000805:                                                                                                  #              AOTSTALL,OR ATTSTALL)
057342,000806: 
057343,000807:                                                                                                  #   NORMAL-EXIT MODE-
057344,000808:                                                                                                  #    TCF   JOBSLEEP OR TCF  MODEXIT
057345,000809: 
057346,000810:                                                                                                  #  ALARM OR ABORT EXIT MODE-
057347,000811:                                                                                                  #    TC   ABORT
057348,000812: 
057349,000813:                                                                                                  #  OUTPUT-
057350,000814:                                                                                                  #     MODECADR= CADR IF JOBSLEEP
057351,000815:                                                                                                  #     MODECADR=+0    IF I/O COMPLETE
057352,000816:                                                                                                  #     BUF2=L+3       IF I/O COMPLETE AND GOOD.
057353,000817:                                                                                                  #     BUF2=L+2 IF I/O COMPLETE BUT FAILED.
057354,000818: 
057355,000819:                                                                                                  #  ERASABLE INITIALIZATION-
057356,000820:                                                                                                  #    BUF2 CONTAINS RETURN ADDRESS PLUS 1,(L+2)
057357,000821:                                                                                                  #    BUF2+1 CONTAINS FBANK VALUE OF CALLING ROUTINE.
057358,000822:                                                                                                  #    MODECADR OF CALLING ROUTINE CONTAINS +0,-1,-0 OR  CADR RETURN ADDRESS.
057359,000823: 
057360,000824:                                                                                                  #  DEBRIS-
057361,000825:                                                                                                  #    RUPTREG2 AND CALLING ROUTINE MODECADR.
057362,000826: 
057363,000827: 07,3731           34744        AOTSTALL           CAF      ONE                                   #  AOT.
057364,000828: 07,3732           03736                           TC       STALL                                 
057365,000829: 
057366,000830: 07,3733           34743        RADSTALL           CAF      TWO                                   
057367,000831: 07,3734           13736                           TCF      STALL                                 
057368,000832: 

Page 1327

057370,000834: 07,3735  07,3731               OPTSTALL           EQUALS   AOTSTALL                              
057371,000835: 
057372,000836: 07,3735           34746        IMUSTALL           CAF      ZERO                                  #  IMU.
057373,000837: 
057374,000838: 07,3736           00004        STALL              INHINT                                         
057375,000839: 07,3737           54071                           TS       RUPTREG2                              #  SAVE DEVICE INDEX.
057376,000840: 07,3740           50000                           INDEX    A                                     #  SEE IF OPERATION COMPLETE.
057377,000841: 07,3741           11301                           CCS      MODECADR                              
057378,000842: 07,3742           13760                           TCF      MODABORT                              #  ALLOWABLE STATES ARE +0, -1, AND -0.
057379,000843: 07,3743           13754                           TCF      MODESLP                               #  OPERATION INCOMPLETE.
057380,000844: 07,3744           13750                           TCF      MODEGOOD                              #  COMPLETE AND GOOD IF = -1.
057381,000845: 
057382,000846: 07,3745           50071        MG2                INDEX    RUPTREG2                              #  COMPLETE AND FAILED IF -0. RESET TO +0.
057383,000847: 07,3746           55301                           TS       MODECADR                              #  RETURN TO CALLER.
057384,000848: 07,3747           12742                           TCF      MODEEXIT                              
057385,000849: 
057386,000850: 07,3750           10000        MODEGOOD           CCS      A                                     #  MAKE SURE INITIAL STATE -1.
057387,000851: 07,3751           13760                           TCF      MODABORT                              
057388,000852: 
057389,000853: 07,3752           24133                           INCR     BUF2                                  #  IF SO, INCREMENT RETURN ADDRESS AND
057390,000854: 07,3753           13745                           TCF      MG2                                   #  RETURN IMMEDIATELY, SETTING CADR = +0.
057391,000855: 
057392,000856: 07,3754           04636        MODESLP            TC       MAKECADR                              #  CALL FROM SWITCHABLE FIXED ONLY.
057393,000857: 07,3755           50071                           INDEX    RUPTREG2                              
057394,000858: 07,3756           55301                           TS       MODECADR                              
057395,000859: 07,3757           15124                           TCF      JOBSLEEP                              
057396,000860: 
057397,000861: 07,3760           52134        MODABORT           DXCH     BUF2                                  
057398,000862: 07,3761           05712                           TC       BAILOUT1                              #  TWO PROGRAMS USING THE SAME DEVICE.
057399,000863: 07,3762           31210                           OCT      31210                                 
057400,000864: 

Page 1328

057402,000866:                                                                                                  #           CONSTANTS FOR MODE SWITCHING ROUTINES
057403,000867: 
057404,000868: 07,3763     5745               BITS3&4            =        OCT14                                 
057405,000869: 07,3763     4762               BITS4&6            =        OCT50                                 
057406,000870: 07,3763           00030        BITS4-5            OCT      00030                                 
057407,000871: 07,3764     4735               IMUSEFLG           EQUALS   BIT8                                  #  INTERPRETER SWITCH 7.
057408,000872: 07,3764           77500        -COMMAX            DEC      -191       B-14                       
057409,000873: 07,3765           77477        -COMMAX-           DEC      -192       B-14                       
057410,000874: 07,3766           00074        600MS              DEC      60         B-14                       
057411,000875: 07,3767  07,3175               IMUFIN20           =        IMUFINE                               
057412,000876: 21,2000                                           SETLOC   MANUR                                 
057413,000877: 21,2000                                           BANK                                           
057414,000878: 
057415,000879: 21,2764           31304        GOMANUR            CA       ATTCADR                               #  IS KALCMANU FREE
057416,000880: 21,2765           00006                           EXTEND                                         
057417,000881: 21,2766           12771                           BZF      OKMANUR                               
057418,000882: 21,2767           04626                           TC       POSTJUMP                              
057419,000883: 21,2770           17760                           CADR     MODABORT                              
057420,000884: 21,2771           00006        OKMANUR            EXTEND                                         
057421,000885: 21,2772           30134                           DCA      BUF2                                  
057422,000886: 21,2773           53305                           DXCH     ATTCADR                               #  SAVE FINAL RETURN FOR KALCMAN3
057423,000887: 
057424,000888: 21,2774           30006                           CA       BBANK                                 
057425,000889: 21,2775           74750                           MASK     SEVEN                                 
057426,000890: 21,2776           27305                           ADS      ATTCADR    +1                         
057427,000891: 
057428,000892: 21,2777           30167                           CA       PRIORITY                              
057429,000893: 21,3000           77746                           MASK     PRIO37                                
057430,000894: 21,3001           55306                           TS       ATTPRIO                               #  SAVE USERS PRIO
057431,000895: 
057432,000896: 21,3002           33006                           CAF      KALEBCON                              #  SET EBANK FOR KALCMAN3
057433,000897: 21,3003           54003                           TS       EBANK                                 
057434,000898: 21,3004           04626                           TC       POSTJUMP                              
057435,000899: 21,3005           44004                           CADR     KALCMAN3                              
057436,000900: 21,3006           03275        KALEBCON           ECADR    BCDU                                  
057437,000901: 

Page 1329

057439,000903:                                                                                                  #  PROGRAM DESCRIPTION
057440,000904:                                                                                                  #  IMU STATUS CHECK ROUTINE R02 (SUBROUTINE UTILITY)
057441,000905:                                                                                                  #  MOD NO - 1
057442,000906:                                                                                                  #  MOD BY - N.BRODEUR
057443,000907:                                                                                                  #  FUNCTIONAL DESCRIPTION
057444,000908: 
057445,000909:                                                                                                  #  TO CHECK WHETHER IMU IS ON AND IF ON WHETHER IT IS ALIGNED TO AN
057446,000910:                                                                                                  #  ORIENTATION KNOWN BY THE CMC. TO REQUEST SELECTION OF THE APPROPRIATE
057447,000911:                                                                                                  #  PROGRAM IF THE IMU IS OFF OR NOT ALIGNED TO AN ORIENTATION KNOWN BY THE
057448,000912:                                                                                                  #  CMC. CALLED THROUGH BANKCALL
057449,000913:                                                                                                  #  CALLING SEQUENCE-
057450,000914: 
057451,000915:                                                                                                  #  L        TC     BANKCALL
057452,000916:                                                                                                  #  L+1      CADR   R02BOTH
057453,000917:                                                                                                  #  SUBROUTINES CALLED
057454,000918: 
057455,000919:                                                                                                  #        VARALARM
057456,000920:                                                                                                  #        FLAGUP
057457,000921:                                                                                                  #  NORMAL EXIT MODES
057458,000922: 
057459,000923:                                                                                                  #  AT L+2 OF CALLING SEQUENCE
057460,000924:                                                                                                  #  ALARM OR ABORT EXIT MODES
057461,000925:                                                                                                  #        GOTOPOOH, WITH ALARM
057462,000926:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
057463,000927: 
057464,000928:                                                                                                  #  NONE
057465,000929:                                                                                                  #  DEBRIS
057466,000930: 
057467,000931:                                                                                                  #  CENTRALS-A,Q,L
057468,000932: 04,2000                                           SETLOC   R02                                   
057469,000933: 04,2000                                           BANK                                           
057470,000934: 04,3256                                           COUNT*   $$/R02                                
057471,000935: 04,3256           00063        DEC51              DEC      51         B-14                       
057472,000936: 
057473,000937: 
057474,000938: 15,2000                                           SETLOC   R02BNK15                              
057475,000939: 15,2000                                           BANK                                           
057476,000940: 
057477,000941: 15,3757           34730        R02BOTH            CAF      REFSMBIT                              
057478,000942: 15,3760           70077                           MASK     FLAGWRD3                              
057479,000943: 15,3761           10000                           CCS      A                                     
057480,000944: 15,3762           03773                           TC       R02ZERO                               #  ZERO IMUS
057481,000945: 
057482,000946: 15,3763           31277                           CA       IMODES30                              
057483,000947: 15,3764           74734                           MASK     BIT9                                  #  IS ISS INITIALIZED
057484,000948: 15,3765           00006                           EXTEND                                         
057485,000949: 15,3766           13770                           BZF      +2                                    
057486,000950: 15,3767           44741                           CS       BIT4                                  #  SEND IMU ALARM CODE 210
057487,000951: 15,3770           63776                           AD       OCT220                                #  SEND REFSMM ALARM
057488,000952: 15,3771           05740                           TC       VARALARM                              
057489,000953: 

Page 1330

057491,000955: 15,3772           06001                           TC       GOTOPOOH                              
057492,000956: 
057493,000957: 15,3773           05506        R02ZERO            TC       UPFLAG                                
057494,000958: 15,3774           00007                           ADRES    IMUSE                                 
057495,000959: 15,3775           14622                           TCF      SWRETURN                              
057496,000960: 15,3776           00220        OCT220             OCT      220                                   
057497,000961: 

Page 1331

057499,000963:                                                                                                  #  PROGRAM DESCRIPTION   P06   10FEB67
057500,000964: 
057501,000965:                                                                                                  #  TRANSFER THE ISS/CMC FROM THE OPERATE TO THE STANDBY CONDITION.
057502,000966: 
057503,000967:                                                                                                  #  THE NORMAL CONDITION OF READINESS OF THE GNCS WHEN NOT IN USE IS STANDBY. IN THIS CONDITION THE IMU
057504,000968:                                                                                                  #  HEATER POWER IS ON. THE IMU OPERATE POWER IS OFF. THE COMPUTER POWER IS ON. THE OPTICS POWER IS OFF. THE
057505,000969:                                                                                                  #  CMC  STANDBY ON THE MAIN AND LEB DISKYS IS ON.
057506,000970: 
057507,000971:                                                                                                  #  CALLING SEQUENCE:
057508,000972:                                                                                                  #           ASTRONAUT REQUEST THROUGH DSKY     V37E 06E.
057509,000973: 
057510,000974:                                                                                                  #  SUBROUTINES CALLED:
057511,000975:                                                                                                  #           GOPERF1
057512,000976:                                                                                                  #           BANKCALL
057513,000977:                                                                                                  #           FLAGDOWN
057514,000978: 

Page 1332

057516,000980:                                                                                                  #  PRESTAND PREPARES FOR STANDBY BY SNAPSHOTTING THE SCALER AND TIME1 TIME2
057517,000981:                                                                                                  #  THE LOW 5 BITS OF THE SCALER ARE INSPECTED TO INSURE COMPATABILITY
057518,000982:                                                                                                  #  BETWEEN THE SCALER READING AND THE TIME1 TIME2 READING.
057519,000983: 
057520,000984: 37,2000                                           SETLOC   P05P06                                
057521,000985: 37,2000                                           BANK                                           
057522,000986: 
057523,000987: 37,3654     0314                                  EBANK=   TIME2SAV                              
057524,000988: 37,3654                                           COUNT*   $$/P06                                
057525,000989: 
057526,000990: 37,3654           05506        P06                TC       UPFLAG                                #  SET NODOV37 BIT
057527,000991: 37,3655           00054                           ADRES    NODOFLAG                              
057528,000992: 
057529,000993: 37,3656           00004        PRESTAND           INHINT                                         
057530,000994: 37,3657           00006                           EXTEND                                         
057531,000995: 37,3660           30025                           DCA      TIME2                                 #  SNAPSHOT TIME1TIME2
057532,000996: 37,3661           52315                           DXCH     TIME2SAV                              
057533,000997: 37,3662           03713                           TC       SCALPREP                              
057534,000998: 37,3663           03656                           TC       PRESTAND                              #  T1,T2,SCALER NOT COMPATIBLE
057535,000999: 37,3664           52155                           DXCH     MPAC                                  #  T1,T2 AND SCALER OK
057536,001000: 37,3665           52317                           DXCH     SCALSAVE                              #  STORE SCALER
057537,001001: 37,3666           00004                           INHINT                                         
057538,001002: 37,3667           04607                           TC       BANKCALL                              
057539,001003: 37,3670           17162                           CADR     RNDREFDR                              #  REFSMM, DRIFT, TRACK FLAGS DOWN
057540,001004: 
057541,001005: 37,3671           05520                           TC       DOWNFLAG                              
057542,001006: 37,3672           00007                           ADRES    IMUSE                                 #  IMUSE DOWN
057543,001007: 37,3673           05520                           TC       DOWNFLAG                              
057544,001008: 37,3674           00010                           ADRES    RNDVZFLG                              #  RNDVZFLG DOWN
057545,001009: 
057546,001010: 37,3675           34732                           CAF      BIT11                                 
057547,001011: 37,3676           00006                           EXTEND                                         
057548,001012: 37,3677           05013                           WOR      CHAN13                                #  SET STANDBY ENABLE BIT
057549,001013: 
057550,001014: 37,3700           05355                           TC       PHASCHNG                              #  SET RESTART TO POSTAND WHEN STANDBY
057551,001015: 37,3701           07024                           OCT      07024                                 #    RECOVERS
057552,001016: 37,3702           20000                           OCT      20000                                 
057553,001017: 37,3703     0316                                  EBANK=   SCALSAVE                              
057554,001018: 37,3703           03733 76060                     2CADR    POSTAND                               
057555,001019: 
057556,001020: 37,3705           34765                           CAF      OCT62                                 
057557,001021: 37,3706           04607                           TC       BANKCALL                              
057558,001022: 37,3707           20635                           CADR     GOPERF1                               
057559,001023: 37,3710           13705                           TCF      -3                                    
057560,001024: 37,3711           13705                           TCF      -4                                    
057561,001025: 37,3712           13705                           TCF      -5                                    
057562,001026: 
057563,001027: 37,3713     4765               OCT62              EQUALS   .5SEC                                 #  DEC 50 = OCT 62
057564,001028: 
057565,001029:                                                                                                  #  THE LOW 5 BITS OF THE SCALER READS 10000 FOR THE FIRST INTERVAL AFTER A

Page 1333

057567,001031:                                                                                                  #  T1 INCREMENT. IF SCALPREP DETECTS THIS INTERVAL THE T1,T2 AND SCALER
057568,001032:                                                                                                  #  DATA ARE NOT COMPATABLE AND RETURN IS TO L+1 FOR ANOTHER READING OF THE
057569,001033:                                                                                                  #  DATA. OTHERWISE, THE RETURN IS TO L+2 TO PROCEED. ROUTINE ALSO PREPARES
057570,001034:                                                                                                  #  THE SCALER READING FOR COMPUTATION OF THE INCREMENT TO UPDATE T1T2. (THE
057571,001035:                                                                                                  #  10 MS BIT (BIT 6) OF THE SCALER IS INCREMENTED 5 MS OUT OF PHASE FROM
057572,001036:                                                                                                  #  T1.) ADDITION OF 5 MS (BIT 5) TO THE SCALER READING HAS THE EFFECT OF
057573,001037:                                                                                                  #  ADJUSTING BIT 6 IN THE SCALER TO BE IN PHASE WITH BIT 1 OF T1. THE LOW 5
057574,001038:                                                                                                  #  BITS OF THE SCALER READING ARE THEN SET TO ZERO, TO TRUNCATE THE SCALER
057575,001039:                                                                                                  #  DATA TO 10 MS. RESULTS ARE STORED IN MPAC, +1.
057576,001040: 
057577,001041: 37,3713           00006        SCALPREP           EXTEND                                         
057578,001042: 37,3714           22156                           QXCH     MPAC       +2                         
057579,001043: 37,3715           04103                           TC       FINETIME   +1                         
057580,001044: 37,3716           00003                           RELINT                                         
057581,001045: 37,3717           52155                           DXCH     MPAC                                  
057582,001046: 37,3720           34740                           CA       BIT5                                  #  ADD 5 MS TO THE SCALER READING.
057583,001047: 37,3721           54001                           TS       L                                     
057584,001048: 37,3722           34746                           CA       ZERO                                  
057585,001049: 37,3723           20155                           DAS      MPAC                                  
057586,001050: 37,3724           44337                           CS       LOW5                                  #  SET LOW 5 BITS OF (SCALER+5MS) TO ZERO
057587,001051: 37,3725           70155                           MASK     MPAC       +1                         #  AND STORE RESULTS IN MPAC,+1.
057588,001052: 37,3726           56155                           XCH      MPAC       +1                         
057589,001053: 37,3727           74337                           MASK     LOW5                                  #  TEST LOW 5 BITS OF SCALER FOR THE FIRST
057590,001054:                                                                                                  #  INTERVAL AFTER THE T1 INCREMENT
057591,001055:                                                                                                  #  (NOW = 00000, SINCE BIT 5 ADDED).
057592,001056: 37,3730           10000                           CCS      A                                     #  IS IT 1ST INTERVAL AFTER T1 INCREMENT
057593,001057: 37,3731           24156                           INCR     MPAC       +2                         #  NO
057594,001058: 37,3732           00156                           TC       MPAC       +2                         #  YES
057595,001059: 
057596,001060:                                                                                                  #  POSTAND RECOVERS TIME AFTER STANDBY.THE SCALER IS SNAPSHOTTED AND THE
057597,001061:                                                                                                  #  TIME1 TIME2 COUNTER IS SET TO ZERO. THE LOW 5 BITS OF THE SCALER ARE
057598,001062:                                                                                                  #  INSPECTED TO INSURE COMPATABILITY BETWEEN THE SCALER READING AND THE
057599,001063:                                                                                                  #  CLEARING OF THE TIME COUNTER. IT THEN COMPUTES THE DIFFERENCE IN SCALER
057600,001064:                                                                                                  #  VALUES (IN DP) AND ADDS THIS TO THE PREVIOUSLY SNAPSHOTTED VALUES OF
057601,001065:                                                                                                  #  TIME1 TIME2 AND PLACES THIS NEW TIME INTO THE TIME1 TIME2 COUNTER.
057602,001066: 
057603,001067: 37,3733                                           COUNT*   $$/P05                                
057604,001068: 
057605,001069: 37,3733           44732        POSTAND            CS       BIT11                                 #  RECOVER TIME AFTER STANDBY.
057606,001070: 37,3734           00006                           EXTEND                                         
057607,001071: 37,3735           03013                           WAND     CHAN13                                #  CLEAR STANDBY ENABLE BIT
057608,001072: 37,3736           00004                           INHINT                                         
057609,001073: 37,3737           34746                           CA       ZERO                                  
057610,001074: 37,3740           54001                           TS       L                                     
057611,001075: 37,3741           52025                           DXCH     TIME2                                 #  CLEAR TIME1TIME2
057612,001076: 37,3742           03713                           TC       SCALPREP                              #  STORE SCALER IN MPAC, MPAC+1
057613,001077: 37,3743           03736                           TC       POSTAND    +3                         #  T1,T2,SCALER NOT COMPATIBLE
057614,001078: 37,3744           00006                           EXTEND                                         #  T1,T2 AND SCALER OK
057615,001079: 37,3745           40317                           DCS      SCALSAVE                              
057616,001080: 37,3746           20155                           DAS      MPAC                                  #  FORM DP DIFFERENCE OF POSTSTANDBY SCALER

Page 1334

057618,001082: 37,3747           34733                           CAF      BIT10                                 #  MINUS PRESTANDBY SCALER AND SHIFT RIGHT
057619,001083: 37,3750           07330                           TC       SHORTMP                               #  5 TO ALIGN BITS WITH TIME1TIME2.
057620,001084: 37,3751           34746                           CAF      ZERO                                  
057621,001085: 37,3752           54156                           TS       MPAC       +2                         #  NEEDED FOR TP AGREE
057622,001086: 37,3753           07300                           TC       TPAGREE                               #  MAKE DP DIFF AGREE
057623,001087: 37,3754           10154                           CCS      MPAC                                  
057624,001088: 37,3755           03762                           TC       POSTCOM                               #  IF DP DIFF NET +, NO SCALER OVERFLOW
057625,001089: 37,3756           03762                           TC       POSTCOM                               #  BETWEEN PRE AND POST STANDBY.
057626,001090: 37,3757           03760                           TC       +1                                    #  IF DP DIFF NET -, SCALER OVERFLOWED. ADD
057627,001091: 37,3760           34733                           CAF      BIT10                                 #  BIT 10 TO HIGH DIFF TO CORRECT.
057628,001092: 37,3761           26154                           ADS      MPAC                                  
057629,001093: 37,3762           00006        POSTCOM            EXTEND                                         #  C(MPAC,+1) IS MAGNITUDE OF DELTA SCALER.
057630,001094: 37,3763           30315                           DCA      TIME2SAV                              #  PRESTANDBY TIME1TIME2
057631,001095: 37,3764           20155                           DAS      MPAC                                  
057632,001096: 37,3765           07300                           TC       TPAGREE                               #  FORCE SIGN AGREEMENT
057633,001097: 37,3766           52155                           DXCH     MPAC                                  #  UPDATED VALUE FOR T1,T2.
057634,001098: 37,3767           20025                           DAS      TIME2                                 #  LOAD UPDATED VALUE INTO T1,T2, WITH
057635,001099: 37,3770           05520                           TC       DOWNFLAG                              #  CLEAR NODOFLAG
057636,001100: 37,3771           00054                           ADRES    NODOFLAG                              
057637,001101: 
057638,001102: 37,3772           06001                           TC       GOTOPOOH                              
057639,001103: 

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