Source Code

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

013609,000002:                                                                                                  ## Copyright:   Public domain.
013610,000003:                                                                                                  ## Filename:    IMU_COMPENSATION_PACKAGE.agc
013611,000004:                                                                                                  ## Purpose:     A section of Luminary 1C, revision 131.
013612,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
013613,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13.
013614,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
013615,000008:                                                                                                  ##              that the code format has been changed to conform to the
013616,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the 
013617,000010:                                                                                                  ##              original YUL assembler.
013618,000011:                                                                                                  ## Reference:   pp. 328-339
013619,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
013620,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
013621,000014:                                                                                                  ## Mod history: 05/10/03 RSB.   Began transcribing.
013622,000015:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
013623,000016:                                                                                                  ##              2016-12-30 RSB  Backported BYRO->GYRO from Colossus 237.
013624,000017:                                                                                                  ##                              (There's lots more that needs to be backported,
013625,000018:                                                                                                  ##                              but I found this one particularly annoying.)
013626,000019:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
013627,000020:                                                                                                  ##                              original harcopy, as opposed to the PDF page
013628,000021:                                                                                                  ##                              numbers in 1701.pdf.
013629,000022:                                                                                                  ##              2017-02-23 RSB  Proofed comment text using octopus/ProoferComments.
013630,000023:                                                                                                  ##              2017-03-07 RSB  Comment-text fixes noted in proofing Luminary 116.
013631,000024: 

Page 328

013633,000026: 07,2666                                           BANK     7                                     
013634,000027: 06,2000                                           SETLOC   IMUCOMP                               
013635,000028: 06,2000                                           BANK                                           
013636,000029: 
013637,000030: 06,3271  E3,1460                                  EBANK=   NBDX                                  
013638,000031: 
013639,000032: 06,3271                                           COUNT*   $$/ICOMP                              
013640,000033: 06,3271           33537        1/PIPA             CAF      LGCOMP                                #  SAVE EBANK OF CALLING PROGRAM
013641,000034: 06,3272           56003                           XCH      EBANK                                 
013642,000035: 06,3273           54163                           TS       MODE                                  
013643,000036: 
013644,000037: 06,3274           11477                           CCS      GCOMPSW                               #  BYPASS IF GCOMPSW NEGATIVE
013645,000038: 06,3275           13300                           TCF      +3                                    
013646,000039: 06,3276           13300                           TCF      +2                                    
013647,000040: 06,3277           13361                           TCF      IRIG1                                 #  RETURN
013648,000041: 
013649,000042: 06,3300           34751        1/PIPA1            CAF      FOUR                                  #  PIPAZ, PIPAY, PIPAX
013650,000043: 06,3301           54132                           TS       BUF        +2                         
013651,000044: 
013652,000045: 06,3302           50132                           INDEX    BUF        +2                         
013653,000046: 06,3303           31453                           CA       PIPASCF                               #  (P.P.M.) X 2(-9)
013654,000047: 06,3304           00006                           EXTEND                                         
013655,000048: 06,3305           50132                           INDEX    BUF        +2                         
013656,000049: 06,3306           70324                           MP       DELVX                                 #  (PP) X 2(+14) NOW (PIPA PULSES) X 2(+5)
013657,000050: 06,3307           54002                           TS       Q                                     #  SAVE MAJOR PART
013658,000051: 
013659,000052: 06,3310           30001                           CA       L                                     #  MINOR PART
013660,000053: 06,3311           00006                           EXTEND                                         
013661,000054: 06,3312           74746                           MP       BIT6                                  #  SCALE 2(+9)   SHIFT RIGHT 9
013662,000055: 
013663,000056: 06,3313           50132                           INDEX    BUF        +2                         
013664,000057: 06,3314           54325                           TS       DELVX      +1                         #  FRACTIONAL PIPA PULSES SCALED 2(+14)
013665,000058: 
013666,000059: 06,3315           30002                           CA       Q                                     #  MAJOR PART
013667,000060: 06,3316           00006                           EXTEND                                         
013668,000061: 06,3317           74746                           MP       BIT6                                  #  SCALE 2(+9)   SHIFT RIGHT 9
013669,000062: 06,3320           50132                           INDEX    BUF        +2                         
013670,000063: 06,3321           20325                           DAS      DELVX                                 #  (PIPAI) + (PIPAI)(SFE)
013671,000064: 
013672,000065: 06,3322           50132                           INDEX    BUF        +2                         
013673,000066: 06,3323           41452                           CS       PIPABIAS                              #  (PIPA PULSES)/(CS) X 2(-3)                    *
013674,000067: 06,3324           00006                           EXTEND                                         
013675,000068: 06,3325           71074                           MP       1/PIPADT                              #  (CS) X 2(+8) NOW (PIPA PULSES) X 2(+5)        *
013676,000069: 06,3326           00006                           EXTEND                                         
013677,000070: 06,3327           74746                           MP       BIT6                                  #  SCALE 2(+9) SHIFT RIGHT 9                     *
013678,000071: 06,3330           50132                           INDEX    BUF        +2                         
013679,000072: 06,3331           20325                           DAS      DELVX                                 #  (PIPAI) + (PIPAI)(SFE) - (BIAS)(DELTAT)
013680,000073: 
013681,000074: 06,3332           10132                           CCS      BUF        +2                         #  PIPAZ, PIPAY, PIPAX
013682,000075: 06,3333           67752                           AD       NEG1                                  
013683,000076: 06,3334           13301                           TCF      1/PIPA1    +1                         

Page 329

013685,000078: 06,3335           13336                           NOOP                                           #  LESS THAN ZERO IMPOSSIBLE
013686,000079: 

Page 330

013688,000081: 06,3336           55477        IRIGCOMP           TS       GCOMPSW                               #  INDICATE COMMANDS 2 PULSES OR LESS.
013689,000082: 06,3337           54130                           TS       BUF                                   #  INDEX COUNTER.  IRIGX, IRIGY, IRIGZ.
013690,000083: 
013691,000084: 06,3340           03364                           TC       IRIGX                                 #  COMPENSATE ACCELERATION TERMS
013692,000085: 
013693,000086: 06,3341           41460                           CS       NBDX                                  #  (GYRO PULSES)/(CS) X 2(-5)
013694,000087: 06,3342           03462                           TC       DRIFTSUB                              #  -(NBOX)(DELTAT)       (GYRO PULSES) X 2(+14)
013695,000088: 
013696,000089: 06,3343           03401                           TC       IRIGY                                 #  COMPENSATE ACCELERATION TERMS
013697,000090: 
013698,000091: 06,3344           41461                           CS       NBDY                                  #  (GYRO PULSES)/(CS) X 2(-5)
013699,000092: 06,3345           03462                           TC       DRIFTSUB                              #  -(NBDY)(DELTAT)       (GYRO PULSES) X 2(+14)
013700,000093: 
013701,000094: 06,3346           03416                           TC       IRIGZ                                 #  COMPENSATE ACCELERATION TERMS
013702,000095: 
013703,000096: 06,3347           31462                           CA       NBDZ                                  #  (GYRO PULSES)/(CS) X 2(-5)
013704,000097: 06,3350           03462                           TC       DRIFTSUB                              #  +(NBDZ)(DELTAT)       (GYRO PULSES) X 2(+14)
013705,000098: 
013706,000099: 06,3351           11477                           CCS      GCOMPSW                               #  ARE GYRO COMMANDS GREATER THAN 2 PULSES
013707,000100: 06,3352           13354                           TCF      +2                                    #  YES   SEND OUT GYRO TORQUING COMMANDS.
013708,000101: 06,3353           13361                           TCF      IRIG1                                 #  NO    RETURN
013709,000102: 
013710,000103: 06,3354           35031                           CA       PRIO21                                #  PRIO GREATER THAN SERVICER
013711,000104: 06,3355           05072                           TC       NOVAC                                 #  SEND OUT GYRO TORQUING COMMANDS.
013712,000105: 06,3356  E3,1460                                  EBANK=   NBDX                                  
013713,000106: 06,3356           03515 14063                     2CADR    1/GYRO                                
013714,000107: 
013715,000108: 06,3360           00003                           RELINT                                         
013716,000109: 06,3361           30163        IRIG1              CA       MODE                                  #  RESTORE CALLER S EBANK
013717,000110: 06,3362           54003                           TS       EBANK                                 
013718,000111: 06,3363           14631                           TCF      SWRETURN                              
013719,000112: 

Page 331

013721,000114: 06,3364           00006        IRIGX              EXTEND                                         
013722,000115: 06,3365           22156                           QXCH     MPAC       +2                         #  SAVE Q
013723,000116: 06,3366           00006                           EXTEND                                         
013724,000117: 06,3367           40325                           DCS      DELVX                                 #  (PIPA PULSES) X 2(+14)
013725,000118: 06,3370           52155                           DXCH     MPAC                                  
013726,000119: 06,3371           31463                           CA       ADIAX                                 #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *
013727,000120: 06,3372           03433                           TC       GCOMPSUB                              #  -(ADIAX)(PIPAX)       (GYRO PULSES) X 2(+14)
013728,000121: 
013729,000122: 06,3373           00006                           EXTEND                                         #  
013730,000123: 06,3374           40327                           DCS      DELVY                                 #        (PIPA PULSES) X 2(+14)
013731,000124: 06,3375           52155                           DXCH     MPAC                                  #  
013732,000125: 06,3376           41466                           CS       ADSRAX                                #        (GYRO PULSES)/(PIPA PULSE) X 2(-6)      *
013733,000126: 06,3377           03433                           TC       GCOMPSUB                              #        -(ADSRAX)(PIPAY)        (GYRO PULSES) X 2(+14)
013734,000127: 
013735,000128:                                                                                                  #                EXTEND                  ***
013736,000129:                                                                                                  #                DCS     DELVZ           ***     (PIPA PULSES) X 2(+14)
013737,000130:                                                                                                  #                DXCH    MPAC            ***
013738,000131:                                                                                                  #                CA      ADOAX           ***     (GYRO PULSES)/(PIPA PULSE) X 2(-6)      *
013739,000132:                                                                                                  #                TC      GCOMPSUB        ***     -(ADOAX)(PIPAZ)         (GYRO PULSES) X 2(+14)
013740,000133: 
013741,000134: 06,3400           00156                           TC       MPAC       +2                         
013742,000135: 
013743,000136: 06,3401           00006        IRIGY              EXTEND                                         
013744,000137: 06,3402           22156                           QXCH     MPAC       +2                         #  SAVE Q
013745,000138: 06,3403           00006                           EXTEND                                         
013746,000139: 06,3404           40327                           DCS      DELVY                                 #  (PIPA PULSES) X 2(+14)
013747,000140: 06,3405           52155                           DXCH     MPAC                                  
013748,000141: 06,3406           31464                           CA       ADIAY                                 #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *
013749,000142: 06,3407           03433                           TC       GCOMPSUB                              #  -(ADIAY)(PIPAY)       (GYRO PULSES) X 2(+14)
013750,000143: 
013751,000144: 06,3410           00006                           EXTEND                                         
013752,000145: 06,3411           40331                           DCS      DELVZ                                 #  (PIPA PULSES) X 2(+14)
013753,000146: 06,3412           52155                           DXCH     MPAC                                  
013754,000147: 06,3413           41467                           CS       ADSRAY                                #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *
013755,000148: 06,3414           03433                           TC       GCOMPSUB                              #  +(ADSRAY)(PIPAZ)      (GYRO PULSES) X 2(+14)
013756,000149: 
013757,000150:                                                                                                  #                EXTEND                  ***
013758,000151:                                                                                                  #                DCS     DELVX           ***     (PIPA PULSES) X 2(+14)
013759,000152:                                                                                                  #                DXCH    MPAC            ***
013760,000153:                                                                                                  #                CA      ADOAY           ***     (GYRO PULSES)/(PIPA PULSE) X 2(-6)      *
013761,000154:                                                                                                  #                TC      GCOMPSUB        ***     -(ADOAY)(PIPAX)   (GYRO PULSES) X 2(+14)
013762,000155: 
013763,000156: 06,3415           00156                           TC       MPAC       +2                         
013764,000157: 
013765,000158: 06,3416           00006        IRIGZ              EXTEND                                         
013766,000159: 06,3417           22156                           QXCH     MPAC       +2                         #  SAVE Q
013767,000160: 06,3420           00006                           EXTEND                                         
013768,000161: 06,3421           40327                           DCS      DELVY                                 #  (PIPA PULSES) X 2(+14)
013769,000162: 06,3422           52155                           DXCH     MPAC                                  
013770,000163: 06,3423           31470                           CA       ADSRAZ                                #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *

Page 332

013772,000165: 06,3424           03433                           TC       GCOMPSUB                              #  -(ADSRAZ)(PIPAY)      (GYRO PULSES) X 2(+14)
013773,000166: 
013774,000167: 06,3425           00006                           EXTEND                                         
013775,000168: 06,3426           40331                           DCS      DELVZ                                 #  (PIPA PULSES) X 2(+14)
013776,000169: 06,3427           52155                           DXCH     MPAC                                  
013777,000170: 06,3430           31465                           CA       ADIAZ                                 #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *
013778,000171: 06,3431           03433                           TC       GCOMPSUB                              #  -(ADIAZ)(PIPAZ)       (GYRO PULSES) X 2(+14)
013779,000172: 
013780,000173:                                                                                                  #                EXTEND                  ***
013781,000174:                                                                                                  #                DCS     DELVX           ***     (PIPA PULSE) X 2(+14)
013782,000175:                                                                                                  #                DXCH    MPAC            ***
013783,000176:                                                                                                  #                CS      ADOAZ           ***     (GYRO PULSES)/(PIPA PULSE) X 2(-6)      *
013784,000177:                                                                                                  #                TC      GCOMPSUB        ***     +(ADOAZ)(PIPAX) (GYRO PULSES) X 2(+14)
013785,000178: 
013786,000179: 06,3432           00156                           TC       MPAC       +2                         
013787,000180: 

Page 333

013789,000182: 06,3433           56154        GCOMPSUB           XCH      MPAC                                  #  ADIA OR ADSRA COEFFICIENT ARRIVES IN A
013790,000183: 06,3434           00006                           EXTEND                                         #  C(MPAC) = (PIPA PULSES) X 2(+14)
013791,000184: 06,3435           70154                           MP       MPAC                                  #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *
013792,000185: 06,3436           52123                           DXCH     VBUF                                  #  NOW = (GYRO PULSES) X 2(+8)                   *
013793,000186: 
013794,000187: 06,3437           30155                           CA       MPAC       +1                         #  MINOR PART PIPA PULSES
013795,000188: 06,3440           00006                           EXTEND                                         
013796,000189: 06,3441           70154                           MP       MPAC                                  #  ADIA OR ADSRA
013797,000190: 06,3442           54001                           TS       L                                     
013798,000191: 06,3443           34755                           CAF      ZERO                                  
013799,000192: 06,3444           20123                           DAS      VBUF                                  #  NOW = (GYRO PULSES) X 2(+8)                   *
013800,000193: 
013801,000194: 06,3445           30122                           CA       VBUF                                  #  PARTIAL RESULT - MAJOR
013802,000195: 06,3446           00006                           EXTEND                                         
013803,000196: 06,3447           74743                           MP       BIT9                                  #  SCALE 2(+6)   SHIFT RIGHT 6                   *
013804,000197: 06,3450           50130                           INDEX    BUF                                   #  RESULT = (GYRO PULSES) X 2(+14)
013805,000198: 06,3451           21472                           DAS      GCOMP                                 #  HI(ADIA)(PIPAI) OR HI(ADSRA)(PIPAI)
013806,000199: 
013807,000200: 06,3452           30123                           CA       VBUF       +1                         #  PARTIAL RESULT - MINOR
013808,000201: 06,3453           00006                           EXTEND                                         
013809,000202: 06,3454           74743                           MP       BIT9                                  #  SCALE 2(+6)   SHIFT RIGHT 6                   *
013810,000203: 06,3455           54001                           TS       L                                     
013811,000204: 06,3456           34755                           CAF      ZERO                                  
013812,000205: 06,3457           50130                           INDEX    BUF                                   #  RESULT = (GYRO PULSES) X 2(+14)
013813,000206: 06,3460           21472                           DAS      GCOMP                                 #  (ADIA)(PIPAI) OR (ADSRA)(PIPAI)
013814,000207: 
013815,000208: 06,3461           00002                           TC       Q                                     
013816,000209: 

Page 334

013818,000211: 06,3462           00006        DRIFTSUB           EXTEND                                         
013819,000212: 06,3463           22131                           QXCH     BUF        +1                         
013820,000213: 
013821,000214: 06,3464           00006                           EXTEND                                         #  C(A) = NBD    (GYRO PULSES)/(CS) X 2(-5)
013822,000215: 06,3465           71074                           MP       1/PIPADT                              #  (CS) X 2(+8)  NOW (GYRO PULSES) X 2(+3)
013823,000216: 06,3466           22155                           LXCH     MPAC       +1                         #  SAVE FOR FRACTIONAL COMPENSATION
013824,000217: 06,3467           00006                           EXTEND                                         
013825,000218: 06,3470           74750                           MP       BIT4                                  #  SCALE 2(+11)  SHIFT RIGHT 11
013826,000219: 06,3471           50130                           INDEX    BUF                                   
013827,000220: 06,3472           21472                           DAS      GCOMP                                 #  HI(NBD)(DELTAT)       (GYRO PULSES) X 2(+14)
013828,000221: 
013829,000222: 06,3473           30155                           CA       MPAC       +1                         #  NOW MINOR PART
013830,000223: 06,3474           00006                           EXTEND                                         
013831,000224: 06,3475           74750                           MP       BIT4                                  #  SCALE 2(+11)          SHIFT RIGHT 11
013832,000225: 06,3476           54001                           TS       L                                     
013833,000226: 06,3477           34755                           CAF      ZERO                                  
013834,000227: 06,3500           50130                           INDEX    BUF                                   #  ADD IN FRACTIONAL COMPENSATION
013835,000228: 06,3501           21472                           DAS      GCOMP                                 #  (NBD)(DELTAT)         (GYRO PULSES) X 2(+14)
013836,000229: 
013837,000230: 06,3502           34752        DRFTSUB2           CAF      TWO                                   #  PIPAX, PIPAY, PIPAZ
013838,000231: 06,3503           60130                           AD       BUF                                   
013839,000232: 06,3504           56130                           XCH      BUF                                   
013840,000233: 06,3505           50000                           INDEX    A                                     
013841,000234: 06,3506           11471                           CCS      GCOMP                                 #  ARE GYRO COMMANDS 1 PULSE OR GREATER
013842,000235: 06,3507           13511                           TCF      +2                                    #  YES
013843,000236: 06,3510           00131                           TC       BUF        +1                         #  NO
013844,000237: 
013845,000238: 06,3511           73561                           MASK     COMPCHK                               #  DEC -1
013846,000239: 06,3512           10000                           CCS      A                                     #  ARE GYRO COMMANDS GREATER THAN 2 PULSES
013847,000240: 06,3513           55477                           TS       GCOMPSW                               #  YES - SET GCOMPSW POSITIVE
013848,000241: 06,3514           00131                           TC       BUF        +1                         #  NO
013849,000242: 

Page 335

013851,000244: 06,3515           34751        1/GYRO             CAF      FOUR                                  #  PIPAZ, PIPAY, PIPAX
013852,000245: 06,3516           54130                           TS       BUF                                   
013853,000246: 
013854,000247: 06,3517           50130                           INDEX    BUF                                   #  SCALE GYRO COMMANDS FOR IMUPULSE
013855,000248: 06,3520           31472                           CA       GCOMP      +1                         #  FRACTIONAL PULSES
013856,000249: 06,3521           00006                           EXTEND                                         
013857,000250: 06,3522           74744                           MP       BIT8                                  #  SHIFT RIGHT 7
013858,000251: 06,3523           50130                           INDEX    BUF                                   
013859,000252: 06,3524           55472                           TS       GCOMP      +1                         #  FRACTIONAL PULSES SCALED
013860,000253: 
013861,000254: 06,3525           34755                           CAF      ZERO                                  #  SET GCOMP = 0 FOR DAS INSTRUCTION
013862,000255: 06,3526           50130                           INDEX    BUF                                   
013863,000256: 06,3527           57471                           XCH      GCOMP                                 #  GYRO PULSES
013864,000257: 06,3530           00006                           EXTEND                                         
013865,000258: 06,3531           74744                           MP       BIT8                                  #  SHIFT RIGHT 7
013866,000259: 06,3532           50130                           INDEX    BUF                                   
013867,000260: 06,3533           21472                           DAS      GCOMP                                 #  ADD THESE TO FRACTIONAL PULSES ABOVE
013868,000261: 
013869,000262: 06,3534           10130                           CCS      BUF                                   #  PIPAZ, PIPAY, PIPAX
013870,000263: 06,3535           67752                           AD       NEG1                                  
013871,000264: 06,3536           13516                           TCF      1/GYRO     +1                         
013872,000265: 06,3537           01471        LGCOMP             ECADR    GCOMP                                 #  LESS THAN ZERO IMPOSSIBLE
013873,000266: 
013874,000267: 06,3540           33537                           CAF      LGCOMP                                
013875,000268: 06,3541           04616                           TC       BANKCALL                              
013876,000269: 06,3542           17314                           CADR     IMUPULSE                              #  CALL GYRO TORQUING ROUTINE
013877,000270: 06,3543           04616                           TC       BANKCALL                              
013878,000271: 06,3544           17707                           CADR     IMUSTALL                              #  WAIT FOR PULSES TO GET OUT
013879,000272: 06,3545           15155                           TCF      ENDOFJOB                              #  TEMPORARY
013880,000273: 
013881,000274: 06,3546           34751        GCOMP1             CAF      FOUR                                  #  PIPAZ, PIPAY, PIPAX
013882,000275: 06,3547           54130                           TS       BUF                                   
013883,000276: 
013884,000277: 06,3550           50130                           INDEX    BUF                                   #  RESCALE
013885,000278: 06,3551           31472                           CA       GCOMP      +1                         
013886,000279: 06,3552           00006                           EXTEND                                         
013887,000280: 06,3553           74744                           MP       BIT8                                  #  SHIFT MINOR PART LEFT 7 - MAJOR PART = 0
013888,000281: 06,3554           50130                           INDEX    BUF                                   
013889,000282: 06,3555           23472                           LXCH     GCOMP      +1                         #  BITS 8-14 OF MINOR PART WERE = 0
013890,000283: 
013891,000284: 06,3556           10130                           CCS      BUF                                   #  PIPAZ, PIPAY, PIPAX
013892,000285: 06,3557           67752                           AD       NEG1                                  
013893,000286: 06,3560           13547                           TCF      GCOMP1     +1                         
013894,000287: 06,3561           77776        COMPCHK            DEC      -1         B-14                       #  LESS THAN ZERO IMPOSSIBLE
013895,000288: 06,3562           15155                           TCF      ENDOFJOB                              
013896,000289: 

Page 336

013898,000291: 06,3563           11477        NBDONLY            CCS      GCOMPSW                               #  BYPASS IF GCOMPSW NEGATIVE
013899,000292: 06,3564           13567                           TCF      +3                                    
013900,000293: 06,3565           13567                           TCF      +2                                    
013901,000294: 06,3566           15155                           TCF      ENDOFJOB                              
013902,000295: 
013903,000296: 06,3567           00004                           INHINT                                         
013904,000297: 06,3570           10076                           CCS      FLAGWRD2                              #  PREREAD T3RUPT MAY COINCIDE
013905,000298: 06,3571           15155                           TCF      ENDOFJOB                              
013906,000299: 06,3572           15155                           TCF      ENDOFJOB                              
013907,000300: 06,3573           13574                           TCF      +1                                    
013908,000301: 
013909,000302: 06,3574           30104                           CA       FLAGWRD8                              #  IF SURFACE FLAG IS SET, SET TEM1
013910,000303: 06,3575           74744                           MASK     BIT8                                  #  POSITIVE SO THAT THE ACCELERATION TERMS
013911,000304: 06,3576           54141                           TS       TEM1                                  #  WILL BE COMPENSATED.
013912,000305: 06,3577           00006                           EXTEND                                         
013913,000306: 06,3600           13603                           BZF      +3                                    #  ARE WE ON THE SURFACE
013914,000307: 
013915,000308: 06,3601           04674                           TC       IBNKCALL                              #  ON THE SURFACE
013916,000309: 06,3602           77541                           CADR     PIPASR     +3                         #  READ PIPAS, BUT DO NOT SCALE THEM
013917,000310: 
013918,000311: 06,3603           30025                           CA       TIME1                                 #  (CS) X 2(+14)
013919,000312: 06,3604           57074                           XCH      1/PIPADT                              #  PREVIOUS TIME
013920,000313: 06,3605           00003                           RELINT                                         
013921,000314: 06,3606           40000                           COM                                            
013922,000315: 06,3607           61074                           AD       1/PIPADT                              #  PRESENT TIME - PREVIOUS TIME
013923,000316: 06,3610           64736        NBD2               AD       HALF                                  #  CORRECT FOR POSSIBLE TIME1 TICK
013924,000317: 06,3611           64736                           AD       HALF                                  
013925,000318: 06,3612           56001                           XCH      L                                     #  IF TIME1 DID NOT TICK, REMOVE RESULTING
013926,000319: 06,3613           56001                           XCH      L                                     #  OVERFLOW.
013927,000320: 
013928,000321: 06,3614           00006        NBD3               EXTEND                                         #  C(A) = DELTAT         (CS) X 2(+14)
013929,000322: 06,3615           74742                           MP       BIT10                                 #  SHIFT RIGHT 5
013930,000323: 06,3616           52125                           DXCH     VBUF       +2                         
013931,000324: 
013932,000325: 06,3617           34755                           CA       ZERO                                  
013933,000326: 06,3620           55477                           TS       GCOMPSW                               #  INDICATE COMMANDS 2 PULSES OR LESS.
013934,000327: 06,3621           54130                           TS       BUF                                   #  INDEX X, Y, Z.
013935,000328: 
013936,000329: 06,3622           10141                           CCS      TEM1                                  #  IF SURFACE FLAG IS SET,
013937,000330: 06,3623           03364                           TC       IRIGX                                 #  COMPENSATE ACCELERATION TERMS.
013938,000331: 
013939,000332: 06,3624           00006                           EXTEND                                         
013940,000333: 06,3625           30125                           DCA      VBUF       +2                         
013941,000334: 06,3626           52155                           DXCH     MPAC                                  #  DELTAT NOW SCALED (CS) X 2(+19)
013942,000335: 
013943,000336: 06,3627           41460                           CS       NBDX                                  #  (GYRO PULSES)/(CS) X 2(-5)
013944,000337: 06,3630           03652                           TC       FBIASSUB                              #  -(NBOX)(DELTAT)       (GYRO PULSES) X 2(+14)
013945,000338: 
013946,000339: 06,3631           10141                           CCS      TEM1                                  #  IF SURFACE FLAG IS SET,
013947,000340: 06,3632           03401                           TC       IRIGY                                 #  COMPENSATE ACCELERATION TERMS.

Page 337

013949,000342: 06,3633           00006                           EXTEND                                         
013950,000343: 06,3634           40125                           DCS      VBUF       +2                         
013951,000344: 06,3635           52155                           DXCH     MPAC                                  #  DELTAT SCALED (CS) X 2(+19)
013952,000345: 06,3636           31461                           CA       NBDY                                  #  (GYRO PULSES)/(CS) X 2(-5)
013953,000346: 06,3637           03652                           TC       FBIASSUB                              #  -(NBDY)(DELTAT)       (GYRO PULSES) X 2(+14)
013954,000347: 
013955,000348: 06,3640           10141                           CCS      TEM1                                  #  IF SURFACE FLAG IS SET,
013956,000349: 06,3641           03416                           TC       IRIGZ                                 #  COMPENSATE ACCELERATION TERMS
013957,000350: 
013958,000351: 06,3642           00006                           EXTEND                                         
013959,000352: 06,3643           40125                           DCS      VBUF       +2                         
013960,000353: 06,3644           52155                           DXCH     MPAC                                  #  DELTAT SCALED (CS) X 2(+19)
013961,000354: 06,3645           41462                           CS       NBDZ                                  #  (GYRO PULSES)/(CS) X 2(-5)
013962,000355: 06,3646           03652                           TC       FBIASSUB                              #  +(NBDZ)(DELTAT)       (GYRO PULSES) X 2(+14)
013963,000356: 
013964,000357: 06,3647           11477                           CCS      GCOMPSW                               #  ARE GYRO COMMANDS GREATER THAN 2 PULSES
013965,000358: 06,3650           13515                           TCF      1/GYRO                                #  YES
013966,000359: 06,3651           15155                           TCF      ENDOFJOB                              #  NO
013967,000360: 

Page 338

013969,000362: 06,3652           56002        FBIASSUB           XCH      Q                                     
013970,000363: 06,3653           54131                           TS       BUF        +1                         
013971,000364: 
013972,000365: 06,3654           30002                           CA       Q                                     #  NBD SCALED (GYRO PULSES)/(CS) X 2(-5)
013973,000366: 06,3655           00006                           EXTEND                                         
013974,000367: 06,3656           70154                           MP       MPAC                                  #  DELTAT SCALED (CS) X 2(+19)
013975,000368: 06,3657           50130                           INDEX    BUF                                   
013976,000369: 06,3660           21472                           DAS      GCOMP                                 #  HI(NBD)(DELTAT)       (GYRO PULSES) X 2(+14)
013977,000370: 
013978,000371: 06,3661           30002                           CA       Q                                     #  NOW FRACTIONAL PART
013979,000372: 06,3662           00006                           EXTEND                                         
013980,000373: 06,3663           70155                           MP       MPAC       +1                         
013981,000374: 06,3664           54001                           TS       L                                     
013982,000375: 06,3665           34755                           CAF      ZERO                                  
013983,000376: 06,3666           50130                           INDEX    BUF                                   
013984,000377: 06,3667           21472                           DAS      GCOMP                                 #  (NBD)(DELTAT)         (GYRO PULSES) X 2(+14)
013985,000378: 
013986,000379: 06,3670           13502                           TCF      DRFTSUB2                              #  CHECK MAGNITUDE OF COMPENSATION
013987,000380: 
013988,000381: 06,3671           04616        LASTBIAS           TC       BANKCALL                              
013989,000382: 06,3672           17270                           CADR     PIPUSE1                               
013990,000383: 
013991,000384: 06,3673           11477                           CCS      GCOMPSW                               
013992,000385: 06,3674           13677                           TCF      +3                                    
013993,000386: 06,3675           13677                           TCF      +2                                    
013994,000387: 06,3676           15155                           TCF      ENDOFJOB                              
013995,000388: 
013996,000389: 06,3677           30104                           CA       FLAGWRD8                              #  IF SURFACE FLAG IS SET, SET TEM1
013997,000390: 06,3700           74744                           MASK     SURFFBIT                              #  POSITIVE SO THAT THE ACCELERATION TERMS
013998,000391: 06,3701           54141                           TS       TEM1                                  #  WILL BE COMPENSATED.
013999,000392: 
014000,000393: 06,3702           37721                           CAF      PRIO31                                #  2 SECONDS SCALED (CS) X 2(+8)
014001,000394: 06,3703           57074                           XCH      1/PIPADT                              
014002,000395: 06,3704           40000                           COM                                            
014003,000396: 06,3705           61234                           AD       PIPTIME    +1                         
014004,000397: 06,3706           13610                           TCF      NBD2                                  
014005,000398: 
014006,000399: 06,3707           33537        GCOMPZER           CAF      LGCOMP                                #  ROUTINE TO ZERO GCOMP BEFORE FIRST
014007,000400: 06,3710           56003                           XCH      EBANK                                 #  CALL TO 1/PIPA
014008,000401: 06,3711           54163                           TS       MODE                                  
014009,000402: 
014010,000403: 06,3712           34755                           CAF      ZERO                                  
014011,000404: 06,3713           55477                           TS       GCOMPSW                               
014012,000405: 06,3714           55471                           TS       GCOMP                                 
014013,000406: 06,3715           55472                           TS       GCOMP      +1                         
014014,000407: 06,3716           55473                           TS       GCOMP      +2                         
014015,000408: 06,3717           55474                           TS       GCOMP      +3                         
014016,000409: 06,3720           55475                           TS       GCOMP      +4                         

Page 339

014018,000411: 06,3721           55476                           TS       GCOMP      +5                         
014019,000412: 
014020,000413: 06,3722           13361                           TCF      IRIG1                                 #  RESTORE EBANK AND RETURN
014021,000414: 

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