Source Code

These source-code files are part of a reconstructed copy of LM131 revision 1, the final release of the Apollo 13 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The source reconstruction began with source code of Luminary 131 previously transcribed from a digitized copy of that program. A dump of the flight spare core rope memory module B5, part number 2010802-171, serial number RAY 411, was obtained. This module is the only module different between Luminary 131 and LM131 revision 1. The dump was disassembled and all changes were incorporated into these source files. Note that page numbers in the reconstructed code match those on the Luminary 131 printout, although the changed code would likely have changed page numbers for a real LM131 revision 1 listing.

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

013478,000002:                                                                                                  ## Copyright:   Public domain.
013479,000003:                                                                                                  ## Filename:    IMU_COMPENSATION_PACKAGE.agc
013480,000004:                                                                                                  ## Purpose:     A section of LM131 revision 1.
013481,000005:                                                                                                  ##              It is part of the reconstructed source code for the final
013482,000006:                                                                                                  ##              release of the flight software for the Lunar Module's (LM)
013483,000007:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13. The code has
013484,000008:                                                                                                  ##              been reconstructed from a listing of Luminary 131 and a dump
013485,000009:                                                                                                  ##              of a core rope memory module B5, part number 2010802-171,
013486,000010:                                                                                                  ##              which is the only module different between LM131 revision 1
013487,000011:                                                                                                  ##              and Luminary 131. The executable generated from this source
013488,000012:                                                                                                  ##              has been verified against the module dump, so while the names,
013489,000013:                                                                                                  ##              comments, and ordering may not be exactly correct, the
013490,000014:                                                                                                  ##              resulting binary is.
013491,000015:                                                                                                  ## Reference:   pp. 328-339
013492,000016:                                                                                                  ## Assembler:   yaYUL
013493,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
013494,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
013495,000019:                                                                                                  ## Mod history: 2022-10-28 MAS  Created from Luminary 131.
013496,000020: 

Page 328

013498,000022: 07,2666                                           BANK     7                                     
013499,000023: 06,2000                                           SETLOC   IMUCOMP                               
013500,000024: 06,2000                                           BANK                                           
013501,000025: 
013502,000026: 06,3271  E3,1460                                  EBANK=   NBDX                                  
013503,000027: 
013504,000028: 06,3271                                           COUNT*   $$/ICOMP                              
013505,000029: 06,3271           33537        1/PIPA             CAF      LGCOMP                                #  SAVE EBANK OF CALLING PROGRAM
013506,000030: 06,3272           56003                           XCH      EBANK                                 
013507,000031: 06,3273           54163                           TS       MODE                                  
013508,000032: 
013509,000033: 06,3274           11477                           CCS      GCOMPSW                               #  BYPASS IF GCOMPSW NEGATIVE
013510,000034: 06,3275           13300                           TCF      +3                                    
013511,000035: 06,3276           13300                           TCF      +2                                    
013512,000036: 06,3277           13361                           TCF      IRIG1                                 #  RETURN
013513,000037: 
013514,000038: 06,3300           34751        1/PIPA1            CAF      FOUR                                  #  PIPAZ, PIPAY, PIPAX
013515,000039: 06,3301           54132                           TS       BUF        +2                         
013516,000040: 
013517,000041: 06,3302           50132                           INDEX    BUF        +2                         
013518,000042: 06,3303           31453                           CA       PIPASCF                               #  (P.P.M.) X 2(-9)
013519,000043: 06,3304           00006                           EXTEND                                         
013520,000044: 06,3305           50132                           INDEX    BUF        +2                         
013521,000045: 06,3306           70324                           MP       DELVX                                 #  (PP) X 2(+14) NOW (PIPA PULSES) X 2(+5)
013522,000046: 06,3307           54002                           TS       Q                                     #  SAVE MAJOR PART
013523,000047: 
013524,000048: 06,3310           30001                           CA       L                                     #  MINOR PART
013525,000049: 06,3311           00006                           EXTEND                                         
013526,000050: 06,3312           74746                           MP       BIT6                                  #  SCALE 2(+9)   SHIFT RIGHT 9
013527,000051: 
013528,000052: 06,3313           50132                           INDEX    BUF        +2                         
013529,000053: 06,3314           54325                           TS       DELVX      +1                         #  FRACTIONAL PIPA PULSES SCALED 2(+14)
013530,000054: 
013531,000055: 06,3315           30002                           CA       Q                                     #  MAJOR PART
013532,000056: 06,3316           00006                           EXTEND                                         
013533,000057: 06,3317           74746                           MP       BIT6                                  #  SCALE 2(+9)   SHIFT RIGHT 9
013534,000058: 06,3320           50132                           INDEX    BUF        +2                         
013535,000059: 06,3321           20325                           DAS      DELVX                                 #  (PIPAI) + (PIPAI)(SFE)
013536,000060: 
013537,000061: 06,3322           50132                           INDEX    BUF        +2                         
013538,000062: 06,3323           41452                           CS       PIPABIAS                              #  (PIPA PULSES)/(CS) X 2(-3)                    *
013539,000063: 06,3324           00006                           EXTEND                                         
013540,000064: 06,3325           71074                           MP       1/PIPADT                              #  (CS) X 2(+8) NOW (PIPA PULSES) X 2(+5)        *
013541,000065: 06,3326           00006                           EXTEND                                         
013542,000066: 06,3327           74746                           MP       BIT6                                  #  SCALE 2(+9) SHIFT RIGHT 9                     *
013543,000067: 06,3330           50132                           INDEX    BUF        +2                         
013544,000068: 06,3331           20325                           DAS      DELVX                                 #  (PIPAI) + (PIPAI)(SFE) - (BIAS)(DELTAT)
013545,000069: 
013546,000070: 06,3332           10132                           CCS      BUF        +2                         #  PIPAZ, PIPAY, PIPAX
013547,000071: 06,3333           67752                           AD       NEG1                                  
013548,000072: 06,3334           13301                           TCF      1/PIPA1    +1                         

Page 329

013550,000074: 06,3335           13336                           NOOP                                           #  LESS THAN ZERO IMPOSSIBLE
013551,000075: 

Page 330

013553,000077: 06,3336           55477        IRIGCOMP           TS       GCOMPSW                               #  INDICATE COMMANDS 2 PULSES OR LESS.
013554,000078: 06,3337           54130                           TS       BUF                                   #  INDEX COUNTER.  IRIGX, IRIGY, IRIGZ.
013555,000079: 
013556,000080: 06,3340           03364                           TC       IRIGX                                 #  COMPENSATE ACCELERATION TERMS
013557,000081: 
013558,000082: 06,3341           41460                           CS       NBDX                                  #  (GYRO PULSES)/(CS) X 2(-5)
013559,000083: 06,3342           03462                           TC       DRIFTSUB                              #  -(NBOX)(DELTAT)       (GYRO PULSES) X 2(+14)
013560,000084: 
013561,000085: 06,3343           03401                           TC       IRIGY                                 #  COMPENSATE ACCELERATION TERMS
013562,000086: 
013563,000087: 06,3344           41461                           CS       NBDY                                  #  (GYRO PULSES)/(CS) X 2(-5)
013564,000088: 06,3345           03462                           TC       DRIFTSUB                              #  -(NBDY)(DELTAT)       (GYRO PULSES) X 2(+14)
013565,000089: 
013566,000090: 06,3346           03416                           TC       IRIGZ                                 #  COMPENSATE ACCELERATION TERMS
013567,000091: 
013568,000092: 06,3347           31462                           CA       NBDZ                                  #  (GYRO PULSES)/(CS) X 2(-5)
013569,000093: 06,3350           03462                           TC       DRIFTSUB                              #  +(NBDZ)(DELTAT)       (GYRO PULSES) X 2(+14)
013570,000094: 
013571,000095: 06,3351           11477                           CCS      GCOMPSW                               #  ARE GYRO COMMANDS GREATER THAN 2 PULSES
013572,000096: 06,3352           13354                           TCF      +2                                    #  YES   SEND OUT GYRO TORQUING COMMANDS.
013573,000097: 06,3353           13361                           TCF      IRIG1                                 #  NO    RETURN
013574,000098: 
013575,000099: 06,3354           35031                           CA       PRIO21                                #  PRIO GREATER THAN SERVICER
013576,000100: 06,3355           05072                           TC       NOVAC                                 #  SEND OUT GYRO TORQUING COMMANDS.
013577,000101: 06,3356  E3,1460                                  EBANK=   NBDX                                  
013578,000102: 06,3356           03515 14063                     2CADR    1/GYRO                                
013579,000103: 
013580,000104: 06,3360           00003                           RELINT                                         
013581,000105: 06,3361           30163        IRIG1              CA       MODE                                  #  RESTORE CALLER S EBANK
013582,000106: 06,3362           54003                           TS       EBANK                                 
013583,000107: 06,3363           14631                           TCF      SWRETURN                              
013584,000108: 

Page 331

013586,000110: 06,3364           00006        IRIGX              EXTEND                                         
013587,000111: 06,3365           22156                           QXCH     MPAC       +2                         #  SAVE Q
013588,000112: 06,3366           00006                           EXTEND                                         
013589,000113: 06,3367           40325                           DCS      DELVX                                 #  (PIPA PULSES) X 2(+14)
013590,000114: 06,3370           52155                           DXCH     MPAC                                  
013591,000115: 06,3371           31463                           CA       ADIAX                                 #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *
013592,000116: 06,3372           03433                           TC       GCOMPSUB                              #  -(ADIAX)(PIPAX)       (GYRO PULSES) X 2(+14)
013593,000117: 
013594,000118: 06,3373           00006                           EXTEND                                         #  
013595,000119: 06,3374           40327                           DCS      DELVY                                 #        (PIPA PULSES) X 2(+14)
013596,000120: 06,3375           52155                           DXCH     MPAC                                  #  
013597,000121: 06,3376           41466                           CS       ADSRAX                                #        (GYRO PULSES)/(PIPA PULSE) X 2(-6)      *
013598,000122: 06,3377           03433                           TC       GCOMPSUB                              #        -(ADSRAX)(PIPAY)        (GYRO PULSES) X 2(+14)
013599,000123: 
013600,000124:                                                                                                  #                EXTEND                  ***
013601,000125:                                                                                                  #                DCS     DELVZ           ***     (PIPA PULSES) X 2(+14)
013602,000126:                                                                                                  #                DXCH    MPAC            ***
013603,000127:                                                                                                  #                CA      ADOAX           ***     (GYRO PULSES)/(PIPA PULSE) X 2(-6)      *
013604,000128:                                                                                                  #                TC      GCOMPSUB        ***     -(ADOAX)(PIPAZ)         (GYRO PULSES) X 2(+14)
013605,000129: 
013606,000130: 06,3400           00156                           TC       MPAC       +2                         
013607,000131: 
013608,000132: 06,3401           00006        IRIGY              EXTEND                                         
013609,000133: 06,3402           22156                           QXCH     MPAC       +2                         #  SAVE Q
013610,000134: 06,3403           00006                           EXTEND                                         
013611,000135: 06,3404           40327                           DCS      DELVY                                 #  (PIPA PULSES) X 2(+14)
013612,000136: 06,3405           52155                           DXCH     MPAC                                  
013613,000137: 06,3406           31464                           CA       ADIAY                                 #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *
013614,000138: 06,3407           03433                           TC       GCOMPSUB                              #  -(ADIAY)(PIPAY)       (GYRO PULSES) X 2(+14)
013615,000139: 
013616,000140: 06,3410           00006                           EXTEND                                         
013617,000141: 06,3411           40331                           DCS      DELVZ                                 #  (PIPA PULSES) X 2(+14)
013618,000142: 06,3412           52155                           DXCH     MPAC                                  
013619,000143: 06,3413           41467                           CS       ADSRAY                                #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *
013620,000144: 06,3414           03433                           TC       GCOMPSUB                              #  +(ADSRAY)(PIPAZ)      (GYRO PULSES) X 2(+14)
013621,000145: 
013622,000146:                                                                                                  #                EXTEND                  ***
013623,000147:                                                                                                  #                DCS     DELVX           ***     (PIPA PULSES) X 2(+14)
013624,000148:                                                                                                  #                DXCH    MPAC            ***
013625,000149:                                                                                                  #                CA      ADOAY           ***     (GYRO PULSES)/(PIPA PULSE) X 2(-6)      *
013626,000150:                                                                                                  #                TC      GCOMPSUB        ***     -(ADOAY)(PIPAX)   (GYRO PULSES) X 2(+14)
013627,000151: 
013628,000152: 06,3415           00156                           TC       MPAC       +2                         
013629,000153: 
013630,000154: 06,3416           00006        IRIGZ              EXTEND                                         
013631,000155: 06,3417           22156                           QXCH     MPAC       +2                         #  SAVE Q
013632,000156: 06,3420           00006                           EXTEND                                         
013633,000157: 06,3421           40327                           DCS      DELVY                                 #  (PIPA PULSES) X 2(+14)
013634,000158: 06,3422           52155                           DXCH     MPAC                                  
013635,000159: 06,3423           31470                           CA       ADSRAZ                                #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *

Page 332

013637,000161: 06,3424           03433                           TC       GCOMPSUB                              #  -(ADSRAZ)(PIPAY)      (GYRO PULSES) X 2(+14)
013638,000162: 
013639,000163: 06,3425           00006                           EXTEND                                         
013640,000164: 06,3426           40331                           DCS      DELVZ                                 #  (PIPA PULSES) X 2(+14)
013641,000165: 06,3427           52155                           DXCH     MPAC                                  
013642,000166: 06,3430           31465                           CA       ADIAZ                                 #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *
013643,000167: 06,3431           03433                           TC       GCOMPSUB                              #  -(ADIAZ)(PIPAZ)       (GYRO PULSES) X 2(+14)
013644,000168: 
013645,000169:                                                                                                  #                EXTEND                  ***
013646,000170:                                                                                                  #                DCS     DELVX           ***     (PIPA PULSE) X 2(+14)
013647,000171:                                                                                                  #                DXCH    MPAC            ***
013648,000172:                                                                                                  #                CS      ADOAZ           ***     (GYRO PULSES)/(PIPA PULSE) X 2(-6)      *
013649,000173:                                                                                                  #                TC      GCOMPSUB        ***     +(ADOAZ)(PIPAX) (GYRO PULSES) X 2(+14)
013650,000174: 
013651,000175: 06,3432           00156                           TC       MPAC       +2                         
013652,000176: 

Page 333

013654,000178: 06,3433           56154        GCOMPSUB           XCH      MPAC                                  #  ADIA OR ADSRA COEFFICIENT ARRIVES IN A
013655,000179: 06,3434           00006                           EXTEND                                         #  C(MPAC) = (PIPA PULSES) X 2(+14)
013656,000180: 06,3435           70154                           MP       MPAC                                  #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *
013657,000181: 06,3436           52123                           DXCH     VBUF                                  #  NOW = (GYRO PULSES) X 2(+8)                   *
013658,000182: 
013659,000183: 06,3437           30155                           CA       MPAC       +1                         #  MINOR PART PIPA PULSES
013660,000184: 06,3440           00006                           EXTEND                                         
013661,000185: 06,3441           70154                           MP       MPAC                                  #  ADIA OR ADSRA
013662,000186: 06,3442           54001                           TS       L                                     
013663,000187: 06,3443           34755                           CAF      ZERO                                  
013664,000188: 06,3444           20123                           DAS      VBUF                                  #  NOW = (GYRO PULSES) X 2(+8)                   *
013665,000189: 
013666,000190: 06,3445           30122                           CA       VBUF                                  #  PARTIAL RESULT - MAJOR
013667,000191: 06,3446           00006                           EXTEND                                         
013668,000192: 06,3447           74743                           MP       BIT9                                  #  SCALE 2(+6)   SHIFT RIGHT 6                   *
013669,000193: 06,3450           50130                           INDEX    BUF                                   #  RESULT = (GYRO PULSES) X 2(+14)
013670,000194: 06,3451           21472                           DAS      GCOMP                                 #  HI(ADIA)(PIPAI) OR HI(ADSRA)(PIPAI)
013671,000195: 
013672,000196: 06,3452           30123                           CA       VBUF       +1                         #  PARTIAL RESULT - MINOR
013673,000197: 06,3453           00006                           EXTEND                                         
013674,000198: 06,3454           74743                           MP       BIT9                                  #  SCALE 2(+6)   SHIFT RIGHT 6                   *
013675,000199: 06,3455           54001                           TS       L                                     
013676,000200: 06,3456           34755                           CAF      ZERO                                  
013677,000201: 06,3457           50130                           INDEX    BUF                                   #  RESULT = (GYRO PULSES) X 2(+14)
013678,000202: 06,3460           21472                           DAS      GCOMP                                 #  (ADIA)(PIPAI) OR (ADSRA)(PIPAI)
013679,000203: 
013680,000204: 06,3461           00002                           TC       Q                                     
013681,000205: 

Page 334

013683,000207: 06,3462           00006        DRIFTSUB           EXTEND                                         
013684,000208: 06,3463           22131                           QXCH     BUF        +1                         
013685,000209: 
013686,000210: 06,3464           00006                           EXTEND                                         #  C(A) = NBD    (GYRO PULSES)/(CS) X 2(-5)
013687,000211: 06,3465           71074                           MP       1/PIPADT                              #  (CS) X 2(+8)  NOW (GYRO PULSES) X 2(+3)
013688,000212: 06,3466           22155                           LXCH     MPAC       +1                         #  SAVE FOR FRACTIONAL COMPENSATION
013689,000213: 06,3467           00006                           EXTEND                                         
013690,000214: 06,3470           74750                           MP       BIT4                                  #  SCALE 2(+11)  SHIFT RIGHT 11
013691,000215: 06,3471           50130                           INDEX    BUF                                   
013692,000216: 06,3472           21472                           DAS      GCOMP                                 #  HI(NBD)(DELTAT)       (GYRO PULSES) X 2(+14)
013693,000217: 
013694,000218: 06,3473           30155                           CA       MPAC       +1                         #  NOW MINOR PART
013695,000219: 06,3474           00006                           EXTEND                                         
013696,000220: 06,3475           74750                           MP       BIT4                                  #  SCALE 2(+11)          SHIFT RIGHT 11
013697,000221: 06,3476           54001                           TS       L                                     
013698,000222: 06,3477           34755                           CAF      ZERO                                  
013699,000223: 06,3500           50130                           INDEX    BUF                                   #  ADD IN FRACTIONAL COMPENSATION
013700,000224: 06,3501           21472                           DAS      GCOMP                                 #  (NBD)(DELTAT)         (GYRO PULSES) X 2(+14)
013701,000225: 
013702,000226: 06,3502           34752        DRFTSUB2           CAF      TWO                                   #  PIPAX, PIPAY, PIPAZ
013703,000227: 06,3503           60130                           AD       BUF                                   
013704,000228: 06,3504           56130                           XCH      BUF                                   
013705,000229: 06,3505           50000                           INDEX    A                                     
013706,000230: 06,3506           11471                           CCS      GCOMP                                 #  ARE GYRO COMMANDS 1 PULSE OR GREATER
013707,000231: 06,3507           13511                           TCF      +2                                    #  YES
013708,000232: 06,3510           00131                           TC       BUF        +1                         #  NO
013709,000233: 
013710,000234: 06,3511           73561                           MASK     COMPCHK                               #  DEC -1
013711,000235: 06,3512           10000                           CCS      A                                     #  ARE GYRO COMMANDS GREATER THAN 2 PULSES
013712,000236: 06,3513           55477                           TS       GCOMPSW                               #  YES - SET GCOMPSW POSITIVE
013713,000237: 06,3514           00131                           TC       BUF        +1                         #  NO
013714,000238: 

Page 335

013716,000240: 06,3515           34751        1/GYRO             CAF      FOUR                                  #  PIPAZ, PIPAY, PIPAX
013717,000241: 06,3516           54130                           TS       BUF                                   
013718,000242: 
013719,000243: 06,3517           50130                           INDEX    BUF                                   #  SCALE GYRO COMMANDS FOR IMUPULSE
013720,000244: 06,3520           31472                           CA       GCOMP      +1                         #  FRACTIONAL PULSES
013721,000245: 06,3521           00006                           EXTEND                                         
013722,000246: 06,3522           74744                           MP       BIT8                                  #  SHIFT RIGHT 7
013723,000247: 06,3523           50130                           INDEX    BUF                                   
013724,000248: 06,3524           55472                           TS       GCOMP      +1                         #  FRACTIONAL PULSES SCALED
013725,000249: 
013726,000250: 06,3525           34755                           CAF      ZERO                                  #  SET GCOMP = 0 FOR DAS INSTRUCTION
013727,000251: 06,3526           50130                           INDEX    BUF                                   
013728,000252: 06,3527           57471                           XCH      GCOMP                                 #  GYRO PULSES
013729,000253: 06,3530           00006                           EXTEND                                         
013730,000254: 06,3531           74744                           MP       BIT8                                  #  SHIFT RIGHT 7
013731,000255: 06,3532           50130                           INDEX    BUF                                   
013732,000256: 06,3533           21472                           DAS      GCOMP                                 #  ADD THESE TO FRACTIONAL PULSES ABOVE
013733,000257: 
013734,000258: 06,3534           10130                           CCS      BUF                                   #  PIPAZ, PIPAY, PIPAX
013735,000259: 06,3535           67752                           AD       NEG1                                  
013736,000260: 06,3536           13516                           TCF      1/GYRO     +1                         
013737,000261: 06,3537           01471        LGCOMP             ECADR    GCOMP                                 #  LESS THAN ZERO IMPOSSIBLE
013738,000262: 
013739,000263: 06,3540           33537                           CAF      LGCOMP                                
013740,000264: 06,3541           04616                           TC       BANKCALL                              
013741,000265: 06,3542           17314                           CADR     IMUPULSE                              #  CALL GYRO TORQUING ROUTINE
013742,000266: 06,3543           04616                           TC       BANKCALL                              
013743,000267: 06,3544           17707                           CADR     IMUSTALL                              #  WAIT FOR PULSES TO GET OUT
013744,000268: 06,3545           15155                           TCF      ENDOFJOB                              #  TEMPORARY
013745,000269: 
013746,000270: 06,3546           34751        GCOMP1             CAF      FOUR                                  #  PIPAZ, PIPAY, PIPAX
013747,000271: 06,3547           54130                           TS       BUF                                   
013748,000272: 
013749,000273: 06,3550           50130                           INDEX    BUF                                   #  RESCALE
013750,000274: 06,3551           31472                           CA       GCOMP      +1                         
013751,000275: 06,3552           00006                           EXTEND                                         
013752,000276: 06,3553           74744                           MP       BIT8                                  #  SHIFT MINOR PART LEFT 7 - MAJOR PART = 0
013753,000277: 06,3554           50130                           INDEX    BUF                                   
013754,000278: 06,3555           23472                           LXCH     GCOMP      +1                         #  BITS 8-14 OF MINOR PART WERE = 0
013755,000279: 
013756,000280: 06,3556           10130                           CCS      BUF                                   #  PIPAZ, PIPAY, PIPAX
013757,000281: 06,3557           67752                           AD       NEG1                                  
013758,000282: 06,3560           13547                           TCF      GCOMP1     +1                         
013759,000283: 06,3561           77776        COMPCHK            DEC      -1         B-14                       #  LESS THAN ZERO IMPOSSIBLE
013760,000284: 06,3562           15155                           TCF      ENDOFJOB                              
013761,000285: 

Page 336

013763,000287: 06,3563           11477        NBDONLY            CCS      GCOMPSW                               #  BYPASS IF GCOMPSW NEGATIVE
013764,000288: 06,3564           13567                           TCF      +3                                    
013765,000289: 06,3565           13567                           TCF      +2                                    
013766,000290: 06,3566           15155                           TCF      ENDOFJOB                              
013767,000291: 
013768,000292: 06,3567           00004                           INHINT                                         
013769,000293: 06,3570           10076                           CCS      FLAGWRD2                              #  PREREAD T3RUPT MAY COINCIDE
013770,000294: 06,3571           15155                           TCF      ENDOFJOB                              
013771,000295: 06,3572           15155                           TCF      ENDOFJOB                              
013772,000296: 06,3573           13574                           TCF      +1                                    
013773,000297: 
013774,000298: 06,3574           30104                           CA       FLAGWRD8                              #  IF SURFACE FLAG IS SET, SET TEM1
013775,000299: 06,3575           74744                           MASK     BIT8                                  #  POSITIVE SO THAT THE ACCELERATION TERMS
013776,000300: 06,3576           54141                           TS       TEM1                                  #  WILL BE COMPENSATED.
013777,000301: 06,3577           00006                           EXTEND                                         
013778,000302: 06,3600           13603                           BZF      +3                                    #  ARE WE ON THE SURFACE
013779,000303: 
013780,000304: 06,3601           04674                           TC       IBNKCALL                              #  ON THE SURFACE
013781,000305: 06,3602           77541                           CADR     PIPASR     +3                         #  READ PIPAS, BUT DO NOT SCALE THEM
013782,000306: 
013783,000307: 06,3603           30025                           CA       TIME1                                 #  (CS) X 2(+14)
013784,000308: 06,3604           57074                           XCH      1/PIPADT                              #  PREVIOUS TIME
013785,000309: 06,3605           00003                           RELINT                                         
013786,000310: 06,3606           40000                           COM                                            
013787,000311: 06,3607           61074                           AD       1/PIPADT                              #  PRESENT TIME - PREVIOUS TIME
013788,000312: 06,3610           64736        NBD2               AD       HALF                                  #  CORRECT FOR POSSIBLE TIME1 TICK
013789,000313: 06,3611           64736                           AD       HALF                                  
013790,000314: 06,3612           56001                           XCH      L                                     #  IF TIME1 DID NOT TICK, REMOVE RESULTING
013791,000315: 06,3613           56001                           XCH      L                                     #  OVERFLOW.
013792,000316: 
013793,000317: 06,3614           00006        NBD3               EXTEND                                         #  C(A) = DELTAT         (CS) X 2(+14)
013794,000318: 06,3615           74742                           MP       BIT10                                 #  SHIFT RIGHT 5
013795,000319: 06,3616           52125                           DXCH     VBUF       +2                         
013796,000320: 
013797,000321: 06,3617           34755                           CA       ZERO                                  
013798,000322: 06,3620           55477                           TS       GCOMPSW                               #  INDICATE COMMANDS 2 PULSES OR LESS.
013799,000323: 06,3621           54130                           TS       BUF                                   #  INDEX X, Y, Z.
013800,000324: 
013801,000325: 06,3622           10141                           CCS      TEM1                                  #  IF SURFACE FLAG IS SET,
013802,000326: 06,3623           03364                           TC       IRIGX                                 #  COMPENSATE ACCELERATION TERMS.
013803,000327: 
013804,000328: 06,3624           00006                           EXTEND                                         
013805,000329: 06,3625           30125                           DCA      VBUF       +2                         
013806,000330: 06,3626           52155                           DXCH     MPAC                                  #  DELTAT NOW SCALED (CS) X 2(+19)
013807,000331: 
013808,000332: 06,3627           41460                           CS       NBDX                                  #  (GYRO PULSES)/(CS) X 2(-5)
013809,000333: 06,3630           03652                           TC       FBIASSUB                              #  -(NBOX)(DELTAT)       (GYRO PULSES) X 2(+14)
013810,000334: 
013811,000335: 06,3631           10141                           CCS      TEM1                                  #  IF SURFACE FLAG IS SET,
013812,000336: 06,3632           03401                           TC       IRIGY                                 #  COMPENSATE ACCELERATION TERMS.

Page 337

013814,000338: 06,3633           00006                           EXTEND                                         
013815,000339: 06,3634           40125                           DCS      VBUF       +2                         
013816,000340: 06,3635           52155                           DXCH     MPAC                                  #  DELTAT SCALED (CS) X 2(+19)
013817,000341: 06,3636           31461                           CA       NBDY                                  #  (GYRO PULSES)/(CS) X 2(-5)
013818,000342: 06,3637           03652                           TC       FBIASSUB                              #  -(NBDY)(DELTAT)       (GYRO PULSES) X 2(+14)
013819,000343: 
013820,000344: 06,3640           10141                           CCS      TEM1                                  #  IF SURFACE FLAG IS SET,
013821,000345: 06,3641           03416                           TC       IRIGZ                                 #  COMPENSATE ACCELERATION TERMS
013822,000346: 
013823,000347: 06,3642           00006                           EXTEND                                         
013824,000348: 06,3643           40125                           DCS      VBUF       +2                         
013825,000349: 06,3644           52155                           DXCH     MPAC                                  #  DELTAT SCALED (CS) X 2(+19)
013826,000350: 06,3645           41462                           CS       NBDZ                                  #  (GYRO PULSES)/(CS) X 2(-5)
013827,000351: 06,3646           03652                           TC       FBIASSUB                              #  +(NBDZ)(DELTAT)       (GYRO PULSES) X 2(+14)
013828,000352: 
013829,000353: 06,3647           11477                           CCS      GCOMPSW                               #  ARE GYRO COMMANDS GREATER THAN 2 PULSES
013830,000354: 06,3650           13515                           TCF      1/GYRO                                #  YES
013831,000355: 06,3651           15155                           TCF      ENDOFJOB                              #  NO
013832,000356: 

Page 338

013834,000358: 06,3652           56002        FBIASSUB           XCH      Q                                     
013835,000359: 06,3653           54131                           TS       BUF        +1                         
013836,000360: 
013837,000361: 06,3654           30002                           CA       Q                                     #  NBD SCALED (GYRO PULSES)/(CS) X 2(-5)
013838,000362: 06,3655           00006                           EXTEND                                         
013839,000363: 06,3656           70154                           MP       MPAC                                  #  DELTAT SCALED (CS) X 2(+19)
013840,000364: 06,3657           50130                           INDEX    BUF                                   
013841,000365: 06,3660           21472                           DAS      GCOMP                                 #  HI(NBD)(DELTAT)       (GYRO PULSES) X 2(+14)
013842,000366: 
013843,000367: 06,3661           30002                           CA       Q                                     #  NOW FRACTIONAL PART
013844,000368: 06,3662           00006                           EXTEND                                         
013845,000369: 06,3663           70155                           MP       MPAC       +1                         
013846,000370: 06,3664           54001                           TS       L                                     
013847,000371: 06,3665           34755                           CAF      ZERO                                  
013848,000372: 06,3666           50130                           INDEX    BUF                                   
013849,000373: 06,3667           21472                           DAS      GCOMP                                 #  (NBD)(DELTAT)         (GYRO PULSES) X 2(+14)
013850,000374: 
013851,000375: 06,3670           13502                           TCF      DRFTSUB2                              #  CHECK MAGNITUDE OF COMPENSATION
013852,000376: 
013853,000377: 06,3671           04616        LASTBIAS           TC       BANKCALL                              
013854,000378: 06,3672           17270                           CADR     PIPUSE1                               
013855,000379: 
013856,000380: 06,3673           11477                           CCS      GCOMPSW                               
013857,000381: 06,3674           13677                           TCF      +3                                    
013858,000382: 06,3675           13677                           TCF      +2                                    
013859,000383: 06,3676           15155                           TCF      ENDOFJOB                              
013860,000384: 
013861,000385: 06,3677           30104                           CA       FLAGWRD8                              #  IF SURFACE FLAG IS SET, SET TEM1
013862,000386: 06,3700           74744                           MASK     SURFFBIT                              #  POSITIVE SO THAT THE ACCELERATION TERMS
013863,000387: 06,3701           54141                           TS       TEM1                                  #  WILL BE COMPENSATED.
013864,000388: 
013865,000389: 06,3702           37721                           CAF      PRIO31                                #  2 SECONDS SCALED (CS) X 2(+8)
013866,000390: 06,3703           57074                           XCH      1/PIPADT                              
013867,000391: 06,3704           40000                           COM                                            
013868,000392: 06,3705           61234                           AD       PIPTIME    +1                         
013869,000393: 06,3706           13610                           TCF      NBD2                                  
013870,000394: 
013871,000395: 06,3707           33537        GCOMPZER           CAF      LGCOMP                                #  ROUTINE TO ZERO GCOMP BEFORE FIRST
013872,000396: 06,3710           56003                           XCH      EBANK                                 #  CALL TO 1/PIPA
013873,000397: 06,3711           54163                           TS       MODE                                  
013874,000398: 
013875,000399: 06,3712           34755                           CAF      ZERO                                  
013876,000400: 06,3713           55477                           TS       GCOMPSW                               
013877,000401: 06,3714           55471                           TS       GCOMP                                 
013878,000402: 06,3715           55472                           TS       GCOMP      +1                         
013879,000403: 06,3716           55473                           TS       GCOMP      +2                         
013880,000404: 06,3717           55474                           TS       GCOMP      +3                         
013881,000405: 06,3720           55475                           TS       GCOMP      +4                         

Page 339

013883,000407: 06,3721           55476                           TS       GCOMP      +5                         
013884,000408: 
013885,000409: 06,3722           13361                           TCF      IRIG1                                 #  RESTORE EBANK AND RETURN
013886,000410: 

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