Source Code

These source-code files derive from a printout of Luminary 210 (Apollo 15-17 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Jim Lawton, and transcribed to source code by a team of volunteers. This colorized, syntax-highlighted form was created by assembling that transcribed source code. Note that the full page images are available on the Virtual AGC project page at archive.org, while reduced-size images are presented at the VirtualAGC project website. Report or fix any transcription errors at the Virtual AGC project code repository.

Notations on the program listing read, in part:

	GAP: ASSEMBLE REVISION 210 OF AGC PROGRAM LUMINARY 
	BY NASA 2021112-161 17:11 MAR. 19,1971
Note that the date is the date of the printout, not the date of the program revision.

060828,000002:                                                                                                  ## Copyright:   Public domain.
060829,000003:                                                                                                  ## Filename:    DAPIDLER_PROGRAM.agc
060830,000004:                                                                                                  ## Purpose:     A section of Luminary revision 210.
060831,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
060832,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 15-17.
060833,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
060834,000008:                                                                                                  ##              that the code format has been changed to conform to the
060835,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
060836,000010:                                                                                                  ##              original YUL assembler.
060837,000011:                                                                                                  ## Reference:   pp. 1407-1418
060838,000012:                                                                                                  ## Assembler:   yaYUL
060839,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
060840,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
060841,000015:                                                                                                  ## Mod history: 2016-11-17 JL   Created from Luminary131 version.
060842,000016:                                                                                                  ##              2016-12-07 RRB  Transcribed from Luminary210.
060843,000017:                                                                                                  ##              2016-12-08 HG   Fix operand AGCINDIC -> AGSINDIC
060844,000018:                                                                                                  ##              2016-12-11 HG   fix operand MOREIDLE -> NONEEDLE
060845,000019:                                                                                                  ##              2016-12-26 RSB  Comment-text proofed using ProoferComments
060846,000020:                                                                                                  ##                              and corrected errors found.
060847,000021: 

Page 1407

060849,000023:                                                                                                  #  THE DAPIDLER PROGRAM IS STARTED BY FRESH START AND RESTART.  THE DAPIDLER PROGRAM IS DONE 10 TIMES
060850,000024:                                                                                                  #  PER SECOND UNTIL THE ASTRONAUT DESIRES THE DAP TO WAKE UP, AND THE IMU AND CDUS ARE READY FOR USE BY THE DAP.
060851,000025:                                                                                                  #  THE NECESSARY INITIALIZATION OF THE DAP IS DONE BY THE DAPIDLER PROGRAM.
060852,000026: 
060853,000027: 16,2000                                           BANK     16                                    
060854,000028: 16,2000                                           SETLOC   DAPS1                                 
060855,000029: 16,2000                                           BANK                                           
060856,000030: 
060857,000031: 16,2000  E6,1536                                  EBANK=   AOSQ                                  
060858,000032: 
060859,000033: 16,2000                                           COUNT*   $$/DAPID                              
060860,000034:                                                                                                  #        CHEKBITS IS CALLED EVERY 0.1 SEC AT THE BEGINNING OF THE DAP PASS, WHETHER THE AUTOPILOT IS ACTIVE OR IDLING.
060861,000035:                                                                                                  #  IT CHECKS FOR THE FOLLOWING
060862,000036:                                                                                                  #                A. IS THE PGNCS MODE SELECT SWITCH TURNED TO "OFF"?
060863,000037:                                                                                                  #                B. IS THE IMU UNAVAILABLE AS AN ATTITUDE REFERENCE?
060864,000038:                                                                                                  #                C. HAS THE INDICATION GONE FROM AGS TO PGNCS SINCE LAST CHECKED
060865,000039:                                                                                                  #        IF EITHER A OR B HOLD, THE FDAI ERROR NEEDLES MUST NOT BE UPDATED (TOAVOID CONFLICT OVER USE OF THE DACS WITH
060866,000040:                                                                                                  #  V43 OR COARSE ALIGN) AND THE DAP MUST IDLE.  A BIT IS SET TO CAUSE  NEEDLER TO INITIALIZE ITSELF WHEN IT IS NEXT
060867,000041:                                                                                                  #  CALLED AND CONTROL IS TRANSFERRED TO A SHORT IDLING ROUTINE.  OTHERWISE, THE NEEDLES ARE UPDATED AND CONDITION
060868,000042:                                                                                                  #  "C" IS TESTED.
060869,000043: 
060870,000044:                                                                                                  #        IF C HOLDS, THE DAP IS REINITIALIZED.  OTHERWISE, THE DAP SHOULD BE ACTIVE AND CONTROL IS TRANSFERRED BACK TO
060871,000045:                                                                                                  #  THE CALLER OF CHEKBITS.
060872,000046: 
060873,000047: 16,2000           00006        CHEKBITS           EXTEND                                         
060874,000048: 16,2001           00031                           READ     CHAN31                                #  IF BOTH BIT13 AND BIT14 ARE ONE, THEN
060875,000049: 16,2002           40000                           COM                                            #  THE MODE SELECT SWITCH IS IN THE OFF
060876,000050: 16,2003           74346                           MASK     BIT13-14                              #  POSITION, AND SO THE DAP SHOULD BE OFF,
060877,000051: 16,2004           00006                           EXTEND                                         #  WITH NO ATTITUDE ERROR DISPLAY.
060878,000052: 16,2005           12012                           BZF      NONEEDLE                              
060879,000053: 
060880,000054: 16,2006           41300                           CS       IMODES33                              #  IF IMU NOT USABLE, DAP SHOULD IDLE WITH
060881,000055: 16,2007           74737                           MASK     BIT6                                  #   NO FDAI NEEDLE DISPLAY.
060882,000056: 16,2010           10000                           CCS      A                                     
060883,000057: 16,2011           12212                           TCF      JUMPDSP                               
060884,000058: 16,2012           41774        NONEEDLE           CS       RCSFLAGS                              #  SET FLAG TO INITIALIZE NEEDLE DISPLAY.
060885,000059: 16,2013           74742                           MASK     BIT3                                  
060886,000060: 16,2014           27774                           ADS      RCSFLAGS                              
060887,000061: 16,2015           12164                           TCF      SHUTDOWN                              
060888,000062: 
060889,000063: 16,2016           34733        CHEKMORE           CAF      BIT10                                 #  BIT 10 OF 30 IS PGNCS CONTROL OF S/C
060890,000064: 16,2017           00006                           EXTEND                                         
060891,000065: 16,2020           02030                           RAND     CHAN30                                #  BITS IN 30 ARE INVERTED
060892,000066: 16,2021           10000                           CCS      A                                     
060893,000067: 16,2022           12033                           TCF      AGSINDIC                              #  AGS: GO SET NPGNCSFL BUT CONTROL ANYHOW.
060894,000068: 16,2023           40106                           CS       FLGWRD10                              
060895,000069: 16,2024           74744                           MASK     NPGNCSBT                              
060896,000070: 16,2025           10000                           CCS      A                                     
060897,000071: 16,2026           00002                           RETURN                                         #  PGNCS BOTH LAST TIME & THIS: GO CONTROL.
060898,000072: 

Page 1408

060900,000074: 16,2027           44744                           CS       NPGNCSBT                              #  PGNCS THIS TIME BUT AGS LAST: CLEAR
060901,000075: 16,2030           70106                           MASK     FLGWRD10                              #    NPGNCSFL AND GO INITIALIZE DAP.
060902,000076: 16,2031           54106                           TS       FLGWRD10                              
060903,000077: 16,2032           12043                           TCF      STARTDP1                              
060904,000078: 
060905,000079: 16,2033           40106        AGSINDIC           CS       FLGWRD10                              
060906,000080: 16,2034           74744                           MASK     NPGNCSBT                              
060907,000081: 16,2035           26106                           ADS      FLGWRD10                              
060908,000082: 16,2036           00002                           RETURN                                         
060909,000083: 

Page 1409

060911,000085: 
060912,000086:                                                                                                  #  DAPIDLER ENTRY.
060913,000087: 
060914,000088: 16,2037           22016        DAPIDLER           LXCH     BANKRUPT                              #  INTERRUPT LEAD INS (CONTINUED)
060915,000089: 16,2040           00006                           EXTEND                                         
060916,000090: 16,2041           22012                           QXCH     QRUPT                                 
060917,000091: 
060918,000092: 16,2042           02000        CHECKUP            TC       CHEKBITS                              #  CHECK TO SEE IF LM DAP IS TO GO ON AND
060919,000093:                                                                                                  #        DO ERROR DISPLAY.
060920,000094: 
060921,000095: 16,2043           30111        STARTDP1           CAE      DAPBOOLS                              #  IF 1/ACCS HAS NOT BEEN COMPLETED, IDLE.
060922,000096: 16,2044           74742                           MASK     ACCSOKAY                              #        NOTE:   ONLY FRESH START AND RESTART
060923,000097: 16,2045           00006                           EXTEND                                         #                KNOCK THIS BIT DOWN.
060924,000098: 16,2046           12160                           BZF      MOREIDLE                              
060925,000099: 
060926,000100: 16,2047           04665        STARTDAP           TC       IBNKCALL                              #  ZERO ATTITUDE ERROR AND DESIRED RATES.
060927,000101: 16,2050           40154                           FCADR    ZATTEROR                              
060928,000102: 16,2051           34746                           CAF      ZERO                                  #  ********** INITIALIZE: **********
060929,000103: 16,2052           55524                           TS       TJP                                   
060930,000104: 16,2053           55525                           TS       TJU                                   
060931,000105: 16,2054           55526                           TS       TJV                                   
060932,000106: 16,2055           55421                           TS       OMEGAP                                #  RATES IN BODY (PILOT) COORDINATES.
060933,000107: 16,2056           55422                           TS       OMEGAQ                                
060934,000108: 16,2057           55423                           TS       OMEGAR                                
060935,000109: 16,2060           55430                           TS       TRAPEDP                               
060936,000110: 16,2061           55431                           TS       TRAPEDQ                               
060937,000111: 16,2062           55432                           TS       TRAPEDR                               
060938,000112: 16,2063           55536                           TS       AOSQ                                  #  OFFSET ACCELERATION ESTIMATES.
060939,000113: 16,2064           55537                           TS       AOSQ       +1                         
060940,000114: 16,2065           55540                           TS       AOSR                                  
060941,000115: 16,2066           55541                           TS       AOSR       +1                         
060942,000116: 16,2067           55424                           TS       ALPHAQ                                #  COPIES OF OFFSET ESTIMATES FOR DOWNLIST.
060943,000117: 16,2070           55425                           TS       ALPHAR                                
060944,000118: 16,2071           55501                           TS       NEGUQ                                 
060945,000119: 16,2072           55503                           TS       NEGUR                                 
060946,000120: 16,2073           55544                           TS       AOSQTERM                              #  QRAXIS RATE DERIVATION TERMS AND KALMAN
060947,000121: 16,2074           55545                           TS       AOSRTERM                              #  FILTER INITIALIZATION TERMS.
060948,000122: 16,2075           55510                           TS       QACCDOT                               #  DESCENT ACCELERATION DERIVATIVE EST.
060949,000123: 16,2076           55512                           TS       RACCDOT                               
060950,000124: 16,2077           55502                           TS       ALLOWGTS                              #  AOSTASK FLAG FOR QRAXIS RCS CONTROL USE.
060951,000125: 16,2100           55630                           TS       COTROLER                              #  DO TRYGTS ON FIRST PASS (WILL GO TO RCS)
060952,000126: 16,2101           55632                           TS       INGTS                                 #  RECOGNIZE FIRST GTS PASS AS SUCH.
060953,000127: 16,2102           55631                           TS       QGIMTIMR                              #  STOP GIMBAL DRIVES.  (PROBABLY WOULD BE
060954,000128: 16,2103           55633                           TS       RGIMTIMR                              #        GOOD ENOUGH JUST TO INACTIVATE TIMERS)
060955,000129: 16,2104           55460                           TS       OLDPMIN                               #  MINIMUM IMPULSE MODE ERASABLES
060956,000130: 16,2105           55461                           TS       OLDQRMIN                              
060957,000131: 16,2106           55766                           TS       PJETCTR                               #  INITIALIZE DOCKED JET INHIBITION
060958,000132: 16,2107           55767                           TS       UJETCTR                               #  COUNTERS
060959,000133: 16,2110           55770                           TS       VJETCTR                               
060960,000134: 16,2111     4740               CALLGMBL           EQUALS   BIT5                                  #  RCSFLAGS INITIALIZATION.
060961,000135: 16,2111           42206                           CS       MANFLAG                               

Page 1410

060963,000137: 16,2112           71774                           MASK     RCSFLAGS                              #  NEGUQ(R) HAVE BEEN GENERATED.
060964,000138: 16,2113           55774                           TS       RCSFLAGS                              
060965,000139: 
060966,000140:                                                                                                  #  SET UP "OLD" MEASURED CDU ANGLES:
060967,000141: 
060968,000142: 16,2114           00006                           EXTEND                                         
060969,000143: 16,2115           30033                           DCA      CDUX                                  #  OLDXFORP AND OLDYFORP
060970,000144: 16,2116           53441                           DXCH     OLDXFORP                              
060971,000145: 16,2117           30034                           CA       CDUZ                                  
060972,000146: 16,2120           55442                           TS       OLDZFORQ                              
060973,000147: 16,2121           41774                           CS       RCSFLAGS                              
060974,000148: 16,2122           74731                           MASK     BIT12                                 
060975,000149: 16,2123           27774                           ADS      RCSFLAGS                              #  BIT 12 SET TO 1.
060976,000150: 16,2124           34742                           CA       FOUR                                  
060977,000151: 16,2125           55534                           TS       SKIPU                                 
060978,000152: 16,2126           55535                           TS       SKIPV                                 
060979,000153: 16,2127           34724                           CA       POSMAX                                
060980,000154: 16,2130           54031                           TS       TIME6                                 
060981,000155: 16,2131           55466                           TS       T6NEXT                                
060982,000156: 16,2132           55470                           TS       T6FURTHA                              
060983,000157: 16,2133           34746                           CA       ZERO                                  
060984,000158: 16,2134           55467                           TS       T6NEXT     +1                         
060985,000159: 16,2135           55471                           TS       T6FURTHA   +1                         
060986,000160: 16,2136           55465                           TS       NXT6ADR                               
060987,000161: 16,2137           55472                           TS       NEXTP                                 
060988,000162: 16,2140           55473                           TS       NEXTU                                 
060989,000163: 16,2141           55474                           TS       NEXTV                                 
060990,000164: 16,2142           44354                           CS       TEN                                   
060991,000165: 16,2143           55756                           TS       DAPZRUPT                              #  JASK NOT IN PROGRESS, INITIALIZE NEG.
060992,000166: 16,2144           34743                           CA       TWO                                   
060993,000167: 16,2145           55433                           TS       NPTRAPS                               
060994,000168: 16,2146           55434                           TS       NQTRAPS                               
060995,000169: 16,2147           55435                           TS       NRTRAPS                               
060996,000170: 16,2150           00006                           EXTEND                                         
060997,000171: 16,2151           32211                           DCA      PAXADIDL                              
060998,000172: 16,2152           53263                           DXCH     T5ADR                                 
060999,000173: 16,2153           37750        SETTIME5           CAF      MS100                                 
061000,000174: 16,2154           54030                           TS       TIME5                                 
061001,000175: 16,2155           15272                           TCF      RESUME                                
061002,000176: 16,2156  E6,1536                                  EBANK=   AOSQ                                  
061003,000177: 16,2156           02037 34106  IDLERADR           2CADR    DAPIDLER                              
061004,000178: 
061005,000179: 16,2160           04665        MOREIDLE           TC       IBNKCALL                              #  CALCULATE Q,R-AXES ATTITUDE ERRORS.
061006,000180: 16,2161           36655                           CADR     QERRCALC                              
061007,000181: 
061008,000182: 16,2162           04665                           TC       IBNKCALL                              
061009,000183: 16,2163           35447                           CADR     CALCPERR                              #  CALCULATE P AXIS ATTITUDE ERRORS.
061010,000184: 
061011,000185: 16,2164           00006        SHUTDOWN           EXTEND                                         
061012,000186: 16,2165           32157                           DCA      IDLERADR                              

Page 1411

061014,000188: 16,2166           53263                           DXCH     T5ADR                                 
061015,000189: 
061016,000190: 16,2167           34746                           CAF      ZERO                                  #  KILL ANY POSSIBLE JET REQUESTS
061017,000191: 16,2170           55472                           TS       NEXTP                                 
061018,000192: 16,2171           55473                           TS       NEXTU                                 
061019,000193: 16,2172           55474                           TS       NEXTV                                 
061020,000194: 16,2173           00006                           EXTEND                                         #  COMMAND JETS OFF.
061021,000195: 16,2174           01005                           WRITE    CHAN5                                 
061022,000196: 16,2175           00006                           EXTEND                                         
061023,000197: 16,2176           01006                           WRITE    CHAN6                                 
061024,000198: 16,2177           42207                           CS       BGIM23                                #  TURN TRIM GIMBAL OFF
061025,000199: 16,2200           00006                           EXTEND                                         
061026,000200: 16,2201           03012                           WAND     CHAN12                                
061027,000201: 16,2202           44743                           CS       CONTRLBT                              
061028,000202: 16,2203           70106                           MASK     FLGWRD10                              #  CLEAR FLAG TO CAUSE THE NO CONTROL DSKY
061029,000203: 16,2204           54106                           TS       FLGWRD10                              #   LIGHT TO BE LIT BY T4RUPT.
061030,000204: 16,2205           12153                           TCF      SETTIME5                              #  RETURN IN 100 MSEC.
061031,000205: 
061032,000206: 16,2206           03021        MANFLAG            OCT      03021                                 
061033,000207: 16,2207           07400        BGIM23             OCTAL    07400                                 
061034,000208: 16,2210  E6,1421                                  EBANK=   OMEGAP                                
061035,000209: 16,2210           02217 34106  PAXADIDL           2CADR    PAXIS                                 
061036,000210: 
061037,000211: 16,2212     7750               MS100              =        OCT37766                              
061038,000212: 16,2212     0061               COSMG              =        ITEMP1                                
061039,000213: 16,2212           00006        JUMPDSP            EXTEND                                         #  TRANSFER TO BANK 20
061040,000214: 16,2213           32216                           DCA      DSPCADR                               #  FOR ATTITUDE ERROR DISPLAYS
061041,000215: 16,2214           52006                           DTCB                                           
061042,000216: 
061043,000217: 16,2215  E6,1760                                  EBANK=   AK                                    
061044,000218: 16,2215           02227 40106  DSPCADR            2CADR    ALTDSPLY                              
061045,000219: 

Page 1412

061047,000221: 20,2227                                           BANK     20                                    
061048,000222: 20,2000                                           SETLOC   DAPS3                                 
061049,000223: 20,2000                                           BANK                                           
061050,000224: 20,2227                                           COUNT*   $$/NEEDL                              
061051,000225: 
061052,000226:                                                                                                  #  PROGRAM:      ALTDSPLY
061053,000227:                                                                                                  #  MOD 0.        6 DEC 1967
061054,000228:                                                                                                  #  AUTHOR:       CRAIG WORK, DON KEENE, MIT IL
061055,000229:                                                                                                  #  MOD 3 BY DON KEENE AUG 1, 1968 MOVED PROGRAM TO BANK 20
061056,000230: 
061057,000231:                                                                                                  #  PROGRAM DESCRIPTION:
061058,000232:                                                                                                  #  ALTDSPLY REVERSES THE DSPLYALT BIT OF RCSFLAGS EACH TIME IT IS CALLED, WHICH IS PRESUMABLY EVERY 100 MS.
061059,000233:                                                                                                  #  IF THE REVERSED BIT IS ONE, NEEDLER IS CALLED TO DISPLAY ATTITUDE ERRORS.  IF THE BIT IS ZERO, THE ATTITUDE ERR-
061060,000234:                                                                                                  #  ORS ARE CALCULATED AS 1) ESTIMATED RATES (FOLLOWING) IF NEED2FLG = 1, OTHERWISE AS 2) DAP FOLLOWING ERRORS FOR
061061,000235:                                                                                                  #  NEEDLFLG = 0 AND 3) TOTAL ATTITUDE ERRORS FOR NEEDLFLG = 1.
061062,000236: 
061063,000237:                                                                                                  #  WARNING:      ALTDSPLY MAY ONLY BE CALLED WITH INTERRUPT INHIBITED.
061064,000238: 
061065,000239:                                                                                                  #  WARNING:      EBANK MUST BE SET TO 6 WHEN USING THIS ROUTINE.
061066,000240: 
061067,000241:                                                                                                  #  INPUT:        RCSFLAGS AND    1) IF NEEDLFLG = 0, INPUT PERROR, QERROR, RERROR.
061068,000242:                                                                                                  #                                2) IF NEEDLFLG = 1, INPUT CPHI,CTHETA,CPSI,CDUX,CDUY,CDUZ,M11,M21,M32,M22,M32.  (GPMATRIX)
061069,000243:                                                                                                  #                        3) IF NEED2FLG = 1, INPUT OMEGAP, OMEGAQ, AND OMEGAR.
061070,000244: 
061071,000245:                                                                                                  #  OUTPUTS:      RCSFLAGS WITH DSPLYALT REVERSED,AK,AK1,AK2,+ NEEDLER OUTPUTS.
061072,000246: 
061073,000247:                                                                                                  #  ENTRY:        TCF     ALTDSPLY
061074,000248: 
061075,000249:                                                                                                  #  EXIT:         TCF     CHEKMORE
061076,000250: 
061077,000251:                                                                                                  #  ALARM OR ABORT EXITS:  NONE
061078,000252: 
061079,000253:                                                                                                  #  SUBPROGRAMS CALLED:  NEEDLER, OVERSUB2
061080,000254: 
061081,000255:                                                                                                  #  DEBRIS:       A, L, AND NEEDLER DEBRIS.
061082,000256: 
061083,000257: 20,2227           31774        ALTDSPLY           CA       RCSFLAGS                              #  INVERT THE DISPLAY ALTERNATION BIT.
061084,000258: 20,2230           54001                           TS       L                                     
061085,000259: 20,2231           34741                           CA       DSPLYALT                              
061086,000260: 20,2232           00006                           EXTEND                                         
061087,000261: 20,2233           06001                           RXOR     LCHAN                                 
061088,000262: 20,2234           55774                           TS       RCSFLAGS                              
061089,000263: 
061090,000264: 20,2235           74741                           MASK     DSPLYALT                              
061091,000265: 20,2236           10000                           CCS      A                                     #  IS ALTERNATION FLAG ZERO?

Page 1413

061093,000267: 20,2237           12336                           TCF      NEEDLER                               
061094,000268: 
061095,000269: 20,2240           40074                           CS       FLAGWRD0                              #  CHECK FOR RATE DISPLAY TO ERROR NEEDLES
061096,000270: 20,2241           74726                           MASK     NEED2BIT                              #  VIA EXTENDED VERB 60
061097,000271: 20,2242           00006                           EXTEND                                         
061098,000272: 20,2243           12257                           BZF      DISPRATE                              
061099,000273: 
061100,000274: 20,2244           30074                           CAE      FLAGWRD0                              #  NEEDLFLG WILL INDICATE TOTAL OR DAP AT-
061101,000275: 20,2245           74741                           MASK     NEEDLBIT                              #  TITUDE ERROR DISPLAY REQUEST.
061102,000276: 20,2246           10000                           CCS      A                                     
061103,000277: 20,2247           12266                           TCF      DSPLYTOT                              #  TOTAL ERROR IS NEEDED IN AK,AK +1,AK +2
061104,000278: 
061105,000279: 20,2250           41450                           CS       QERROR                                #  YES. DISPLAY ATT ERRORS ON THE ,-BALL.
061106,000280: 20,2251           55761                           TS       AK         +1                         #  ERROR COMPLEMENTS ARE INPUT TO NEEDLER.
061107,000281: 20,2252           41452                           CS       RERROR                                
061108,000282: 20,2253           55762                           TS       AK         +2                         
061109,000283: 20,2254           41464                           CS       PERROR                                
061110,000284: 20,2255           57760                           XCH      AK                                    
061111,000285: 
061112,000286: 20,2256           12456                           TCF      RETNMORE                              #  DISPLAY THESE THE NEXT TIME THROUGH
061113,000287: 
061114,000288: 20,2257           41422        DISPRATE           CS       OMEGAQ                                #  LOAD ESTIMATED RATES (FOLLOWING)
061115,000289: 20,2260           55761                           TS       AK         +1                         
061116,000290: 20,2261           41423                           CS       OMEGAR                                
061117,000291: 20,2262           55762                           TS       AK         +2                         
061118,000292: 20,2263           41421                           CS       OMEGAP                                
061119,000293: 20,2264           57760                           XCH      AK                                    
061120,000294: 20,2265           12456                           TCF      RETNMORE                              
061121,000295: 
061122,000296:                                                                                                  #  CALCULATE GIMBAL ANGLE TOTAL ERRORS, RESOLVE INTO PILOT AXES, STORE TOTAL ERRORS FOR NEEDLER.  Q-AXIS FIRST.
061123,000297: 
061124,000298: 20,2266           00006        DSPLYTOT           EXTEND                                         
061125,000299: 20,2267           22061                           QXCH     ITEMP1                                #  SAVE Q FOR CHEKBITS RETURN.
061126,000300: 
061127,000301: 20,2270           30322                           CA       CTHETA                                #  DESIRED ATTITUDE, Y-AXIS, 2'S COMP.
061128,000302: 20,2271           00006                           EXTEND                                         #  SUBTRACT CURRENT ATTITUDE.
061129,000303: 20,2272           20033                           MSU      CDUY                                  #  DIFFERENCE SCALED AT PI, 1'S COMP.
061130,000304: 20,2273           55760                           TS       AK                                    #  SAVE FOR R-ERROR CALCULATION.
061131,000305: 20,2274           00006                           EXTEND                                         
061132,000306: 20,2275           71415                           MP       M21                                   #  (CHTETA-CDUY)*M21 SCALED AT PI RADIANS.
061133,000307: 20,2276           57761                           XCH      AK         +1                         #  STORE FIRST TERM OF Q ERROR.
061134,000308: 20,2277           30323                           CA       CPSI                                  #  DESIRED ATTITUDE, Z-AXIS, 2'S COMP.
061135,000309: 20,2300           00006                           EXTEND                                         #  SUBTRACT CURRENT ATTITUDE.
061136,000310: 20,2301           20034                           MSU      CDUZ                                  #  DIFFERENCE SCALED AT PI, 1'S COMP.
061137,000311: 20,2302           55762                           TS       AK         +2                         #  SAVE Z-AXIS TERM FOR R ERROR CALCULATION
061138,000312: 20,2303           00006                           EXTEND                                         
061139,000313: 20,2304           71417                           MP       M22                                   #  (CPSI-CDUZ)*M22, SCALED AT PI RADIANS.
061140,000314: 20,2305           61761                           AD       AK         +1                         #  Q ERROR COMPLETE         , AT PI RAD.
061141,000315: 20,2306           02451                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
061142,000316: 20,2307           55761                           TS       AK         +1                         
061143,000317: 

Page 1414

061145,000319:                                                                                                  #  R ERROR CALCULATION NEXT.
061146,000320: 
061147,000321: 20,2310           31760                           CA       AK                                    #  Y-AXIS DIFFERENCE STORED BY Q-AXIS CALC.
061148,000322: 20,2311           00006                           EXTEND                                         
061149,000323: 20,2312           71416                           MP       M31                                   #  (CTHETA-CDUY)*M31, SCALED AT PI RADIANS.
061150,000324: 20,2313           57762                           XCH      AK         +2                         #  FIRST TERM OF R ERROR.
061151,000325:                                                                                                  #  Z-AXIS DIFFERENCE, STORED BY A CALC. IS
061152,000326: 20,2314           00006                           EXTEND                                         #  RECOVERED BY THE EXCHANGE.
061153,000327: 20,2315           71420                           MP       M32                                   #  (CPSI-CDUZ)*M32, SCALED AT PI RADIANS.
061154,000328: 20,2316           61762                           AD       AK         +2                         #  R ERROR COMPLETE         , AT PI RAD.
061155,000329: 20,2317           02451                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
061156,000330: 20,2320           55762                           TS       AK         +2                         
061157,000331: 
061158,000332:                                                                                                  #  NOW CALCULATE P ERROR.  (NOTE THAT M13 = 1, SCALED AT 1, SO THE MULTIPLICATION IS BY-PASSED.)
061159,000333: 
061160,000334: 20,2321           31760                           CA       AK                                    #  Y-AXIS DIFFERENCE STORED BY Q AXIS CALC.
061161,000335: 20,2322           00006                           EXTEND                                         
061162,000336: 20,2323           71414                           MP       M11                                   #  (CTHETA-CDUY)*M11 SCALED AT PI RADIANS.
061163,000337: 20,2324           57760                           XCH      AK                                    #  FIRST TERM OF P ERROR IN AK, AT PI RAD.
061164,000338: 20,2325           30321                           CAE      CPHI                                  #  DESIRED ATTITUDE, X-AXIS, 2'S COMP.
061165,000339: 20,2326           00006                           EXTEND                                         #  SUBTRACT CURRENT X ATTITUDE.
061166,000340: 20,2327           20032                           MSU      CDUX                                  #  X-AXIS DIFFERENCE, 1'S COMP, AT PI RAD.
061167,000341: 
061168,000342:                                                                                                  #  M13 = 1, SO BYPASS THE MULTIPLICATION.
061169,000343:                                                                                                  #                EXTEND
061170,000344:                                                                                                  #                MP      M13             (CPHI-CDUX)*M13 SCALED AT PI RADIANS.
061171,000345: 
061172,000346: 20,2330           61760                           AD       AK                                    #  P ERROR COMPLETE      , SCALED AT PI RAD
061173,000347: 20,2331           02451                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
061174,000348: 20,2332           55760                           TS       AK                                    
061175,000349: 
061176,000350: 20,2333           00006                           EXTEND                                         
061177,000351: 20,2334           22061                           QXCH     ITEMP1                                #  RESTORE Q FOR CHEKBITS RETURN.
061178,000352: 
061179,000353: 20,2335           12456                           TCF      RETNMORE                              #  DISPLAY THESE THE NEXT TIME THROUGH
061180,000354: 

Page 1415

061182,000356:                                                                                                  #  FDAI ATTITUDE ERROR DISPLAY SUBROUTINE
061183,000357: 
061184,000358:                                                                                                  #  PROGRAM DESCRIPTION:          D. KEENE        5/24/67
061185,000359:                                                                                                  #  MOD 1 BY CRAIG WORK, 12 DEC 67
061186,000360:                                                                                                  #  MOD 2 BY CRAIG WORK, 6 APRIL 68 CONVERTS ATTITUDE ERROR DISPLAY SCALING FROM 16 7/8 DEG. TO 42 3/16 DEGREES.
061187,000361: 
061188,000362:                                                                                                  #        THIS SUBROUTINE IS USED TO DISPLAY ATTITUDE ERRORS ON THE FDAI VIA THE DIGITAL TO ANALOG CONVERTERS (DACS)
061189,000363:                                                                                                  #  IN THE CDUS.  CARE IS TAKEN TO METER OUT THE APPROPRIATE NUMBER OF PULSES TO THE IMU ERROR COUNTERS AND PREVENT
061190,000364:                                                                                                  #  OVERFLOW, TO CONTROL THE RELAY SEQUENCING, AND TO AVOID INTERFERENCE WITH THE COARSE ALIGN LOOP WHICH ALSO USES
061191,000365:                                                                                                  #  THE DACS.
061192,000366: 
061193,000367:                                                                                                  #  CALLING SEQUENCE:
061194,000368:                                                                                                  #        DURING THE INITIALIZATION SECTION OF THE USER'S PROGRAM, BIT3 OF RCSFLAGS SHOULD BE SET TO INITIATE THE
061195,000369:                                                                                                  #  TURN-ON SEQUENCE WITHIN THE NEEDLES PROGRAM:
061196,000370:                                                                                                  #                CS      RCSFLAGS        IN EBANK6
061197,000371:                                                                                                  #                MASK    BIT3
061198,000372:                                                                                                  #                ADS     RCSFLAGS
061199,000373:                                                                                                  #  THEREAFTER, THE ATTITUDE ERRORS GENERATED BY THE USER SHOULD BE TRANSFERED TO THE FOLLOWING LOCATIONS IN EBANK6:
061200,000374:                                                                                                  #                AK      SCALED 180 DEGREES      NOTE:   THESE LOCATIONS ARE SUBJECT
061201,000375:                                                                                                  #                AK1     SCALED 180 DEGREES              TO CHANGE
061202,000376:                                                                                                  #                AK2     SCALED 180 DEGREES
061203,000377:                                                                                                  #  FULL SCALED DEFLECTION OF THE NEEDLES CORRESPONDS TO 5 1/16 DEGREES, WHILE 384 BITS IN THE IMU ERROR COUNTER
061204,000378:                                                                                                  #  CORRESPONDS TO 42 3/16 DEGREES.  (DAC MAXIMUM CAPACITY IS 384 BITS.)  46 BITS EFFECTIVELY PIN THE NEEDLES.
061205,000379: 
061206,000380:                                                                                                  #  FOR RATE DISPLAY, FULL SCALE NEEDLE DEFLECTION IS 1 17/64 DEG/SEC, AND A FULL COUNTER IS ABOUT 10.5 DEG/SEC.
061207,000381:                                                                                                  #  A CALL TO NEEDLER WILL THEN UPDATE THE DISPLAY:
061208,000382:                                                                                                  #                INHINT
061209,000383:                                                                                                  #                TC      IBNKCALL        NOTE:  EBANK SHOULD BE SET TO E6
061210,000384:                                                                                                  #                CADR    NEEDLER
061211,000385:                                                                                                  #                RELINT
061212,000386:                                                                                                  #        THIS PROCESS SHOULD BE REPEATED EACH TIME THE ERRORS ARE UPDATED.  AT LEAST 3 PASSES THRU THE PROGRAM ARE
061213,000387:                                                                                                  #  REQUIRED BEFORE ANYTHING IS ACTUALLY DISPLAYED ON THE ERROR METERS.
061214,000388:                                                                                                  #  NOTE:  EACH CALL TO NEEDLER MUST BE SEPARATED BY AT LEAST 50 MS TO ASSURE PROPER RELAY SEQUENCING.
061215,000389: 
061216,000390:                                                                                                  #  ERASABLE USED:
061217,000391:                                                                                                  #                                AK              CDUXCMD
061218,000392:                                                                                                  #                                AK1             CDUYCMD
061219,000393:                                                                                                  #                                AK2             CDUZCMD
061220,000394:                                                                                                  #                                EDRIVEX         A,L,Q
061221,000395:                                                                                                  #                                EDRIVEY         T5TEMP

Page 1416

061223,000397:                                                                                                  #                                EDRIVEZ         DINDX
061224,000398: 
061225,000399:                                                                                                  #  SWITCHES:                     RCSFLAGS  BITS 3,2
061226,000400: 
061227,000401:                                                                                                  #  I/O CHANNELS:                 CHAN12  BIT 4 (COARSE ALIGN - READ ONLY)
061228,000402:                                                                                                  #                                CHAN12  BIT 6 (IMU ERROR COUNTER ENABLE)
061229,000403:                                                                                                  #                                CHAN14  BIT 13,14,15 (DAC ACTIVITY)
061230,000404: 
061231,000405:                                                                                                  #  SIGN CONVENTION<      AK = THETAC - THETA
061232,000406:                                                                                                  #                WHERE   THETAC = COMMAND ANGLE
061233,000407:                                                                                                  #                        THETA = PRESENT ANGLE
061234,000408: 
061235,000409: 20,2336           31774        NEEDLER            CA       RCSFLAGS                              
061236,000410: 20,2337           76263                           MASK     SIX                                   
061237,000411: 20,2340           00006                           EXTEND                                         
061238,000412: 20,2341           12376                           BZF      NEEDLES3                              
061239,000413: 20,2342           74742                           MASK     BIT3                                  
061240,000414: 20,2343           00006                           EXTEND                                         
061241,000415: 20,2344           12367                           BZF      NEEDLER2                              #  BIT3 = 0, BIT2 = 1
061242,000416: 
061243,000417: 20,2345           44737                           CS       BIT6                                  #  FIRST PASS BIT3 = 1
061244,000418: 20,2346           00006                           EXTEND                                         #  DISABLE IMU ERROR COUNTER TO ZERO DACS
061245,000419: 20,2347           03012                           WAND     CHAN12                                #  MUST WAIT AT LEAST 60 MS BEFORE
061246,000420: 20,2350           44746        NEEDLE11           CS       ZERO                                  #  ENABLING COUNTERS.
061247,000421: 20,2351           55760                           TS       AK                                    #  ZERO THE INPUTS ON FIRST PASS
061248,000422: 20,2352           55761                           TS       AK1                                   
061249,000423: 20,2353           55762                           TS       AK2                                   
061250,000424: 20,2354           55763                           TS       EDRIVEX                               #  ZERO THE DISPLAY REGISTERS
061251,000425: 20,2355           55764                           TS       EDRIVEY                               
061252,000426: 20,2356           55765                           TS       EDRIVEZ                               
061253,000427: 20,2357           54050                           TS       CDUXCMD                               #  ZERO THE OUT COUNTERS
061254,000428: 20,2360           54051                           TS       CDUYCMD                               
061255,000429: 20,2361           54052                           TS       CDUZCMD                               
061256,000430: 20,2362           46263                           CS       SIX                                   #  RESET RCSFLAGS FOR PASS2
061257,000431: 20,2363           71774                           MASK     RCSFLAGS                              
061258,000432: 20,2364           64743                           AD       BIT2                                  
061259,000433: 20,2365           55774                           TS       RCSFLAGS                              
061260,000434: 20,2366           12456                           TCF      RETNMORE                              
061261,000435: 
061262,000436: 20,2367           34737        NEEDLER2           CAF      BIT6                                  #  ENABLE IMU ERROR COUNTERS
061263,000437: 20,2370           00006                           EXTEND                                         
061264,000438: 20,2371           05012                           WOR      CHAN12                                
061265,000439: 20,2372           46263                           CS       SIX                                   #  RESET RCSFLAGS TO DISPLAY ATTITUDE
061266,000440: 20,2373           71774                           MASK     RCSFLAGS                              #  ERRORS    WAIT AT LEAST 4 MS FOR
061267,000441: 20,2374           55774                           TS       RCSFLAGS                              #  RELAY CLOSURE
061268,000442: 20,2375           12456                           TCF      RETNMORE                              
061269,000443: 
061270,000444: 20,2376           34737        NEEDLES3           CAF      BIT6                                  #  CHECK TO SEE IF IMU ERROR COUNTER

Page 1417

061272,000446: 20,2377           00006                           EXTEND                                         #  IS ENABLED
061273,000447: 20,2400           02012                           RAND     CHAN12                                
061274,000448: 20,2401           10000                           CCS      A                                     #  IF NOT, RE-INITIALIZE NEEDLER.
061275,000449: 20,2402           12407                           TCF      NEEDLES                               
061276,000450: 
061277,000451: 20,2403           41774                           CS       RCSFLAGS                              #  SET UP INITIALIZATION FLAG IN RCSFLAGS.
061278,000452: 20,2404           74742                           MASK     BIT3                                  
061279,000453: 20,2405           27774                           ADS      RCSFLAGS                              
061280,000454: 20,2406           12456                           TCF      RETNMORE                              
061281,000455: 
061282,000456: 20,2407           34743        NEEDLES            CAF      TWO                                   
061283,000457: 20,2410           54063        DACLOOP            TS       DINDX                                 
061284,000458: 20,2411           42450                           CS       ONETENTH                              #  RESCALE INPUTS TO + OR - 1800 DEGREES.
061285,000459: 20,2412           00006                           EXTEND                                         
061286,000460: 20,2413           50063                           INDEX    DINDX                                 
061287,000461: 20,2414           71760                           MP       AK                                    
061288,000462: 20,2415           54001                           TS       L                                     
061289,000463: 20,2416           10000                           CCS      A                                     
061290,000464: 20,2417           32446                           CA       DACLIMIT                              
061291,000465: 20,2420           12422                           TCF      +2                                    
061292,000466: 20,2421           42446                           CS       DACLIMIT                              
061293,000467: 20,2422           60001                           AD       L                                     
061294,000468: 20,2423           54061                           TS       T5TEMP                                #  OVFLO CHK
061295,000469: 20,2424           12430                           TCF      +4                                    
061296,000470: 20,2425           50000                           INDEX    A                                     #  ON OVERFLOW LIMIT OUTPUT TO +-384
061297,000471: 20,2426           32446                           CAF      DACLIMIT                              
061298,000472: 20,2427           54001                           TS       L                                     
061299,000473: 20,2430           50063                           INDEX    DINDX                                 
061300,000474: 20,2431           41763                           CS       EDRIVEX                               #  CURRENT VALUE OF DAC
061301,000475: 20,2432           60001                           AD       L                                     
061302,000476: 20,2433           50063                           INDEX    DINDX                                 
061303,000477: 20,2434           26050                           ADS      CDUXCMD                               
061304,000478: 20,2435           50063                           INDEX    DINDX                                 
061305,000479: 20,2436           23763                           LXCH     EDRIVEX                               
061306,000480: 20,2437           10063                           CCS      DINDX                                 
061307,000481: 20,2440           12410                           TCF      DACLOOP                               
061308,000482: 20,2441           37761                           CAF      13,14,15                              
061309,000483: 20,2442           00006                           EXTEND                                         
061310,000484: 20,2443           05014                           WOR      CHAN14                                #  SET DAC ACTIVITY BITS
061311,000485: 20,2444           12456                           TCF      RETNMORE                              
061312,000486: 
061313,000487: 20,2445           77177                           DEC      -384       B-14                       
061314,000488: 20,2446           37200        DACLIMIT           DEC      16000      B-14                       
061315,000489: 20,2447           00600                           DEC      384        B-14                       
061316,000490: 
061317,000491: 20,2450           03146        ONETENTH           OCT      03146                                 #  DECIMAL +0.1, SCALED AT 1.
061318,000492: 20,2451     4741               DSPLYALT           EQUALS   BIT4                                  #  100 MS ALTERNATION BIT IN RCSFLAGS
061319,000493: 
061320,000494: 20,2451           54007        OVERSUB2           TS       7                                     #  RETURNS A UNCHANGED OR LIMITED TO

Page 1418

061322,000496: 20,2452           00002                           TC       Q                                     #  POSMAX OR NEGMAX IF A HAS OVERFLOW
061323,000497: 20,2453           50000                           INDEX    A                                     
061324,000498: 20,2454           44725                           CS       LIMITS                                #  DUPLICATE CODING IN BANK 16
061325,000499: 20,2455           00002                           TC       Q                                     
061326,000500: 
061327,000501: 20,2456           00006        RETNMORE           EXTEND                                         #  RETURN TO CHEKMORE
061328,000502: 20,2457           32462                           DCA      MORECADR                              
061329,000503: 20,2460           52006                           DTCB                                           
061330,000504: 
061331,000505: 20,2461  E6,1536                                  EBANK=   AOSQ                                  
061332,000506: 20,2461           02016 34106  MORECADR           2CADR    CHEKMORE                              
061333,000507: 
061334,000508: 
061335,000509: 
061336,000510: 

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