Source Code

This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the third release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 96 and 97. A bug (which had been around since at least Apollo 10, Luminary 69) was discovered in Rev 0 shortly before the Apollo 11 flight, resulting in a last minute revision into Rev 1, which is what actually flew rather than the Rev 0 presented here. A hardcopy of Rev 0 is known to exist — it belonged to AGC developer Allan Klumpp for many years — but unfortunately the Virtual AGC Project has not had access to that hardcopy. Thus the code you see here had been reconstructed (we believe accurately) rather than transcribed. The first step of the reconstruction of the Rev 0 source code was the transcription of the Rev 1 source code from a hardcopy in the MIT Museum collection. The process of reverting the active portion of the source code (i.e., other than program comments) from Rev 1 to Rev 0 was very minor, consisting only of moving the position of the STARTSB1 label in FRESH START AND RESTART. Allan had previously given us the checksums of the memory banks of Rev 0, and we have verified the program presented here has checksums identical to all banks of Allan's listing of Rev 0. The notations on Allan's Rev 0 program listing read, in part:

	GAP:  ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-051

A single program comment is known to differ between Rev 0 and Rev 1, but these are harder to reconstruct and verify than changes to the active portion of the code. Thus it is possible that there are additional differences between the program comments in Rev 0 and Rev 1 that are unknown to us, and therefore are not reflected in the code presented here.

013894,000002:                                                                                                  ## Copyright:   Public domain.
013895,000003:                                                                                                  ## Filename:    IMU_COMPENSATION_PACKAGE.agc
013896,000004:                                                                                                  ## Purpose:     Part of the reconstructed source code for LMY99 Rev 0,
013897,000005:                                                                                                  ##              otherwise known as Luminary Rev 99, the third release
013898,000006:                                                                                                  ##              of the Apollo Guidance Computer (AGC) software for Apollo 11.
013899,000007:                                                                                                  ##              It differs from LMY99 Rev 1 (the flown version) only in the
013900,000008:                                                                                                  ##              placement of a single label. The corrections shown here have
013901,000009:                                                                                                  ##              been verified to have the same bank checksums as AGC developer
013902,000010:                                                                                                  ##              Allan Klumpp's copy of Luminary Rev 99, and so are believed
013903,000011:                                                                                                  ##              to be accurate. This file is intended to be a faithful 
013904,000012:                                                                                                  ##              recreation, except that the code format has been changed to 
013905,000013:                                                                                                  ##              conform to the requirements of the yaYUL assembler rather than 
013906,000014:                                                                                                  ##              the original YUL assembler.
013907,000015:                                                                                                  ##
013908,000016:                                                                                                  ## Assembler:   yaYUL
013909,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
013910,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo.
013911,000019:                                                                                                  ## Pages:       326-337
013912,000020:                                                                                                  ## Mod history: 2009-05-16 RSB  Adapted from the corresponding 
013913,000021:                                                                                                  ##                              Luminary131 file, using page 
013914,000022:                                                                                                  ##                              images from Luminary 1A.
013915,000023:                                                                                                  ##              2009-06-07 RSB  Corrected a typo.
013916,000024:                                                                                                  ##              2016-12-14 RSB  Proofed text comments with octopus/ProoferComments
013917,000025:                                                                                                  ##                              and corrected the errors found.
013918,000026:                                                                                                  ##              2017-03-07 RSB  Comment-text fixes noted in proofing Luminary 116.
013919,000027:                                                                                                  ##              2017-08-01 MAS  Created from LMY99 Rev 1.
013920,000028: 
013921,000029:                                                                                                  ## This source code has been transcribed or otherwise adapted from
013922,000030:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
013923,000031:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
013924,000032:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
013925,000033:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
013926,000034:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
013927,000035:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
013928,000036:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
013929,000037:                                                                                                  ## actually created.
013930,000038:                                                                                                  ##
013931,000039:                                                                                                  ## The code has been modified to match LMY99 Revision 0, otherwise
013932,000040:                                                                                                  ## known as Luminary Revision 99, the Apollo 11 software release preceeding
013933,000041:                                                                                                  ## the listing from which it was transcribed. It has been verified to
013934,000042:                                                                                                  ## contain the same bank checksums as AGC developer Allan Klumpp's listing
013935,000043:                                                                                                  ## of Luminary Revision 99 (for which we do not have scans).
013936,000044:                                                                                                  ##
013937,000045:                                                                                                  ## Notations on Allan Klumpp's listing read, in part:
013938,000046:                                                                                                  ##
013939,000047:                                                                                                  ##      ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
013940,000048: 

Page 326

013942,000050: 07,2667                                           BANK     7                                     
013943,000051: 06,2000                                           SETLOC   IMUCOMP                               
013944,000052: 06,2000                                           BANK                                           
013945,000053: 
013946,000054: 06,3263  E3,1460                                  EBANK=   NBDX                                  
013947,000055: 
013948,000056: 06,3263                                           COUNT*   $$/ICOMP                              
013949,000057: 06,3263           33531        1/PIPA             CAF      LGCOMP                                #  SAVE EBANK OF CALLING PROGRAM
013950,000058: 06,3264           56003                           XCH      EBANK                                 
013951,000059: 06,3265           54163                           TS       MODE                                  
013952,000060: 
013953,000061: 06,3266           11477                           CCS      GCOMPSW                               #  BYPASS IF GCOMPSW NEGATIVE
013954,000062: 06,3267           13272                           TCF      +3                                    
013955,000063: 06,3270           13272                           TCF      +2                                    
013956,000064: 06,3271           13353                           TCF      IRIG1                                 #  RETURN
013957,000065: 
013958,000066: 06,3272           34751        1/PIPA1            CAF      FOUR                                  #  PIPAZ, PIPAY, PIPAX
013959,000067: 06,3273           54132                           TS       BUF        +2                         
013960,000068: 
013961,000069: 06,3274           50132                           INDEX    BUF        +2                         
013962,000070: 06,3275           31453                           CA       PIPASCF                               #  (P.P.M.) X 2(-9)
013963,000071: 06,3276           00006                           EXTEND                                         
013964,000072: 06,3277           50132                           INDEX    BUF        +2                         
013965,000073: 06,3300           70324                           MP       DELVX                                 #  (PP) X 2(+14) NOW (PIPA PULSES) X 2(+5)
013966,000074: 06,3301           54002                           TS       Q                                     #  SAVE MAJOR PART
013967,000075: 
013968,000076: 06,3302           30001                           CA       L                                     #  MINOR PART
013969,000077: 06,3303           00006                           EXTEND                                         
013970,000078: 06,3304           74746                           MP       BIT6                                  #  SCALE 2(+9)   SHIFT RIGHT 9
013971,000079: 06,3305           50132                           INDEX    BUF        +2                         
013972,000080: 06,3306           54325                           TS       DELVX      +1                         #  FRACTIONAL PIPA PULSES SCALED 2(+14)
013973,000081: 
013974,000082: 06,3307           30002                           CA       Q                                     #  MAJOR PART
013975,000083: 06,3310           00006                           EXTEND                                         
013976,000084: 06,3311           74746                           MP       BIT6                                  #  SCALE 2(+9)   SHIFT RIGHT 9
013977,000085: 06,3312           50132                           INDEX    BUF        +2                         
013978,000086: 06,3313           20325                           DAS      DELVX                                 #  (PIPAI) + (PIPAI)(SFE)
013979,000087: 
013980,000088: 06,3314           50132                           INDEX    BUF        +2                         
013981,000089: 06,3315           41452                           CS       PIPABIAS                              #  (PIPA PULSES)/(CS) X 2(-5)             *
013982,000090: 06,3316           00006                           EXTEND                                         
013983,000091: 06,3317           71075                           MP       1/PIPADT                              #  (CS) X 2(+8) NOW (PIPA PULSES) X 2(+3) *
013984,000092: 06,3320           00006                           EXTEND                                         
013985,000093: 06,3321           74750                           MP       BIT4                                  #  SCALE 2(+11) SHIFT RIGHT 11            *
013986,000094: 06,3322           50132                           INDEX    BUF        +2                         
013987,000095: 06,3323           20325                           DAS      DELVX                                 #  (PIPAI) + (PIPAI)(SFE) - (BIAS)(DELTAT)
013988,000096: 
013989,000097: 06,3324           10132                           CCS      BUF        +2                         #  PIPAZ, PIPAY, PIPAX
013990,000098: 06,3325           67747                           AD       NEG1                                  
013991,000099: 06,3326           13273                           TCF      1/PIPA1    +1                         

Page 327

013993,000101: 06,3327           13330                           NOOP                                           #  LESS THAN ZERO IMPOSSIBLE
013994,000102: 

Page 328

013996,000104: 06,3330           55477        IRIGCOMP           TS       GCOMPSW                               #  INDICATE COMMANDS 2 PULSES OR LESS.
013997,000105: 06,3331           54130                           TS       BUF                                   #  INDEX COUNTER.  IRIGX, IRIGY, IRIGZ.
013998,000106: 
013999,000107: 06,3332           03356                           TC       IRIGX                                 #  COMPENSATE ACCELERATION TERMS
014000,000108: 
014001,000109: 06,3333           41460                           CS       NBDX                                  #  (GYRO PULSES)/(CS) X 2(-5)
014002,000110: 06,3334           03454                           TC       DRIFTSUB                              #  -(NBOX)(DELTAT)       (GYRO PULSES) X 2(+14)
014003,000111: 
014004,000112: 06,3335           03373                           TC       IRIGY                                 #  COMPENSATE ACCELERATION TERMS
014005,000113: 
014006,000114: 06,3336           41461                           CS       NBDY                                  #  (GYRO PULSES)/(CS) X 2(-5)
014007,000115: 06,3337           03454                           TC       DRIFTSUB                              #  -(NBDY)(DELTAT)       (GYRO PULSES) X 2(+14)
014008,000116: 
014009,000117: 06,3340           03410                           TC       IRIGZ                                 #  COMPENSATE ACCELERATION TERMS
014010,000118: 
014011,000119: 06,3341           31462                           CA       NBDZ                                  #  (GYRO PULSES)/(CS) X 2(-5)
014012,000120: 06,3342           03454                           TC       DRIFTSUB                              #  +(NBDZ)(DELTAT)       (GYRO PULSES) X 2(+14)
014013,000121: 
014014,000122: 06,3343           11477                           CCS      GCOMPSW                               #  ARE GYRO COMMANDS GREATER THAN 2 PULSES
014015,000123: 06,3344           13346                           TCF      +2                                    #  YES   SEND OUT GYRO TORQUING COMMANDS.
014016,000124: 06,3345           13353                           TCF      IRIG1                                 #  NO    RETURN
014017,000125: 
014018,000126: 06,3346           35031                           CA       PRIO21                                #  PRIO GREATER THAN SERVICER
014019,000127: 06,3347           05072                           TC       NOVAC                                 #  SEND OUT GYRO TORQUING COMMANDS.
014020,000128: 06,3350  E3,1460                                  EBANK=   NBDX                                  
014021,000129: 06,3350           03507 14063                     2CADR    1/GYRO                                
014022,000130: 
014023,000131: 06,3352           00003                           RELINT                                         
014024,000132: 06,3353           30163        IRIG1              CA       MODE                                  #  RESTORE CALLERS EBANK
014025,000133: 06,3354           54003                           TS       EBANK                                 
014026,000134: 06,3355           14631                           TCF      SWRETURN                              
014027,000135: 

Page 329

014029,000137: 06,3356           00006        IRIGX              EXTEND                                         
014030,000138: 06,3357           22156                           QXCH     MPAC       +2                         #  SAVE Q
014031,000139: 06,3360           00006                           EXTEND                                         
014032,000140: 06,3361           40325                           DCS      DELVX                                 #  (PIPA PULSES) X 2(+14)
014033,000141: 06,3362           52155                           DXCH     MPAC                                  
014034,000142: 06,3363           31463                           CA       ADIAX                                 #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *
014035,000143: 06,3364           03425                           TC       GCOMPSUB                              #  -(ADIAX)(PIPAX)          (GYRO PULSES) X 2(+14)
014036,000144: 
014037,000145: 06,3365           00006                           EXTEND                                         #  
014038,000146: 06,3366           40327                           DCS      DELVY                                 #        (PIPA PULSES) X 2(+14)
014039,000147: 06,3367           52155                           DXCH     MPAC                                  #  
014040,000148: 06,3370           41466                           CS       ADSRAX                                #        (GYRO PULSES)/(PIPA PULSE) X 2(-6)      *
014041,000149: 06,3371           03425                           TC       GCOMPSUB                              #        -(ADSRAX)(PIPAY)   (GYRO PULSES) X 2(+14)
014042,000150: 
014043,000151:                                                                                                  #                EXTEND                  ***
014044,000152:                                                                                                  #                DCS     DELVZ           ***     (PIPA PULSES) X 2(+14)
014045,000153:                                                                                                  #                DXCH    MPAC            ***
014046,000154:                                                                                                  #                CA      ADOAX           ***     (GYRO PULSES)/(PIPA PULSE) X 2(-6)      *
014047,000155:                                                                                                  #                TC      GCOMPSUB        ***     -(ADOAX)(PIPAZ)    (GYRO PULSES) X 2(+14)
014048,000156: 
014049,000157: 06,3372           00156                           TC       MPAC       +2                         
014050,000158: 
014051,000159: 06,3373           00006        IRIGY              EXTEND                                         
014052,000160: 06,3374           22156                           QXCH     MPAC       +2                         #  SAVE Q
014053,000161: 06,3375           00006                           EXTEND                                         
014054,000162: 06,3376           40327                           DCS      DELVY                                 #  (PIPA PULSES) X 2(+14)
014055,000163: 06,3377           52155                           DXCH     MPAC                                  
014056,000164: 06,3400           31464                           CA       ADIAY                                 #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *
014057,000165: 06,3401           03425                           TC       GCOMPSUB                              #  -(ADIAY)(PIPAY)          (GYRO PULSES) X 2(+14)
014058,000166: 
014059,000167: 06,3402           00006                           EXTEND                                         
014060,000168: 06,3403           40331                           DCS      DELVZ                                 #  (PIPA PULSES) X 2(+14)
014061,000169: 06,3404           52155                           DXCH     MPAC                                  
014062,000170: 06,3405           41467                           CS       ADSRAY                                #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *
014063,000171: 06,3406           03425                           TC       GCOMPSUB                              #  +(ADSRAY)(PIPAZ)              (GYRO PULSES) X 2(+14)
014064,000172: 
014065,000173:                                                                                                  #                EXTEND                  ***
014066,000174:                                                                                                  #                DCS     DELVX           ***     (PIPA PULSES) X 2(+14)
014067,000175:                                                                                                  #                DXCH    MPAC            ***
014068,000176:                                                                                                  #                CA      ADOAY           ***     (GYRO PULSES)/(PIPA PULSE) X 2(-6)      *
014069,000177:                                                                                                  #                TC      GCOMPSUB        ***     -(ADOAY)(PIPAX)   (GYRO PULSES) X 2(+14)
014070,000178: 
014071,000179: 06,3407           00156                           TC       MPAC       +2                         
014072,000180: 
014073,000181: 06,3410           00006        IRIGZ              EXTEND                                         
014074,000182: 06,3411           22156                           QXCH     MPAC       +2                         #  SAVE Q
014075,000183: 06,3412           00006                           EXTEND                                         
014076,000184: 06,3413           40327                           DCS      DELVY                                 #  (PIPA PULSES) X 2(+14)
014077,000185: 06,3414           52155                           DXCH     MPAC                                  
014078,000186: 06,3415           31470                           CA       ADSRAZ                                #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *

Page 330

014080,000188: 06,3416           03425                           TC       GCOMPSUB                              #  -(ADSRAZ)(PIPAY)        (GYRO PULSES) X 2(+14)
014081,000189: 
014082,000190: 06,3417           00006                           EXTEND                                         
014083,000191: 06,3420           40331                           DCS      DELVZ                                 #  (PIPA PULSES) X 2(+14)
014084,000192: 06,3421           52155                           DXCH     MPAC                                  
014085,000193: 06,3422           31465                           CA       ADIAZ                                 #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *
014086,000194: 06,3423           03425                           TC       GCOMPSUB                              #  -(ADIAZ)(PIPAZ)          (GYRO PULSES) X 2(+14)
014087,000195: 
014088,000196:                                                                                                  #                EXTEND                  ***
014089,000197:                                                                                                  #                DCS     DELVX           ***     (PIPA PULSE) X 2(+14)
014090,000198:                                                                                                  #                DXCH    MPAC            ***
014091,000199:                                                                                                  #                CS      ADOAZ           ***     (GYRO PULSES)/(PIPA PULSE) X 2(-6)      *
014092,000200:                                                                                                  #                TC      GCOMPSUB        ***     +(ADOAZ)(PIPAX)    (GYRO PULSES) X 2(+14)
014093,000201: 
014094,000202: 06,3424           00156                           TC       MPAC       +2                         
014095,000203: 

Page 331

014097,000205: 06,3425           56154        GCOMPSUB           XCH      MPAC                                  #  ADIA OR ADSRA COEFFICIENT ARRIVES IN A
014098,000206: 06,3426           00006                           EXTEND                                         #  C(MPAC) = (PIPA PULSES) X 2(+14)
014099,000207: 06,3427           70154                           MP       MPAC                                  #  (GYRO PULSES)/(PIPA PULSE) X 2(-6)            *
014100,000208: 06,3430           52123                           DXCH     VBUF                                  #  NOW = (GYRO PULSES) X 2(+8)                   *
014101,000209: 
014102,000210: 06,3431           30155                           CA       MPAC       +1                         #  MINOR PART PIPA PULSES
014103,000211: 06,3432           00006                           EXTEND                                         
014104,000212: 06,3433           70154                           MP       MPAC                                  #  ADIA OR ADSRA
014105,000213: 06,3434           54001                           TS       L                                     
014106,000214: 06,3435           34755                           CAF      ZERO                                  
014107,000215: 06,3436           20123                           DAS      VBUF                                  #  NOW = (GYRO PULSES) X 2(+8)                   *
014108,000216: 
014109,000217: 06,3437           30122                           CA       VBUF                                  #  PARTIAL RESULT - MAJOR
014110,000218: 06,3440           00006                           EXTEND                                         
014111,000219: 06,3441           74743                           MP       BIT9                                  #  SCALE 2(+6)   SHIFT RIGHT 6                   *
014112,000220: 06,3442           50130                           INDEX    BUF                                   #  RESULT = (GYRO PULSES) X 2(+14)
014113,000221: 06,3443           21472                           DAS      GCOMP                                 #  HI(ADIA)(PIPAI) OR HI(ADSRA)(PIPAI)
014114,000222: 
014115,000223: 06,3444           30123                           CA       VBUF       +1                         #  PARTIAL RESULT - MINOR
014116,000224: 06,3445           00006                           EXTEND                                         
014117,000225: 06,3446           74743                           MP       BIT9                                  #  SCALE 2(+6)   SHIFT RIGHT 6                   *
014118,000226: 06,3447           54001                           TS       L                                     
014119,000227: 06,3450           34755                           CAF      ZERO                                  
014120,000228: 06,3451           50130                           INDEX    BUF                                   #  RESULT = (GYRO PULSES) X 2(+14)
014121,000229: 06,3452           21472                           DAS      GCOMP                                 #  (ADIA)(PIPAI) OR (ADSRA)(PIPAI)
014122,000230: 
014123,000231: 06,3453           00002                           TC       Q                                     
014124,000232: 

Page 332

014126,000234: 06,3454           00006        DRIFTSUB           EXTEND                                         
014127,000235: 06,3455           22131                           QXCH     BUF        +1                         
014128,000236: 
014129,000237: 06,3456           00006                           EXTEND                                         #  C(A) = NBD    (GYRO PULSES)/(CS) X 2(-5)
014130,000238: 06,3457           71075                           MP       1/PIPADT                              #  (CS) X 2(+8)  NOW (GYRO PULSES) X 2(+3)
014131,000239: 06,3460           22155                           LXCH     MPAC       +1                         #  SAVE FOR FRACTIONAL COMPENSATION
014132,000240: 06,3461           00006                           EXTEND                                         
014133,000241: 06,3462           74750                           MP       BIT4                                  #  SCALE 2(+11)  SHIFT RIGHT 11
014134,000242: 06,3463           50130                           INDEX    BUF                                   
014135,000243: 06,3464           21472                           DAS      GCOMP                                 #  HI(NBD)(DELTAT)       (GYRO PULSES) X 2(+14)
014136,000244: 
014137,000245: 06,3465           30155                           CA       MPAC       +1                         #  NOW MINOR PART
014138,000246: 06,3466           00006                           EXTEND                                         
014139,000247: 06,3467           74750                           MP       BIT4                                  #  SCALE 2(+11)          SHIFT RIGHT 11
014140,000248: 06,3470           54001                           TS       L                                     
014141,000249: 06,3471           34755                           CAF      ZERO                                  
014142,000250: 06,3472           50130                           INDEX    BUF                                   #  ADD IN FRACTIONAL COMPENSATION
014143,000251: 06,3473           21472                           DAS      GCOMP                                 #  (NBD)(DELTAT)         (GYRO PULSES) X 2(+14)
014144,000252: 
014145,000253: 06,3474           34752        DRFTSUB2           CAF      TWO                                   #  PIPAX, PIPAY, PIPAZ
014146,000254: 06,3475           60130                           AD       BUF                                   
014147,000255: 06,3476           56130                           XCH      BUF                                   
014148,000256: 06,3477           50000                           INDEX    A                                     
014149,000257: 06,3500           11471                           CCS      GCOMP                                 #  ARE GYRO COMMANDS 1 PULSE OR GREATER
014150,000258: 06,3501           13503                           TCF      +2                                    #  YES
014151,000259: 06,3502           00131                           TC       BUF        +1                         #  NO
014152,000260: 
014153,000261: 06,3503           73553                           MASK     COMPCHK                               #  DEC -1
014154,000262: 06,3504           10000                           CCS      A                                     #  ARE GYRO COMMANDS GREATER THAN 2 PULSES
014155,000263: 06,3505           55477                           TS       GCOMPSW                               #  YES - SET GCOMPSW POSITIVE
014156,000264: 06,3506           00131                           TC       BUF        +1                         #  NO
014157,000265: 

Page 333

014159,000267: 06,3507           34751        1/GYRO             CAF      FOUR                                  #  PIPAZ, PIPAY, PIPAX
014160,000268: 06,3510           54130                           TS       BUF                                   
014161,000269: 
014162,000270: 06,3511           50130                           INDEX    BUF                                   #  SCALE GYRO COMMANDS FOR IMUPULSE
014163,000271: 06,3512           31472                           CA       GCOMP      +1                         #  FRACTIONAL PULSES
014164,000272: 06,3513           00006                           EXTEND                                         
014165,000273: 06,3514           74744                           MP       BIT8                                  #  SHIFT RIGHT 7
014166,000274: 06,3515           50130                           INDEX    BUF                                   
014167,000275: 06,3516           55472                           TS       GCOMP      +1                         #  FRACTIONAL PULSES SCALED
014168,000276: 
014169,000277: 06,3517           34755                           CAF      ZERO                                  #  SET GCOMP = 0 FOR DAS INSTRUCTION
014170,000278: 06,3520           50130                           INDEX    BUF                                   
014171,000279: 06,3521           57471                           XCH      GCOMP                                 #  GYRO PULSES
014172,000280: 06,3522           00006                           EXTEND                                         
014173,000281: 06,3523           74744                           MP       BIT8                                  #  SHIFT RIGHT 7
014174,000282: 06,3524           50130                           INDEX    BUF                                   
014175,000283: 06,3525           21472                           DAS      GCOMP                                 #  ADD THESE TO FRACTIONAL PULSES ABOVE
014176,000284: 
014177,000285: 06,3526           10130                           CCS      BUF                                   #  PIPAZ, PIPAY, PIPAX
014178,000286: 06,3527           67747                           AD       NEG1                                  
014179,000287: 06,3530           13510                           TCF      1/GYRO     +1                         
014180,000288: 06,3531           01471        LGCOMP             ECADR    GCOMP                                 #  LESS THAN ZERO IMPOSSIBLE
014181,000289: 
014182,000290: 06,3532           33531                           CAF      LGCOMP                                
014183,000291: 06,3533           04616                           TC       BANKCALL                              
014184,000292: 06,3534           17323                           CADR     IMUPULSE                              #  CALL GYRO TORQUING ROUTINE
014185,000293: 06,3535           04616                           TC       BANKCALL                              
014186,000294: 06,3536           17716                           CADR     IMUSTALL                              #  WAIT FOR PULSES TO GET OUT
014187,000295: 06,3537           15155                           TCF      ENDOFJOB                              #  TEMPORARY
014188,000296: 
014189,000297: 06,3540           34751        GCOMP1             CAF      FOUR                                  #  PIPAZ, PIPAY, PIPAX
014190,000298: 06,3541           54130                           TS       BUF                                   
014191,000299: 
014192,000300: 06,3542           50130                           INDEX    BUF                                   #  RESCALE
014193,000301: 06,3543           31472                           CA       GCOMP      +1                         
014194,000302: 06,3544           00006                           EXTEND                                         
014195,000303: 06,3545           74744                           MP       BIT8                                  #  SHIFT MINOR PART LEFT 7 - MAJOR PART = 0
014196,000304: 06,3546           50130                           INDEX    BUF                                   
014197,000305: 06,3547           23472                           LXCH     GCOMP      +1                         #  BITS 8-14 OF MINOR PART WERE = 0
014198,000306: 
014199,000307: 06,3550           10130                           CCS      BUF                                   #  PIPAZ, PIPAY, PIPAX
014200,000308: 06,3551           67747                           AD       NEG1                                  
014201,000309: 06,3552           13541                           TCF      GCOMP1     +1                         
014202,000310: 06,3553           77776        COMPCHK            DEC      -1         B-14                       #  LESS THAN ZERO IMPOSSIBLE
014203,000311: 06,3554           15155                           TCF      ENDOFJOB                              
014204,000312: 

Page 334

014206,000314: 06,3555           11477        NBDONLY            CCS      GCOMPSW                               #  BYPASS IF GCOMPSW NEGATIVE
014207,000315: 06,3556           13561                           TCF      +3                                    
014208,000316: 06,3557           13561                           TCF      +2                                    
014209,000317: 06,3560           15155                           TCF      ENDOFJOB                              
014210,000318: 
014211,000319: 06,3561           00004                           INHINT                                         
014212,000320: 06,3562           10076                           CCS      FLAGWRD2                              #  PREREAD T3RUPT MAY COINCIDE
014213,000321: 06,3563           15155                           TCF      ENDOFJOB                              
014214,000322: 06,3564           15155                           TCF      ENDOFJOB                              
014215,000323: 06,3565           13566                           TCF      +1                                    
014216,000324: 
014217,000325: 06,3566           30104                           CA       FLAGWRD8                              #  IF SURFACE FLAG IS SET, SET TEM1
014218,000326: 06,3567           74744                           MASK     BIT8                                  #  POSITIVE SO THAT THE ACCELERATION TERMS
014219,000327: 06,3570           54141                           TS       TEM1                                  #  WILL BE COMPENSATED.
014220,000328: 06,3571           00006                           EXTEND                                         
014221,000329: 06,3572           13575                           BZF      +3                                    #  ARE WE ON THE SURFACE
014222,000330: 
014223,000331: 06,3573           04674                           TC       IBNKCALL                              #  ON THE SURFACE
014224,000332: 06,3574           77544                           CADR     PIPASR     +3                         #  READ PIPAS, BUT DO NOT SCALE THEM
014225,000333: 
014226,000334: 06,3575           30025                           CA       TIME1                                 #  (CS) X 2(+14)
014227,000335: 06,3576           57075                           XCH      1/PIPADT                              #  PREVIOUS TIME
014228,000336: 06,3577           00003                           RELINT                                         
014229,000337: 06,3600           40000                           COM                                            
014230,000338: 06,3601           61075                           AD       1/PIPADT                              #  PRESENT TIME - PREVIOUS TIME
014231,000339: 06,3602           64736        NBD2               AD       HALF                                  #  CORRECT FOR POSSIBLE TIME1 TICK
014232,000340: 06,3603           64736                           AD       HALF                                  
014233,000341: 06,3604           56001                           XCH      L                                     #  IF TIME1 DID NOT TICK, REMOVE RESULTING
014234,000342: 06,3605           56001                           XCH      L                                     #  OVERFLOW.
014235,000343: 
014236,000344: 06,3606           00006        NBD3               EXTEND                                         #  C(A) = DELTAT         (CS) X 2(+14)
014237,000345: 06,3607           74742                           MP       BIT10                                 #  SHIFT RIGHT 5
014238,000346: 06,3610           52125                           DXCH     VBUF       +2                         
014239,000347: 
014240,000348: 06,3611           34755                           CA       ZERO                                  
014241,000349: 06,3612           55477                           TS       GCOMPSW                               #  INDICATE COMMANDS 2 PULSES OR LESS.
014242,000350: 06,3613           54130                           TS       BUF                                   #  INDEX X, Y, Z.
014243,000351: 
014244,000352: 06,3614           10141                           CCS      TEM1                                  #  IF SURFACE FLAG IS SET,
014245,000353: 06,3615           03356                           TC       IRIGX                                 #  COMPENSATE ACCELERATION TERMS.
014246,000354: 
014247,000355: 06,3616           00006                           EXTEND                                         
014248,000356: 06,3617           30125                           DCA      VBUF       +2                         
014249,000357: 06,3620           52155                           DXCH     MPAC                                  #  DELTAT NOW SCALED (CS) X 2(+19)
014250,000358: 
014251,000359: 06,3621           41460                           CS       NBDX                                  #  (GYRO PULSES)/(CS) X 2(-5)
014252,000360: 06,3622           03644                           TC       FBIASSUB                              #  -(NBOX)(DELTAT)       (GYRO PULSES) X 2(+14)
014253,000361: 
014254,000362: 06,3623           10141                           CCS      TEM1                                  #  IF SURFACE FLAG IS SET,
014255,000363: 06,3624           03373                           TC       IRIGY                                 #  COMPENSATE ACCELERATION TERMS.

Page 335

014257,000365: 06,3625           00006                           EXTEND                                         
014258,000366: 06,3626           40125                           DCS      VBUF       +2                         
014259,000367: 06,3627           52155                           DXCH     MPAC                                  #  DELTAT SCALED (CS) X 2(+19)
014260,000368: 06,3630           31461                           CA       NBDY                                  #  (GYRO PULSES)/(CS) X 2(-5)
014261,000369: 06,3631           03644                           TC       FBIASSUB                              #  -(NBDY)(DELTAT)       (GYRO PULSES) X 2(+14)
014262,000370: 
014263,000371: 06,3632           10141                           CCS      TEM1                                  #  IF SURFACE FLAG IS SET,
014264,000372: 06,3633           03410                           TC       IRIGZ                                 #  COMPENSATE ACCELERATION TERMS
014265,000373: 
014266,000374: 06,3634           00006                           EXTEND                                         
014267,000375: 06,3635           40125                           DCS      VBUF       +2                         
014268,000376: 06,3636           52155                           DXCH     MPAC                                  #  DELTAT SCALED (CS) X 2(+19)
014269,000377: 06,3637           41462                           CS       NBDZ                                  #  (GYRO PULSES)/(CS) X 2(-5)
014270,000378: 06,3640           03644                           TC       FBIASSUB                              #  +(NBDZ)(DELTAT)       (GYRO PULSES) X 2(+14)
014271,000379: 
014272,000380: 06,3641           11477                           CCS      GCOMPSW                               #  ARE GYRO COMMANDS GREATER THAN 2 PULSES
014273,000381: 06,3642           13507                           TCF      1/GYRO                                #  YES
014274,000382: 06,3643           15155                           TCF      ENDOFJOB                              #  NO
014275,000383: 

Page 336

014277,000385: 06,3644           56002        FBIASSUB           XCH      Q                                     
014278,000386: 06,3645           54131                           TS       BUF        +1                         
014279,000387: 
014280,000388: 06,3646           30002                           CA       Q                                     #  NBD SCALED (GYRO PULSES)/(CS) X 2(-5)
014281,000389: 06,3647           00006                           EXTEND                                         
014282,000390: 06,3650           70154                           MP       MPAC                                  #  DELTAT SCALED (CS) X 2(+19)
014283,000391: 06,3651           50130                           INDEX    BUF                                   
014284,000392: 06,3652           21472                           DAS      GCOMP                                 #  HI(NBD)(DELTAT)       (GYRO PULSES) X 2(+14)
014285,000393: 
014286,000394: 06,3653           30002                           CA       Q                                     #  NOW FRACTIONAL PART
014287,000395: 06,3654           00006                           EXTEND                                         
014288,000396: 06,3655           70155                           MP       MPAC       +1                         
014289,000397: 06,3656           54001                           TS       L                                     
014290,000398: 06,3657           34755                           CAF      ZERO                                  
014291,000399: 06,3660           50130                           INDEX    BUF                                   
014292,000400: 06,3661           21472                           DAS      GCOMP                                 #  (NBD)(DELTAT)         (GYRO PULSES) X 2(+14)
014293,000401: 
014294,000402: 06,3662           13474                           TCF      DRFTSUB2                              #  CHECK MAGNITUDE OF COMPENSATION
014295,000403: 
014296,000404: 06,3663           04616        LASTBIAS           TC       BANKCALL                              
014297,000405: 06,3664           17277                           CADR     PIPUSE1                               
014298,000406: 
014299,000407: 06,3665           11477                           CCS      GCOMPSW                               
014300,000408: 06,3666           13671                           TCF      +3                                    
014301,000409: 06,3667           13671                           TCF      +2                                    
014302,000410: 06,3670           15155                           TCF      ENDOFJOB                              
014303,000411: 
014304,000412: 06,3671           30104                           CA       FLAGWRD8                              #  IF SURFACE FLAG IS SET, SET TEM1
014305,000413: 06,3672           74744                           MASK     SURFFBIT                              #  POSITIVE SO THAT THE ACCELERATION TERMS
014306,000414: 06,3673           54141                           TS       TEM1                                  #  WILL BE COMPENSATED.
014307,000415: 
014308,000416: 06,3674           37716                           CAF      PRIO31                                #  2 SECONDS SCALED (CS) X 2(+8)
014309,000417: 06,3675           57075                           XCH      1/PIPADT                              
014310,000418: 06,3676           40000                           COM                                            
014311,000419: 06,3677           61235                           AD       PIPTIME    +1                         
014312,000420: 06,3700           13602                           TCF      NBD2                                  
014313,000421: 
014314,000422: 06,3701           33531        GCOMPZER           CAF      LGCOMP                                #  ROUTINE TO ZERO GCOMP BEFORE FIRST
014315,000423: 06,3702           56003                           XCH      EBANK                                 #  CALL TO 1/PIPA
014316,000424: 06,3703           54163                           TS       MODE                                  
014317,000425: 
014318,000426: 06,3704           34755                           CAF      ZERO                                  
014319,000427: 06,3705           55477                           TS       GCOMPSW                               
014320,000428: 06,3706           55471                           TS       GCOMP                                 
014321,000429: 06,3707           55472                           TS       GCOMP      +1                         
014322,000430: 06,3710           55473                           TS       GCOMP      +2                         
014323,000431: 06,3711           55474                           TS       GCOMP      +3                         
014324,000432: 06,3712           55475                           TS       GCOMP      +4                         

Page 337

014326,000434: 06,3713           55476                           TS       GCOMP      +5                         
014327,000435: 
014328,000436: 06,3714           13353                           TCF      IRIG1                                 #  RESTORE EBANK AND RETURN
014329,000437: 

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