Source Code

This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the second release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 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.

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

Page 326

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

Page 327

013988,000101: 06,3327           13330                           NOOP                                           #  LESS THAN ZERO IMPOSSIBLE
013989,000102: 

Page 328

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

Page 329

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

Page 330

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

Page 331

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

Page 332

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

Page 333

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

Page 334

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

Page 335

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

Page 336

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

Page 337

014321,000434: 06,3713           55476                           TS       GCOMP      +5                         
014322,000435: 
014323,000436: 06,3714           13353                           TCF      IRIG1                                 #  RESTORE EBANK AND RETURN
014324,000437: 

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