Source Code

These source-code files are part of a reconstructed copy of Comanche 72, the first release of the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 13.

They have been adapted from sources files created from a listing of Comanche 55. These source files were updated to match binary dumps of a set of Comanche 67 rope modules. They were then further modified by applying known changes between Comanche 67 and Comanche 72. A binary dump of module B2 of Comanche 72, part number 2010802-021, was also used to validate changes made to banks 05-13. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments.

Since no contemporary listings of Comanche 72 are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

059395,000002:                                                                                                  ## Copyright:   Public domain.
059396,000003:                                                                                                  ## Filename:    IMU_MODE_SWITCHING_ROUTINES.agc
059397,000004:                                                                                                  ## Purpose:     A section of Comanche revision 072.
059398,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
059399,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
059400,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
059401,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
059402,000009:                                                                                                  ##              from a printout of Comanche 055, binary dumps of a set of
059403,000010:                                                                                                  ##              Comanche 067 rope modules, and changelogs between Comanche 067
059404,000011:                                                                                                  ##              and 072. It has been adapted such that the resulting bugger words
059405,000012:                                                                                                  ##              exactly match those specified for Comanche 072 in NASA drawing
059406,000013:                                                                                                  ##              2021153G, which gives relatively high confidence that the
059407,000014:                                                                                                  ##              reconstruction is correct.
059408,000015:                                                                                                  ## Assembler:   yaYUL
059409,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
059410,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
059411,000018:                                                                                                  ## Mod history: 2024-05-13 MAS  Created from Comanche 067.
059412,000019: 
059413,000020:    5535                                           BLOCK    02                                    
059414,000021:    4000                                           SETLOC   FFTAG3                                
059415,000022:    4000                                           BANK                                           
059416,000023: 
059417,000024:    5535  E3,1471                                  EBANK=   COMMAND                               
059418,000025: 
059419,000026:                                                                                                  #  FIXED-FIXED ROUTINES.
059420,000027: 
059421,000028:    5535                                           COUNT    02/IMODE                              
059422,000029: 
059423,000030:    5535           35035        ZEROICDU           CAF      ZERO                                  #  ZERO ICDU COUNTERS.
059424,000031:    5536           54032                           TS       CDUX                                  
059425,000032:    5537           54033                           TS       CDUY                                  
059426,000033:    5540           54034                           TS       CDUZ                                  
059427,000034:    5541           00002                           TC       Q                                     
059428,000035: 
059429,000036:    5542     5023               SPSCODE            =        BIT9                                  
059430,000037: 
059431,000038:                                                                                                  #  IMU ZEROING ROUTINE.
059432,000039: 
059433,000040: 11,3760                                           BANK     11                                    
059434,000041: 07,2000                                           SETLOC   MODESW                                
059435,000042: 07,2000                                           BANK                                           
059436,000043: 
059437,000044: 07,2577                                           COUNT    07/IMODE                              
059438,000045: 
059439,000046: 07,2577           00004        IMUZERO            INHINT                                         #  ROUTINE TO ZERO ICDUS.
059440,000047: 07,2600           41036                           CS       DSPTAB     +11D                       #  DONT ZERO CDUS IF IMU IN GIMBAL LOCK AND
059441,000048: 07,2601           75047                           MASK     BITS4&6                               #  COARSE ALIGN (GIMBAL RUNAWAY PROTECTION)
059442,000049: 07,2602           10000                           CCS      A                                     
059443,000050: 07,2603           12607                           TCF      IMUZEROA                              
059444,000051: 
059445,000052: 07,2604           05664                           TC       ALARM                                 #  IF SO.
059446,000053: 07,2605           00206                           OCT      00206                                 
059447,000054: 
059448,000055: 07,2606           13542                           TCF      CAGETSTJ   +4                         #  IMMEDIATE FAILURE.
059449,000056: 
059450,000057: 07,2607           03536        IMUZEROA           TC       CAGETSTJ                              
059451,000058: 
059452,000059:                                                                                                  #  DO ALL THE WORK.
059453,000060: 
059454,000061: 07,2610           41321                           CS       IMODES33                              #  DISABLE DAP AUTO AND HOLD MODES
059455,000062: 07,2611           75051                           MASK     SUPER011                              #        BIT5 FOR GROUND
059456,000063: 07,2612           27321                           ADS      IMODES33                              
059457,000064: 
059458,000065: 07,2613           41320                           CS       IMODES30                              #  INHIBIT ICDUFAIL AND IMUFAIL (IN CASE WE
059459,000066: 07,2614           75775                           MASK     BITS3&4                               #  JUST CAME OUT OF COARSE ALIGN).
059460,000067: 07,2615           27320                           ADS      IMODES30                              
059461,000068: 
059462,000069: 07,2616           45047                           CS       BITS4&6                               #  SEND ZERO ENCODE WITH COARSE AND ERROR
059463,000070: 07,2617           00006                           EXTEND                                         #  COUNTER DISABLED.
059464,000071: 07,2620           03012                           WAND     CHAN12                                
059465,000072: 
059466,000073: 07,2621           03151                           TC       NOATTOFF                              #  TURN OFF NO ATT LAMP.
059467,000074: 
059468,000075: 07,2622           35027                           CAF      BIT5                                  
059469,000076: 07,2623           00006                           EXTEND                                         
059470,000077: 07,2624           05012                           WOR      CHAN12                                
059471,000078: 
059472,000079: 07,2625           05535                           TC       ZEROICDU                              
059473,000080: 07,2626           35026                           CAF      BIT6                                  #  WAIT 320 MS TO GIVE AGS ADEQUATE TIME TO
059474,000081: 07,2627           05261                           TC       WAITLIST                              #  RECEIVE ITS PULSE TRAIN.
059475,000082: 07,2630  E3,1474                                  EBANK=   CDUIND                                
059476,000083: 07,2630           02642 16063                     2CADR    IMUZERO2                              
059477,000084: 
059478,000085: 07,2632           41320                           CS       IMODES30                              #  SEE IF IMU OPERATING AND ALARM IF NOT.
059479,000086: 07,2633           75023                           MASK     BIT9                                  
059480,000087: 07,2634           10000                           CCS      A                                     
059481,000088: 07,2635           12640                           TCF      MODEEXIT                              
059482,000089: 07,2636           05664                           TC       ALARM                                 
059483,000090: 07,2637           00210                           OCT      210                                   
059484,000091: 
059485,000092: 07,2640           00003        MODEEXIT           RELINT                                         #  GENERAL MODE-SWITCHING EXIT.
059486,000093: 07,2641           14711                           TCF      SWRETURN                              
059487,000094: 
059488,000095: 07,2642           03524        IMUZERO2           TC       CAGETEST                              
059489,000096: 07,2643           05535                           TC       ZEROICDU                              #  ZERO CDUX, CDUY, CDUZ
059490,000097: 
059491,000098: 07,2644           45027                           CS       BIT5                                  #  REMOVE ZERO DISCRETE.
059492,000099: 07,2645           00006                           EXTEND                                         
059493,000100: 07,2646           03012                           WAND     CHAN12                                
059494,000101: 
059495,000102: 07,2647           35021                           CAF      BIT11                                 #  WAIT 10 SECS FOR CTRS TO FIND GIMBALS
059496,000103: 07,2650           05306                           TC       VARDELAY                              
059497,000104: 
059498,000105: 07,2651           03524        IMUZERO3           TC       CAGETEST                              
059499,000106: 07,2652           45775                           CS       BITS3&4                               #  REMOVE IMUFAIL AND ICDUFAIL INHIBIT.
059500,000107: 07,2653           71320                           MASK     IMODES30                              
059501,000108: 07,2654           55320                           TS       IMODES30                              
059502,000109: 
059503,000110: 07,2655           45051                           CS       SUPER011                              #  ENABLE DAP AUTO AND HOLD MODES
059504,000111: 07,2656           71321                           MASK     IMODES33                              #        BIT5 FOR GROUND
059505,000112: 07,2657           55321                           TS       IMODES33                              
059506,000113: 
059507,000114: 07,2660           04754                           TC       IBNKCALL                              #  SET ISS WARNING IF EITHER OF ABOVE ARE
059508,000115: 07,2661           14665                           CADR     SETISSW                               #  PRESENT.
059509,000116: 
059510,000117: 07,2662           13514                           TCF      ENDIMU                                
059511,000118: 
059512,000119:                                                                                                  #  IMU COARSE ALIGN MODE.
059513,000120: 
059514,000121: 07,2663           00004        IMUCOARS           INHINT                                         
059515,000122: 07,2664           03536                           TC       CAGETSTJ                              
059516,000123: 07,2665           03027                           TC       SETCOARS                              
059517,000124: 
059518,000125: 07,2666           36211                           CAF      SIX                                   
059519,000126: 07,2667           05261                           TC       WAITLIST                              
059520,000127: 07,2670  E3,1474                                  EBANK=   CDUIND                                
059521,000128: 07,2670           02673 16063                     2CADR    COARS                                 
059522,000129: 
059523,000130: 07,2672           12640                           TCF      MODEEXIT                              
059524,000131: 
059525,000132: 07,2673           03524        COARS              TC       CAGETEST                              
059526,000133: 07,2674           35026                           CAF      BIT6                                  #  ENABLE ALL THREE ISS CDU ERROR COUNTERS
059527,000134: 07,2675           00006                           EXTEND                                         
059528,000135: 07,2676           05012                           WOR      CHAN12                                
059529,000136: 
059530,000137: 07,2677           35032                           CAF      TWO                                   #  SET CDU INDICATOR
059531,000138: 07,2700           55474        COARS1             TS       CDUIND                                
059532,000139: 
059533,000140: 07,2701           51474                           INDEX    CDUIND                                #  COMPUTE THETAD - THETAA IN 1:S
059534,000141: 07,2702           31155                           CA       THETAD                                #        COMPLEMENT FORM
059535,000142: 07,2703           00006                           EXTEND                                         
059536,000143: 07,2704           51474                           INDEX    CDUIND                                
059537,000144: 07,2705           20032                           MSU      CDUX                                  
059538,000145: 07,2706           00006                           EXTEND                                         
059539,000146: 07,2707           75017                           MP       BIT13                                 #  SHIFT RIGHT 2
059540,000147: 07,2710           56001                           XCH      L                                     #  ROUND
059541,000148: 07,2711           60000                           DOUBLE                                         
059542,000149: 07,2712           54061                           TS       ITEMP1                                
059543,000150: 07,2713           12715                           TCF      +2                                    
059544,000151: 07,2714           26001                           ADS      L                                     
059545,000152: 
059546,000153: 07,2715           51474                           INDEX    CDUIND                                #  DIFFERENCE TO BE COMPUTED
059547,000154: 07,2716           23471                           LXCH     COMMAND                               
059548,000155: 07,2717           11474                           CCS      CDUIND                                
059549,000156: 07,2720           02700                           TC       COARS1                                
059550,000157: 
059551,000158: 07,2721           35032                           CAF      TWO                                   #  MINIMUM OF 4 MS WAIT
059552,000159: 07,2722           05306                           TC       VARDELAY                              
059553,000160: 
059554,000161: 07,2723           03524        COARS2             TC       CAGETEST                              #  DONT CONTINUE IF CAGED.
059555,000162: 07,2724           54061                           TS       ITEMP1                                #  SETS TO +0.
059556,000163: 07,2725           35032                           CAF      TWO                                   #  SET CDU INDICATOR
059557,000164: 07,2726           55474                 +3        TS       CDUIND                                
059558,000165: 
059559,000166: 07,2727           51474                           INDEX    CDUIND                                
059560,000167: 07,2730           11471                           CCS      COMMAND                               #  NUMBER OF PULSES REQUIRED
059561,000168: 07,2731           02735                           TC       COMPOS                                #  GREATER THAN MAX ALLOWED
059562,000169: 07,2732           02744                           TC       NEXTCDU    +1                         
059563,000170: 07,2733           03002                           TC       COMNEG                                
059564,000171: 07,2734           02744                           TC       NEXTCDU    +1                         
059565,000172: 
059566,000173: 07,2735           63624        COMPOS             AD       -COMMAX                               #  COMMAX = MAX NUMBER OF PULSES ALLOWED
059567,000174: 07,2736           00006                           EXTEND                                         #        MINUS ONE
059568,000175: 07,2737           63012                           BZMF     COMZERO                               
059569,000176: 07,2740           51474                           INDEX    CDUIND                                
059570,000177: 07,2741           55471                           TS       COMMAND                               #  REDUCE COMMAND BY MAX NUMBER OF PULSES
059571,000178: 07,2742           43625                           CS       -COMMAX-                              #        ALLOWED
059572,000179: 
059573,000180: 07,2743           24061        NEXTCDU            INCR     ITEMP1                                
059574,000181: 07,2744           65034                           AD       NEG0                                  
059575,000182: 07,2745           51474                           INDEX    CDUIND                                
059576,000183: 07,2746           54050                           TS       CDUXCMD                               #  SET UP COMMAND REGISTER.
059577,000184: 
059578,000185: 07,2747           11474                           CCS      CDUIND                                
059579,000186: 07,2750           02726                           TC       COARS2     +3                         
059580,000187: 
059581,000188: 07,2751           10061                           CCS      ITEMP1                                #  SEE IF ANY PULSES TO GO OUT.
059582,000189: 07,2752           13016                           TCF      SENDPULS                              
059583,000190: 
059584,000191: 07,2753           05303                           TC       FIXDELAY                              #  WAIT FOR GIMBALS TO SETTLE.
059585,000192: 07,2754           00226                           DEC      150        B-14                       
059586,000193: 
059587,000194: 07,2755           35032                           CAF      TWO                                   #  AT END OF COMMAND, CHECK TO SEE THAT
059588,000195: 07,2756           54061        CHKCORS            TS       ITEMP1                                #  GIMBALS ARE WITHIN 2 DEGREES OF THETAD.
059589,000196: 07,2757           50000                           INDEX    A                                     
059590,000197: 07,2760           30032                           CA       CDUX                                  
059591,000198: 07,2761           00006                           EXTEND                                         
059592,000199: 07,2762           50061                           INDEX    ITEMP1                                
059593,000200: 07,2763           21155                           MSU      THETAD                                
059594,000201: 07,2764           10000                           CCS      A                                     
059595,000202: 07,2765           12773                           TCF      COARSERR                              
059596,000203: 07,2766           12770                           TCF      CORSCHK2                              
059597,000204: 07,2767           12773                           TCF      COARSERR                              
059598,000205: 
059599,000206: 07,2770           10061        CORSCHK2           CCS      ITEMP1                                
059600,000207: 07,2771           12756                           TCF      CHKCORS                               
059601,000208: 07,2772           13514                           TCF      ENDIMU                                #  END OF COARSE ALIGNMENT.
059602,000209: 
059603,000210: 07,2773           63001        COARSERR           AD       COARSTOL                              #  2 DEGREES.
059604,000211: 07,2774           00006                           EXTEND                                         
059605,000212: 07,2775           62770                           BZMF     CORSCHK2                              
059606,000213: 
059607,000214: 07,2776           05664                           TC       ALARM                                 #  COARSE ALIGN ERROR.
059608,000215: 07,2777           00211                           OCT      211                                   
059609,000216: 
059610,000217: 07,3000           13522                           TCF      IMUBAD                                
059611,000218: 
059612,000219: 07,3001           77511        COARSTOL           DEC      -.01111                               #  2 DEGREES SCALED AT HALF-REVOLUTIONS
059613,000220: 
059614,000221: 07,3002           63624        COMNEG             AD       -COMMAX                               
059615,000222: 07,3003           00006                           EXTEND                                         
059616,000223: 07,3004           63012                           BZMF     COMZERO                               
059617,000224: 07,3005           40000                           COM                                            
059618,000225: 07,3006           51474                           INDEX    CDUIND                                
059619,000226: 07,3007           55471                           TS       COMMAND                               
059620,000227: 07,3010           33625                           CA       -COMMAX-                              
059621,000228: 07,3011           02743                           TC       NEXTCDU                               
059622,000229: 
059623,000230: 07,3012           35035        COMZERO            CAF      ZERO                                  
059624,000231: 07,3013           51474                           INDEX    CDUIND                                
059625,000232: 07,3014           57471                           XCH      COMMAND                               
059626,000233: 07,3015           02743                           TC       NEXTCDU                               
059627,000234: 
059628,000235: 07,3016           37707        SENDPULS           CAF      13,14,15                              
059629,000236: 07,3017           00006                           EXTEND                                         
059630,000237: 07,3020           05014                           WOR      CHAN14                                
059631,000238: 07,3021           33626                           CAF      600MS                                 
059632,000239: 07,3022           12722                           TCF      COARS2     -1                         #  THEN TO VARDELAY
059633,000240: 
059634,000241: 07,3023           35026        CA+ECE             CAF      BIT6                                  #  ENABLE ALL THREE ISS CDU ERROR COUNTERS
059635,000242: 07,3024           00006                           EXTEND                                         
059636,000243: 07,3025           05012                           WOR      CHAN12                                
059637,000244: 07,3026           05340                           TC       TASKOVER                              
059638,000245: 
059639,000246: 07,3027           35030        SETCOARS           CAF      BIT4                                  #  BYPASS IF ALREADY IN COARSE ALIGN
059640,000247: 07,3030           00006                           EXTEND                                         
059641,000248: 07,3031           02012                           RAND     CHAN12                                
059642,000249: 07,3032           10000                           CCS      A                                     
059643,000250: 07,3033           00002                           TC       Q                                     
059644,000251: 
059645,000252: 07,3034           45026                           CS       BIT6                                  #  CLEAR ISS ERROR COUNTERS
059646,000253: 07,3035           00006                           EXTEND                                         
059647,000254: 07,3036           03012                           WAND     CHAN12                                
059648,000255: 
059649,000256: 07,3037           45022                           CS       BIT10                                 #  KNOCK DOWN GYRO ACTIVITY
059650,000257: 07,3040           00006                           EXTEND                                         
059651,000258: 07,3041           03014                           WAND     CHAN14                                
059652,000259: 07,3042           45035                           CS       ZERO                                  
059653,000260: 07,3043           54047                           TS       GYROCMD                               
059654,000261: 
059655,000262: 07,3044           35030                           CAF      BIT4                                  #  PUT ISS IN COARSE ALIGN
059656,000263: 07,3045           00006                           EXTEND                                         
059657,000264: 07,3046           05012                           WOR      CHAN12                                
059658,000265: 
059659,000266: 07,3047           41036                           CS       DSPTAB     +11D                       #  TURN ON NO ATT LAMP
059660,000267: 07,3050           73072                           MASK     OCT40010                              
059661,000268: 07,3051           27036                           ADS      DSPTAB     +11D                       
059662,000269: 
059663,000270: 07,3052           41321                           CS       IMODES33                              #  DISABLE DAP AUTO AND HOLD MODES
059664,000271: 07,3053           75026                           MASK     BIT6                                  
059665,000272: 07,3054           27321                           ADS      IMODES33                              
059666,000273: 
059667,000274: 07,3055           41320                           CS       IMODES30                              #  DISABLE IMUFAIL
059668,000275: 07,3056           75030                           MASK     BIT4                                  
059669,000276: 07,3057           27320                           ADS      IMODES30                              
059670,000277: 
059671,000278: 07,3060           45027        RNDREFDR           CS       BIT5                                  #  KNOCK DOWN TRACK FLAG
059672,000279: 07,3061           70075                           MASK     FLAGWRD1                              
059673,000280: 07,3062           54075                           TS       FLAGWRD1                              
059674,000281: 
059675,000282: 07,3063           45015                           CS       BIT15                                 #  KNOCK DOWN DRIFT FLAG
059676,000283: 07,3064           70076                           MASK     FLAGWRD2                              
059677,000284: 07,3065           54076                           TS       FLAGWRD2                              
059678,000285: 
059679,000286: 07,3066           45017                           CS       BIT13                                 #  KNOCK DOWN REFSMMAT FLAG
059680,000287: 07,3067           70077                           MASK     FLAGWRD3                              
059681,000288: 07,3070           54077                           TS       FLAGWRD3                              
059682,000289: 
059683,000290: 07,3071           00002                           TC       Q                                     
059684,000291: 
059685,000292: 07,3072           40010        OCT40010           OCT      40010                                 
059686,000293: 
059687,000294:                                                                                                  #  IMU FINE ALIGN MODE SWITCH.
059688,000295: 
059689,000296: 07,3073           00004        IMUFINE            INHINT                                         
059690,000297: 07,3074           03536                           TC       CAGETSTJ                              #  SEE IF IMU BEING CAGED.
059691,000298: 
059692,000299: 07,3075           45043                           CS       BITS4-5                               #  RESET ZERO AND COARSE
059693,000300: 07,3076           00006                           EXTEND                                         
059694,000301: 07,3077           03012                           WAND     CHAN12                                
059695,000302: 
059696,000303: 07,3100           45026                           CS       BIT6                                  #  INSURE DAP AUTO AND HOLD MODES ENABLED
059697,000304: 07,3101           71321                           MASK     IMODES33                              
059698,000305: 07,3102           55321                           TS       IMODES33                              
059699,000306: 
059700,000307: 07,3103           03151                           TC       NOATTOFF                              
059701,000308: 
059702,000309: 07,3104           35022                           CAF      BIT10                                 #  IMU FAIL WAS INHIBITED DURING THE
059703,000310: 07,3105           05261                           TC       WAITLIST                              #  PRESUMABLY PRECEDING COARSE ALIGN.  LEAVE
059704,000311: 07,3106  E3,1474                                  EBANK=   CDUIND                                
059705,000312: 07,3106           03117 16063                     2CADR    IFAILOK                               #  IT ON FOR THE FIRST 5 SECS OF FINE ALIGN
059706,000313: 
059707,000314: 07,3110           35056                           CAF      2SECS                                 
059708,000315: 07,3111           05261                           TC       WAITLIST                              
059709,000316: 07,3112  E3,1474                                  EBANK=   CDUIND                                
059710,000317: 07,3112           03115 16063                     2CADR    IMUFINED                              
059711,000318: 
059712,000319: 07,3114           12640                           TCF      MODEEXIT                              
059713,000320: 
059714,000321: 07,3115           03524        IMUFINED           TC       CAGETEST                              #  SEE THAT NO ONE HAS CAGED THE IMU.
059715,000322: 07,3116           13514                           TCF      ENDIMU                                
059716,000323: 
059717,000324: 07,3117           03531        IFAILOK            TC       CAGETSTQ                              #  ENABLE IMU FIAL UNLESS IMU BEING CAGED.
059718,000325: 07,3120           15340                           TCF      TASKOVER                              #  IT IS.
059719,000326: 
059720,000327: 07,3121           35030                           CAF      BIT4                                  #  DONT RESET IMU FAIL INHIBIT IF SOMEONE
059721,000328: 07,3122           00006                           EXTEND                                         #  HAS GONE INTO COARSE ALIGN.
059722,000329: 07,3123           02012                           RAND     CHAN12                                
059723,000330: 07,3124           10000                           CCS      A                                     
059724,000331: 07,3125           15340                           TCF      TASKOVER                              
059725,000332: 
059726,000333: 07,3126           41320                           CS       IMODES30                              #  RESET IMUFAIL.
059727,000334: 07,3127           75017                           MASK     BIT13                                 
059728,000335: 07,3130           27320                           ADS      IMODES30                              
059729,000336: 07,3131           45030                           CS       BIT4                                  
059730,000337: 07,3132           71320        PFAILOK2           MASK     IMODES30                              
059731,000338: 07,3133           55320                           TS       IMODES30                              
059732,000339: 07,3134           04754                           TC       IBNKCALL                              #  THE ISS WARNING LIGHT MAY COME ON NOW
059733,000340: 07,3135           14665                           CADR     SETISSW                               #  THAT THE INHIBIT HAS BEEN REMOVED.
059734,000341: 07,3136           15340                           TCF      TASKOVER                              
059735,000342: 
059736,000343: 07,3137           03531        PFAILOK            TC       CAGETSTQ                              #  ENABLE PIP FAIL PROG ALARM.
059737,000344: 07,3140           15340                           TCF      TASKOVER                              
059738,000345: 
059739,000346: 07,3141           41320                           CS       IMODES30                              #  RESET IMU AND PIPA FAIL BITS.
059740,000347: 07,3142           75022                           MASK     BIT10                                 
059741,000348: 07,3143           27320                           ADS      IMODES30                              
059742,000349: 
059743,000350: 07,3144           41321                           CS       IMODES33                              
059744,000351: 07,3145           75017                           MASK     BIT13                                 
059745,000352: 07,3146           27321                           ADS      IMODES33                              
059746,000353: 
059747,000354: 07,3147           45027                           CS       BIT5                                  
059748,000355: 07,3150           13132                           TCF      PFAILOK2                              
059749,000356: 
059750,000357: 07,3151           43072        NOATTOFF           CS       OCT40010                              #  SUBROUTINE TO TURN OFF NO ATT LAMP.
059751,000358: 07,3152           71036                           MASK     DSPTAB     +11D                       
059752,000359: 07,3153           65015                           AD       BIT15                                 
059753,000360: 07,3154           55036                           TS       DSPTAB     +11D                       
059754,000361: 07,3155           00002                           TC       Q                                     
059755,000362: 
059756,000363:                                                                                                  #  ROUITNES TO INITIATE AND TERMINATE PROGRAM USE OF THE PIPAS.  NO IMUSTALL REQUIRED IN EITHER CASE.
059757,000364: 
059758,000365: 07,3156           45035        PIPUSE             CS       ZERO                                  
059759,000366: 07,3157           54037                           TS       PIPAX                                 
059760,000367: 07,3160           54040                           TS       PIPAY                                 
059761,000368: 07,3161           54041                           TS       PIPAZ                                 
059762,000369: 
059763,000370: 07,3162           03531        PIPUSE1            TC       CAGETSTQ                              #  DO NOT ENABLE PIPA FAIL IF IMU IS CAGED
059764,000371: 07,3163           14711                           TCF      SWRETURN                              
059765,000372: 
059766,000373: 07,3164           00004                           INHINT                                         
059767,000374: 07,3165           45033                           CS       BIT1                                  #  IF PIPA FAILS FROM NOW ON (UNTIL
059768,000375: 07,3166           71320                           MASK     IMODES30                              #  PIPFREE), LIGHT ISS WARNING.
059769,000376: 07,3167           55320                           TS       IMODES30                              
059770,000377: 
059771,000378: 07,3170           04754        PIPFREE2           TC       IBNKCALL                              #  ISS WARNING MIGHT COME ON NOW.
059772,000379: 07,3171           14665                           CADR     SETISSW                               #  (OR GO OFF ON PIPFREE).
059773,000380: 
059774,000381: 07,3172           12640                           TCF      MODEEXIT                              
059775,000382: 
059776,000383: 07,3173           00004        PIPFREE            INHINT                                         #  PROGRAM DONE WITH PIPAS.  DONT LIGHT
059777,000384: 07,3174           41320                           CS       IMODES30                              #  ISS WARNING.
059778,000385: 07,3175           75033                           MASK     BIT1                                  
059779,000386: 07,3176           27320                           ADS      IMODES30                              
059780,000387: 
059781,000388: 07,3177           75022                           MASK     BIT10                                 #  IF PIP FAIL ON, DO PROG ALSRM AND RESET
059782,000389: 07,3200           10000                           CCS      A                                     #  ISS WARNING.
059783,000390: 07,3201           12640                           TCF      MODEEXIT                              
059784,000391: 
059785,000392: 07,3202           05664                           TC       ALARM                                 
059786,000393: 07,3203           00212                           OCT      212                                   
059787,000394: 
059788,000395: 07,3204           00004                           INHINT                                         
059789,000396: 
059790,000397: 07,3205           13170                           TCF      PIPFREE2                              
059791,000398: 
059792,000399:                                                                                                  #  THE FOLLOWING ROUTINE TORQUES THE IRIGS ACCORDING TO DOUBLE PRECISION INPUTS IN THE SIX REGISTERS
059793,000400:                                                                                                  #  BEGINNING AT THE ECADR ARRIVING IN A.  THE MINIMUM SIZE OF ANY PULSE TRAIN IS 16 PULSES (.25 CDU COUNTS).  THE
059794,000401:                                                                                                  #  UNSENT PORTION OF THE COMMAND IS LEFT INTACT IN THE INPUT COMMAND REGISTERS.
059795,000402: 
059796,000403: 07,3206  E3,1400                                  EBANK=   1400                                  #  VARIABLE, ACTUALLY.
059797,000404: 
059798,000405: 07,3206           54161        IMUPULSE           TS       MPAC       +5                         #  SAVE ARRIVING ECADR.
059799,000406: 07,3207           03536                           TC       CAGETSTJ                              #  DONT PROCEED IF IMU BEING CAGED.
059800,000407: 
059801,000408: 07,3210           11304                           CCS      LGYRO                                 #  SEE IF GYROS BUSY.
059802,000409: 07,3211           03252                           TC       GYROBUSY                              #  SLEEP.
059803,000410: 
059804,000411: 07,3212           54156                           TS       MPAC       +2                         
059805,000412: 07,3213           35026                           CAF      BIT6                                  #  ENABLE THE POWER SUPPLY.
059806,000413: 07,3214           00006                           EXTEND                                         
059807,000414: 07,3215           05014                           WOR      CHAN14                                
059808,000415: 
059809,000416: 07,3216           35031                           CAF      FOUR                                  
059810,000417: 07,3217           05261        GWAKE2             TC       WAITLIST                              #  (IF A JOB WAS PUT TO SLEEP, THE POWER
059811,000418: 07,3220  E3,1474                                  EBANK=   CDUIND                                #  SUPPLY IS LEFT ON BY THE WAKING JOB).
059812,000419: 07,3220           03270 16063                     2CADR    STRTGYRO                              
059813,000420: 
059814,000421: 07,3222           30161                           CA       MPAC       +5                         #  SET UP EBANK, SAVING CALLER'S EBANK FOR
059815,000422: 07,3223           56003                           XCH      EBANK                                 #  RESTORATION ON RETURN.
059816,000423: 07,3224           56161                           XCH      MPAC       +5                         
059817,000424: 07,3225           55304                           TS       LGYRO                                 #  RESERVES GYROS.
059818,000425: 07,3226           74373                           MASK     LOW8                                  
059819,000426: 07,3227           54061                           TS       ITEMP1                                
059820,000427: 
059821,000428: 07,3230           35032                           CAF      TWO                                   #  FORCE SIGN AGREEMENT ON INPUTS.
059822,000429: 07,3231           54157        GYROAGRE           TS       MPAC       +3                         
059823,000430: 07,3232           60000                           DOUBLE                                         
059824,000431: 07,3233           60061                           AD       ITEMP1                                
059825,000432: 07,3234           54160                           TS       MPAC       +4                         
059826,000433: 07,3235           00006                           EXTEND                                         
059827,000434: 07,3236           50000                           INDEX    A                                     
059828,000435: 07,3237           31401                           DCA      1400                                  
059829,000436: 07,3240           52155                           DXCH     MPAC                                  
059830,000437: 07,3241           07226                           TC       TPAGREE                               
059831,000438: 07,3242           52155                           DXCH     MPAC                                  
059832,000439: 07,3243           50160                           INDEX    MPAC       +4                         
059833,000440: 07,3244           53401                           DXCH     1400                                  
059834,000441: 
059835,000442: 07,3245           10157                           CCS      MPAC       +3                         
059836,000443: 07,3246           13231                           TCF      GYROAGRE                              
059837,000444: 
059838,000445: 07,3247           30161                           CA       MPAC       +5                         #  RESTORE CALLER'S EBANK.
059839,000446: 07,3250           54003                           TS       EBANK                                 
059840,000447: 07,3251           12640                           TCF      MODEEXIT                              
059841,000448: 
059842,000449:                                                                                                  #  ROUTINES TO ALLOW TORQUING BY ONLY ONE JOB AT A TIME.
059843,000450: 
059844,000451: 07,3252           00006        GYROBUSY           EXTEND                                         #  SAVE RETURN 2FCADR.
059845,000452: 07,3253           30134                           DCA      BUF2                                  
059846,000453: 07,3254           52155                           DXCH     MPAC                                  
059847,000454: 07,3255           33267        REGSLEEP           CAF      LGWAKE                                
059848,000455: 07,3256           15211                           TCF      JOBSLEEP                              
059849,000456: 
059850,000457: 07,3257           11304        GWAKE              CCS      LGYRO                                 #  WHEN AWAKENED, SEE IF GYROS STILL BUSY.
059851,000458: 07,3260           13255                           TCF      REGSLEEP                              #  IF SO, SLEEP SOME MORE.
059852,000459: 
059853,000460: 07,3261           54156                           TS       MPAC       +2                         
059854,000461: 07,3262           00006                           EXTEND                                         
059855,000462: 07,3263           30155                           DCA      MPAC                                  
059856,000463: 07,3264           52134                           DXCH     BUF2                                  #  RESTORE SWRETURN INFO.
059857,000464: 07,3265           35033                           CAF      ONE                                   
059858,000465: 07,3266           13217                           TCF      GWAKE2                                
059859,000466: 
059860,000467: 07,3267           17257        LGWAKE             CADR     GWAKE                                 
059861,000468: 
059862,000469:                                                                                                  #  GYRO-TORQUING WAITLIST TASKS.
059863,000470: 
059864,000471: 07,3270           43511        STRTGYRO           CS       GDESELCT                              #  DE-SELECT LAST GYRO.
059865,000472: 07,3271           00006                           EXTEND                                         
059866,000473: 07,3272           03014                           WAND     CHAN14                                
059867,000474: 
059868,000475: 07,3273           03524                           TC       CAGETEST                              
059869,000476: 
059870,000477: 07,3274           31304        STRTGYR2           CA       LGYRO                                 #  JUMP ON PHASE COUNTER IN BITS 13-14.
059871,000478: 07,3275           00006                           EXTEND                                         
059872,000479: 07,3276           75030                           MP       BIT4                                  
059873,000480: 07,3277           50000                           INDEX    A                                     
059874,000481: 07,3300           13301                           TCF      +1                                    
059875,000482: 07,3301           03316                           TC       GSELECT                               #  =0.  DO Y GYRO.
059876,000483: 07,3302           00202                           OCT      00202                                 
059877,000484: 
059878,000485: 07,3303           03316                           TC       GSELECT                               #  =1.  DO Z GYRO.
059879,000486: 07,3304           00302                           OCT      00302                                 
059880,000487: 
059881,000488: 07,3305           03314                           TC       GSELECT    -2                         #  =2.  DO X GYRO.
059882,000489: 07,3306           00100                           OCT      00100                                 
059883,000490: 
059884,000491: 07,3307           35035                           CAF      ZERO                                  #  =3.  DONE
059885,000492: 07,3310           55304                           TS       LGYRO                                 
059886,000493: 07,3311           33267                           CAF      LGWAKE                                #  WAKE A POSSIBLE SLEEPING JOB.
059887,000494: 07,3312           05215                           TC       JOBWAKE                               
059888,000495: 
059889,000496: 07,3313           13115        NORESET            TCF      IMUFINED                              #  DO NOT RESET POWER SUPPLY
059890,000497: 07,3314           45031                 -2        CS       FOUR                                  #  SPECIAL ENTRY TO REGRESS LGYRO FOR X.
059891,000498: 07,3315           27304                           ADS      LGYRO                                 
059892,000499: 
059893,000500: 07,3316           50002        GSELECT            INDEX    Q                                     #  SELECT GYRO.
059894,000501: 07,3317           30000                           CAF      0                                     #  PACKED WORD CONTAINS GYRO SELECT BITS
059895,000502: 07,3320           54064                           TS       ITEMP4                                #  AND INCREMENT TO LGYRO.
059896,000503: 07,3321           75037                           MASK     SEVEN                                 
059897,000504: 07,3322           65017                           AD       BIT13                                 
059898,000505: 07,3323           27304                           ADS      LGYRO                                 
059899,000506: 07,3324           54003                           TS       EBANK                                 
059900,000507: 07,3325           74373                           MASK     LOW8                                  
059901,000508: 07,3326           54061                           TS       ITEMP1                                
059902,000509: 
059903,000510: 07,3327           45037                           CS       SEVEN                                 
059904,000511: 07,3330           70064                           MASK     ITEMP4                                
059905,000512: 07,3331           54064                           TS       ITEMP4                                
059906,000513: 
059907,000514: 07,3332           00006                           EXTEND                                         #  MOVE DP COMMAND TO RUPTREGS FOR TESTING.
059908,000515: 07,3333           50061                           INDEX    ITEMP1                                
059909,000516: 07,3334           31401                           DCA      1400                                  
059910,000517: 07,3335           52071                           DXCH     RUPTREG1                              
059911,000518: 
059912,000519: 07,3336           10070                           CCS      RUPTREG1                              
059913,000520: 07,3337           13352                           TCF      MAJ+                                  
059914,000521: 07,3340           13342                           TCF      +2                                    
059915,000522: 07,3341           13472                           TCF      MAJ-                                  
059916,000523: 
059917,000524: 07,3342           10071                           CCS      RUPTREG2                              
059918,000525: 07,3343           13347                           TCF      MIN+                                  
059919,000526: 07,3344           13274                           TCF      STRTGYR2                              
059920,000527: 07,3345           13467                           TCF      MIN-                                  
059921,000528: 07,3346           13274                           TCF      STRTGYR2                              
059922,000529: 
059923,000530: 07,3347           63403        MIN+               AD       -GYROMIN                              #  SMALL POSITIVE COMMAND.  SEE IF AT LEAST
059924,000531: 07,3350           00006                           EXTEND                                         #  16 GYRO PULSES.
059925,000532: 07,3351           63274                           BZMF     STRTGYR2                              
059926,000533: 
059927,000534: 07,3352           00006        MAJ+               EXTEND                                         #  DEFINITE POSITIVE OUTPUT.
059928,000535: 07,3353           33513                           DCA      GYROFRAC                              
059929,000536: 07,3354           20071                           DAS      RUPTREG1                              
059930,000537: 
059931,000538: 07,3355           30064                           CA       ITEMP4                                #  SELECT POSITIVE TORQUING FOR THIS GYRO.
059932,000539: 07,3356           00006                           EXTEND                                         
059933,000540: 07,3357           05014                           WOR      CHAN14                                
059934,000541: 
059935,000542: 07,3360           36043                           CAF      LOW7                                  #  LEAVE NUMBER OF POSSIBLE 8192 AUGMENTS
059936,000543: 07,3361           70071                           MASK     RUPTREG2                              #  TO INITIAL COMMAND IN MAJOR PART OF LONG
059937,000544: 07,3362           56071                           XCH      RUPTREG2                              #  TERM STORAGE AND TRUNCATED FRACTION
059938,000545: 07,3363           00006        GMERGE             EXTEND                                         #  IN MINOR PART.  THE MAJOR PART WILL BE
059939,000546: 07,3364           75024                           MP       BIT8                                  #  COUNTED DOWN TO ZERO IN THE COURSE OF
059940,000547: 07,3365           54062                           TS       ITEMP2                                #  PUTTING OUT THE ENTIRE COMMAND.
059941,000548: 07,3366           30070                           CA       RUPTREG1                              
059942,000549: 07,3367           00006                           EXTEND                                         
059943,000550: 07,3370           75023                           MP       BIT9                                  
059944,000551: 07,3371           54070                           TS       RUPTREG1                              
059945,000552: 07,3372           30001                           CA       L                                     
059946,000553: 07,3373           00006                           EXTEND                                         
059947,000554: 07,3374           75016                           MP       BIT14                                 
059948,000555: 07,3375           26062                           ADS      ITEMP2                                #  INITIAL COMMAND.
059949,000556: 
059950,000557: 07,3376           00006                           EXTEND                                         #  SEE IF MORE THAN ONE PULSE TRAIN NEEDED
059951,000558: 07,3377           30071                           DCA      RUPTREG1                              #  (MORE THAN 16383 PULSES).
059952,000559: 07,3400           67716                           AD       MINUS1                                
059953,000560: 07,3401           10000                           CCS      A                                     
059954,000561: 07,3402           13426                           TCF      LONGGYRO                              
059955,000562: 07,3403           77601        -GYROMIN           OCT      -176                                  #  MAY BE ADJUSTED TO SPECIFY MINIMUM CMD
059956,000563: 07,3404           13410                           TCF      +4                                    
059957,000564: 
059958,000565: 07,3405           35016                           CAF      BIT14                                 
059959,000566: 07,3406           26062                           ADS      ITEMP2                                
059960,000567: 07,3407           35035                           CAF      ZERO                                  
059961,000568: 
059962,000569: 07,3410           50061                 +4        INDEX    ITEMP1                                
059963,000570: 07,3411           53401                           DXCH     1400                                  
059964,000571: 07,3412           30062                           CA       ITEMP2                                #  ENTIRE COMMAND.
059965,000572: 07,3413           54047        LASTSEG            TS       GYROCMD                               
059966,000573: 07,3414           00006                           EXTEND                                         
059967,000574: 07,3415           75022                           MP       BIT10                                 #  WAITLIST DT
059968,000575: 07,3416           66214                           AD       THREE                                 #  TRUNCATION AND PHASE UNCERTAINTIES.
059969,000576: 07,3417           05261                           TC       WAITLIST                              
059970,000577: 07,3420  E3,1474                                  EBANK=   CDUIND                                
059971,000578: 07,3420           03270 16063                     2CADR    STRTGYRO                              
059972,000579: 
059973,000580: 07,3422           35022        GYROEXIT           CAF      BIT10                                 
059974,000581: 07,3423           00006                           EXTEND                                         
059975,000582: 07,3424           05014                           WOR      CHAN14                                
059976,000583: 07,3425           15340                           TCF      TASKOVER                              
059977,000584: 
059978,000585: 07,3426           50061        LONGGYRO           INDEX    ITEMP1                                
059979,000586: 07,3427           53401                           DXCH     1400                                  #  INITIAL COMMAND OUT PLUS N AUGMENTS OF
059980,000587: 07,3430           35016                           CAF      BIT14                                 #  8192.  INITIAL COMMAND IS AT LEAST 8192.
059981,000588: 07,3431           60062                           AD       ITEMP2                                
059982,000589: 07,3432           54047                           TS       GYROCMD                               
059983,000590: 
059984,000591: 07,3433           00006        AUG3               EXTEND                                         #  GET WAITLIST DT TO TIME WHEN TRAIN IS
059985,000592: 07,3434           75022                           MP       BIT10                                 #  ALMOST OUT.
059986,000593: 07,3435           67714                           AD       NEG3                                  
059987,000594: 07,3436           05261                           TC       WAITLIST                              
059988,000595: 07,3437  E3,1474                                  EBANK=   CDUIND                                
059989,000596: 07,3437           03442 16063                     2CADR    8192AUG                               
059990,000597: 
059991,000598: 07,3441           13422                           TCF      GYROEXIT                              
059992,000599: 
059993,000600: 07,3442           03524        8192AUG            TC       CAGETEST                              
059994,000601: 
059995,000602: 07,3443           35030                           CAF      BIT4                                  
059996,000603: 07,3444           00006                           EXTEND                                         
059997,000604: 07,3445           02012                           RAND     CHAN12                                
059998,000605: 07,3446           10000                           CCS      A                                     
059999,000606: 07,3447           13522                           TCF      IMUBAD                                
060000,000607: 07,3450           31304                           CA       LGYRO                                 #  ADD 8192 PULSES TO GYROCMD
060001,000608: 07,3451           54003                           TS       EBANK                                 
060002,000609: 07,3452           74373                           MASK     LOW8                                  
060003,000610: 07,3453           54061                           TS       ITEMP1                                
060004,000611: 
060005,000612: 07,3454           50061                           INDEX    ITEMP1                                #  SEE IF THIS IS THE LAST AUG.
060006,000613: 07,3455           11400                           CCS      1400                                  
060007,000614: 07,3456           13462                           TCF      AUG2                                  #  MORE TO COME.
060008,000615: 
060009,000616: 07,3457           35016                           CAF      BIT14                                 
060010,000617: 07,3460           26047                           ADS      GYROCMD                               
060011,000618: 07,3461           13414                           TCF      LASTSEG    +1                         
060012,000619: 
060013,000620: 07,3462           50061        AUG2               INDEX    ITEMP1                                
060014,000621: 07,3463           55400                           TS       1400                                  
060015,000622: 07,3464           35016                           CAF      BIT14                                 
060016,000623: 07,3465           26047                           ADS      GYROCMD                               
060017,000624: 07,3466           13433                           TCF      AUG3                                  #  COMPUTE DT.
060018,000625: 
060019,000626: 07,3467           63403        MIN-               AD       -GYROMIN                              #  POSSIBLE NEGATIVE OUTPUT.
060020,000627: 07,3470           00006                           EXTEND                                         
060021,000628: 07,3471           63274                           BZMF     STRTGYR2                              
060022,000629: 
060023,000630: 07,3472           00006        MAJ-               EXTEND                                         #  DEFINITE NEGATIVE OUTPUT.
060024,000631: 07,3473           43513                           DCS      GYROFRAC                              
060025,000632: 07,3474           20071                           DAS      RUPTREG1                              
060026,000633: 
060027,000634: 07,3475           30064                           CA       ITEMP4                                #  SELECT NEGATIVE TORQUING FOR THIS GYRO.
060028,000635: 07,3476           65023                           AD       BIT9                                  
060029,000636: 07,3477           00006                           EXTEND                                         
060030,000637: 07,3500           05014                           WOR      CHAN14                                
060031,000638: 
060032,000639: 07,3501           40070                           CS       RUPTREG1                              #  SET UP RUPTREGS TO FALL INTO GMERGE.
060033,000640: 07,3502           54070                           TS       RUPTREG1                              #  ALL NUMBERS PUT INTO GYROCMD ARE
060034,000641: 07,3503           40071                           CS       RUPTREG2                              #  POSITIVE - BIT9 OF CHAN 14 DETERMINES
060035,000642: 07,3504           76043                           MASK     LOW7                                  #  THE SIGN OF THE COMMAND.
060036,000643: 07,3505           40000                           COM                                            
060037,000644: 07,3506           56071                           XCH      RUPTREG2                              
060038,000645: 07,3507           40000                           COM                                            
060039,000646: 07,3510           13363                           TCF      GMERGE                                
060040,000647: 
060041,000648: 07,3511           01700        GDESELCT           OCT      1700                                  #  TURN OFF SELECT AND ACTIVITY BITS.
060042,000649: 
060043,000650: 07,3512           00000 00034  GYROFRAC           2DEC     .215       B-21                       
060044,000651: 
060045,000652:                                                                                                  #  IMU MODE SWITCHING ROUTINES COME HERE WHEN ACTION COMPLETE.
060046,000653: 
060047,000654: 07,3514           00006        ENDIMU             EXTEND                                         #  MODE IS BAD IF CAGE HAS OCCURED OR IF
060048,000655: 07,3515           00011                           READ     DSALMOUT                              #  ISS WARNING IS ON.
060049,000656: 07,3516           75033                           MASK     BIT1                                  
060050,000657: 07,3517           10000                           CCS      A                                     
060051,000658: 07,3520           13522                           TCF      IMUBAD                                
060052,000659: 
060053,000660: 07,3521           13550        IMUGOOD            TCF      GOODEND                               #  WITH C(A) = 0.
060054,000661: 
060055,000662: 07,3522           35035        IMUBAD             CAF      ZERO                                  
060056,000663: 07,3523           13545                           TCF      BADEND                                
060057,000664: 
060058,000665: 07,3524           35026        CAGETEST           CAF      BIT6                                  #  SUBROUTINE TO TERMINATE IMU MODE
060059,000666: 07,3525           71320                           MASK     IMODES30                              #  SWITCH IF IMU HAS BEEN CAGED.
060060,000667: 07,3526           10000                           CCS      A                                     
060061,000668: 07,3527           13522                           TCF      IMUBAD                                #  DIRECTLY.
060062,000669: 07,3530           00002                           TC       Q                                     #  WITH C(A) = +0.
060063,000670: 
060064,000671: 07,3531           41320        CAGETSTQ           CS       IMODES30                              #  SKIP IF IMU NOT BEING CAGED.
060065,000672: 07,3532           75026                           MASK     BIT6                                  
060066,000673: 07,3533           10000                           CCS      A                                     
060067,000674: 07,3534           24002                           INCR     Q                                     
060068,000675: 07,3535           00002                           TC       Q                                     
060069,000676: 
060070,000677: 07,3536           41320        CAGETSTJ           CS       IMODES30                              #  IF DURING MODE SWITCH INITIALIZATION
060071,000678: 07,3537           75026                           MASK     BIT6                                  #  IT IS FOUND THAT THE IMU IS BEING CAGED,
060072,000679: 07,3540           10000                           CCS      A                                     #  SET IMUCADR TO -0 TO INDICATE OPERATION
060073,000680: 07,3541           00002                           TC       Q                                     #  COMPLETE BUT FAILED.  RETURN IMMEDIATELY
060074,000681: 07,3542           45035                           CS       ZERO                                  #  TO SWRETURN.
060075,000682: 07,3543           55322                           TS       IMUCADR                               
060076,000683: 07,3544           12640                           TCF      MODEEXIT                              
060077,000684: 
060078,000685:                                                                                                  #  GENERALIZED MODE SWITCHING TERMINATION.  ENTER AT GOODEND FOR SUCCESSFUL COMPLETION OF AN I/O OPERATION
060079,000686:                                                                                                  #  OR AT BADEND FOR AN UNSUCCESSFUL ONE.  C(A) OR ARRIVAL =0 FOR IMU, 1 FOR OPTICS.
060080,000687: 
060081,000688: 07,3545           54071        BADEND             TS       RUPTREG2                              #  DEVICE INDEX.
060082,000689: 07,3546           45035                           CS       ZERO                                  #  FOR FAILURE.
060083,000690: 07,3547           13552                           TCF      GOODEND    +2                         
060084,000691: 
060085,000692: 07,3550           54071        GOODEND            TS       RUPTREG2                              
060086,000693: 07,3551           45033                           CS       ONE                                   #  FOR SUCCESS.
060087,000694: 
060088,000695: 07,3552           54072                           TS       RUPTREG3                              
060089,000696: 07,3553           50071                           INDEX    RUPTREG2                              #  SEE IF USING PROGRAM ASLEEP.
060090,000697: 07,3554           11322                           CCS      MODECADR                              
060091,000698: 07,3555           13557                           TCF      +2                                    #  YES - WAKE IT UP.
060092,000699: 07,3556           13567                           TCF      ENDMODE                               #  IF 0, PROGRAM NOT IN YET.
060093,000700: 
060094,000701: 07,3557           35035                           CAF      ZERO                                  #  WAKE SLEEPING PROGRAM.
060095,000702: 07,3560           50071                           INDEX    RUPTREG2                              
060096,000703: 07,3561           57322                           XCH      MODECADR                              
060097,000704: 07,3562           05215                           TC       JOBWAKE                               
060098,000705: 
060099,000706: 07,3563           40072                           CS       RUPTREG3                              #  ADVANCE LOC IF SUCCESSFUL.
060100,000707: 07,3564           50064                           INDEX    LOCCTR                                
060101,000708: 07,3565           26164                           ADS      LOC                                   
060102,000709: 
060103,000710: 07,3566           15340                           TCF      TASKOVER                              
060104,000711: 
060105,000712: 07,3567           30072        ENDMODE            CA       RUPTREG3                              #  -0 INDICATES OPERATION COMPLETE BUT
060106,000713: 07,3570           50071                           INDEX    RUPTREG2                              #  UNSUCCESSFUL - -1 INDICATES COMPLETE AND
060107,000714: 07,3571           55322                           TS       MODECADR                              #  SUCCESSFUL.
060108,000715: 07,3572           15340                           TCF      TASKOVER                              
060109,000716: 
060110,000717:                                                                                                  #  GENERAL STALLING ROUTINE.  USING PROGRAMS COME HERE TO WAIT FOR I/O COMPLETION.
060111,000718: 
060112,000719:                                                                                                  #  PROGRAM DESCRIPTION                           DATE - 21 FEB 1967
060113,000720:                                                                                                  #                                                LOG SECTION IMU MODE SWITCHING
060114,000721:                                                                                                  #  MOD BY - R. MELANSON TO ADD DOCUMENTATION     ASSEMBLY SUNDISK REV. 82
060115,000722: 
060116,000723:                                                                                                  #  FUNCTIONAL DESCRIPTION -
060117,000724:                                                                                                  #        TO DELAY FURTHER EXECUTION OF THE CALLING ROUTINE UNTIL ITS SELECTED
060118,000725:                                                                                                  #        I/O FUNCTION IS COMPLETE.  THE FOLLOWING CHECKS ON THE CALLING ROUTINE:S
060119,000726:                                                                                                  #        MODECADR ARE MADE AND ACTED UPON.
060120,000727:                                                                                                  #        1) +0 INDICATES INCOMPLETE I/O OPERATION.  CALLING ROUTINE IS PUT TO
060121,000728:                                                                                                  #           SLEEP.
060122,000729:                                                                                                  #        2) -1 INDICATES COMPLETED I/O OPERATION.  STALL BYPASSES JOBSLEEP
060123,000730:                                                                                                  #           CALL AND RETURNS TO CALLING ROUTINE AT L+3
060124,000731:                                                                                                  #        3) -0 INDICATES COMPLETED I/O WITH FAILURE.  STALL CLEARS MODECADR
060125,000732:                                                                                                  #           AND RETURNS TO CALLING ROUTINE AT L+2.
060126,000733:                                                                                                  #        4) VALUE GREATER THAN 0 INDICATES TWO ROUTINES CALLING FOR USE OF
060127,000734:                                                                                                  #           SAME DEVICE.  STALL EXITS TO ABORT WHICH EXECUTES A PROGRAM
060128,000735:                                                                                                  #           RESTART WHICH IN TURN CLEARS ALL MODECADR REGISTERS.
060129,000736: 
060130,000737:                                                                                                  #  CALLING SEQUENCE -
060131,000738:                                                                                                  #        L       TC      BANKCALL
060132,000739:                                                                                                  #        L+1     CADR    (ONE OF 5 STALL ADDRESSES  I.E. IMUSTALL, OPTSTALL, RADSTALL,
060133,000740:                                                                                                  #                        AOTSTALL, OR ATTSTALL)
060134,000741: 
060135,000742:                                                                                                  #  NORMAL-EXIT MODE -
060136,000743:                                                                                                  #        TCF JOBSLEEP    OR      TCF MODEXIT
060137,000744: 
060138,000745:                                                                                                  #  ALARM OR ABORT EXIT MODE -
060139,000746:                                                                                                  #        TC      ABORT
060140,000747: 
060141,000748:                                                                                                  #  OUTPUT -
060142,000749:                                                                                                  #        MODECADR=CADR   IF JOBSLEEP
060143,000750:                                                                                                  #        MODECADR=+0     IF I/O COMPLETE
060144,000751:                                                                                                  #        BUF2=L+3        IF I/O COMPLETE AND GOOD.
060145,000752:                                                                                                  #        BUF2=L+2        IF I/O COMPLETE BUT FAILED.
060146,000753: 
060147,000754:                                                                                                  #  ERASABLE INITIALIZATION -
060148,000755:                                                                                                  #        BUF2 CONTAINS RETURN ADDRESS PLUS 1,(L+2)
060149,000756:                                                                                                  #        BUF2+1 CONTAINS FBANK VALUE OF CALLING ROUTINE.
060150,000757:                                                                                                  #        MODECADR OF CALLING ROUTINE CONTAINS +0,-1,-0 OR CADR RETURN ADDRESS.
060151,000758: 
060152,000759:                                                                                                  #  DEBRIS -
060153,000760:                                                                                                  #        RUPTREG2 AND CALLING ROUTINE MODECADR.
060154,000761: 
060155,000762: 07,3573           35033        AOTSTALL           CAF      ONE                                   #  AOT.
060156,000763: 07,3574           03600                           TC       STALL                                 
060157,000764: 
060158,000765: 07,3575           35032        RADSTALL           CAF      TWO                                   
060159,000766: 07,3576           13600                           TCF      STALL                                 
060160,000767: 
060161,000768: 07,3577  07,3573               OPTSTALL           EQUALS   AOTSTALL                              
060162,000769: 
060163,000770: 07,3577           35035        IMUSTALL           CAF      ZERO                                  #  IMU.
060164,000771: 
060165,000772: 07,3600           00004        STALL              INHINT                                         
060166,000773: 07,3601           54071                           TS       RUPTREG2                              #  SAVE DEVICE INDEX.
060167,000774: 07,3602           50000                           INDEX    A                                     #  SEE IF OPERATION COMPLETE.
060168,000775: 07,3603           11322                           CCS      MODECADR                              
060169,000776: 07,3604           13622                           TCF      MODABORT                              #  ALLOWABLE STATES ARE +0, -1, AND -0.
060170,000777: 07,3605           13616                           TCF      MODESLP                               #  OPERATION INCOMPLETE.
060171,000778: 07,3606           13612                           TCF      MODEGOOD                              #  COMPLETE AND GOOD IF = -1.
060172,000779: 
060173,000780: 07,3607           50071        MG2                INDEX    RUPTREG2                              #  COMPLETE AND FAILED IF -0.  RESET TO +0.
060174,000781: 07,3610           55322                           TS       MODECADR                              #  RETURN TO CALLER.
060175,000782: 07,3611           12640                           TCF      MODEEXIT                              
060176,000783: 
060177,000784: 07,3612           10000        MODEGOOD           CCS      A                                     #  MAKE SURE INITIAL STATE -1.
060178,000785: 07,3613           13622                           TCF      MODABORT                              
060179,000786: 
060180,000787: 07,3614           24133                           INCR     BUF2                                  #  IF SO, INCREMENT RETURN ADDRESS AND
060181,000788: 07,3615           13607                           TCF      MG2                                   #  RETURN IMMEDIATELY, SETTING CADR = +0.
060182,000789: 
060183,000790: 07,3616           04725        MODESLP            TC       MAKECADR                              #  CALL FROM SWITCHABLE FIXED ONLY.
060184,000791: 07,3617           50071                           INDEX    RUPTREG2                              
060185,000792: 07,3620           55322                           TS       MODECADR                              
060186,000793: 07,3621           15211                           TCF      JOBSLEEP                              
060187,000794: 
060188,000795: 07,3622           05725        MODABORT           TC       POODOO                                #  TWO PROGRAMS USING SAME DEVICE.
060189,000796: 07,3623           21210                           OCT      21210                                 
060190,000797: 
060191,000798:                                                                                                  #  CONSTANTS FOR MODE SWITCHING ROUTINES
060192,000799: 
060193,000800: 07,3624     5775               BITS3&4            =        OCT14                                 
060194,000801: 07,3624     5047               BITS4&6            =        OCT50                                 
060195,000802: 07,3624     5043               BITS4-5            EQUALS   BITS4&5                               
060196,000803: 07,3624     5024               IMUSEFLG           EQUALS   BIT8                                  #  INTERPRETER SWITCH 7.
060197,000804: 07,3624           77500        -COMMAX            DEC      -191       B-14                       
060198,000805: 07,3625           77477        -COMMAX-           DEC      -192       B-14                       
060199,000806: 07,3626           00074        600MS              DEC      60         B-14                       
060200,000807: 07,3627  07,3073               IMUFIN20           =        IMUFINE                               
060201,000808: 07,3627           31325        GOMANUR            CA       ATTCADR                               #  IS KALCMANU FREE
060202,000809: 07,3630           00006                           EXTEND                                         
060203,000810: 07,3631           13634                           BZF      +3                                    
060204,000811: 07,3632           05725                           TC       POODOO                                #  NO
060205,000812: 07,3633           21210                           OCT      21210                                 #  2 TRYING TO USE SAME DEVICE
060206,000813: 
060207,000814: 07,3634           00006                 +3        EXTEND                                         
060208,000815: 07,3635           30134                           DCA      BUF2                                  
060209,000816: 07,3636           53326                           DXCH     ATTCADR                               #  SAVE FINAL RETURN FOR KALCMAN3
060210,000817: 
060211,000818: 07,3637           30006                           CA       BBANK                                 
060212,000819: 07,3640           75037                           MASK     SEVEN                                 
060213,000820: 07,3641           27326                           ADS      ATTCADR    +1                         
060214,000821: 
060215,000822: 07,3642           30167                           CA       PRIORITY                              
060216,000823: 07,3643           77674                           MASK     PRIO37                                
060217,000824: 07,3644           55327                           TS       ATTPRIO                               #  SAVE USERS PRIO
060218,000825: 
060219,000826: 07,3645           33651                           CAF      KALEBCON                              #  SET EBANK FOR KALCMAN3
060220,000827: 07,3646           54003                           TS       EBANK                                 
060221,000828: 07,3647           04715                           TC       POSTJUMP                              
060222,000829: 07,3650           44000                           CADR     KALCMAN3                              
060223,000830: 07,3651           03261        KALEBCON           ECADR    BCDU                                  
060224,000831: 
060225,000832:                                                                                                  #  PROGRAM DESCRIPTION
060226,000833:                                                                                                  #  IMU STATUS CHECK ROUTINE R02 (SUBROUTINE UTILITY)
060227,000834:                                                                                                  #  MOD NO - 1
060228,000835:                                                                                                  #  MOD BY - N.BRODEUR
060229,000836: 
060230,000837:                                                                                                  #  FUNCTIONAL DESCRIPTION
060231,000838:                                                                                                  #        TO CHECK WHETHER IMU IS ON AND IF ON WHETHER IT IS ALIGNED TO AN
060232,000839:                                                                                                  #        ORIENTATION KNOWN BY THE CMC.  TO REQUEST SELECTION OF THE APPROPRIATE
060233,000840:                                                                                                  #        PROGRAM IF THE IMU IS OFF OR NOT ALIGNED TO AN ORIENTATION KNOWN BY THE
060234,000841:                                                                                                  #        CMC.  CALLED THROUGH BANKCALL
060235,000842: 
060236,000843:                                                                                                  #  CALLING SEQUENCE -
060237,000844:                                                                                                  #        L       TC      BANKCALL
060238,000845:                                                                                                  #        L+1     CADR    R02BOTH
060239,000846: 
060240,000847:                                                                                                  #  SUBROUTINES CALLED
060241,000848:                                                                                                  #        VARALARM
060242,000849:                                                                                                  #        FLAGUP
060243,000850: 
060244,000851:                                                                                                  #  NORMAL EXIT MODES
060245,000852:                                                                                                  #        AT L+2 OF CALLING SEQUENCE
060246,000853: 
060247,000854:                                                                                                  #  ALARM OR ABORT EXIT MODES
060248,000855:                                                                                                  #        GOTOPOOH, WITH ALARM
060249,000856: 
060250,000857:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
060251,000858:                                                                                                  #        NONE
060252,000859: 
060253,000860:                                                                                                  #  DEBRIS
060254,000861:                                                                                                  #        CENTRALS - A,Q,L
060255,000862: 
060256,000863: 34,3763                                           BANK     34                                    
060257,000864: 07,2000                                           SETLOC   R02                                   
060258,000865: 07,2000                                           BANK                                           
060259,000866: 07,3652                                           COUNT    04/R02                                #  COUNT*
060260,000867: 
060261,000868: 07,3652           00063        DEC51              DEC      51         B-14                       
060262,000869: 07,3653           35017        R02BOTH            CAF      BIT13                                 
060263,000870: 07,3654           70077                           MASK     STATE      +3                         #  REFSMFLG
060264,000871: 07,3655           10000                           CCS      A                                     
060265,000872: 07,3656           03667                           TC       R02ZERO                               #  ZERO IMUS
060266,000873: 
060267,000874: 07,3657           31320                           CA       IMODES30                              
060268,000875: 07,3660           75023                           MASK     BIT9                                  #  IS ISS INITIALIZED
060269,000876: 07,3661           00006                           EXTEND                                         
060270,000877: 07,3662           13664                           BZF      +2                                    
060271,000878: 07,3663           45030                           CS       BIT4                                  #  SEND IMU ALARM CODE 210
060272,000879: 07,3664           63672                           AD       OCT220                                #  SEND REFSMM ALARM
060273,000880: 07,3665           05770                           TC       VARALARM                              
060274,000881: 
060275,000882: 07,3666           04106                           TC       GOTOPOOH                              
060276,000883: 
060277,000884: 07,3667           05562        R02ZERO            TC       UPFLAG                                
060278,000885: 07,3670           00007                           ADRES    IMUSE                                 
060279,000886: 07,3671           14711                           TCF      SWRETURN                              
060280,000887: 07,3672           00220        OCT220             OCT      220                                   
060281,000888: 
060282,000889:                                                                                                  #  PROGRAM DESCRIPTION   P06             10FEB67
060283,000890: 
060284,000891:                                                                                                  #  TRANSFER THE ISS/CMC FROM THE OPERATE TO THE STANDBY CONDITION.
060285,000892: 
060286,000893:                                                                                                  #  THE NORMAL CONDITION OF READINESS OF THE GNCS WHEN NOT IN USE IS STANDBY.  IN THIS CONDITION THE IMU
060287,000894:                                                                                                  #  HEATER POWER IS ON.  THE IMU OPERATE POWER IS OFF.  THE COMPUTER POWER IS ON.  THE OPTICS POWER IS OFF.  THE
060288,000895:                                                                                                  #  CMC STANDBY ON THE MAIN AND LEB DISKYS IS ON.
060289,000896: 
060290,000897:                                                                                                  #  CALLING SEQUENCE:
060291,000898:                                                                                                  #        ASTRONAUT REQUEST THROUGH DSKY  V37E 06E.
060292,000899: 
060293,000900:                                                                                                  #  SUBROUTINES CALLED:
060294,000901:                                                                                                  #        GOPERF1
060295,000902:                                                                                                  #        BANKCALL
060296,000903:                                                                                                  #        FLAGDOWN
060297,000904: 
060298,000905:                                                                                                  #  PRESTAND PREPARES FOR STANDBY BY SNAPSHOTTING THE SCALER AND TIME1 TIME2
060299,000906:                                                                                                  #  THE LOW 5 BITS OF THE SCALER ARE INSPECTED TO INSURE COMPATABILITY
060300,000907:                                                                                                  #  BETWEEN THE SCALER READING AND THE TIME1 TIME2 READING.
060301,000908: 
060302,000909: 26,2000                                           SETLOC   P05P06                                
060303,000910: 26,2000                                           BANK                                           
060304,000911: 
060305,000912: 26,3657     1150                                  EBANK=   TIME2SAV                              
060306,000913: 26,3657                                           COUNT*   $$/P06                                
060307,000914: 
060308,000915: 26,3657           05562        P06                TC       UPFLAG                                #  SET NODOV37 BIT
060309,000916: 26,3660           00054                           ADRES    NODOFLAG                              
060310,000917: 
060311,000918: 26,3661           00004        PRESTAND           INHINT                                         
060312,000919: 26,3662           00006                           EXTEND                                         
060313,000920: 26,3663           30025                           DCA      TIME2                                 #  SNAPSHOT TIME1 TIME2
060314,000921: 26,3664           53151                           DXCH     TIME2SAV                              
060315,000922: 26,3665           03716                           TC       SCALPREP                              
060316,000923: 26,3666           03661                           TC       PRESTAND                              #  T1,T2,SCALER NOT COMPATIBLE
060317,000924: 26,3667           52155                           DXCH     MPAC                                  #  T1,T2 AND SCALER OK
060318,000925: 26,3670           53153                           DXCH     SCALSAVE                              #  STORE SCALER
060319,000926: 26,3671           00004                           INHINT                                         
060320,000927: 26,3672           04676                           TC       BANKCALL                              
060321,000928: 26,3673           17060                           CADR     RNDREFDR                              #  REFSMM, DRIFT, TRACK FLAGS DOWN
060322,000929: 
060323,000930: 26,3674           05574                           TC       DOWNFLAG                              
060324,000931: 26,3675           00007                           ADRES    IMUSE                                 #  IMUSE DOWN
060325,000932: 26,3676           05574                           TC       DOWNFLAG                              
060326,000933: 26,3677           00010                           ADRES    RNDVZFLG                              #  RNDVZFLG DOWN
060327,000934: 
060328,000935: 26,3700           35021                           CAF      BIT11                                 
060329,000936: 26,3701           00006                           EXTEND                                         
060330,000937: 26,3702           05013                           WOR      CHAN13                                #  SET STANDBY ENABLE BIT
060331,000938: 
060332,000939: 26,3703           05426                           TC       PHASCHNG                              #  SET RESTART TO POSTAND WHEN STANDBY
060333,000940: 26,3704           07024                           OCT      07024                                 #        RECOVERS
060334,000941: 26,3705           20000                           OCT      20000                                 
060335,000942: 26,3706     1152                                  EBANK=   SCALSAVE                              
060336,000943: 26,3706           03736 54062                     2CADR    POSTAND                               
060337,000944: 
060338,000945: 26,3710           35052                           CAF      OCT62                                 
060339,000946: 26,3711           04676                           TC       BANKCALL                              
060340,000947: 26,3712           21045                           CADR     GOPERF1                               
060341,000948: 26,3713           13710                           TCF      -3                                    
060342,000949: 26,3714           13710                           TCF      -4                                    
060343,000950: 26,3715           13710                           TCF      -5                                    
060344,000951: 
060345,000952: 26,3716     5052               OCT62              EQUALS   .5SEC                                 #  DEC 50 = OCT 62
060346,000953: 
060347,000954:                                                                                                  #  THE LOW 5 BITS OF THE SCALER READS 10000 FOR THE FIRST INTERVAL AFTER A
060348,000955:                                                                                                  #  T1 INCREMENT.  IF SCALPREP DETECTS THIS INTERVAL THE T1,T2 AND SCALER
060349,000956:                                                                                                  #  DATA ARE NOT COMPATABLE AND RETURN IS TO L+1 FOR ANOTHER READING OF THE
060350,000957:                                                                                                  #  DATA.  OTHERWISE, THE RETURN IS TO L+2 TO PROCEED.  ROUTINE ALSO PREPARES
060351,000958:                                                                                                  #  THE SCALER READING FOR COMPUTATION OF THE INCREMENT TO UPDATE T1T2.  (THE
060352,000959:                                                                                                  #  10 MS BIT (BIT 6) OF THE SCALER IS INCREMENTED 5 MS OUT OF PHASE FROM
060353,000960:                                                                                                  #  T1.) ADDITION OF 5 MS (BIT 5) TO THE SCALER READING HAS THE EFFECT OF
060354,000961:                                                                                                  #  ADJUSTING BIT 6 IN THE SCALER TO BE IN PHASE WITH BIT 1 OF T1.  THE LOW 5
060355,000962:                                                                                                  #  BITS OF THE SCALER READING ARE THEN SET TO ZERO, TO TRUNCATE THE SCALER
060356,000963:                                                                                                  #  DATA TO 10 MS.  RESULTS ARE STORED IN MPAC, +1.
060357,000964: 
060358,000965: 26,3716           00006        SCALPREP           EXTEND                                         
060359,000966: 26,3717           22156                           QXCH     MPAC       +2                         
060360,000967: 26,3720           04554                           TC       FINETIME   +1                         
060361,000968: 26,3721           00003                           RELINT                                         
060362,000969: 26,3722           52155                           DXCH     MPAC                                  
060363,000970: 26,3723           35027                           CA       BIT5                                  #  ADD 5 MS TO THE SCALER READING.
060364,000971: 26,3724           54001                           TS       L                                     
060365,000972: 26,3725           35035                           CA       ZERO                                  
060366,000973: 26,3726           20155                           DAS      MPAC                                  
060367,000974: 26,3727           44362                           CS       LOW5                                  #  SET LOW 5 BITS OF (SCALER+5MS) TO ZERO
060368,000975: 26,3730           70155                           MASK     MPAC       +1                         #  AND STORE RESULTS IN MPAC,+1.
060369,000976: 26,3731           56155                           XCH      MPAC       +1                         
060370,000977: 26,3732           74362                           MASK     LOW5                                  #  TEST LOW 5 BITS OF SCALER FOR THE FIRST
060371,000978:                                                                                                  #  INTERVAL AFTER THE T1 INCREMENT
060372,000979:                                                                                                  #  (NOW = 00000, SINCE BIT 5 ADDED).
060373,000980: 26,3733           10000                           CCS      A                                     #  IS IT 1ST INTERVAL AFTER T1 INCREMENT
060374,000981: 26,3734           24156                           INCR     MPAC       +2                         #  NO
060375,000982: 26,3735           00156                           TC       MPAC       +2                         #  YES
060376,000983: 
060377,000984:                                                                                                  #  POSTAND RECOVERS TIME AFTER STANDBY.  THE SCALER IS SNAPSHOTTED AND THE
060378,000985:                                                                                                  #  TIME1 TIME2 COUNTER IS SET TO ZERO.  THE LOW 5 BITS OF THE SCALER ARE
060379,000986:                                                                                                  #  INSPECTED TO INSURE COMPATABILITY BETWEEN THE SCALER READING AND THE
060380,000987:                                                                                                  #  CLEARING OF THE TIME COUNTER.  IT THEN COMPUTES THE DIFFERENCE IN SCALER
060381,000988:                                                                                                  #  VALUES (IN DP) AND ADDS THIS TO THE PREVIOUSLY SNAPSHOTTED VALUES OF
060382,000989:                                                                                                  #  TIME1 TIME2 AND PLACES THIS NEW TIME INTO THE TIME1 TIME2 COUNTER.
060383,000990: 
060384,000991: 26,3736                                           COUNT*   $$/P05                                
060385,000992: 
060386,000993: 26,3736           45021        POSTAND            CS       BIT11                                 #  RECOVER TIME AFTER STANDBY.
060387,000994: 26,3737           00006                           EXTEND                                         
060388,000995: 26,3740           03013                           WAND     CHAN13                                #  CLEAR STANDBY ENABLE BIT
060389,000996: 26,3741           00004                           INHINT                                         
060390,000997: 26,3742           35035                           CA       ZERO                                  
060391,000998: 26,3743           54001                           TS       L                                     
060392,000999: 26,3744           52025                           DXCH     TIME2                                 #  CLEAR TIME1 TIME2
060393,001000: 26,3745           03716                           TC       SCALPREP                              #  STORE SCALER IN MPAC, MPAC+1
060394,001001: 26,3746           03741                           TC       POSTAND    +3                         #  T1,T2,SCALER NOT COMPATIBLE
060395,001002: 26,3747           00006                           EXTEND                                         #  T1,T2 AND SCALER OK
060396,001003: 26,3750           41153                           DCS      SCALSAVE                              
060397,001004: 26,3751           20155                           DAS      MPAC                                  #  FORM DP DIFFERENCE OF POSTSTANDBY SCALER
060398,001005: 26,3752           35022                           CAF      BIT10                                 #  MINUS PRESTANDBY SCALER AND SHIFT RIGHT
060399,001006: 26,3753           07256                           TC       SHORTMP                               #  5 TO ALIGN BITS WITH TIME1 TIME2.
060400,001007: 26,3754           35035                           CAF      ZERO                                  
060401,001008: 26,3755           54156                           TS       MPAC       +2                         #  NEEDED FOR TP AGREE
060402,001009: 26,3756           07226                           TC       TPAGREE                               #  MAKE DP DIFF AGREE
060403,001010: 26,3757           10154                           CCS      MPAC                                  
060404,001011: 26,3760           03765                           TC       POSTCOM                               #  IF DP DIFF NET +, NO SCALER OVERFLOW
060405,001012: 26,3761           03765                           TC       POSTCOM                               #  BETWEEN PRE AND POST STANDBY.
060406,001013: 26,3762           03763                           TC       +1                                    #  IF DP DIFF NET -, SCALER OVERFLOWED.  ADD
060407,001014: 26,3763           35022                           CAF      BIT10                                 #  BIT 10 TO HIGH DIFF TO CORRECT.
060408,001015: 26,3764           26154                           ADS      MPAC                                  
060409,001016: 26,3765           00006        POSTCOM            EXTEND                                         #  C(MPAC,+1) IS MAGNITUDE OF DELTA SCALER.
060410,001017: 26,3766           31151                           DCA      TIME2SAV                              #  PRESTANDBY TIME1 TIME2
060411,001018: 26,3767           20155                           DAS      MPAC                                  
060412,001019: 26,3770           07226                           TC       TPAGREE                               #  FORCE SIGN AGREEMENT
060413,001020: 26,3771           52155                           DXCH     MPAC                                  #  UPDATED VALUE FOR T1,T2.
060414,001021: 26,3772           20025                           DAS      TIME2                                 #  LOAD UPDATED VALUE INTO T1,T2, WITH
060415,001022: 26,3773           05574                           TC       DOWNFLAG                              #  CLEAR NODOFLAG
060416,001023: 26,3774           00054                           ADRES    NODOFLAG                              
060417,001024: 
060418,001025: 26,3775           04106                           TC       GOTOPOOH                              
060419,001026: 
060420,001027: 
060421,001028: 

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