Source Code

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

054958,000002:                                                                                                  ## Copyright:   Public domain.
054959,000003:                                                                                                  ## Filename:    IMU_MODE_SWITCHING_ROUTINES.agc
054960,000004:                                                                                                  ## Purpose:     A section of Luminary 1C, revision 131.
054961,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
054962,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13.
054963,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
054964,000008:                                                                                                  ##              that the code format has been changed to conform to the
054965,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
054966,000010:                                                                                                  ##              original YUL assembler.
054967,000011:                                                                                                  ## Reference:   pp. 1301-1329
054968,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
054969,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
054970,000014:                                                                                                  ## Mod history: 06/05/03 RSB.   Began transcribing.
054971,000015:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
054972,000016:                                                                                                  ##              2010-08-24 JL   Fixed page number comment.
054973,000017:                                                                                                  ##              2010-10-25 JL   Indentation fixes.
054974,000018:                                                                                                  ##              2011-05-07 JL   Removed workaround. Flagged SBANK= workaround
054975,000019:                                                                                                  ##                              for future removal.
054976,000020:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
054977,000021:                                                                                                  ##                              original hardcopy, as opposed to the PDF page
054978,000022:                                                                                                  ##                              numbers in 1701.pdf.
054979,000023:                                                                                                  ##              2017-01-28 RSB  Comment-text fixes identified for Luminary 69.
054980,000024:                                                                                                  ##              2017-02-27 RSB  Proofed comment text using octopus/ProoferComments.
054981,000025:                                                                                                  ##              2017-03-01 RSB  Fixed lingering comment-text typos.
054982,000026:                                                                                                  ##              2017-03-13 RSB  Comment-text fixes noted in proofing Luminary 116.
054983,000027:                                                                                                  ##              2017-03-15 RSB  Comment-text fixes identified in 6-way
054984,000028:                                                                                                  ##                              side-by-side diff of Sunburst 120 and Luminary 
054985,000029:                                                                                                  ##                              69/99/116/131/210.
054986,000030:                                                                                                  ##              2017-06-17 MAS  Globally removed all SBANK= workarounds.
054987,000031: 

Page 1301

054989,000033:    5457                                           BLOCK    02                                    
054990,000034:    4000                                           SETLOC   FFTAG3                                
054991,000035:    4000                                           BANK                                           
054992,000036: 
054993,000037:    5457  E3,1471                                  EBANK=   COMMAND                               
054994,000038: 
054995,000039:                                                                                                  #  FIXED-FIXED ROUTINES.
054996,000040: 
054997,000041:    5457                                           COUNT*   $$/IMODE                              
054998,000042:    5457           34755        ZEROICDU           CAF      ZERO                                  #  ZERO ICDU COUNTERS.
054999,000043:    5460           54032                           TS       CDUX                                  
055000,000044:    5461           54033                           TS       CDUY                                  
055001,000045:    5462           54034                           TS       CDUZ                                  
055002,000046:    5463           00002                           TC       Q                                     
055003,000047: 
055004,000048:    5464     4743               SPSCODE            =        BIT9                                  
055005,000049: 

Page 1302

055007,000051:                                                                                                  #  IMU ZEROING ROUTINE.
055008,000052: 
055009,000053: 11,3774                                           BANK     11                                    
055010,000054: 07,2000                                           SETLOC   MODESW                                
055011,000055: 07,2000                                           BANK                                           
055012,000056: 
055013,000057: 07,2705                                           COUNT*   $$/IMODE                              
055014,000058: 07,2705           00004        IMUZERO            INHINT                                         #  ROUTINE TO ZERO ICDUS.
055015,000059: 07,2706           41035                           CS       DSPTAB     +11D                       #  DONT ZERO CDUS IF IMU IN GIMBAL LOCK AND
055016,000060: 07,2707           74771                           MASK     BITS4&6                               #  COARSE ALIGN (GIMBAL RUNAWAY PROTECTION)
055017,000061: 07,2710           10000                           CCS      A                                     
055018,000062: 07,2711           12715                           TCF      IMUZEROA                              
055019,000063: 
055020,000064: 07,2712           05567                           TC       ALARM                                 #  IF SO.
055021,000065: 07,2713           00206                           OCT      00206                                 
055022,000066: 
055023,000067: 07,2714           13650                           TCF      CAGETSTJ   +4                         #  IMMEDIATE FAILURE.
055024,000068: 
055025,000069: 07,2715           03644        IMUZEROA           TC       CAGETSTJ                              
055026,000070:                                                                                                  #           DELETE
055027,000071: 07,2716           41300                           CS       IMODES33                              #  DISABLE DAP AUTO AND HOLD MODES
055028,000072: 07,2717           74773                           MASK     SUPER011                              #        BIT5 FOR GROUND
055029,000073: 07,2720           27300                           ADS      IMODES33                              
055030,000074: 
055031,000075: 07,2721           41277                           CS       IMODES30                              #  INHIBIT ICDUFAIL AND IMUFAIL (IN CASE WE
055032,000076: 07,2722           75741                           MASK     BITS3&4                               #  JUST CAME OUT OF COARSE ALIGN).
055033,000077: 07,2723           27277                           ADS      IMODES30                              
055034,000078: 
055035,000079: 07,2724           44771                           CS       BITS4&6                               #  SEND ZERO ENCODE WITH COARSE AND ERROR
055036,000080: 07,2725           00006                           EXTEND                                         #  COUNTER DISABLED.
055037,000081: 07,2726           03012                           WAND     CHAN12                                
055038,000082: 
055039,000083: 07,2727           03257                           TC       NOATTOFF                              #  TURN OFF NO ATT LAMP.
055040,000084: 
055041,000085: 07,2730           34747                           CAF      BIT5                                  
055042,000086: 07,2731           00006                           EXTEND                                         
055043,000087: 07,2732           05012                           WOR      CHAN12                                
055044,000088: 
055045,000089: 07,2733           05457                           TC       ZEROICDU                              
055046,000090: 07,2734           34746                           CAF      BIT6                                  #  WAIT 320 MS TO GIVE AGS ADEQUATE TIME TO
055047,000091: 07,2735           05203                           TC       WAITLIST                              #  RECEIVE ITS PULSE TRAIN.
055048,000092: 07,2736  E3,1474                                  EBANK=   CDUIND                                
055049,000093: 07,2736           02750 16103                     2CADR    IMUZERO2                              
055050,000094: 
055051,000095: 07,2740           41277                           CS       IMODES30                              #  SEE IF IMU OPERATING AND ALARM IF NOT.
055052,000096: 07,2741           74743                           MASK     BIT9                                  
055053,000097: 07,2742           10000                           CCS      A                                     
055054,000098: 07,2743           12746                           TCF      MODEEXIT                              

Page 1303

055056,000100: 07,2744           05567                           TC       ALARM                                 
055057,000101: 07,2745           00210                           OCT      210                                   
055058,000102: 
055059,000103: 07,2746           00003        MODEEXIT           RELINT                                         #  GENERAL MODE-SWITCHING EXIT.
055060,000104: 07,2747           14631                           TCF      SWRETURN                              
055061,000105: 
055062,000106: 07,2750           03632        IMUZERO2           TC       CAGETEST                              
055063,000107: 07,2751           05457                           TC       ZEROICDU                              #  ZERO CDUX, CDUY, CDUZ
055064,000108: 
055065,000109: 07,2752           44747                           CS       BIT5                                  #  REMOVE ZERO DISCRETE.
055066,000110: 07,2753           00006                           EXTEND                                         
055067,000111: 07,2754           03012                           WAND     CHAN12                                
055068,000112: 
055069,000113: 07,2755           34741                           CAF      BIT11                                 #  WAIT 10 SECS FOR CTRS TO FIND GIMBALS
055070,000114: 07,2756           05224                           TC       VARDELAY                              
055071,000115: 
055072,000116: 07,2757           03632        IMUZERO3           TC       CAGETEST                              
055073,000117: 07,2760           45741                           CS       BITS3&4                               #  REMOVE IMUFAIL AND ICDUFAIL INHIBIT.
055074,000118: 07,2761           71277                           MASK     IMODES30                              
055075,000119: 07,2762           55277                           TS       IMODES30                              
055076,000120: 
055077,000121: 07,2763           44773                           CS       SUPER011                              #  ENABLE DAP AUTO AND HOLD MODES
055078,000122: 07,2764           71300                           MASK     IMODES33                              #        BIT5 FOR GROUND
055079,000123: 07,2765           55300                           TS       IMODES33                              
055080,000124: 
055081,000125: 07,2766           04674                           TC       IBNKCALL                              #  SET ISS WARNING IF EITHER OF ABOVE ARE
055082,000126: 07,2767           14703                           CADR     SETISSW                               #  PRESENT.
055083,000127: 
055084,000128: 07,2770           13622                           TCF      ENDIMU                                
055085,000129: 

Page 1304

055087,000131:                                                                                                  #  IMU COARSE ALIGN MODE.
055088,000132: 
055089,000133: 07,2771           00004        IMUCOARS           INHINT                                         
055090,000134: 07,2772           03644                           TC       CAGETSTJ                              
055091,000135: 07,2773           03135                           TC       SETCOARS                              
055092,000136: 
055093,000137: 07,2774           36245                           CAF      SIX                                   
055094,000138: 07,2775           05203                           TC       WAITLIST                              
055095,000139: 07,2776  E3,1474                                  EBANK=   CDUIND                                
055096,000140: 07,2776           03001 16103                     2CADR    COARS                                 
055097,000141: 
055098,000142: 07,3000           12746                           TCF      MODEEXIT                              
055099,000143: 
055100,000144: 07,3001           03632        COARS              TC       CAGETEST                              
055101,000145: 07,3002           34746                           CAF      BIT6                                  #  ENABLE ALL THREE ISS CDU ERROR COUNTERS
055102,000146: 07,3003           00006                           EXTEND                                         
055103,000147: 07,3004           05012                           WOR      CHAN12                                
055104,000148: 
055105,000149: 07,3005           34752                           CAF      TWO                                   #  SET CDU INDICATOR
055106,000150: 07,3006           55474        COARS1             TS       CDUIND                                
055107,000151: 
055108,000152: 07,3007           51474                           INDEX    CDUIND                                #  COMPUTE THETAD - THETAA IN 1:S
055109,000153: 07,3010           30321                           CA       THETAD                                #        COMPLEMENT FORM
055110,000154: 07,3011           00006                           EXTEND                                         
055111,000155: 07,3012           51474                           INDEX    CDUIND                                
055112,000156: 07,3013           20032                           MSU      CDUX                                  
055113,000157: 07,3014           00006                           EXTEND                                         
055114,000158: 07,3015           74737                           MP       BIT13                                 #  SHIFT RIGHT 2
055115,000159: 07,3016           56001                           XCH      L                                     #  ROUND
055116,000160: 07,3017           60000                           DOUBLE                                         
055117,000161: 07,3020           54061                           TS       ITEMP1                                
055118,000162: 07,3021           13023                           TCF      +2                                    
055119,000163: 07,3022           26001                           ADS      L                                     
055120,000164: 
055121,000165: 07,3023           51474                           INDEX    CDUIND                                #  DIFFERENCE TO BE COMPUTED
055122,000166: 07,3024           23471                           LXCH     COMMAND                               
055123,000167: 07,3025           11474                           CCS      CDUIND                                
055124,000168: 07,3026           03006                           TC       COARS1                                
055125,000169: 
055126,000170: 07,3027           34752                           CAF      TWO                                   #  MINIMUM OF 4 MS WAIT
055127,000171: 07,3030           05224                           TC       VARDELAY                              
055128,000172: 

Page 1305

055130,000174: 07,3031           03632        COARS2             TC       CAGETEST                              #  DONT CONTINUE IF CAGED.
055131,000175: 07,3032           54061                           TS       ITEMP1                                #  SETS TO +0.
055132,000176: 07,3033           34752                           CAF      TWO                                   #  SET CDU INDICATOR
055133,000177: 07,3034           55474                 +3        TS       CDUIND                                
055134,000178: 
055135,000179: 07,3035           51474                           INDEX    CDUIND                                
055136,000180: 07,3036           11471                           CCS      COMMAND                               #  NUMBER OF PULSES REQUIRED
055137,000181: 07,3037           03043                           TC       COMPOS                                #  GREATER THAN MAX ALLOWED
055138,000182: 07,3040           03052                           TC       NEXTCDU    +1                         
055139,000183: 07,3041           03110                           TC       COMNEG                                
055140,000184: 07,3042           03052                           TC       NEXTCDU    +1                         
055141,000185: 
055142,000186: 07,3043           63736        COMPOS             AD       -COMMAX                               #  COMMAX = MAX NUMBER OF PULSES ALLOWED
055143,000187: 07,3044           00006                           EXTEND                                         #        MINUS ONE
055144,000188: 07,3045           63120                           BZMF     COMZERO                               
055145,000189: 07,3046           51474                           INDEX    CDUIND                                
055146,000190: 07,3047           55471                           TS       COMMAND                               #  REDUCE COMMAND BY MAX NUMBER OF PULSES
055147,000191: 07,3050           43737                           CS       -COMMAX-                              #        ALLOWED
055148,000192: 
055149,000193: 07,3051           24061        NEXTCDU            INCR     ITEMP1                                
055150,000194: 07,3052           64754                           AD       NEG0                                  
055151,000195: 07,3053           51474                           INDEX    CDUIND                                
055152,000196: 07,3054           54050                           TS       CDUXCMD                               #  SET UP COMMAND REGISTER.
055153,000197: 
055154,000198: 07,3055           11474                           CCS      CDUIND                                
055155,000199: 07,3056           03034                           TC       COARS2     +3                         
055156,000200: 
055157,000201: 07,3057           10061                           CCS      ITEMP1                                #  SEE IF ANY PULSES TO GO OUT.
055158,000202: 07,3060           13124                           TCF      SENDPULS                              
055159,000203: 
055160,000204: 07,3061           05221                           TC       FIXDELAY                              #  WAIT FOR GIMBALS TO SETTLE.
055161,000205: 07,3062           00226                           DEC      150        B-14                       
055162,000206: 
055163,000207: 07,3063           34752                           CAF      TWO                                   #  AT END OF COMMAND, CHECK TO SEE THAT
055164,000208: 07,3064           54061        CHKCORS            TS       ITEMP1                                #  GIMBALS ARE WITHIN 2 DEGREES OF THETAD.
055165,000209: 07,3065           50000                           INDEX    A                                     
055166,000210: 07,3066           30032                           CA       CDUX                                  
055167,000211: 07,3067           00006                           EXTEND                                         
055168,000212: 07,3070           50061                           INDEX    ITEMP1                                
055169,000213: 07,3071           20321                           MSU      THETAD                                
055170,000214: 07,3072           10000                           CCS      A                                     
055171,000215: 07,3073           13101                           TCF      COARSERR                              
055172,000216: 07,3074           13076                           TCF      CORSCHK2                              
055173,000217: 07,3075           13101                           TCF      COARSERR                              
055174,000218: 

Page 1306

055176,000220: 07,3076           10061        CORSCHK2           CCS      ITEMP1                                
055177,000221: 07,3077           13064                           TCF      CHKCORS                               
055178,000222: 07,3100           13622                           TCF      ENDIMU                                #  END OF COARSE ALIGNMENT.
055179,000223: 
055180,000224: 07,3101           63107        COARSERR           AD       COARSTOL                              #  2 DEGREES.
055181,000225: 07,3102           00006                           EXTEND                                         
055182,000226: 07,3103           63076                           BZMF     CORSCHK2                              
055183,000227: 
055184,000228: 07,3104           05567                           TC       ALARM                                 #  COARSE ALIGN ERROR.
055185,000229: 07,3105           00211                           OCT      211                                   
055186,000230: 
055187,000231: 07,3106           13630                           TCF      IMUBAD                                
055188,000232: 
055189,000233: 07,3107           77511        COARSTOL           DEC      -.01111                               #  2 DEGREES SCALED AT HALF-REVOLUTIONS
055190,000234: 
055191,000235: 07,3110           63736        COMNEG             AD       -COMMAX                               
055192,000236: 07,3111           00006                           EXTEND                                         
055193,000237: 07,3112           63120                           BZMF     COMZERO                               
055194,000238: 07,3113           40000                           COM                                            
055195,000239: 07,3114           51474                           INDEX    CDUIND                                
055196,000240: 07,3115           55471                           TS       COMMAND                               
055197,000241: 07,3116           33737                           CA       -COMMAX-                              
055198,000242: 07,3117           03051                           TC       NEXTCDU                               
055199,000243: 
055200,000244: 07,3120           34755        COMZERO            CAF      ZERO                                  
055201,000245: 07,3121           51474                           INDEX    CDUIND                                
055202,000246: 07,3122           57471                           XCH      COMMAND                               
055203,000247: 07,3123           03051                           TC       NEXTCDU                               
055204,000248: 
055205,000249: 07,3124           37743        SENDPULS           CAF      13,14,15                              
055206,000250: 07,3125           00006                           EXTEND                                         
055207,000251: 07,3126           05014                           WOR      CHAN14                                
055208,000252: 07,3127           33740                           CAF      600MS                                 
055209,000253: 07,3130           13030                           TCF      COARS2     -1                         #  THEN TO VARDELAY
055210,000254: 
055211,000255: 07,3131           34746        CA+ECE             CAF      BIT6                                  #  ENABLE ALL THREE ISS CDU ERROR COUNTERS
055212,000256: 07,3132           00006                           EXTEND                                         
055213,000257: 07,3133           05012                           WOR      CHAN12                                
055214,000258: 07,3134           05261                           TC       TASKOVER                              
055215,000259: 

Page 1307

055217,000261: 07,3135           34750        SETCOARS           CAF      BIT4                                  #  BYPASS IF ALREADY IN COARSE ALIGN
055218,000262: 07,3136           00006                           EXTEND                                         
055219,000263: 07,3137           02012                           RAND     CHAN12                                
055220,000264: 07,3140           10000                           CCS      A                                     
055221,000265: 07,3141           00002                           TC       Q                                     
055222,000266: 
055223,000267: 07,3142           44746                           CS       BIT6                                  #  CLEAR ISS ERROR COUNTERS
055224,000268: 07,3143           00006                           EXTEND                                         
055225,000269: 07,3144           03012                           WAND     CHAN12                                
055226,000270: 
055227,000271: 07,3145           44742                           CS       BIT10                                 #  KNOCK DOWN GYRO ACTIVITY
055228,000272: 07,3146           00006                           EXTEND                                         
055229,000273: 07,3147           03014                           WAND     CHAN14                                
055230,000274: 07,3150           44755                           CS       ZERO                                  
055231,000275: 07,3151           54047                           TS       GYROCMD                               
055232,000276: 
055233,000277: 07,3152           34750                           CAF      BIT4                                  #  PUT ISS IN COARSE ALIGN
055234,000278: 07,3153           00006                           EXTEND                                         
055235,000279: 07,3154           05012                           WOR      CHAN12                                
055236,000280: 
055237,000281: 07,3155           41035                           CS       DSPTAB     +11D                       #  TURN ON NO ATT LAMP
055238,000282: 07,3156           73200                           MASK     OCT40010                              
055239,000283: 07,3157           27035                           ADS      DSPTAB     +11D                       
055240,000284: 
055241,000285: 07,3160           41300                           CS       IMODES33                              #  DISABLE DAP AUTO AND HOLD MODES
055242,000286: 07,3161           74746                           MASK     BIT6                                  
055243,000287: 07,3162           27300                           ADS      IMODES33                              
055244,000288: 
055245,000289: 07,3163           41277                           CS       IMODES30                              #  DISABLE IMUFAIL
055246,000290: 07,3164           74750                           MASK     BIT4                                  
055247,000291: 07,3165           27277                           ADS      IMODES30                              
055248,000292: 
055249,000293: 07,3166           44747        RNDREFDR           CS       TRACKBIT                              #  CLEAR TRACK FLAG
055250,000294: 07,3167           70075                           MASK     FLAGWRD1                              
055251,000295: 07,3170           54075                           TS       FLAGWRD1                              
055252,000296: 
055253,000297: 07,3171           44735                           CS       DRFTBIT                               #  CLEAR DRIFT FLAG
055254,000298: 07,3172           70076                           MASK     FLAGWRD2                              
055255,000299: 07,3173           54076                           TS       FLAGWRD2                              
055256,000300: 
055257,000301: 07,3174           44737                           CS       REFSMBIT                              #  CLEAR REFSMMAT FLAG
055258,000302: 07,3175           70077                           MASK     FLAGWRD3                              
055259,000303: 07,3176           54077                           TS       FLAGWRD3                              
055260,000304: 
055261,000305: 07,3177           00002                           TC       Q                                     
055262,000306: 
055263,000307: 07,3200           40010        OCT40010           OCT      40010                                 
055264,000308: 

Page 1308

055266,000310:                                                                                                  #  IMU FINE ALIGN MODE SWITCH.
055267,000311: 
055268,000312: 07,3201           00004        IMUFINE            INHINT                                         
055269,000313: 07,3202           03644                           TC       CAGETSTJ                              #  SEE IF IMU BEING CAGED.
055270,000314: 
055271,000315: 07,3203           43735                           CS       BITS4-5                               #  RESET ZERO AND COARSE
055272,000316: 07,3204           00006                           EXTEND                                         
055273,000317: 07,3205           03012                           WAND     CHAN12                                
055274,000318: 
055275,000319: 07,3206           44746                           CS       BIT6                                  #  INSURE DAP AUTO AND HOLD MODES ENABLED
055276,000320: 07,3207           71300                           MASK     IMODES33                              
055277,000321: 07,3210           55300                           TS       IMODES33                              
055278,000322: 
055279,000323: 07,3211           03257                           TC       NOATTOFF                              
055280,000324: 
055281,000325: 07,3212           34742                           CAF      BIT10                                 #  IMU FAIL WAS INHIBITED DURING THE
055282,000326: 07,3213           05203                           TC       WAITLIST                              #  PRESUMABLY PRECEDING COARSE ALIGN.  LEAVE
055283,000327: 07,3214  E3,1474                                  EBANK=   CDUIND                                
055284,000328: 07,3214           03225 16103                     2CADR    IFAILOK                               #  IT ON FOR THE FIRST 5 SECS OF FINE ALIGN
055285,000329: 
055286,000330: 07,3216           35000                           CAF      2SECS                                 
055287,000331: 07,3217           05203                           TC       WAITLIST                              
055288,000332: 07,3220  E3,1474                                  EBANK=   CDUIND                                
055289,000333: 07,3220           03223 16103                     2CADR    IMUFINED                              
055290,000334: 
055291,000335: 07,3222           12746                           TCF      MODEEXIT                              
055292,000336: 
055293,000337: 07,3223           03632        IMUFINED           TC       CAGETEST                              #  SEE THAT NO ONE HAS CAGED THE IMU.
055294,000338: 07,3224           13622                           TCF      ENDIMU                                
055295,000339: 

Page 1309

055297,000341: 07,3225           03637        IFAILOK            TC       CAGETSTQ                              #  ENABLE IMU FIAL UNLESS IMU BEING CAGED.
055298,000342: 07,3226           15261                           TCF      TASKOVER                              #  IT IS.
055299,000343: 
055300,000344: 07,3227           34750                           CAF      BIT4                                  #  DONT RESET IMU FAIL INHIBIT IF SOMEONE
055301,000345: 07,3230           00006                           EXTEND                                         #  HAS GONE INTO COARSE ALIGN.
055302,000346: 07,3231           02012                           RAND     CHAN12                                
055303,000347: 07,3232           10000                           CCS      A                                     
055304,000348: 07,3233           15261                           TCF      TASKOVER                              
055305,000349: 
055306,000350: 07,3234           41277                           CS       IMODES30                              #  RESET IMUFAIL.
055307,000351: 07,3235           74737                           MASK     BIT13                                 
055308,000352: 07,3236           27277                           ADS      IMODES30                              
055309,000353: 07,3237           44750                           CS       BIT4                                  
055310,000354: 07,3240           71277        PFAILOK2           MASK     IMODES30                              
055311,000355: 07,3241           55277                           TS       IMODES30                              
055312,000356: 07,3242           04674                           TC       IBNKCALL                              #  THE ISS WARNING LIGHT MAY COME ON NOW
055313,000357: 07,3243           14703                           CADR     SETISSW                               #  THAT THE INHIBIT HAS BEEN REMOVED.
055314,000358: 07,3244           15261                           TCF      TASKOVER                              
055315,000359: 
055316,000360: 07,3245           03637        PFAILOK            TC       CAGETSTQ                              #  ENABLE PIP FAIL PROG ALARM.
055317,000361: 07,3246           15261                           TCF      TASKOVER                              
055318,000362: 
055319,000363: 07,3247           41277                           CS       IMODES30                              #  RESET IMU AND PIPA FAIL BITS.
055320,000364: 07,3250           74742                           MASK     BIT10                                 
055321,000365: 07,3251           27277                           ADS      IMODES30                              
055322,000366: 
055323,000367: 07,3252           41300                           CS       IMODES33                              
055324,000368: 07,3253           74737                           MASK     BIT13                                 
055325,000369: 07,3254           27300                           ADS      IMODES33                              
055326,000370: 
055327,000371: 07,3255           44747                           CS       BIT5                                  
055328,000372: 07,3256           13240                           TCF      PFAILOK2                              
055329,000373: 
055330,000374: 07,3257           43200        NOATTOFF           CS       OCT40010                              #  SUBROUTINE TO TURN OFF NO ATT LAMP.
055331,000375: 07,3260           71035                           MASK     DSPTAB     +11D                       
055332,000376: 07,3261           64735                           AD       BIT15                                 
055333,000377: 07,3262           55035                           TS       DSPTAB     +11D                       
055334,000378: 07,3263           00002                           TC       Q                                     
055335,000379: 

Page 1310

055337,000381:                                                                                                  #  ROUITNES TO INITIATE AND TERMINATE PROGRAM USE OF THE PIPAS.  NO IMUSTALL REQUIRED IN EITHER CASE.
055338,000382: 
055339,000383: 07,3264           44755        PIPUSE             CS       ZERO                                  
055340,000384: 07,3265           54037                           TS       PIPAX                                 
055341,000385: 07,3266           54040                           TS       PIPAY                                 
055342,000386: 07,3267           54041                           TS       PIPAZ                                 
055343,000387: 
055344,000388: 07,3270           03637        PIPUSE1            TC       CAGETSTQ                              #  DO NOT ENABLE PIPA FAIL IF IMU IS CAGED
055345,000389: 07,3271           14631                           TCF      SWRETURN                              
055346,000390: 
055347,000391: 07,3272           00004                           INHINT                                         
055348,000392: 07,3273           44753                           CS       BIT1                                  #  IF PIPA FAILS FROM NOW ON (UNTIL
055349,000393: 07,3274           71277                           MASK     IMODES30                              #  PIPFREE), LIGHT ISS WARNING.
055350,000394: 07,3275           55277                           TS       IMODES30                              
055351,000395: 
055352,000396: 07,3276           04674        PIPFREE2           TC       IBNKCALL                              #  ISS WARNING MIGHT COME ON NOW.
055353,000397: 07,3277           14703                           CADR     SETISSW                               #  (OR GO OFF ON PIPFREE).
055354,000398: 
055355,000399: 07,3300           12746                           TCF      MODEEXIT                              
055356,000400: 
055357,000401: 07,3301           00004        PIPFREE            INHINT                                         #  PROGRAM DONE WITH PIPAS.  DONT LIGHT
055358,000402: 07,3302           41277                           CS       IMODES30                              #  ISS WARNING.
055359,000403: 07,3303           74753                           MASK     BIT1                                  
055360,000404: 07,3304           27277                           ADS      IMODES30                              
055361,000405: 
055362,000406: 07,3305           74742                           MASK     BIT10                                 #  IF PIP FAIL ON, DO PROG ALSRM AND RESET
055363,000407: 07,3306           10000                           CCS      A                                     #  ISS WARNING.
055364,000408: 07,3307           12746                           TCF      MODEEXIT                              
055365,000409: 
055366,000410: 07,3310           05567                           TC       ALARM                                 
055367,000411: 07,3311           00212                           OCT      212                                   
055368,000412: 
055369,000413: 07,3312           00004                           INHINT                                         
055370,000414: 
055371,000415: 07,3313           13276                           TCF      PIPFREE2                              
055372,000416: 

Page 1311

055374,000418:                                                                                                  #  THE FOLLOWING ROUTINE TORQUES THE IRIGS ACCORDING TO DOUBLE PRECISION INPUTS IN THE SIX REGISTERS
055375,000419:                                                                                                  #  BEGINNING AT THE ECADR ARRIVING IN A.  THE MINIMUM SIZE OF ANY PULSE TRAIN IS 16 PULSES (.25 CDU COUNTS).  THE
055376,000420:                                                                                                  #  UNSENT PORTION OF THE COMMAND IS LEFT INTACT IN THE INPUT COMMAND REGISTERS.
055377,000421: 
055378,000422: 07,3314  E3,1400                                  EBANK=   1400                                  #  VARIABLE, ACTUALLY.
055379,000423: 
055380,000424: 07,3314           54161        IMUPULSE           TS       MPAC       +5                         #  SAVE ARRIVING ECADR.
055381,000425: 07,3315           03644                           TC       CAGETSTJ                              #  DONT PROCEED IF IMU BEING CAGED.
055382,000426: 
055383,000427: 07,3316           11311                           CCS      LGYRO                                 #  SEE IF GYROS BUSY.
055384,000428: 07,3317           03360                           TC       GYROBUSY                              #  SLEEP.
055385,000429: 
055386,000430: 07,3320           54156                           TS       MPAC       +2                         
055387,000431: 07,3321           34746                           CAF      BIT6                                  #  ENABLE THE POWER SUPPLY.
055388,000432: 07,3322           00006                           EXTEND                                         
055389,000433: 07,3323           05014                           WOR      CHAN14                                
055390,000434: 
055391,000435: 07,3324           34751                           CAF      FOUR                                  
055392,000436: 07,3325           05203        GWAKE2             TC       WAITLIST                              #  (IF A JOB WAS PUT TO SLEEP, THE POWER
055393,000437: 07,3326  E3,1474                                  EBANK=   CDUIND                                #  SUPPLY IS LEFT ON BY THE WAKING JOB).
055394,000438: 07,3326           03376 16103                     2CADR    STRTGYRO                              
055395,000439: 
055396,000440: 07,3330           30161                           CA       MPAC       +5                         #  SET UP EBANK, SAVING CALLER'S EBANK FOR
055397,000441: 07,3331           56003                           XCH      EBANK                                 #  RESTORATION ON RETURN.
055398,000442: 07,3332           56161                           XCH      MPAC       +5                         
055399,000443: 07,3333           55311                           TS       LGYRO                                 #  RESERVES GYROS.
055400,000444: 07,3334           74357                           MASK     LOW8                                  
055401,000445: 07,3335           54061                           TS       ITEMP1                                
055402,000446: 
055403,000447: 07,3336           34752                           CAF      TWO                                   #  FORCE SIGN AGREEMENT ON INPUTS.
055404,000448: 07,3337           54157        GYROAGRE           TS       MPAC       +3                         
055405,000449: 07,3340           60000                           DOUBLE                                         
055406,000450: 07,3341           60061                           AD       ITEMP1                                
055407,000451: 07,3342           54160                           TS       MPAC       +4                         
055408,000452: 07,3343           00006                           EXTEND                                         
055409,000453: 07,3344           50000                           INDEX    A                                     
055410,000454: 07,3345           31401                           DCA      1400                                  
055411,000455: 07,3346           52155                           DXCH     MPAC                                  
055412,000456: 07,3347           07262                           TC       TPAGREE                               
055413,000457: 07,3350           52155                           DXCH     MPAC                                  
055414,000458: 07,3351           50160                           INDEX    MPAC       +4                         
055415,000459: 07,3352           53401                           DXCH     1400                                  
055416,000460: 
055417,000461: 07,3353           10157                           CCS      MPAC       +3                         
055418,000462: 07,3354           13337                           TCF      GYROAGRE                              
055419,000463: 
055420,000464: 07,3355           30161                           CA       MPAC       +5                         #  RESTORE CALLER'S EBANK.
055421,000465: 07,3356           54003                           TS       EBANK                                 
055422,000466: 07,3357           12746                           TCF      MODEEXIT                              
055423,000467: 

Page 1312

055425,000469:                                                                                                  #  ROUTINES TO ALLOW TORQUING BY ONLY ONE JOB AT A TIME.
055426,000470: 
055427,000471: 07,3360           00006        GYROBUSY           EXTEND                                         #  SAVE RETURN 2FCADR.
055428,000472: 07,3361           30134                           DCA      BUF2                                  
055429,000473: 07,3362           52155                           DXCH     MPAC                                  
055430,000474: 07,3363           33375        REGSLEEP           CAF      LGWAKE                                
055431,000475: 07,3364           15133                           TCF      JOBSLEEP                              
055432,000476: 
055433,000477: 07,3365           11311        GWAKE              CCS      LGYRO                                 #  WHEN AWAKENED, SEE IF GYROS STILL BUSY.
055434,000478: 07,3366           13363                           TCF      REGSLEEP                              #  IF SO, SLEEP SOME MORE.
055435,000479: 
055436,000480: 07,3367           54156                           TS       MPAC       +2                         
055437,000481: 07,3370           00006                           EXTEND                                         
055438,000482: 07,3371           30155                           DCA      MPAC                                  
055439,000483: 07,3372           52134                           DXCH     BUF2                                  #  RESTORE SWRETURN INFO.
055440,000484: 07,3373           34753                           CAF      ONE                                   
055441,000485: 07,3374           13325                           TCF      GWAKE2                                
055442,000486: 
055443,000487: 07,3375           17365        LGWAKE             CADR     GWAKE                                 
055444,000488: 

Page 1313

055446,000490:                                                                                                  #  GYRO-TORQUING WAITLIST TASKS.
055447,000491: 
055448,000492: 07,3376           43617        STRTGYRO           CS       GDESELCT                              #  DE-SELECT LAST GYRO.
055449,000493: 07,3377           00006                           EXTEND                                         
055450,000494: 07,3400           03014                           WAND     CHAN14                                
055451,000495: 
055452,000496: 07,3401           03632                           TC       CAGETEST                              
055453,000497: 
055454,000498: 07,3402           31311        STRTGYR2           CA       LGYRO                                 #  JUMP ON PHASE COUNTER IN BITS 13-14.
055455,000499: 07,3403           00006                           EXTEND                                         
055456,000500: 07,3404           74750                           MP       BIT4                                  
055457,000501: 07,3405           50000                           INDEX    A                                     
055458,000502: 07,3406           13407                           TCF      +1                                    
055459,000503: 07,3407           03424                           TC       GSELECT                               #  =0.  DO Y GYRO.
055460,000504: 07,3410           00202                           OCT      00202                                 
055461,000505: 
055462,000506: 07,3411           03424                           TC       GSELECT                               #  =1.  DO Z GYRO.
055463,000507: 07,3412           00302                           OCT      00302                                 
055464,000508: 
055465,000509: 07,3413           03422                           TC       GSELECT    -2                         #  =2.  DO X GYRO.
055466,000510: 07,3414           00100                           OCT      00100                                 
055467,000511: 
055468,000512: 07,3415           34755                           CAF      ZERO                                  #  =3.  DONE
055469,000513: 07,3416           55311                           TS       LGYRO                                 
055470,000514: 07,3417           33375                           CAF      LGWAKE                                #  WAKE A POSSIBLE SLEEPING JOB.
055471,000515: 07,3420           05137                           TC       JOBWAKE                               
055472,000516: 
055473,000517: 07,3421           13223        NORESET            TCF      IMUFINED                              #  DO NOT RESET POWER SUPPLY

Page 1314

055475,000519: 07,3422           44751                 -2        CS       FOUR                                  #  SPECIAL ENTRY TO REGRESS LGYRO FOR X.
055476,000520: 07,3423           27311                           ADS      LGYRO                                 
055477,000521: 
055478,000522: 07,3424           50002        GSELECT            INDEX    Q                                     #  SELECT GYRO.
055479,000523: 07,3425           30000                           CAF      0                                     #  PACKED WORD CONTAINS GYRO SELECT BITS
055480,000524: 07,3426           54064                           TS       ITEMP4                                #  AND INCREMENT TO LGYRO.
055481,000525: 07,3427           74757                           MASK     SEVEN                                 
055482,000526: 07,3430           64737                           AD       BIT13                                 
055483,000527: 07,3431           27311                           ADS      LGYRO                                 
055484,000528: 07,3432           54003                           TS       EBANK                                 
055485,000529: 07,3433           74357                           MASK     LOW8                                  
055486,000530: 07,3434           54061                           TS       ITEMP1                                
055487,000531: 
055488,000532: 07,3435           44757                           CS       SEVEN                                 
055489,000533: 07,3436           70064                           MASK     ITEMP4                                
055490,000534: 07,3437           54064                           TS       ITEMP4                                
055491,000535: 
055492,000536: 07,3440           00006                           EXTEND                                         #  MOVE DP COMMAND TO RUPTREGS FOR TESTING.
055493,000537: 07,3441           50061                           INDEX    ITEMP1                                
055494,000538: 07,3442           31401                           DCA      1400                                  
055495,000539: 07,3443           52071                           DXCH     RUPTREG1                              
055496,000540: 
055497,000541: 07,3444           10070                           CCS      RUPTREG1                              
055498,000542: 07,3445           13460                           TCF      MAJ+                                  
055499,000543: 07,3446           13450                           TCF      +2                                    
055500,000544: 07,3447           13600                           TCF      MAJ-                                  
055501,000545: 
055502,000546: 07,3450           10071                           CCS      RUPTREG2                              
055503,000547: 07,3451           13455                           TCF      MIN+                                  
055504,000548: 07,3452           13402                           TCF      STRTGYR2                              
055505,000549: 07,3453           13575                           TCF      MIN-                                  
055506,000550: 07,3454           13402                           TCF      STRTGYR2                              
055507,000551: 

Page 1315

055509,000553: 07,3455           63511        MIN+               AD       -GYROMIN                              #  SMALL POSITIVE COMMAND.  SEE IF AT LEAST
055510,000554: 07,3456           00006                           EXTEND                                         #  16 GYRO PULSES.
055511,000555: 07,3457           63402                           BZMF     STRTGYR2                              
055512,000556: 
055513,000557: 07,3460           00006        MAJ+               EXTEND                                         #  DEFINITE POSITIVE OUTPUT.
055514,000558: 07,3461           33621                           DCA      GYROFRAC                              
055515,000559: 07,3462           20071                           DAS      RUPTREG1                              
055516,000560: 
055517,000561: 07,3463           30064                           CA       ITEMP4                                #  SELECT POSITIVE TORQUING FOR THIS GYRO.
055518,000562: 07,3464           00006                           EXTEND                                         
055519,000563: 07,3465           05014                           WOR      CHAN14                                
055520,000564: 
055521,000565: 07,3466           36077                           CAF      LOW7                                  #  LEAVE NUMBER OF POSSIBLE 8192 AUGMENTS
055522,000566: 07,3467           70071                           MASK     RUPTREG2                              #  TO INITIAL COMMAND IN MAJOR PART OF LONG
055523,000567: 07,3470           56071                           XCH      RUPTREG2                              #  TERM STORAGE AND TRUNCATED FRACTION
055524,000568: 07,3471           00006        GMERGE             EXTEND                                         #  IN MINOR PART.  THE MAJOR PART WILL BE
055525,000569: 07,3472           74744                           MP       BIT8                                  #  COUNTED DOWN TO ZERO IN THE COURSE OF
055526,000570: 07,3473           54062                           TS       ITEMP2                                #  PUTTING OUT THE ENTIRE COMMAND.
055527,000571: 07,3474           30070                           CA       RUPTREG1                              
055528,000572: 07,3475           00006                           EXTEND                                         
055529,000573: 07,3476           74743                           MP       BIT9                                  
055530,000574: 07,3477           54070                           TS       RUPTREG1                              
055531,000575: 07,3500           30001                           CA       L                                     
055532,000576: 07,3501           00006                           EXTEND                                         
055533,000577: 07,3502           74736                           MP       BIT14                                 
055534,000578: 07,3503           26062                           ADS      ITEMP2                                #  INITIAL COMMAND.
055535,000579: 
055536,000580: 07,3504           00006                           EXTEND                                         #  SEE IF MORE THAN ONE PULSE TRAIN NEEDED
055537,000581: 07,3505           30071                           DCA      RUPTREG1                              #  (MORE THAN 16383 PULSES).
055538,000582: 07,3506           67752                           AD       MINUS1                                
055539,000583: 07,3507           10000                           CCS      A                                     
055540,000584: 07,3510           13534                           TCF      LONGGYRO                              
055541,000585: 07,3511           77601        -GYROMIN           OCT      -176                                  #  MAY BE ADJUSTED TO SPECIFY MINIMUM CMD
055542,000586: 07,3512           13516                           TCF      +4                                    
055543,000587: 
055544,000588: 07,3513           34736                           CAF      BIT14                                 
055545,000589: 07,3514           26062                           ADS      ITEMP2                                
055546,000590: 07,3515           34755                           CAF      ZERO                                  
055547,000591: 
055548,000592: 07,3516           50061                 +4        INDEX    ITEMP1                                
055549,000593: 07,3517           53401                           DXCH     1400                                  

Page 1316

055551,000595: 07,3520           30062                           CA       ITEMP2                                #  ENTIRE COMMAND.
055552,000596: 07,3521           54047        LASTSEG            TS       GYROCMD                               
055553,000597: 07,3522           00006                           EXTEND                                         
055554,000598: 07,3523           74742                           MP       BIT10                                 #  WAITLIST DT
055555,000599: 07,3524           66250                           AD       THREE                                 #  TRUNCATION AND PHASE UNCERTAINTIES.
055556,000600: 07,3525           05203                           TC       WAITLIST                              
055557,000601: 07,3526  E3,1474                                  EBANK=   CDUIND                                
055558,000602: 07,3526           03376 16103                     2CADR    STRTGYRO                              
055559,000603: 
055560,000604: 07,3530           34742        GYROEXIT           CAF      BIT10                                 
055561,000605: 07,3531           00006                           EXTEND                                         
055562,000606: 07,3532           05014                           WOR      CHAN14                                
055563,000607: 07,3533           15261                           TCF      TASKOVER                              
055564,000608: 
055565,000609: 07,3534           50061        LONGGYRO           INDEX    ITEMP1                                
055566,000610: 07,3535           53401                           DXCH     1400                                  #  INITIAL COMMAND OUT PLUS N AUGMENTS OF
055567,000611: 07,3536           34736                           CAF      BIT14                                 #  8192.  INITIAL COMMAND IS AT LEAST 8192.
055568,000612: 07,3537           60062                           AD       ITEMP2                                
055569,000613: 07,3540           54047                           TS       GYROCMD                               
055570,000614: 
055571,000615: 07,3541           00006        AUG3               EXTEND                                         #  GET WAITLIST DT TO TIME WHEN TRAIN IS
055572,000616: 07,3542           74742                           MP       BIT10                                 #  ALMOST OUT.
055573,000617: 07,3543           67750                           AD       NEG3                                  
055574,000618: 07,3544           05203                           TC       WAITLIST                              
055575,000619: 07,3545  E3,1474                                  EBANK=   CDUIND                                
055576,000620: 07,3545           03550 16103                     2CADR    8192AUG                               
055577,000621: 
055578,000622: 07,3547           13530                           TCF      GYROEXIT                              
055579,000623: 
055580,000624: 07,3550           03632        8192AUG            TC       CAGETEST                              
055581,000625: 
055582,000626: 07,3551           34750                           CAF      BIT4                                  
055583,000627: 07,3552           00006                           EXTEND                                         
055584,000628: 07,3553           02012                           RAND     CHAN12                                
055585,000629: 07,3554           10000                           CCS      A                                     
055586,000630: 07,3555           13630                           TCF      IMUBAD                                
055587,000631: 07,3556           31311                           CA       LGYRO                                 #  ADD 8192 PULSES TO GYROCMD
055588,000632: 07,3557           54003                           TS       EBANK                                 
055589,000633: 07,3560           74357                           MASK     LOW8                                  
055590,000634: 07,3561           54061                           TS       ITEMP1                                
055591,000635: 
055592,000636: 07,3562           50061                           INDEX    ITEMP1                                #  SEE IF THIS IS THE LAST AUG.
055593,000637: 07,3563           11400                           CCS      1400                                  
055594,000638: 07,3564           13570                           TCF      AUG2                                  #  MORE TO COME.
055595,000639: 
055596,000640: 07,3565           34736                           CAF      BIT14                                 
055597,000641: 07,3566           26047                           ADS      GYROCMD                               
055598,000642: 07,3567           13522                           TCF      LASTSEG    +1                         
055599,000643: 

Page 1317

055601,000645: 07,3570           50061        AUG2               INDEX    ITEMP1                                
055602,000646: 07,3571           55400                           TS       1400                                  
055603,000647: 07,3572           34736                           CAF      BIT14                                 
055604,000648: 07,3573           26047                           ADS      GYROCMD                               
055605,000649: 07,3574           13541                           TCF      AUG3                                  #  COMPUTE DT.
055606,000650: 

Page 1318

055608,000652: 07,3575           63511        MIN-               AD       -GYROMIN                              #  POSSIBLE NEGATIVE OUTPUT.
055609,000653: 07,3576           00006                           EXTEND                                         
055610,000654: 07,3577           63402                           BZMF     STRTGYR2                              
055611,000655: 
055612,000656: 07,3600           00006        MAJ-               EXTEND                                         #  DEFINITE NEGATIVE OUTPUT.
055613,000657: 07,3601           43621                           DCS      GYROFRAC                              
055614,000658: 07,3602           20071                           DAS      RUPTREG1                              
055615,000659: 
055616,000660: 07,3603           30064                           CA       ITEMP4                                #  SELECT NEGATIVE TORQUING FOR THIS GYRO.
055617,000661: 07,3604           64743                           AD       BIT9                                  
055618,000662: 07,3605           00006                           EXTEND                                         
055619,000663: 07,3606           05014                           WOR      CHAN14                                
055620,000664: 
055621,000665: 07,3607           40070                           CS       RUPTREG1                              #  SET UP RUPTREGS TO FALL INTO GMERGE.
055622,000666: 07,3610           54070                           TS       RUPTREG1                              #  ALL NUMBERS PUT INTO GYROCMD ARE
055623,000667: 07,3611           40071                           CS       RUPTREG2                              #  POSITIVE - BIT9 OF CHAN 14 DETERMINES
055624,000668: 07,3612           76077                           MASK     LOW7                                  #  THE SIGN OF THE COMMAND.
055625,000669: 07,3613           40000                           COM                                            
055626,000670: 07,3614           56071                           XCH      RUPTREG2                              
055627,000671: 07,3615           40000                           COM                                            
055628,000672: 07,3616           13471                           TCF      GMERGE                                
055629,000673: 
055630,000674: 07,3617           01700        GDESELCT           OCT      1700                                  #  TURN OFF SELECT AND ACTIVITY BITS.
055631,000675: 
055632,000676: 07,3620           00000 00034  GYROFRAC           2DEC     .215       B-21                       
055633,000677: 

Page 1319

055635,000679:                                                                                                  #  IMU MODE SWITCHING ROUTINES COME HERE WHEN ACTION COMPLETE.
055636,000680: 
055637,000681: 07,3622           00006        ENDIMU             EXTEND                                         #  MODE IS BAD IF CAGE HAS OCCURED OR IF
055638,000682: 07,3623           00011                           READ     DSALMOUT                              #  ISS WARNING IS ON.
055639,000683: 07,3624           74753                           MASK     BIT1                                  
055640,000684: 07,3625           10000                           CCS      A                                     
055641,000685: 07,3626           13630                           TCF      IMUBAD                                
055642,000686: 
055643,000687: 07,3627           13656        IMUGOOD            TCF      GOODEND                               #  WITH C(A) = 0.
055644,000688: 
055645,000689: 07,3630           34755        IMUBAD             CAF      ZERO                                  
055646,000690: 07,3631           13653                           TCF      BADEND                                
055647,000691: 
055648,000692: 07,3632           34746        CAGETEST           CAF      BIT6                                  #  SUBROUTINE TO TERMINATE IMU MODE
055649,000693: 07,3633           71277                           MASK     IMODES30                              #  SWITCH IF IMU HAS BEEN CAGED.
055650,000694: 07,3634           10000                           CCS      A                                     
055651,000695: 07,3635           13630                           TCF      IMUBAD                                #  DIRECTLY.
055652,000696: 07,3636           00002                           TC       Q                                     #  WITH C(A) = +0.
055653,000697: 
055654,000698: 07,3637           41277        CAGETSTQ           CS       IMODES30                              #  SKIP IF IMU NOT BEING CAGED.
055655,000699: 07,3640           74746                           MASK     BIT6                                  
055656,000700: 07,3641           10000                           CCS      A                                     
055657,000701: 07,3642           24002                           INCR     Q                                     
055658,000702: 07,3643           00002                           TC       Q                                     
055659,000703: 
055660,000704: 07,3644           41277        CAGETSTJ           CS       IMODES30                              #  IF DURING MODE SWITCH INITIALIZATION
055661,000705: 07,3645           74746                           MASK     BIT6                                  #  IT IS FOUND THAT THE IMU IS BEING CAGED,
055662,000706: 07,3646           10000                           CCS      A                                     #  SET IMUCADR TO -0 TO INDICATE OPERATION
055663,000707: 07,3647           00002                           TC       Q                                     #  COMPLETE BUT FAILED.  RETURN IMMEDIATELY
055664,000708: 07,3650           44755                           CS       ZERO                                  #  TO SWRETURN.
055665,000709: 07,3651           55301                           TS       IMUCADR                               
055666,000710: 07,3652           12746                           TCF      MODEEXIT                              
055667,000711: 

Page 1320

055669,000713:                                                                                                  #  GENERALIZED MODE SWITCHING TERMINATION.  ENTER AT GOODEND FOR SUCCESSFUL COMPLETION OF AN I/O OPERATION
055670,000714:                                                                                                  #  OR AT BADEND FOR AN UNSUCCESSFUL ONE.  C(A) OR ARRIVAL =0 FOR IMU, 1 FOR OPTICS.
055671,000715: 
055672,000716: 07,3653           54071        BADEND             TS       RUPTREG2                              #  DEVICE INDEX.
055673,000717: 07,3654           44755                           CS       ZERO                                  #  FOR FAILURE.
055674,000718: 07,3655           13660                           TCF      GOODEND    +2                         
055675,000719: 
055676,000720: 07,3656           54071        GOODEND            TS       RUPTREG2                              
055677,000721: 07,3657           44753                           CS       ONE                                   #  FOR SUCCESS.
055678,000722: 
055679,000723: 07,3660           54072                           TS       RUPTREG3                              
055680,000724: 07,3661           50071                           INDEX    RUPTREG2                              #  SEE IF USING PROGRAM ASLEEP.
055681,000725: 07,3662           11301                           CCS      MODECADR                              
055682,000726: 07,3663           13667                           TCF      +4                                    #  YES - WAKE IT UP.
055683,000727: 07,3664           13677                           TCF      ENDMODE                               #  IF 0, PROGRAM NOT IN YET.
055684,000728: 
055685,000729: 07,3665           00006                           EXTEND                                         
055686,000730: 07,3666           13700                           BZF      ENDMODE    +1                         #  BZF = TCF IF MODECADR = -0.
055687,000731: 
055688,000732: 07,3667           34755                           CAF      ZERO                                  #  WAKE SLEEPING PROGRAM.
055689,000733: 07,3670           50071                           INDEX    RUPTREG2                              
055690,000734: 07,3671           57301                           XCH      MODECADR                              
055691,000735: 07,3672           05137                           TC       JOBWAKE                               
055692,000736: 
055693,000737: 07,3673           40072                           CS       RUPTREG3                              #  ADVANCE LOC IF SUCCESSFUL.
055694,000738: 07,3674           50064                           INDEX    LOCCTR                                
055695,000739: 07,3675           26164                           ADS      LOC                                   
055696,000740: 
055697,000741: 07,3676           15261                           TCF      TASKOVER                              
055698,000742: 
055699,000743: 07,3677           30072        ENDMODE            CA       RUPTREG3                              #  -0 INDICATES OPERATION COMPLETE BUT
055700,000744: 07,3700           50071                 +1        INDEX    RUPTREG2                              #  UNSUCCESSFUL:  -1 INDICATES COMPLETE AND
055701,000745: 07,3701           55301                           TS       MODECADR                              #  SUCCESSFUL.
055702,000746: 07,3702           15261                           TCF      TASKOVER                              
055703,000747: 

Page 1321

055705,000749:                                                                                                  #  GENERAL STALLING ROUTINE.  USING PROGRAMS COME HERE TO WAIT FOR I/O COMPLETION.
055706,000750: 
055707,000751:                                                                                                  #  PROGRAM DESCRIPTION                           DATE - 21 FEB 1967
055708,000752:                                                                                                  #                                                LOG SECTION IMU MODE SWITCHING
055709,000753:                                                                                                  #  MOD BY - R. MELANSON TO ADD DOCUMENTATION     ASSEMBLY SUNDISK REV. 82
055710,000754: 
055711,000755:                                                                                                  #  FUNCTIONAL DESCRIPTION -
055712,000756:                                                                                                  #        TO DELAY FURTHER EXECUTION OF THE CALLING ROUTINE UNTIL ITS SELECTED
055713,000757:                                                                                                  #        I/O FUNCTION IS COMPLETE.  THE FOLLOWING CHECKS ON THE CALLING ROUTINE:S
055714,000758:                                                                                                  #        MODECADR ARE MADE AND ACTED UPON.
055715,000759:                                                                                                  #        1) +0 INDICATES INCOMPLETE I/O OPERATION.  CALLING ROUTINE IS PUT TO
055716,000760:                                                                                                  #           SLEEP.
055717,000761:                                                                                                  #        2) -1 INDICATES COMPLETED I/O OPERATION.  STALL BYPASSES JOBSLEEP
055718,000762:                                                                                                  #           CALL AND RETURNS TO CALLING ROUTINE AT L+3
055719,000763:                                                                                                  #        3) -0 INDICATES COMPLETED I/O WITH FAILURE.  STALL CLEARS MODECADR
055720,000764:                                                                                                  #           AND RETURNS TO CALLING ROUTINE AT L+2.
055721,000765:                                                                                                  #        4) VALUE GREATER THAN 0 INDICATES TWO ROUTINES CALLING FOR USE OF
055722,000766:                                                                                                  #           SAME DEVICE.  STALL EXITS TO ABORT WHICH EXECUTES A PROGRAM
055723,000767:                                                                                                  #           RESTART WHICH IN TURN CLEARS ALL MODECADR REGISTERS.
055724,000768: 
055725,000769:                                                                                                  #  CALLING SEQUENCE -
055726,000770:                                                                                                  #        L       TC      BANKCALL
055727,000771:                                                                                                  #        L+1     CADR    (ONE OF 5 STALL ADDRESSES I.E. IMUSTALL, OPTSTALL, RADSTALL,
055728,000772:                                                                                                  #                        AOTSTALL, OR ATTSTALL)
055729,000773: 
055730,000774:                                                                                                  #  NORMAL-EXIT MODE -
055731,000775:                                                                                                  #        TCF JOBSLEEP    OR      TCF MODEXIT
055732,000776: 
055733,000777:                                                                                                  #  ALARM OR ABORT EXIT MODE -
055734,000778:                                                                                                  #        TC      ABORT
055735,000779: 
055736,000780:                                                                                                  #  OUTPUT -
055737,000781:                                                                                                  #        MODECADR=CADR   IF JOBSLEEP
055738,000782:                                                                                                  #        MODECADR=+0     IF I/O COMPLETE
055739,000783:                                                                                                  #        BUF2=L+3        IF I/O COMPLETE AND GOOD.
055740,000784:                                                                                                  #        BUF2=L+2        IF I/O COMPLETE BUT FAILED.
055741,000785: 
055742,000786:                                                                                                  #  ERASABLE INITIALIZATION -
055743,000787:                                                                                                  #        BUF2 CONTAINS RETURN ADDRESS PLUS 1,(L+2)
055744,000788:                                                                                                  #        BUF2+1 CONTAINS FBANK VALUE OF CALLING ROUTINE.
055745,000789:                                                                                                  #        MODECADR OF CALLING ROUTINE CONTAINS +0,-1,-0 OR CADR RETURN ADDRESS.
055746,000790: 
055747,000791:                                                                                                  #  DEBRIS -
055748,000792:                                                                                                  #        RUPTREG2 AND CALLING ROUTINE MODECADR.
055749,000793: 
055750,000794: 07,3703           34753        AOTSTALL           CAF      ONE                                   #  AOT.
055751,000795: 07,3704           03710                           TC       STALL                                 
055752,000796: 
055753,000797: 07,3705           34752        RADSTALL           CAF      TWO                                   
055754,000798: 07,3706           13710                           TCF      STALL                                 
055755,000799: 

Page 1322

055757,000801: 07,3707  07,3703               OPTSTALL           EQUALS   AOTSTALL                              
055758,000802: 
055759,000803: 07,3707           34755        IMUSTALL           CAF      ZERO                                  #  IMU.
055760,000804: 
055761,000805: 07,3710           00004        STALL              INHINT                                         
055762,000806: 07,3711           54071                           TS       RUPTREG2                              #  SAVE DEVICE INDEX.
055763,000807: 07,3712           50000                           INDEX    A                                     #  SEE IF OPERATION COMPLETE.
055764,000808: 07,3713           11301                           CCS      MODECADR                              
055765,000809: 07,3714           13732                           TCF      MODABORT                              #  ALLOWABLE STATES ARE +0, -1, AND -0.
055766,000810: 07,3715           13726                           TCF      MODESLP                               #  OPERATION INCOMPLETE.
055767,000811: 07,3716           13722                           TCF      MODEGOOD                              #  COMPLETE AND GOOD IF = -1.
055768,000812: 
055769,000813: 07,3717           50071        MG2                INDEX    RUPTREG2                              #  COMPLETE AND FAILED IF -0.  RESET TO +0.
055770,000814: 07,3720           55301                           TS       MODECADR                              #  RETURN TO CALLER.
055771,000815: 07,3721           12746                           TCF      MODEEXIT                              
055772,000816: 
055773,000817: 07,3722           10000        MODEGOOD           CCS      A                                     #  MAKE SURE INITIAL STATE -1.
055774,000818: 07,3723           13732                           TCF      MODABORT                              
055775,000819: 
055776,000820: 07,3724           24133                           INCR     BUF2                                  #  IF SO, INCREMENT RETURN ADDRESS AND
055777,000821: 07,3725           13717                           TCF      MG2                                   #  RETURN IMMEDIATELY, SETTING CADR = +0.
055778,000822: 
055779,000823: 07,3726           04645        MODESLP            TC       MAKECADR                              #  CALL FROM SWITCHABLE FIXED ONLY.
055780,000824: 07,3727           50071                           INDEX    RUPTREG2                              
055781,000825: 07,3730           55301                           TS       MODECADR                              
055782,000826: 07,3731           15133                           TCF      JOBSLEEP                              
055783,000827: 
055784,000828: 07,3732           52134        MODABORT           DXCH     BUF2                                  
055785,000829: 07,3733           05706                           TC       BAILOUT1                              #  TWO PROGRAMS USING THE SAME DEVICE.
055786,000830: 07,3734           31210                           OCT      31210                                 
055787,000831: 

Page 1323

055789,000833:                                                                                                  #  CONSTANTS FOR MODE SWITCHING ROUTINES
055790,000834: 
055791,000835: 07,3735     5741               BITS3&4            =        OCT14                                 
055792,000836: 07,3735     4771               BITS4&6            =        OCT50                                 
055793,000837: 07,3735           00030        BITS4-5            OCT      00030                                 
055794,000838: 07,3736     4744               IMUSEFLG           EQUALS   BIT8                                  #  INTERPRETER SWITCH 7.
055795,000839: 07,3736           77500        -COMMAX            DEC      -191       B-14                       
055796,000840: 07,3737           77477        -COMMAX-           DEC      -192       B-14                       
055797,000841: 07,3740           00074        600MS              DEC      60         B-14                       
055798,000842: 07,3741  07,3201               IMUFIN20           =        IMUFINE                               
055799,000843: 07,3741           31304        GOMANUR            CA       ATTCADR                               #  IS KALCMANU FREE
055800,000844: 07,3742           00006                           EXTEND                                         
055801,000845: 07,3743           13745                           BZF      +2                                    
055802,000846: 07,3744           03732                           TC       MODABORT                              #  BAILOUT
055803,000847: 07,3745           00006                 +2        EXTEND                                         
055804,000848: 07,3746           30134                           DCA      BUF2                                  
055805,000849: 07,3747           53305                           DXCH     ATTCADR                               #  SAVE FINAL RETURN FOR KALCMAN3
055806,000850: 
055807,000851: 07,3750           30006                           CA       BBANK                                 
055808,000852: 07,3751           74757                           MASK     SEVEN                                 
055809,000853: 07,3752           27305                           ADS      ATTCADR    +1                         
055810,000854: 
055811,000855: 07,3753           30167                           CA       PRIORITY                              
055812,000856: 07,3754           77730                           MASK     PRIO37                                
055813,000857: 07,3755           55306                           TS       ATTPRIO                               #  SAVE USERS PRIO
055814,000858: 
055815,000859: 07,3756           33762                           CAF      KALEBCON                              #  SET EBANK FOR KALCMAN3
055816,000860: 07,3757           54003                           TS       EBANK                                 
055817,000861: 07,3760           04635                           TC       POSTJUMP                              
055818,000862: 07,3761           44004                           CADR     KALCMAN3                              
055819,000863: 07,3762           03275        KALEBCON           ECADR    BCDU                                  
055820,000864: 

Page 1324

055822,000866:                                                                                                  #  PROGRAM DESCRIPTION
055823,000867:                                                                                                  #  IMU STATUS CHECK ROUTINE R02 (SUBROUTINE UTILITY)
055824,000868:                                                                                                  #  MOD NO - 1
055825,000869:                                                                                                  #  MOD BY - N.BRODEUR
055826,000870: 
055827,000871:                                                                                                  #  FUNCTIONAL DESCRIPTION
055828,000872:                                                                                                  #        TO CHECK WHETHER IMU IS ON AND IF ON WHETHER IT IS ALIGNED TO AN
055829,000873:                                                                                                  #        ORIENTATION KNOWN BY THE CMC.  TO REQUEST SELECTION OF THE APPROPRIATE
055830,000874:                                                                                                  #        PROGRAM IF THE IMU IS OFF OR NOT ALIGNED TO AN ORIENTATION KNOWN BY THE
055831,000875:                                                                                                  #        CMC.  CALLED THROUGH BANKCALL
055832,000876: 
055833,000877:                                                                                                  #  CALLING SEQUENCE -
055834,000878:                                                                                                  #        L       TC      BANKCALL
055835,000879:                                                                                                  #        L+1     CADR    R02BOTH
055836,000880: 
055837,000881:                                                                                                  #  SUBROUTINES CALLED
055838,000882:                                                                                                  #        VARALARM
055839,000883:                                                                                                  #        FLAGUP
055840,000884: 
055841,000885:                                                                                                  #  NORMAL EXIT MODES
055842,000886:                                                                                                  #        AT L+2 OF CALLING SEQUENCE
055843,000887: 
055844,000888:                                                                                                  #  ALARM OR ABORT EXIT MODES
055845,000889:                                                                                                  #        GOTOPOOH, WITH ALARM
055846,000890: 
055847,000891:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
055848,000892:                                                                                                  #        NONE
055849,000893: 
055850,000894:                                                                                                  #  DEBRIS
055851,000895:                                                                                                  #        CENTRALS-A,Q,L
055852,000896: 
055853,000897: 34,3650                                           BANK     34                                    
055854,000898: 04,2000                                           SETLOC   R02                                   
055855,000899: 04,2000                                           BANK                                           
055856,000900: 04,3232                                           COUNT*   $$/R02                                
055857,000901: 04,3232           00063        DEC51              DEC      51         B-14                       
055858,000902: 04,3233           34737        R02BOTH            CAF      REFSMBIT                              
055859,000903: 04,3234           70077                           MASK     FLAGWRD3                              
055860,000904: 04,3235           10000                           CCS      A                                     
055861,000905: 04,3236           03247                           TC       R02ZERO                               #  ZERO IMUS
055862,000906: 
055863,000907: 04,3237           31277                           CA       IMODES30                              
055864,000908: 04,3240           74743                           MASK     BIT9                                  #  IS ISS INITIALIZED
055865,000909: 04,3241           00006                           EXTEND                                         
055866,000910: 04,3242           13244                           BZF      +2                                    
055867,000911: 04,3243           44750                           CS       BIT4                                  #  SEND IMU ALARM CODE 210
055868,000912: 04,3244           63252                           AD       OCT220                                #  SEND REFSMM ALARM
055869,000913: 04,3245           05734                           TC       VARALARM                              
055870,000914: 
055871,000915: 04,3246           06001                           TC       GOTOPOOH                              
055872,000916: 
055873,000917: 04,3247           05504        R02ZERO            TC       UPFLAG                                

Page 1325

055875,000919: 04,3250           00007                           ADRES    IMUSE                                 
055876,000920: 04,3251           14631                           TCF      SWRETURN                              
055877,000921: 04,3252           00220        OCT220             OCT      220                                   
055878,000922: 

Page 1326

055880,000924:                                                                                                  #  PROGRAM DESCRIPTION   P06             10FEB67
055881,000925: 
055882,000926:                                                                                                  #  TRANSFER THE ISS/CMC FROM THE OPERATE TO THE STANDBY CONDITION.
055883,000927: 
055884,000928:                                                                                                  #  THE NORMAL CONDITION OF READINESS OF THE GNCS WHEN NOT IN USE IS STANDBY.  IN THIS CONDITION THE IMU
055885,000929:                                                                                                  #  HEATER POWER IS ON.  THE IMU OPERATE POWER IS OFF.  THE COMPUTER POWER IS ON.  THE OPTICS POWER IS OFF.  THE
055886,000930:                                                                                                  #  CMC STANDBY ON THE MAIN AND LEB DISKYS IS ON.
055887,000931: 
055888,000932:                                                                                                  #  CALLING SEQUENCE:
055889,000933:                                                                                                  #        ASTRONAUT REQUEST THROUGH DSKY  V37E 06E.
055890,000934: 
055891,000935:                                                                                                  #  SUBROUTINES CALLED:
055892,000936:                                                                                                  #        GOPERF1
055893,000937:                                                                                                  #        BANKCALL
055894,000938:                                                                                                  #        FLAGDOWN
055895,000939: 

Page 1327

055897,000941:                                                                                                  #  PRESTAND PREPARES FOR STANDBY BY SNAPSHOTTING THE SCALER AND TIME1 TIME2
055898,000942:                                                                                                  #  THE LOW 5 BITS OF THE SCALER ARE INSPECTED TO INSURE COMPATABILITY
055899,000943:                                                                                                  #  BETWEEN THE SCALER READING AND THE TIME1 TIME2 READING.
055900,000944: 
055901,000945: 37,2000                                           SETLOC   P05P06                                
055902,000946: 37,2000                                           BANK                                           
055903,000947: 
055904,000948: 37,3652     0314                                  EBANK=   TIME2SAV                              
055905,000949: 37,3652                                           COUNT*   $$/P06                                
055906,000950: 
055907,000951: 37,3652           05504        P06                TC       UPFLAG                                #  SET NODOV37 BIT
055908,000952: 37,3653           00054                           ADRES    NODOFLAG                              
055909,000953: 
055910,000954: 37,3654           00004        PRESTAND           INHINT                                         
055911,000955: 37,3655           00006                           EXTEND                                         
055912,000956: 37,3656           30025                           DCA      TIME2                                 #  SNAPSHOT TIME1 TIME2
055913,000957: 37,3657           52315                           DXCH     TIME2SAV                              
055914,000958: 37,3660           03711                           TC       SCALPREP                              
055915,000959: 37,3661           03654                           TC       PRESTAND                              #  T1,T2,SCALER NOT COMPATIBLE
055916,000960: 37,3662           52155                           DXCH     MPAC                                  #  T1,T2 AND SCALER OK
055917,000961: 37,3663           52317                           DXCH     SCALSAVE                              #  STORE SCALER
055918,000962: 37,3664           00004                           INHINT                                         
055919,000963: 37,3665           04616                           TC       BANKCALL                              
055920,000964: 37,3666           17166                           CADR     RNDREFDR                              #  REFSMM, DRIFT, TRACK FLAGS DOWN
055921,000965: 
055922,000966: 37,3667           05516                           TC       DOWNFLAG                              
055923,000967: 37,3670           00007                           ADRES    IMUSE                                 #  IMUSE DOWN
055924,000968: 37,3671           05516                           TC       DOWNFLAG                              
055925,000969: 37,3672           00010                           ADRES    RNDVZFLG                              #  RNDVZFLG DOWN
055926,000970: 
055927,000971: 37,3673           34741                           CAF      BIT11                                 
055928,000972: 37,3674           00006                           EXTEND                                         
055929,000973: 37,3675           05013                           WOR      CHAN13                                #  SET STANDBY ENABLE BIT
055930,000974: 
055931,000975: 37,3676           05353                           TC       PHASCHNG                              #  SET RESTART TO POSTAND WHEN STANDBY
055932,000976: 37,3677           07024                           OCT      07024                                 #        RECOVERS
055933,000977: 37,3700           20000                           OCT      20000                                 
055934,000978: 37,3701     0316                                  EBANK=   SCALSAVE                              
055935,000979: 37,3701           03731 76060                     2CADR    POSTAND                               
055936,000980: 
055937,000981: 37,3703           34774                           CAF      OCT62                                 
055938,000982: 37,3704           04616                           TC       BANKCALL                              
055939,000983: 37,3705           20624                           CADR     GOPERF1                               
055940,000984: 37,3706           13703                           TCF      -3                                    
055941,000985: 37,3707           13703                           TCF      -4                                    
055942,000986: 37,3710           13703                           TCF      -5                                    
055943,000987: 
055944,000988: 37,3711     4774               OCT62              EQUALS   .5SEC                                 #  DEC 50 = OCT 62
055945,000989: 
055946,000990:                                                                                                  #  THE LOW 5 BITS OF THE SCALER READS 10000 FOR THE FIRST INTERVAL AFTER A

Page 1328

055948,000992:                                                                                                  #  T1 INCREMENT.  IF SCALPREP DETECTS THIS INTERVAL THE T1,T2 AND SCALER
055949,000993:                                                                                                  #  DATA ARE NOT COMPATABLE AND RETURN IS TO L+1 FOR ANOTHER READING OF THE
055950,000994:                                                                                                  #  DATA.  OTHERWISE, THE RETURN IS TO L+2 TO PROCEED.  ROUTINE ALSO PREPARES
055951,000995:                                                                                                  #  THE SCALER READING FOR COMPUTATION OF THE INCREMENT TO UPDATE T1T2.  (THE
055952,000996:                                                                                                  #  10 MS BIT (BIT 6) OF THE SCALER IS INCREMENTED 5 MS OUT OF PHASE FROM
055953,000997:                                                                                                  #  T1.) ADDITION OF 5 MS (BIT 5) TO THE SCALER READING HAS THE EFFECT OF
055954,000998:                                                                                                  #  ADJUSTING BIT 6 IN THE SCALER TO BE IN PHASE WITH BIT 1 OF T1.  THE LOW 5
055955,000999:                                                                                                  #  BITS OF THE SCALER READING ARE THEN SET TO ZERO, TO TRUNCATE THE SCALER
055956,001000:                                                                                                  #  DATA TO 10 MS.  RESULTS ARE STORED IN MPAC, +1.
055957,001001: 
055958,001002: 37,3711           00006        SCALPREP           EXTEND                                         
055959,001003: 37,3712           22156                           QXCH     MPAC       +2                         
055960,001004: 37,3713           04103                           TC       FINETIME   +1                         
055961,001005: 37,3714           00003                           RELINT                                         
055962,001006: 37,3715           52155                           DXCH     MPAC                                  
055963,001007: 37,3716           34747                           CA       BIT5                                  #  ADD 5 MS TO THE SCALER READING.
055964,001008: 37,3717           54001                           TS       L                                     
055965,001009: 37,3720           34755                           CA       ZERO                                  
055966,001010: 37,3721           20155                           DAS      MPAC                                  
055967,001011: 37,3722           44346                           CS       LOW5                                  #  SET LOW 5 BITS OF (SCALER+5MS) TO ZERO
055968,001012: 37,3723           70155                           MASK     MPAC       +1                         #  AND STORE RESULTS IN MPAC,+1.
055969,001013: 37,3724           56155                           XCH      MPAC       +1                         
055970,001014: 37,3725           74346                           MASK     LOW5                                  #  TEST LOW 5 BITS OF SCALER FOR THE FIRST
055971,001015:                                                                                                  #  INTERVAL AFTER THE T1 INCREMENT
055972,001016:                                                                                                  #  (NOW = 00000, SINCE BIT 5 ADDED).
055973,001017: 37,3726           10000                           CCS      A                                     #  IS IT 1ST INTERVAL AFTER T1 INCREMENT
055974,001018: 37,3727           24156                           INCR     MPAC       +2                         #  NO
055975,001019: 37,3730           00156                           TC       MPAC       +2                         #  YES
055976,001020: 
055977,001021:                                                                                                  #  POSTAND RECOVERS TIME AFTER STANDBY.  THE SCALER IS SNAPSHOTTED AND THE
055978,001022:                                                                                                  #  TIME1 TIME2 COUNTER IS SET TO ZERO.  THE LOW 5 BITS OF THE SCALER ARE
055979,001023:                                                                                                  #  INSPECTED TO INSURE COMPATABILITY BETWEEN THE SCALER READING AND THE
055980,001024:                                                                                                  #  CLEARING OF THE TIME COUNTER.  IT THEN COMPUTES THE DIFFERENCE IN SCALER
055981,001025:                                                                                                  #  VALUES (IN DP) AND ADDS THIS TO THE PREVIOUSLY SNAPSHOTTED VALUES OF
055982,001026:                                                                                                  #  TIME1 TIME2 AND PLACES THIS NEW TIME INTO THE TIME1 TIME2 COUNTER.
055983,001027: 
055984,001028: 37,3731                                           COUNT*   $$/P05                                
055985,001029: 
055986,001030: 37,3731           44741        POSTAND            CS       BIT11                                 #  RECOVER TIME AFTER STANDBY.
055987,001031: 37,3732           00006                           EXTEND                                         
055988,001032: 37,3733           03013                           WAND     CHAN13                                #  CLEAR STANDBY ENABLE BIT
055989,001033: 37,3734           00004                           INHINT                                         
055990,001034: 37,3735           34755                           CA       ZERO                                  
055991,001035: 37,3736           54001                           TS       L                                     
055992,001036: 37,3737           52025                           DXCH     TIME2                                 #  CLEAR TIME1 TIME2
055993,001037: 37,3740           03711                           TC       SCALPREP                              #  STORE SCALER IN MPAC, MPAC+1
055994,001038: 37,3741           03734                           TC       POSTAND    +3                         #  T1,T2,SCALER NOT COMPATIBLE
055995,001039: 37,3742           00006                           EXTEND                                         #  T1,T2 AND SCALER OK
055996,001040: 37,3743           40317                           DCS      SCALSAVE                              
055997,001041: 37,3744           20155                           DAS      MPAC                                  #  FORM DP DIFFERENCE OF POSTSTANDBY SCALER

Page 1329

055999,001043: 37,3745           34742                           CAF      BIT10                                 #  MINUS PRESTANDBY SCALER AND SHIFT RIGHT
056000,001044: 37,3746           07312                           TC       SHORTMP                               #  5 TO ALIGN BITS WITH TIME1 TIME2.
056001,001045: 37,3747           34755                           CAF      ZERO                                  
056002,001046: 37,3750           54156                           TS       MPAC       +2                         #  NEEDED FOR TP AGREE
056003,001047: 37,3751           07262                           TC       TPAGREE                               #  MAKE DP DIFF AGREE
056004,001048: 37,3752           10154                           CCS      MPAC                                  
056005,001049: 37,3753           03760                           TC       POSTCOM                               #  IF DP DIFF NET +, NO SCALER OVERFLOW
056006,001050: 37,3754           03760                           TC       POSTCOM                               #  BETWEEN PRE AND POST STANDBY.
056007,001051: 37,3755           03756                           TC       +1                                    #  IF DP DIFF NET -, SCALER OVERFLOWED.  ADD
056008,001052: 37,3756           34742                           CAF      BIT10                                 #  BIT 10 TO HIGH DIFF TO CORRECT.
056009,001053: 37,3757           26154                           ADS      MPAC                                  
056010,001054: 37,3760           00006        POSTCOM            EXTEND                                         #  C(MPAC,+1) IS MAGNITUDE OF DELTA SCALER.
056011,001055: 37,3761           30315                           DCA      TIME2SAV                              #  PRESTANDBY TIME1 TIME2
056012,001056: 37,3762           20155                           DAS      MPAC                                  
056013,001057: 37,3763           07262                           TC       TPAGREE                               #  FORCE SIGN AGREEMENT
056014,001058: 37,3764           52155                           DXCH     MPAC                                  #  UPDATED VALUE FOR T1,T2.
056015,001059: 37,3765           20025                           DAS      TIME2                                 #  LOAD UPDATED VALUE INTO T1,T2, WITH
056016,001060: 37,3766           05516                           TC       DOWNFLAG                              #  CLEAR NODOFLAG
056017,001061: 37,3767           00054                           ADRES    NODOFLAG                              
056018,001062: 
056019,001063: 37,3770           06001                           TC       GOTOPOOH                              
056020,001064: 

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