Source Code

These source-code files were from the printout at the MIT Museum, with many thanks to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing it to us. The printout was digitally photographed by Paul Fjeld. A team of volunteers transcribed the source code manually from these images or, where appropriate, modified already-transcribed but similar source Luminary 131 (Apollo 13) source code to agree with the images from the printout. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 001 OF AGC PROGRAM LMY99 BY NASA 2021112-061
	16:27 JULY 14,1969
Note that the date is the date of the printout, not the date of the program revision.

060586,000002:                                                                                                  ## Copyright:   Public domain.
060587,000003:                                                                                                  ## Filename:    DAPIDLER_PROGRAM.agc
060588,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
060589,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
060590,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
060591,000007:                                                                                                  ## Assembler:   yaYUL
060592,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
060593,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
060594,000010:                                                                                                  ## Pages:       1410-1420
060595,000011:                                                                                                  ## Mod history: 2009-05-10 SN  (Sergio Navarro).  Started adapting
060596,000012:                                                                                                  ##                              from the Luminary131/ file of the same
060597,000013:                                                                                                  ##                              name, using Luminary099 page images.
060598,000014:                                                                                                  ##              2016-12-18 RSB  Proofed text comments with octopus/ProoferComments
060599,000015:                                                                                                  ##                              and corrected the errors found.
060600,000016:                                                                                                  ##              2017-01-28 RSB  Comment-text fixes identified for Luminary 69.
060601,000017:                                                                                                  ##
060602,000018:                                                                                                  ## This source code has been transcribed or otherwise adapted from
060603,000019:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
060604,000020:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
060605,000021:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
060606,000022:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
060607,000023:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
060608,000024:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
060609,000025:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
060610,000026:                                                                                                  ## actually created.
060611,000027:                                                                                                  ##
060612,000028:                                                                                                  ## Notations on the hardcopy document read, in part:
060613,000029:                                                                                                  ##
060614,000030:                                                                                                  ##      Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
060615,000031:                                                                                                  ##      16:27 JULY 14, 1969 
060616,000032: 

Page 1410

060618,000034:                                                                                                  #  THE DAPIDLER PROGRAM IS STARTED BY FRESH START AND RESTART.  THE DAPIDLER PROGRAM IS DONE 10 TIMES
060619,000035:                                                                                                  #  PER SECOND UNTIL THE ASTRONAUT DESIRES THE DAP TO WAKE UP, AND THE IMU AND CDUS ARE READY FOR USE BY THE DAP.
060620,000036:                                                                                                  #  THE NECESSARY INITIALIZATION OF THE DAP IS DONE BY THE DAPIDLER PROGRAM.
060621,000037: 
060622,000038: 16,2000                                           BANK     16                                    
060623,000039: 16,2000                                           SETLOC   DAPS1                                 
060624,000040: 16,2000                                           BANK                                           
060625,000041: 
060626,000042: 16,2000  E6,1537                                  EBANK=   AOSQ                                  
060627,000043: 
060628,000044: 16,2000                                           COUNT*   $$/DAPID                              
060629,000045: 
060630,000046: 16,2000           00006        CHEKBITS           EXTEND                                         
060631,000047: 16,2001           00031                           READ     CHAN31                                #  IF BOTH BIT13 AND BIT14 ARE ONE, THEN
060632,000048: 16,2002           40000                           COM                                            #  THE MODE SELECT SWITCH IS IN THE OFF
060633,000049: 16,2003           74355                           MASK     BIT13-14                              #  POSITION, AND SO THE DAP SHOULD BE OFF,
060634,000050: 16,2004           00006                           EXTEND                                         #  WITH NO ATTITUDE ERROR DISPLAY.
060635,000051: 16,2005           12157                           BZF      MOREIDLE                              
060636,000052: 
060637,000053: 16,2006           41303                           CS       IMODES33                              
060638,000054: 16,2007           74746                           MASK     BIT6                                  
060639,000055: 16,2010           10000                           CCS      A                                     
060640,000056: 16,2011           12206                           TCF      JUMPDSP                               
060641,000057: 16,2012           41273                           CS       RCSFLAGS                              #  IMU NOT USABLE.  SET UP INITIALIZATION
060642,000058: 16,2013           74751                           MASK     BIT3                                  #  FLAG FOR ATT ERROR DISPLAY ROUTINE.
060643,000059: 16,2014           27273                           ADS      RCSFLAGS                              
060644,000060: 16,2015           12163                           TCF      SHUTDOWN                              
060645,000061: 
060646,000062: 16,2016           34742        CHEKMORE           CAF      BIT10                                 #  BIT 10 OF 30 IS PGNCS CONTROL OF S/C
060647,000063: 16,2017           00006                           EXTEND                                         
060648,000064: 16,2020           02030                           RAND     CHAN30                                #  BITS IN 30 ARE INVERTED
060649,000065: 16,2021           10000                           CCS      A                                     
060650,000066: 16,2022           12157                           TCF      MOREIDLE                              
060651,000067: 
060652,000068: 16,2023           00002                           RETURN                                         
060653,000069: 

Page 1411

060655,000071:                                                                                                  #  DAPIDLER ENTRY.
060656,000072: 
060657,000073: 16,2024           22016        DAPIDLER           LXCH     BANKRUPT                              #  INTERRUPT LEAD INS (CONTINUED)
060658,000074: 16,2025           00006                           EXTEND                                         
060659,000075: 16,2026           22012                           QXCH     QRUPT                                 
060660,000076: 
060661,000077: 16,2027           31273                           CA       RCSFLAGS                              
060662,000078: 16,2030           74737                           MASK     BIT13                                 
060663,000079: 16,2031           10000                           CCS      A                                     #  CHECK IF 1/ACCJOB HAS BEEN SET UP SINCE
060664,000080: 16,2032           12041                           TCF      CHECKUP                               #  THE LAST FRESH START OR RESTART.
060665,000081: 16,2033           34737                           CA       BIT13                                 
060666,000082: 16,2034           27273                           ADS      RCSFLAGS                              #  BIT 13 IS 1.
060667,000083: 16,2035           37715                           CAF      PRIO27                                
060668,000084: 16,2036           05072                           TC       NOVAC                                 #  SET UP JOB TO DO A LITTLE INITIALIZATION
060669,000085: 16,2037  E6,1537                                  EBANK=   AOSQ                                  #        AND EXECUTE 1/ACCS.
060670,000086: 16,2037           02447 40106                     2CADR    1/ACCSET                              #  (WILL BRANCH TO MOREIDLE ON ACCSOKAY)
060671,000087: 
060672,000088: 16,2041           02000        CHECKUP            TC       CHEKBITS                              #  CHECK TO SEE IF LM DAP IS TO GO ON AND
060673,000089:                                                                                                  #        DO ERROR DISPLAY.
060674,000090: 
060675,000091: 16,2042           30111                           CAE      DAPBOOLS                              #  IF 1/ACCS HAS NOT BEEN COMPLETED, IDLE.
060676,000092: 16,2043           74751                           MASK     ACCSOKAY                              #        NOTE:   ONLY FRESH START AND RESTART
060677,000093: 16,2044           00006                           EXTEND                                         #                KNOCK THIS BIT DOWN.
060678,000094: 16,2045           12157                           BZF      MOREIDLE                              
060679,000095: 
060680,000096: 16,2046           04674        STARTDAP           TC       IBNKCALL                              #  ZERO ATTITUDE ERROR AND DESIRED RATES.
060681,000097: 16,2047           40153                           FCADR    ZATTEROR                              
060682,000098: 16,2050           34755                           CAF      ZERO                                  #  ********** INITIALIZE: **********
060683,000099: 16,2051           55524                           TS       TJP                                   
060684,000100: 16,2052           55525                           TS       TJU                                   
060685,000101: 16,2053           55526                           TS       TJV                                   
060686,000102: 16,2054           55421                           TS       OMEGAP                                #  RATES IN BODY (PILOT) COORDINATES.
060687,000103: 16,2055           55422                           TS       OMEGAQ                                
060688,000104: 16,2056           55423                           TS       OMEGAR                                
060689,000105: 16,2057           55430                           TS       TRAPEDP                               
060690,000106: 16,2060           55431                           TS       TRAPEDQ                               
060691,000107: 16,2061           55432                           TS       TRAPEDR                               
060692,000108: 16,2062           55537                           TS       AOSQ                                  #  OFFSET ACCELERATION ESTIMATES.
060693,000109: 16,2063           55540                           TS       AOSQ       +1                         
060694,000110: 16,2064           55541                           TS       AOSR                                  
060695,000111: 16,2065           55542                           TS       AOSR       +1                         
060696,000112: 16,2066           55424                           TS       ALPHAQ                                #  COPIES OF OFFSET ESTIMATES FOR DOWNLIST.
060697,000113: 16,2067           55425                           TS       ALPHAR                                
060698,000114: 16,2070           55501                           TS       NEGUQ                                 
060699,000115: 16,2071           55503                           TS       NEGUR                                 
060700,000116: 16,2072           55545                           TS       AOSQTERM                              #  QRAXIS RATE DERIVATION TERMS AND KALMAN
060701,000117: 16,2073           55546                           TS       AOSRTERM                              #  FILTER INITIALIZATION TERMS.
060702,000118: 16,2074           55510                           TS       QACCDOT                               #  DESCENT ACCELERATION DERIVATIVE EST.
060703,000119: 16,2075           55512                           TS       RACCDOT                               

Page 1412

060705,000121: 16,2076           55502                           TS       ALLOWGTS                              #  AOSTASK FLAG FOR QRAXIS RCS CONTROL USE.
060706,000122: 16,2077           55631                           TS       COTROLER                              #  DO TRYGTS ON FIRST PASS (WILL GO TO RCS)
060707,000123: 16,2100           55633                           TS       INGTS                                 #  RECOGNIZE FIRST GTS PASS AS SUCH.
060708,000124: 16,2101           55632                           TS       QGIMTIMR                              #  STOP GIMBAL DRIVES.  (PROBABLY WOULD BE
060709,000125: 16,2102           55634                           TS       RGIMTIMR                              #        GOOD ENOUGH JUST TO INACTIVATE TIMERS)
060710,000126: 16,2103           55460                           TS       OLDPMIN                               #  MINIMUM IMPULSE MODE ERASABLES
060711,000127: 16,2104           55461                           TS       OLDQRMIN                              
060712,000128: 16,2105           55767                           TS       PJETCTR                               #  INITIALIZE DOCKED JET INHIBITION
060713,000129: 16,2106           55770                           TS       UJETCTR                               #  COUNTERS
060714,000130: 16,2107           55771                           TS       VJETCTR                               
060715,000131: 16,2110     4747               CALLGMBL           EQUALS   BIT5                                  #  RCSFLAGS INITIALIZATION.
060716,000132: 16,2110           42202                           CS       MANFLAG                               
060717,000133: 16,2111           71273                           MASK     RCSFLAGS                              #  NEGUQ(R) HAVE BEEN GENERATED.
060718,000134: 16,2112           55273                           TS       RCSFLAGS                              
060719,000135: 
060720,000136:                                                                                                  #  SET UP "OLD" MEASURED CDU ANGLES:
060721,000137: 
060722,000138: 16,2113           00006                           EXTEND                                         
060723,000139: 16,2114           30033                           DCA      CDUX                                  #  OLDXFORP AND OLDYFORP
060724,000140: 16,2115           53441                           DXCH     OLDXFORP                              
060725,000141: 16,2116           30034                           CA       CDUZ                                  
060726,000142: 16,2117           55442                           TS       OLDZFORQ                              
060727,000143: 16,2120           41273                           CS       RCSFLAGS                              
060728,000144: 16,2121           74740                           MASK     BIT12                                 
060729,000145: 16,2122           27273                           ADS      RCSFLAGS                              #  BIT 12 SET TO 1.
060730,000146: 16,2123           34751                           CA       FOUR                                  
060731,000147: 16,2124           55535                           TS       SKIPU                                 
060732,000148: 16,2125           55536                           TS       SKIPV                                 
060733,000149: 16,2126           34733                           CA       POSMAX                                
060734,000150: 16,2127           54031                           TS       TIME6                                 
060735,000151: 16,2130           55466                           TS       T6NEXT                                
060736,000152: 16,2131           55470                           TS       T6FURTHA                              
060737,000153: 16,2132           34755                           CA       ZERO                                  
060738,000154: 16,2133           55467                           TS       T6NEXT     +1                         
060739,000155: 16,2134           55471                           TS       T6FURTHA   +1                         
060740,000156: 16,2135           55465                           TS       NXT6ADR                               
060741,000157: 16,2136           55472                           TS       NEXTP                                 
060742,000158: 16,2137           55473                           TS       NEXTU                                 
060743,000159: 16,2140           55474                           TS       NEXTV                                 
060744,000160: 16,2141           44363                           CS       TEN                                   
060745,000161: 16,2142           55757                           TS       DAPZRUPT                              #  JASK NOT IN PROGRESS, INITIALIZE NEG.
060746,000162: 16,2143           34752                           CA       TWO                                   
060747,000163: 16,2144           55433                           TS       NPTRAPS                               
060748,000164: 16,2145           55434                           TS       NQTRAPS                               
060749,000165: 16,2146           55435                           TS       NRTRAPS                               
060750,000166: 16,2147           00006                           EXTEND                                         
060751,000167: 16,2150           32205                           DCA      PAXADIDL                              
060752,000168: 16,2151           53275                           DXCH     T5ADR                                 
060753,000169: 16,2152           37727        SETTIME5           CAF      MS100                                 
060754,000170: 16,2153           54030                           TS       TIME5                                 

Page 1413

060756,000172: 16,2154           15270                           TCF      RESUME                                
060757,000173: 16,2155  E6,1537                                  EBANK=   AOSQ                                  
060758,000174: 16,2155           02024 34106  IDLERADR           2CADR    DAPIDLER                              
060759,000175: 
060760,000176: 16,2157           04674        MOREIDLE           TC       IBNKCALL                              #  CALCULATE Q,R-AXES ATTITUDE ERRORS.
060761,000177: 16,2160           36626                           CADR     QERRCALC                              
060762,000178: 
060763,000179: 16,2161           04674                           TC       IBNKCALL                              
060764,000180: 16,2162           35446                           CADR     CALCPERR                              #  CALCULATE P AXIS ATTITUDE ERRORS.
060765,000181: 
060766,000182: 16,2163           00006        SHUTDOWN           EXTEND                                         
060767,000183: 16,2164           32156                           DCA      IDLERADR                              
060768,000184: 16,2165           53275                           DXCH     T5ADR                                 
060769,000185: 
060770,000186: 16,2166           34755                           CAF      ZERO                                  #  KILL ANY POSSIBLE JET REQUESTS
060771,000187: 16,2167           55472                           TS       NEXTP                                 
060772,000188: 16,2170           55473                           TS       NEXTU                                 
060773,000189: 16,2171           55474                           TS       NEXTV                                 
060774,000190: 16,2172           00006                           EXTEND                                         #  COMMAND JETS OFF.
060775,000191: 16,2173           01005                           WRITE    CHAN5                                 
060776,000192: 16,2174           00006                           EXTEND                                         
060777,000193: 16,2175           01006                           WRITE    CHAN6                                 
060778,000194: 16,2176           42203                           CS       BGIM23                                #  TURN TRIM GIMBAL OFF
060779,000195: 16,2177           00006                           EXTEND                                         
060780,000196: 16,2200           03012                           WAND     CHAN12                                
060781,000197: 16,2201           12152                           TCF      SETTIME5                              #  RETURN IN 100 MSEC.
060782,000198: 
060783,000199: 16,2202           03021        MANFLAG            OCT      03021                                 
060784,000200: 16,2203           07400        BGIM23             OCTAL    07400                                 
060785,000201: 16,2204  E6,1421                                  EBANK=   OMEGAP                                
060786,000202: 16,2204           02213 34106  PAXADIDL           2CADR    PAXIS                                 
060787,000203: 
060788,000204: 16,2206     7727               MS100              =        OCT37766                              
060789,000205: 16,2206     0061               COSMG              =        ITEMP1                                
060790,000206: 16,2206           00006        JUMPDSP            EXTEND                                         #  TRANSFER TO BANK 20
060791,000207: 16,2207           32212                           DCA      DSPCADR                               #  FOR ATTITUDE ERROR DISPLAYS
060792,000208: 16,2210           52006                           DTCB                                           
060793,000209: 
060794,000210: 16,2211  E6,1761                                  EBANK=   AK                                    
060795,000211: 16,2211           02226 40106  DSPCADR            2CADR    ALTDSPLY                              
060796,000212: 

Page 1414

060798,000214: 20,2226                                           BANK     20                                    
060799,000215: 20,2000                                           SETLOC   DAPS3                                 
060800,000216: 20,2000                                           BANK                                           
060801,000217: 20,2226                                           COUNT*   $$/NEEDL                              
060802,000218: 
060803,000219:                                                                                                  #  PROGRAM:      ALTDSPLY
060804,000220:                                                                                                  #  MOD 0.        6 DEC 1967
060805,000221:                                                                                                  #  AUTHOR:       CRAIG WORK, DON KEENE, MIT IL
060806,000222:                                                                                                  #  MOD 3 BY DON KEENE AUG 1, 1968 MOVED PROGRAM TO BANK 20
060807,000223: 
060808,000224:                                                                                                  #  PROGRAM DESCRIPTION:
060809,000225:                                                                                                  #        ALTDSPLY REVERSES THE DSPLYALT BIT OF RCSFLAGS EACH TIME IT IS CALLED, WHICH IS PRESUMABLY EVERY 100 MS.
060810,000226:                                                                                                  #        IF THE REVERSED BIT IS ONE, NEEDLER IS CALLED TO DISPLAY ATTITUDE ERRORS.  IF THE BIT IS ZERO, THE ATTITUDE ERR-
060811,000227:                                                                                                  #        ORS ARE CALCULATED AS 1) DAP FOLLOWING ERRORS, IF NEEDLFLG = 0, AND 2) TOTAL ATTITUDE ERRORS FOR NEEDLFLG = 1.
060812,000228: 
060813,000229: 
060814,000230:                                                                                                  #  WARNING:      ALTDSPLY MAY ONLY BE CALLED WITH INTERRUPT INHIBITED.
060815,000231: 
060816,000232:                                                                                                  #  WARNING:      EBANK MUST BE SET TO 6 WHEN USING THIS ROUTINE.
060817,000233: 
060818,000234:                                                                                                  #  INPUT:        RCSFLAGS AND    1) IF NEEDLFLG = 0, INPUT PERROR, QERROR, RERROR.
060819,000235:                                                                                                  #                                2) IF NEEDLFLG = 1, INPUT CPHI,CTHETA,CPSI,CDUX,CDUY,CDUZ,M11,M21,M32,M22,M32.  (GPMATRIX)
060820,000236: 
060821,000237: 
060822,000238:                                                                                                  #  OUTPUTS:      RCSFLAGS WITH DSPLYALT REVERSED, AK, AK1, AK2, + NEEDLER OUTPUTS.
060823,000239: 
060824,000240:                                                                                                  #  ENTRY:        TCF     ALTDSPLY
060825,000241: 
060826,000242:                                                                                                  #  EXIT:         TCF     CHEKMORE
060827,000243: 
060828,000244:                                                                                                  #  ALARM OR ABORT EXITS: NONE
060829,000245: 
060830,000246:                                                                                                  #  SUBPROGRAMS CALLED:  NEEDLER, OVERSUB2
060831,000247: 
060832,000248:                                                                                                  #  DEBRIS:       A, L, AND NEEDLER DEBRIS.
060833,000249: 
060834,000250: 20,2226           31273        ALTDSPLY           CA       RCSFLAGS                              #  INVERT THE DISPLAY ALTERNATION BIT.
060835,000251: 20,2227           54001                           TS       L                                     
060836,000252: 20,2230           34750                           CA       DSPLYALT                              
060837,000253: 20,2231           00006                           EXTEND                                         
060838,000254: 20,2232           06001                           RXOR     LCHAN                                 
060839,000255: 20,2233           55273                           TS       RCSFLAGS                              
060840,000256: 
060841,000257: 20,2234           74750                           MASK     DSPLYALT                              
060842,000258: 20,2235           10000                           CCS      A                                     #  IS ALTERNATION FLAG ZERO?
060843,000259: 20,2236           12322                           TCF      NEEDLER                               
060844,000260: 
060845,000261: 20,2237           30074                           CAE      FLAGWRD0                              #  NEEDLFLG WILL INDICATE TOTAL OR DAP AT-

Page 1415

060847,000263: 20,2240           74750                           MASK     NEEDLBIT                              #  TITUDE ERROR DISPLAY REQUEST.
060848,000264: 20,2241           10000                           CCS      A                                     
060849,000265: 20,2242           12252                           TCF      DSPLYTOT                              #  TOTAL ERROR IS NEEDED IN AK, AK +1, AK +2
060850,000266: 
060851,000267: 20,2243           41450                           CS       QERROR                                #  YES.  DISPLAY ATT ERRORS ON THE ,-BALL.
060852,000268: 20,2244           55762                           TS       AK         +1                         #  ERROR COMPLEMENTS ARE INPUT TO NEEDLER.
060853,000269: 20,2245           41452                           CS       RERROR                                
060854,000270: 20,2246           55763                           TS       AK         +2                         
060855,000271: 20,2247           41464                           CS       PERROR                                
060856,000272: 20,2250           57761                           XCH      AK                                    
060857,000273: 
060858,000274: 20,2251           12442                           TCF      RETNMORE                              #  DISPLAY THESE THE NEXT TIME THROUGH
060859,000275: 
060860,000276:                                                                                                  #  CALCULATE GIMBAL ANGLE TOTAL ERRORS, RESOLVE INTO PILOT AXES, STORE TOTAL ERRORS FOR NEEDLER.  Q-AXIS FIRST.
060861,000277: 
060862,000278: 20,2252           00006        DSPLYTOT           EXTEND                                         
060863,000279: 20,2253           22061                           QXCH     ITEMP1                                #  SAVE Q FOR CHEKBITS RETURN.
060864,000280: 
060865,000281: 20,2254           30322                           CA       CTHETA                                #  DESIRED ATTITUDE, Y-AXIS, 2'S COMP.
060866,000282: 20,2255           00006                           EXTEND                                         #  SUBTRACT CURRENT ATTITUDE.
060867,000283: 20,2256           20033                           MSU      CDUY                                  #  DIFFERENCE SCALED AT PI, 1'S COMP.
060868,000284: 20,2257           55761                           TS       AK                                    #  SAVE FOR R-ERROR CALCULATION.
060869,000285: 20,2260           00006                           EXTEND                                         
060870,000286: 20,2261           71415                           MP       M21                                   #  (CHTETA-CDUY)*M21 SCALED AT PI RADIANS.
060871,000287: 20,2262           57762                           XCH      AK         +1                         #  STORE FIRST TERM OF Q ERROR.
060872,000288: 20,2263           30323                           CA       CPSI                                  #  DESIRED ATTITUDE, Z-AXIS, 2'S COMP.
060873,000289: 20,2264           00006                           EXTEND                                         #  SUBTRACT CURRENT ATTITUDE.
060874,000290: 20,2265           20034                           MSU      CDUZ                                  #  DIFFERENCE SCALED AT PI, 1'S COMP.
060875,000291: 20,2266           55763                           TS       AK         +2                         #  SAVE Z-AXIS TERM FOR R ERROR CALCULATION
060876,000292: 20,2267           00006                           EXTEND                                         
060877,000293: 20,2270           71417                           MP       M22                                   #  (CPSI-CDUZ)*M22, SCALED AT PI RADIANS.
060878,000294: 20,2271           61762                           AD       AK         +1                         #  Q ERROR COMPLETE         , AT PI RAD.
060879,000295: 20,2272           02435                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
060880,000296: 20,2273           55762                           TS       AK         +1                         
060881,000297: 
060882,000298:                                                                                                  #  R ERROR CALCULATION NEXT.
060883,000299: 
060884,000300: 20,2274           31761                           CA       AK                                    #  Y-AXIS DIFFERENCE STORED BY Q-AXIS CALC.
060885,000301: 20,2275           00006                           EXTEND                                         
060886,000302: 20,2276           71416                           MP       M31                                   #  (CTHETA-CDUY)*M31, SCALED AT PI RADIANS.
060887,000303: 20,2277           57763                           XCH      AK         +2                         #  FIRST TERM OF R ERROR.
060888,000304:                                                                                                  #  Z-AXIS DIFFERENCE, STORED BY A CALC. IS
060889,000305: 20,2300           00006                           EXTEND                                         #  RECOVERED BY THE EXCHANGE.
060890,000306: 20,2301           71420                           MP       M32                                   #  (CPSI-CDUZ)*M32, SCALED AT PI RADIANS.
060891,000307: 20,2302           61763                           AD       AK         +2                         #  R ERROR COMPLETE         , AT PI RAD.
060892,000308: 20,2303           02435                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
060893,000309: 20,2304           55763                           TS       AK         +2                         
060894,000310: 
060895,000311:                                                                                                  #  NOW CALCULATE P ERROR.  (NOTE THAT M13 = 1, SCALED AT 1, SO THE MULTIPLICATION IS BY-PASSED.)

Page 1416

060897,000313: 20,2305           31761                           CA       AK                                    #  Y-AXIS DIFFERENCE STORED BY Q AXIS CALC.
060898,000314: 20,2306           00006                           EXTEND                                         
060899,000315: 20,2307           71414                           MP       M11                                   #  (CTHETA-CDUY)*M11 SCALED AT PI RADIANS.
060900,000316: 20,2310           57761                           XCH      AK                                    #  FIRST TERM OF P ERROR IN AK, AT PI RAD.
060901,000317: 20,2311           30321                           CAE      CPHI                                  #  DESIRED ATTITUDE, X-AXIS, 2'S COMP.
060902,000318: 20,2312           00006                           EXTEND                                         #  SUBTRACT CURRENT X ATTITUDE.
060903,000319: 20,2313           20032                           MSU      CDUX                                  #  X-AXIS DIFFERENCE, 1'S COMP, AT PI RAD.
060904,000320: 
060905,000321:                                                                                                  #  M13 = 1, SO BYPASS THE MULTIPLICATION.
060906,000322:                                                                                                  #                EXTEND
060907,000323:                                                                                                  #                MP      M13             (CPHI-CDUX)*M13 SCALED AT PI RADIANS.
060908,000324: 
060909,000325: 20,2314           61761                           AD       AK                                    #  P ERROR COMPLETE      , SCALED AT PI RAD
060910,000326: 20,2315           02435                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
060911,000327: 20,2316           55761                           TS       AK                                    
060912,000328: 
060913,000329: 20,2317           00006                           EXTEND                                         
060914,000330: 20,2320           22061                           QXCH     ITEMP1                                #  RESTORE Q FOR CHEKBITS RETURN.
060915,000331: 
060916,000332: 20,2321           12442                           TCF      RETNMORE                              #  DISPLAY THESE THE NEXT TIME THROUGH
060917,000333: 

Page 1417

060919,000335:                                                                                                  #  FDAI ATTITUDE ERROR DISPLAY SUBROUTINE
060920,000336: 
060921,000337:                                                                                                  #  PROGRAM DESCRIPTION:          D. KEENE        5/24/67
060922,000338:                                                                                                  #  MOD 1 BY CRAIG WORK, 12 DEC 67
060923,000339:                                                                                                  #  MOD 2 BY CRAIG WORK, 6 APRIL 68 CONVERTS ATTITUDE ERROR DISPLAY SCALING FROM 16 7/8 DEG. TO 42 3/16 DEGREES.
060924,000340: 
060925,000341:                                                                                                  #  THIS SUBROUTINE IS USED TO DISPLAY ATTITUDE ERRORS ON THE FDAI VIA THE DIGITAL TO ANALOG CONVERTERS (DACS)
060926,000342:                                                                                                  #  IN THE CDUS.  CARE IS TAKEN TO METER OUT THE APPROPRIATE NUMBER OF PULSES TO THE IMU ERROR COUNTERS AND PREVENT
060927,000343:                                                                                                  #  OVERFLOW, TO CONTROL THE RELAY SEQUENCING, AND TO AVOID INTERFERENCE WITH THE COARSE ALIGN LOOP WHICH ALSO USES
060928,000344:                                                                                                  #  THE DACS.
060929,000345: 
060930,000346:                                                                                                  #  CALLING SEQUENCE:
060931,000347:                                                                                                  #        DURING THE INITIALIZATION SECTION OF THE USER'S PROGRAM, BIT3 OF RCSFLAGS SHOULD BE SET TO INITIATE THE
060932,000348:                                                                                                  #        TURN-ON SEQUENCE WITHIN THE NEEDLES PROGRAM:
060933,000349:                                                                                                  #                CS      RCSFLAGS        IN EBANK6
060934,000350:                                                                                                  #                MASK    BIT3
060935,000351:                                                                                                  #                ADS     RCSFLAGS
060936,000352:                                                                                                  #        THEREAFTER, THE ATTITUDE ERRORS GENERATED BY THE USER SHOULD BE TRANSFERED TO THE FOLLOWING LOCATIONS IN EBANK6:
060937,000353:                                                                                                  #                AK      SCALED 180 DEGREES      NOTE:   THESE LOCATIONS ARE SUBJECT
060938,000354:                                                                                                  #                AK1     SCALED 180 DEGREES              TO CHANGE
060939,000355:                                                                                                  #                AK2     SCALED 180 DEGREES
060940,000356:                                                                                                  #        FULL SCALED DEFLECTION OF THE NEEDLES CORRESPONDS TO 5 1/16 DEGREES, WHILE 384 BITS IN THE IMU ERROR COUNTER
060941,000357:                                                                                                  #        CORRESPONDS TO 42 3/16 DEGREES.  (DAC MAXIMUM CAPACITY IS 384 BITS.)  46 BITS EFFECTIVELY PIN THE NEEDLES.
060942,000358: 
060943,000359:                                                                                                  #        A CALL TO NEEDLER WILL THEN UPDATE THE DISPLAY:
060944,000360:                                                                                                  #                INHINT
060945,000361:                                                                                                  #                TC      IBNKCALL        NOTE:  EBANK SHOULD BE SET TO E6
060946,000362:                                                                                                  #                CADR    NEEDLER
060947,000363:                                                                                                  #                RELINT
060948,000364:                                                                                                  #        THIS PROCESS SHOULD BE REPEATED EACH TIME THE ERRORS ARE UPDATED.  AT LEAST 3 PASSES THRU THE PROGRAM ARE
060949,000365:                                                                                                  #        REQUIRED BEFORE ANYTHING IS ACTUALLY DISPLAYED ON THE ERROR METERS.
060950,000366:                                                                                                  #        NOTE:  EACH CALL TO NEEDLER MUST BE SEPARATED BY AT LEAST 50 MS TO ASSURE PROPER RELAY SEQUENCING.
060951,000367: 
060952,000368:                                                                                                  #  ERASABLE USED:
060953,000369:                                                                                                  #        AK              CDUXCMD
060954,000370:                                                                                                  #        AK1             CDUYCMD
060955,000371:                                                                                                  #        AK2             CDUZCMD
060956,000372:                                                                                                  #        EDRIVEX         A,L,Q
060957,000373:                                                                                                  #        EDRIVEY         T5TEMP
060958,000374:                                                                                                  #        EDRIVEZ         DINDX

Page 1418

060960,000376: 
060961,000377:                                                                                                  #  SWITCHES:             RCSFLAGS  BITS 3,2
060962,000378: 
060963,000379:                                                                                                  #  I/O CHANNELS:         CHAN12  BIT 4 (COARSE ALIGN - READ ONLY)
060964,000380:                                                                                                  #                        CHAN12  BIT 6 (IMU ERROR COUNTER ENABLE)
060965,000381:                                                                                                  #                        CHAN14  BIT 13,14,15 (DAC ACTIVITY)
060966,000382: 
060967,000383:                                                                                                  #  SIGN CONVENTION<      AK = THETAC - THETA
060968,000384:                                                                                                  #                        WHERE   THETAC = COMMAND ANGLE
060969,000385:                                                                                                  #                                THETA = PRESENT ANGLE
060970,000386: 
060971,000387: 20,2322           31273        NEEDLER            CA       RCSFLAGS                              
060972,000388: 20,2323           76242                           MASK     SIX                                   
060973,000389: 20,2324           00006                           EXTEND                                         
060974,000390: 20,2325           12362                           BZF      NEEDLES3                              
060975,000391: 20,2326           74751                           MASK     BIT3                                  
060976,000392: 20,2327           00006                           EXTEND                                         
060977,000393: 20,2330           12353                           BZF      NEEDLER2                              #  BIT3 = 0, BIT2 = 1
060978,000394: 
060979,000395: 20,2331           44746                           CS       BIT6                                  #  FIRST PASS BIT3 = 1
060980,000396: 20,2332           00006                           EXTEND                                         #  DISABLE IMU ERROR COUNTER TO ZERO DACS
060981,000397: 20,2333           03012                           WAND     CHAN12                                #  MUST WAIT AT LEAST 60 MS BEFORE
060982,000398: 20,2334           44755        NEEDLE11           CS       ZERO                                  #  ENABLING COUNTERS.
060983,000399: 20,2335           55761                           TS       AK                                    #  ZERO THE INPUTS ON FIRST PASS
060984,000400: 20,2336           55762                           TS       AK1                                   
060985,000401: 20,2337           55763                           TS       AK2                                   
060986,000402: 20,2340           55764                           TS       EDRIVEX                               #  ZERO THE DISPLAY REGISTERS
060987,000403: 20,2341           55765                           TS       EDRIVEY                               
060988,000404: 20,2342           55766                           TS       EDRIVEZ                               
060989,000405: 20,2343           54050                           TS       CDUXCMD                               #  ZERO THE OUT COUNTERS
060990,000406: 20,2344           54051                           TS       CDUYCMD                               
060991,000407: 20,2345           54052                           TS       CDUZCMD                               
060992,000408: 20,2346           46242                           CS       SIX                                   #  RESET RCSFLAGS FOR PASS2
060993,000409: 20,2347           71273                           MASK     RCSFLAGS                              
060994,000410: 20,2350           64752                           AD       BIT2                                  
060995,000411: 20,2351           55273                           TS       RCSFLAGS                              
060996,000412: 20,2352           12442                           TCF      RETNMORE                              
060997,000413: 
060998,000414: 20,2353           34746        NEEDLER2           CAF      BIT6                                  #  ENABLE IMU ERROR COUNTERS
060999,000415: 20,2354           00006                           EXTEND                                         
061000,000416: 20,2355           05012                           WOR      CHAN12                                
061001,000417: 20,2356           46242                           CS       SIX                                   #  RESET RCSFLAGS TO DISPLAY ATTITUDE
061002,000418: 20,2357           71273                           MASK     RCSFLAGS                              #  ERRORS    WAIT AT LEAST 4 MS FOR
061003,000419: 20,2360           55273                           TS       RCSFLAGS                              #  RELAY CLOSURE
061004,000420: 20,2361           12442                           TCF      RETNMORE                              
061005,000421: 
061006,000422: 20,2362           34746        NEEDLES3           CAF      BIT6                                  #  CHECK TO SEE IF IMU ERROR COUNTER
061007,000423: 20,2363           00006                           EXTEND                                         #  IS ENABLED
061008,000424: 20,2364           02012                           RAND     CHAN12                                

Page 1419

061010,000426: 20,2365           10000                           CCS      A                                     #  IF NOT, RE-INITIALIZE NEEDLER.
061011,000427: 20,2366           12373                           TCF      NEEDLES                               
061012,000428: 
061013,000429: 20,2367           41273                           CS       RCSFLAGS                              #  SET UP INITIALIZATION FLAG IN RCSFLAGS.
061014,000430: 20,2370           74751                           MASK     BIT3                                  
061015,000431: 20,2371           27273                           ADS      RCSFLAGS                              
061016,000432: 20,2372           12442                           TCF      RETNMORE                              
061017,000433: 
061018,000434: 20,2373           34752        NEEDLES            CAF      TWO                                   
061019,000435: 20,2374           54063        DACLOOP            TS       DINDX                                 
061020,000436: 20,2375           42434                           CS       ONETENTH                              #  RESCALE INPUTS TO + OR - 1800 DEGREES.
061021,000437: 20,2376           00006                           EXTEND                                         
061022,000438: 20,2377           50063                           INDEX    DINDX                                 
061023,000439: 20,2400           71761                           MP       AK                                    
061024,000440: 20,2401           54001                           TS       L                                     
061025,000441: 20,2402           10000                           CCS      A                                     
061026,000442: 20,2403           32432                           CA       DACLIMIT                              
061027,000443: 20,2404           12406                           TCF      +2                                    
061028,000444: 20,2405           42432                           CS       DACLIMIT                              
061029,000445: 20,2406           60001                           AD       L                                     
061030,000446: 20,2407           54061                           TS       T5TEMP                                #  OVFLO CHK
061031,000447: 20,2410           12414                           TCF      +4                                    
061032,000448: 20,2411           50000                           INDEX    A                                     #  ON OVERFLOW LIMIT OUTPUT TO +-384
061033,000449: 20,2412           32432                           CAF      DACLIMIT                              
061034,000450: 20,2413           54001                           TS       L                                     
061035,000451: 20,2414           50063                           INDEX    DINDX                                 
061036,000452: 20,2415           41764                           CS       EDRIVEX                               #  CURRENT VALUE OF DAC
061037,000453: 20,2416           60001                           AD       L                                     
061038,000454: 20,2417           50063                           INDEX    DINDX                                 
061039,000455: 20,2420           26050                           ADS      CDUXCMD                               
061040,000456: 20,2421           50063                           INDEX    DINDX                                 
061041,000457: 20,2422           23764                           LXCH     EDRIVEX                               
061042,000458: 20,2423           10063                           CCS      DINDX                                 
061043,000459: 20,2424           12374                           TCF      DACLOOP                               
061044,000460: 20,2425           37740                           CAF      13,14,15                              
061045,000461: 20,2426           00006                           EXTEND                                         
061046,000462: 20,2427           05014                           WOR      CHAN14                                #  SET DAC ACTIVITY BITS
061047,000463: 20,2430           12442                           TCF      RETNMORE                              
061048,000464: 
061049,000465: 20,2431           77177                           DEC      -384       B-14                       
061050,000466: 20,2432           37200        DACLIMIT           DEC      16000      B-14                       
061051,000467: 20,2433           00600                           DEC      384        B-14                       
061052,000468: 
061053,000469: 20,2434           03146        ONETENTH           OCT      03146                                 #  DECIMAL +0.1, SCALED AT 1.
061054,000470: 20,2435     4750               DSPLYALT           EQUALS   BIT4                                  #  100 MS ALTERNATION BIT IN RCSFLAGS
061055,000471: 
061056,000472: 20,2435           54007        OVERSUB2           TS       7                                     #  RETURNS A UNCHANGED OR LIMITED TO
061057,000473: 20,2436           00002                           TC       Q                                     #  POSMAX OR NEGMAX IF A HAS OVERFLOW
061058,000474: 20,2437           50000                           INDEX    A                                     

Page 1420

061060,000476: 20,2440           44734                           CS       LIMITS                                #  DUPLICATE CODING IN BANK 16
061061,000477: 20,2441           00002                           TC       Q                                     
061062,000478: 
061063,000479: 20,2442           00006        RETNMORE           EXTEND                                         #  RETURN TO CHEKMORE
061064,000480: 20,2443           32446                           DCA      MORECADR                              
061065,000481: 20,2444           52006                           DTCB                                           
061066,000482: 
061067,000483: 20,2445  E6,1537                                  EBANK=   AOSQ                                  
061068,000484: 20,2445           02016 34106  MORECADR           2CADR    CHEKMORE                              
061069,000485: 

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