Source Code

These source code files are a reconstruction of Sundance, the Apollo 9 LM (Lunar Module) AGC (Apollo Guidance Computer) flight software, created from binary dumps of original core rope program modules, as follows:
  • B1 — Revision 292
  • B2 — Revision 302
  • B3 — Revision 302
  • B4 — Revision 302
  • B5 — Revision 292
  • B6 — Revision 306
This means that source code does not represent a specific historical revision of Sundance, but rather a mixture of the three released versions. Nonetheless, it is capable of flying the whole Apollo 9 mission. This source code matches the binary dumps, as closely as feasible, but 100% match is not possible, due mostly to changes in memory addresses at which code and variables were allocated in different revisions of Sundance. Refer to this list of explanations for each binary mismatch.

Since only binary dumps (rather than listings) of Sundance are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

055563,000002:                                                                                                  ## Copyright:   Public domain.
055564,000003:                                                                                                  ## Filename:    DAPIDLER_PROGRAM.agc
055565,000004:                                                                                                  ## Purpose:     A section of a reconstructed, mixed version of Sundance
055566,000005:                                                                                                  ##              It is part of the reconstructed source code for the Lunar
055567,000006:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 9.
055568,000007:                                                                                                  ##              No original listings of this program are available;
055569,000008:                                                                                                  ##              instead, this file was created via disassembly of dumps
055570,000009:                                                                                                  ##              of various revisions of Sundance core rope modules.
055571,000010:                                                                                                  ## Assembler:   yaYUL
055572,000011:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
055573,000012:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
055574,000013:                                                                                                  ## Mod history: 2020-06-17 MAS  Created from Luminary 69.
055575,000014: 
055576,000015:                                                                                                  ## Sundance 302
055577,000016: 
055578,000017:                                                                                                  #  THE DAPIDLER PROGRAM IS STARTED BY FRESH START AND RESTART.  THE DAPIDLER PROGRAM IS DONE 10 TIMES
055579,000018:                                                                                                  #  PER SECOND UNTIL THE ASTRONAUT DESIRES THE DAP TO WAKE UP, AND THE IMU AND CDUS ARE READY FOR USE BY THE DAP.
055580,000019:                                                                                                  #  THE NECESSARY INITIALIZATION OF THE DAP IS DONE BY THE DAPIDLER PROGRAM.
055581,000020: 
055582,000021: 16,2043                                           BANK     16                                    
055583,000022: 16,2000                                           SETLOC   DAPS1                                 
055584,000023: 16,2000                                           BANK                                           
055585,000024: 
055586,000025: 16,2043  E6,1532                                  EBANK=   AOSQ                                  
055587,000026: 
055588,000027: 16,2043                                           COUNT*   $$/DAPID                              
055589,000028: 
055590,000029: 16,2043           00006        CHEKBITS           EXTEND                                         
055591,000030: 16,2044           00031                           READ     CHAN31                                #  IF BOTH BIT13 AND BIT14 ARE ONE, THEN
055592,000031: 16,2045           40000                           COM                                            #  THE MODE SELECT SWITCH IS IN THE OFF
055593,000032: 16,2046           74367                           MASK     BIT13-14                              #  POSITION, AND SO THE DAP SHOULD BE OFF,
055594,000033: 16,2047           00006                           EXTEND                                         #  WITH NO ATTITUDE ERROR DISPLAY.
055595,000034: 16,2050           12206                           BZF      MOREIDLE                              
055596,000035: 
055597,000036: 16,2051           41305                           CS       IMODES33                              
055598,000037: 16,2052           75021                           MASK     BIT6                                  
055599,000038: 16,2053           10000                           CCS      A                                     
055600,000039: 16,2054           12236                           TCF      ALTDSPLY                              
055601,000040: 16,2055           41275                           CS       RCSFLAGS                              #  IMU NOT USABLE.  SET UP INITIALIZATION
055602,000041: 16,2056           75024                           MASK     BIT3                                  #  FLAG FOR ATT ERROR DISPLAY ROUTINE.
055603,000042: 16,2057           27275                           ADS      RCSFLAGS                              
055604,000043: 16,2060           12212                           TCF      SHUTDOWN                              
055605,000044: 
055606,000045: 16,2061           35015        CHEKMORE           CAF      BIT10                                 #  BIT 10 OF 30 IS PGNCS CONTROL OF S/C
055607,000046: 16,2062           00006                           EXTEND                                         
055608,000047: 16,2063           02030                           RAND     CHAN30                                #  BITS IN 30 ARE INVERTED
055609,000048: 16,2064           10000                           CCS      A                                     
055610,000049: 16,2065           12206                           TCF      MOREIDLE                              
055611,000050: 
055612,000051: 16,2066           00002                           RETURN                                         
055613,000052: 
055614,000053:                                                                                                  #  DAPIDLER ENTRY.
055615,000054: 
055616,000055: 16,2067           22016        DAPIDLER           LXCH     BANKRUPT                              #  INTERRUPT LEAD INS (CONTINUED)
055617,000056: 16,2070           00006                           EXTEND                                         
055618,000057: 16,2071           22012                           QXCH     QRUPT                                 
055619,000058: 
055620,000059: 16,2072           11631                           CCS      ACCSET                                #  CHECK IF 1/ACCJOB HAS BEEN SET UP SINCE
055621,000060: 16,2073           12101                           TCF      CHECKUP                               #  THE LAST FRESH START OR RESTART.
055622,000061: 16,2074           37667                           CAF      PRIO27                                
055623,000062: 16,2075           55631                           TS       ACCSET                                #  ACCSET IS POSITIVE.
055624,000063: 16,2076           05142                           TC       NOVAC                                 #  SET UP JOB TO DO A LITTLE INITIALIZATION
055625,000064: 16,2077  E6,1532                                  EBANK=   AOSQ                                  #        AND EXECUTE 1/ACCS.
055626,000065: 16,2077           02305 40106  1/ACCSAD           2CADR    1/ACCSET                              #  (WILL BRANCH TO MOREIDLE ON ACCSOKAY)
055627,000066: 
055628,000067: 16,2101           02043        CHECKUP            TC       CHEKBITS                              #  CHECK TO SEE IF LM DAP IS TO GO ON AND
055629,000068:                                                                                                  #        DO ERROR DISPLAY.
055630,000069: 
055631,000070: 16,2102           31102                           CAE      DAPBOOLS                              #  IF 1/ACCS HAS NOT BEEN COMPLETED, IDLE.
055632,000071: 16,2103           75024                           MASK     ACCSOKAY                              #        NOTE:   ONLY FRESH START AND RESTART
055633,000072: 16,2104           00006                           EXTEND                                         #                KNOCK THIS BIT DOWN.
055634,000073: 16,2105           12206                           BZF      MOREIDLE                              
055635,000074: 
055636,000075: 16,2106           04737        STARTDAP           TC       IBNKCALL                              #  ZERO ATTITUDE ERROR AND DESIRED RATES.
055637,000076: 16,2107           40232                           FCADR    ZATTEROR                              
055638,000077: 16,2110           35030                           CAF      ZERO                                  #  ********** INITIALIZE: **********
055639,000078: 16,2111           55516                           TS       TJP                                   
055640,000079: 16,2112           55517                           TS       TJU                                   
055641,000080: 16,2113           55520                           TS       TJV                                   
055642,000081: 16,2114           55417                           TS       OMEGAP                                #  RATES IN BODY (PILOT) COORDINATES.
055643,000082: 16,2115           55420                           TS       OMEGAQ                                
055644,000083: 16,2116           55421                           TS       OMEGAR                                
055645,000084: 16,2117           55426                           TS       TRAPEDP                               
055646,000085: 16,2120           55427                           TS       TRAPEDQ                               
055647,000086: 16,2121           55430                           TS       TRAPEDR                               
055648,000087: 16,2122           55532                           TS       AOSQ                                  #  OFFSET ACCELERATION ESTIMATES.
055649,000088: 16,2123           55533                           TS       AOSQ       +1                         
055650,000089: 16,2124           55534                           TS       AOSR                                  
055651,000090: 16,2125           55535                           TS       AOSR       +1                         
055652,000091: 16,2126           55422                           TS       ALPHAQ                                #  COPIES OF OFFSET ESTIMATES FOR DOWNLIST.
055653,000092: 16,2127           55423                           TS       ALPHAR                                
055654,000093: 16,2130           55540                           TS       AOSQTERM                              #  QRAXIS RATE DERIVATION TERMS AND KALMAN
055655,000094: 16,2131           55541                           TS       AOSRTERM                              #  FILTER INITIALIZATION TERMS.
055656,000095: 16,2132           55510                           TS       QACCDOT                               #  DESCENT ACCELERATION DERIVATIVE EST.
055657,000096: 16,2133           55512                           TS       RACCDOT                               
055658,000097: 16,2134           55624                           TS       ALLOWGTS                              #  AOSTASK FLAG FOR QRAXIS RCS CONTROL USE.
055659,000098: 16,2135           55625                           TS       COTROLER                              #  DO TRYGTS ON FIRST PASS (WILL GO TO RCS)
055660,000099: 16,2136           55627                           TS       INGTS                                 #  RECOGNIZE FIRST GTS PASS AS SUCH.
055661,000100: 16,2137           55626                           TS       QGIMTIMR                              #  STOP GIMBAL DRIVES.  (PROBABLY WOULD BE
055662,000101: 16,2140           55630                           TS       RGIMTIMR                              #        GOOD ENOUGH JUST TO INACTIVATE TIMERS)
055663,000102: 16,2141           55443                           TS       OLDPMIN                               #  MINIMUM IMPULSE MODE ERASABLES
055664,000103: 16,2142           55444                           TS       OLDQRMIN                              
055665,000104: 
055666,000105:                                                                                                  #  SET UP "OLD" MEASURED CDU ANGLES:
055667,000106: 
055668,000107: 16,2143           00006                           EXTEND                                         
055669,000108: 16,2144           30033                           DCA      CDUX                                  #  OLDXFORP AND OLDYFORP
055670,000109: 16,2145           53437                           DXCH     OLDXFORP                              
055671,000110: 16,2146           30034                           CA       CDUZ                                  
055672,000111: 16,2147           55440                           TS       OLDZFORQ                              
055673,000112: 16,2150           32234                           CAF      CHKVISAD                              
055674,000113: 16,2151           55527                           TS       PJUMPADR                              
055675,000114: 16,2152           35024                           CA       FOUR                                  
055676,000115: 16,2153           55530                           TS       SKIPU                                 
055677,000116: 16,2154           55531                           TS       SKIPV                                 
055678,000117: 16,2155           35006                           CA       POSMAX                                
055679,000118: 16,2156           54031                           TS       TIME6                                 
055680,000119: 16,2157           55454                           TS       T6NEXT                                
055681,000120: 16,2160           55456                           TS       T6FURTHA                              
055682,000121: 16,2161           35030                           CA       ZERO                                  
055683,000122: 16,2162           55455                           TS       T6NEXT     +1                         
055684,000123: 16,2163           55457                           TS       T6FURTHA   +1                         
055685,000124: 16,2164           55453                           TS       NXT6ADR                               
055686,000125: 16,2165           55460                           TS       NEXTP                                 
055687,000126: 16,2166           55461                           TS       NEXTU                                 
055688,000127: 16,2167           55462                           TS       NEXTV                                 
055689,000128: 16,2170           44375                           CS       TEN                                   
055690,000129: 16,2171           55752                           TS       DAPZRUPT                              #  JASK NOT IN PROGRESS, INITIALIZE NEG.
055691,000130: 16,2172           35025                           CA       TWO                                   
055692,000131: 16,2173           55431                           TS       NPTRAPS                               
055693,000132: 16,2174           55432                           TS       NQTRAPS                               
055694,000133: 16,2175           55433                           TS       NRTRAPS                               
055695,000134: 16,2176           00006                           EXTEND                                         
055696,000135: 16,2177           32233                           DCA      PAXADIDL                              
055697,000136: 16,2200           53277                           DXCH     T5ADR                                 
055698,000137: 16,2201           37701        SETTIME5           CAF      MS100                                 
055699,000138: 16,2202           54030                           TS       TIME5                                 
055700,000139: 16,2203           15330                           TCF      RESUME                                
055701,000140: 16,2204  E6,1532                                  EBANK=   AOSQ                                  
055702,000141: 16,2204           02067 34106  IDLERADR           2CADR    DAPIDLER                              
055703,000142: 16,2206           04737        MOREIDLE           TC       IBNKCALL                              #  CALCULATE Q,R-AXES ATTITUDE ERRORS.
055704,000143: 16,2207           36426                           CADR     QERRCALC                              
055705,000144: 
055706,000145: 16,2210           04737                           TC       IBNKCALL                              
055707,000146: 16,2211           35476                           CADR     CALCPERR                              #  CALCULATE P AXIS ATTITUDE ERRORS.
055708,000147: 
055709,000148: 16,2212           00006        SHUTDOWN           EXTEND                                         
055710,000149: 16,2213           32205                           DCA      IDLERADR                              
055711,000150: 16,2214           53277                           DXCH     T5ADR                                 
055712,000151: 
055713,000152: 16,2215           35030                           CAF      ZERO                                  #  KILL ANY POSSIBLE JET REQUESTS
055714,000153: 16,2216           55460                           TS       NEXTP                                 
055715,000154: 16,2217           55461                           TS       NEXTU                                 
055716,000155: 16,2220           55462                           TS       NEXTV                                 
055717,000156: 16,2221           00006                           EXTEND                                         #  COMMAND JETS OFF.
055718,000157: 16,2222           01005                           WRITE    CHAN5                                 
055719,000158: 16,2223           00006                           EXTEND                                         
055720,000159: 16,2224           01006                           WRITE    CHAN6                                 
055721,000160: 16,2225           42231                           CS       BGIM23                                #  TURN TRIM GIMBAL OFF
055722,000161: 16,2226           00006                           EXTEND                                         
055723,000162: 16,2227           03012                           WAND     CHAN12                                
055724,000163: 16,2230           12201                           TCF      SETTIME5                              #  RETURN IN 100 MSEC.
055725,000164: 
055726,000165: 16,2231           07400        BGIM23             OCTAL    07400                                 
055727,000166: 16,2232  E6,1417                                  EBANK=   OMEGAP                                
055728,000167: 16,2232           02444 34106  PAXADIDL           2CADR    PAXIS                                 
055729,000168: 
055730,000169: 16,2234           03112        CHKVISAD           ADRES    CHKVISFZ                              
055731,000170: 16,2235           02077        ACCSETAD           ADRES    1/ACCSAD                              
055732,000171: 
055733,000172: 16,2236     7701               MS100              =        OCT37766                              
055734,000173: 16,2236     0061               COSMG              =        ITEMP1                                
055735,000174: 
055736,000175:                                                                                                  #  PROGRAM:      ALTDSPLY
055737,000176:                                                                                                  #  MOD 0.        6 DEC 1967
055738,000177:                                                                                                  #  AUTHOR:       CRAIG WORK, DON KEENE, MIT IL
055739,000178:                                                                                                  #  MOD 3 BY DON KEENE AUG 1, 1968 MOVED PROGRAM TO BANK 20
055740,000179: 
055741,000180:                                                                                                  #  PROGRAM DESCRIPTION:
055742,000181:                                                                                                  #        ALTDSPLY REVERSES THE DSPLYALT BIT OF RCSFLAGS EACH TIME IT IS CALLED, WHICH IS PRESUMABLY EVERY 100 MS.
055743,000182:                                                                                                  #        IF THE REVERSED BIT IS ONE, NEEDLER IS CALLED TO DISPLAY ATTITUDE ERRORS.  IF THE BIT IS ZERO, THE ATTITUDE ERR-
055744,000183:                                                                                                  #        ORS ARE CALCULATED AS 1) DAP FOLLOWING ERRORS, IF NEEDLFLG = 0, AND 2) TOTAL ATTITUDE ERRORS FOR NEEDLFLG = 1.
055745,000184: 
055746,000185: 
055747,000186:                                                                                                  #  WARNING:      ALTDSPLY MAY ONLY BE CALLED WITH INTERRUPT INHIBITED.
055748,000187: 
055749,000188:                                                                                                  #  WARNING:      EBANK MUST BE SET TO 6 WHEN USING THIS ROUTINE.
055750,000189: 
055751,000190:                                                                                                  #  INPUT:        RCSFLAGS AND    1) IF NEEDLFLG = 0, INPUT PERROR, QERROR, RERROR.
055752,000191:                                                                                                  #                                2) IF NEEDLFLG = 1, INPUT CPHI,CTHETA,CPSI,CDUX,CDUY,CDUZ,M11,M21,M31,M22,M32.  (GPMATRIX)
055753,000192: 
055754,000193: 
055755,000194:                                                                                                  #  OUTPUTS:      RCSFLAGS WITH DSPLYALT REVERSED, AK, AK1, AK2, + NEEDLER OUTPUTS.
055756,000195: 
055757,000196:                                                                                                  #  ENTRY:        TCF     ALTDSPLY
055758,000197: 
055759,000198:                                                                                                  #  EXIT:         TCF     CHEKMORE
055760,000199: 
055761,000200:                                                                                                  #  ALARM OR ABORT EXITS: NONE
055762,000201: 
055763,000202:                                                                                                  #  SUBPROGRAMS CALLED:  NEEDLER, OVERSUB2
055764,000203: 
055765,000204:                                                                                                  #  DEBRIS:       A, L, AND NEEDLER DEBRIS.
055766,000205: 
055767,000206: 16,2236           31275        ALTDSPLY           CA       RCSFLAGS                              #  INVERT THE DISPLAY ALTERNATION BIT.
055768,000207: 16,2237           54001                           TS       L                                     
055769,000208: 16,2240           35023                           CA       DSPLYALT                              
055770,000209: 16,2241           00006                           EXTEND                                         
055771,000210: 16,2242           06001                           RXOR     LCHAN                                 
055772,000211: 16,2243           55275                           TS       RCSFLAGS                              
055773,000212: 
055774,000213: 16,2244           75023                           MASK     DSPLYALT                              
055775,000214: 16,2245           10000                           CCS      A                                     #  IS ALTERNATION FLAG ZERO?
055776,000215: 16,2246           12331                           TCF      NEEDLER                               
055777,000216: 
055778,000217: 16,2247           30074                           CAE      FLAGWRD0                              #  NEEDLFLG WILL INDICATE TOTAL OR DAP AT-
055779,000218: 16,2250           75023                           MASK     NEEDLBIT                              #  TITUDE ERROR DISPLAY REQUEST.
055780,000219: 16,2251           10000                           CCS      A                                     
055781,000220: 16,2252           12261                           TCF      DSPLYTOT                              #  TOTAL ERROR IS NEEDED IN AK, AK +1, AK +2
055782,000221: 
055783,000222: 16,2253           00006                           EXTEND                                         
055784,000223: 16,2254           41452                           DCS      QERROR                                #  YES.  DISPLAY ATT ERRORS ON THE ,-BALL.
055785,000224: 16,2255           53756                           DXCH     AK         +1                         #  ERROR COMPLEMENTS ARE INPUT TO NEEDLER.
055786,000225: 16,2256           41450                           CS       PERROR                                
055787,000226: 16,2257           57754                           XCH      AK                                    
055788,000227: 
055789,000228: 16,2260           12061                           TCF      CHEKMORE                              #  DISPLAY THESE THE NEXT TIME THROUGH
055790,000229: 
055791,000230:                                                                                                  #  CALCULATE GIMBAL ANGLE TOTAL ERRORS, RESOLVE INTO PILOT AXES, STORE TOTAL ERRORS FOR NEEDLER.  Q-AXIS FIRST.
055792,000231: 
055793,000232: 16,2261           00006        DSPLYTOT           EXTEND                                         
055794,000233: 16,2262           22061                           QXCH     ITEMP1                                #  SAVE Q FOR CHEKBITS RETURN.
055795,000234: 
055796,000235: 16,2263           31207                           CA       CTHETA                                #  DESIRED ATTITUDE, Y-AXIS, 2'S COMP.
055797,000236: 16,2264           00006                           EXTEND                                         #  SUBTRACT CURRENT ATTITUDE.
055798,000237: 16,2265           20033                           MSU      CDUY                                  #  DIFFERENCE SCALED AT PI, 1'S COMP.
055799,000238: 16,2266           55754                           TS       AK                                    #  SAVE FOR R-ERROR CALCULATION.
055800,000239: 16,2267           00006                           EXTEND                                         
055801,000240: 16,2270           71413                           MP       M21                                   #  (CHTETA-CDUY)*M21 SCALED AT PI RADIANS.
055802,000241: 16,2271           57755                           XCH      AK         +1                         #  STORE FIRST TERM OF Q ERROR.
055803,000242: 16,2272           31210                           CA       CPSI                                  #  DESIRED ATTITUDE, Z-AXIS, 2'S COMP.
055804,000243: 16,2273           00006                           EXTEND                                         #  SUBTRACT CURRENT ATTITUDE.
055805,000244: 16,2274           20034                           MSU      CDUZ                                  #  DIFFERENCE SCALED AT PI, 1'S COMP.
055806,000245: 16,2275           55756                           TS       AK         +2                         #  SAVE Z-AXIS TERM FOR R ERROR CALCULATION
055807,000246: 16,2276           00006                           EXTEND                                         
055808,000247: 16,2277           71415                           MP       M22                                   #  (CPSI-CDUZ)*M22, SCALED AT PI RADIANS.
055809,000248: 16,2300           61755                           AD       AK         +1                         #  Q ERROR COMPLETE         , AT PI RAD.
055810,000249: 16,2301           02524                           TC       OVERSUB                               #  PIN NEEDLES IN CASE OF OVERFLOW.
055811,000250: 16,2302           55755                           TS       AK         +1                         
055812,000251: 
055813,000252:                                                                                                  #  R ERROR CALCULATION NEXT.
055814,000253: 
055815,000254: 16,2303           31754                           CA       AK                                    #  Y-AXIS DIFFERENCE STORED BY Q-AXIS CALC.
055816,000255: 16,2304           00006                           EXTEND                                         
055817,000256: 16,2305           71414                           MP       M31                                   #  (CTHETA-CDUY)*M31, SCALED AT PI RADIANS.
055818,000257: 16,2306           57756                           XCH      AK         +2                         #  FIRST TERM OF R ERROR.
055819,000258:                                                                                                  #  Z-AXIS DIFFERENCE, STORED BY A CALC. IS
055820,000259: 16,2307           00006                           EXTEND                                         #  RECOVERED BY THE EXCHANGE.
055821,000260: 16,2310           71416                           MP       M32                                   #  (CPSI-CDUZ)*M32, SCALED AT PI RADIANS.
055822,000261: 16,2311           61756                           AD       AK         +2                         #  R ERROR COMPLETE         , AT PI RAD.
055823,000262: 16,2312           02524                           TC       OVERSUB                               #  PIN NEEDLES IN CASE OF OVERFLOW.
055824,000263: 16,2313           55756                           TS       AK         +2                         
055825,000264: 
055826,000265:                                                                                                  #  NOW CALCULATE P ERROR.  (NOTE THAT M13 = 1, SCALED AT 1, SO THE MULTIPLICATION IS BY-PASSED.)
055827,000266: 16,2314           31754                           CA       AK                                    #  Y-AXIS DIFFERENCE STORED BY Q AXIS CALC.
055828,000267: 16,2315           00006                           EXTEND                                         
055829,000268: 16,2316           71412                           MP       M11                                   #  (CTHETA-CDUY)*M11 SCALED AT PI RADIANS.
055830,000269: 16,2317           57754                           XCH      AK                                    #  FIRST TERM OF P ERROR IN AK, AT PI RAD.
055831,000270: 16,2320           31206                           CAE      CPHI                                  #  DESIRED ATTITUDE, X-AXIS, 2'S COMP.
055832,000271: 16,2321           00006                           EXTEND                                         #  SUBTRACT CURRENT X ATTITUDE.
055833,000272: 16,2322           20032                           MSU      CDUX                                  #  X-AXIS DIFFERENCE, 1'S COMP, AT PI RAD.
055834,000273: 
055835,000274:                                                                                                  #  M13 = 1, SO BYPASS THE MULTIPLICATION.
055836,000275:                                                                                                  #                EXTEND
055837,000276:                                                                                                  #                MP      M13             (CPHI-CDUX)*M13 SCALED AT PI RADIANS.
055838,000277: 
055839,000278: 16,2323           61754                           AD       AK                                    #  P ERROR COMPLETE      , SCALED AT PI RAD
055840,000279: 16,2324           02524                           TC       OVERSUB                               #  PIN NEEDLES IN CASE OF OVERFLOW.
055841,000280: 16,2325           55754                           TS       AK                                    
055842,000281: 
055843,000282: 16,2326           00006                           EXTEND                                         
055844,000283: 16,2327           22061                           QXCH     ITEMP1                                #  RESTORE Q FOR CHEKBITS RETURN.
055845,000284: 
055846,000285: 16,2330           12061                           TCF      CHEKMORE                              #  DISPLAY THESE THE NEXT TIME THROUGH
055847,000286: 
055848,000287:                                                                                                  #  FDAI ATTITUDE ERROR DISPLAY SUBROUTINE
055849,000288: 
055850,000289:                                                                                                  #  PROGRAM DESCRIPTION:          D. KEENE        5/24/67
055851,000290:                                                                                                  #  MOD 1 BY CRAIG WORK, 12 DEC 67
055852,000291:                                                                                                  #  MOD 2 BY CRAIG WORK, 6 APRIL 68 CONVERTS ATTITUDE ERROR DISPLAY SCALING FROM 16 7/8 DEG. TO 42 3/16 DEGREES.
055853,000292: 
055854,000293:                                                                                                  #  THIS SUBROUTINE IS USED TO DISPLAY ATTITUDE ERRORS ON THE FDAI VIA THE DIGITAL TO ANALOG CONVERTERS (DACS)
055855,000294:                                                                                                  #  IN THE CDUS.  CARE IS TAKEN TO METER OUT THE APPROPRIATE NUMBER OF PULSES TO THE IMU ERROR COUNTERS AND PREVENT
055856,000295:                                                                                                  #  OVERFLOW, TO CONTROL THE RELAY SEQUENCING, AND TO AVOID INTERFERENCE WITH THE COARSE ALIGN LOOP WHICH ALSO USES
055857,000296:                                                                                                  #  THE DACS.
055858,000297: 
055859,000298:                                                                                                  #  CALLING SEQUENCE:
055860,000299:                                                                                                  #        DURING THE INITIALIZATION SECTION OF THE USER'S PROGRAM, BIT3 OF RCSFLAGS SHOULD BE SET TO INITIATE THE
055861,000300:                                                                                                  #        TURN-ON SEQUENCE WITHIN THE NEEDLES PROGRAM:
055862,000301:                                                                                                  #                CS      RCSFLAGS        IN EBANK6
055863,000302:                                                                                                  #                MASK    BIT3
055864,000303:                                                                                                  #                ADS     RCSFLAGS
055865,000304:                                                                                                  #        THEREAFTER, THE ATTITUDE ERRORS GENERATED BY THE USER SHOULD BE TRANSFERED TO THE FOLLOWING LOCATIONS IN EBANK6:
055866,000305:                                                                                                  #                AK      SCALED 180 DEGREES      NOTE:   THESE LOCATIONS ARE SUBJECT
055867,000306:                                                                                                  #                AK1     SCALED 180 DEGREES              TO CHANGE
055868,000307:                                                                                                  #                AK2     SCALED 180 DEGREES
055869,000308:                                                                                                  #        FULL SCALED DEFLECTION OF THE NEEDLES CORRESPONDS TO 5 1/16 DEGREES, WHILE 384 BITS IN THE IMU ERROR COUNTER
055870,000309:                                                                                                  #        CORRESPONDS TO 42 3/16 DEGREES.  (DAC MAXIMUM CAPACITY IS 384 BITS.)  46 BITS EFFECTIVELY PIN THE NEEDLES.
055871,000310: 
055872,000311:                                                                                                  #        A CALL TO NEEDLER WILL THEN UPDATE THE DISPLAY:
055873,000312:                                                                                                  #                INHINT
055874,000313:                                                                                                  #                TC      IBNKCALL        NOTE:  EBANK SHOULD BE SET TO E6
055875,000314:                                                                                                  #                CADR    NEEDLER
055876,000315:                                                                                                  #                RELINT
055877,000316:                                                                                                  #        THIS PROCESS SHOULD BE REPEATED EACH TIME THE ERRORS ARE UPDATED.  AT LEAST 3 PASSES THRU THE PROGRAM ARE
055878,000317:                                                                                                  #        REQUIRED BEFORE ANYTHING IS ACTUALLY DISPLAYED ON THE ERROR METERS.
055879,000318:                                                                                                  #        NOTE:  EACH CALL TO NEEDLER MUST BE SEPARATED BY AT LEAST 50 MS TO ASSURE PROPER RELAY SEQUENCING.
055880,000319: 
055881,000320:                                                                                                  #  ERASABLE USED:
055882,000321:                                                                                                  #        AK              CDUXCMD
055883,000322:                                                                                                  #        AK1             CDUYCMD
055884,000323:                                                                                                  #        AK2             CDUZCMD
055885,000324:                                                                                                  #        EDRIVEX         A,L,Q
055886,000325:                                                                                                  #        EDRIVEY         T5TEMP
055887,000326:                                                                                                  #        EDRIVEZ         DINDX
055888,000327: 
055889,000328:                                                                                                  #  SWITCHES:             RCSFLAGS  BITS 3,2
055890,000329: 
055891,000330:                                                                                                  #  I/O CHANNELS:         CHAN12  BIT 4 (COARSE ALIGN - READ ONLY)
055892,000331:                                                                                                  #                        CHAN12  BIT 6 (IMU ERROR COUNTER ENABLE)
055893,000332:                                                                                                  #                        CHAN14  BIT 13,14,15 (DAC ACTIVITY)
055894,000333: 
055895,000334:                                                                                                  #  SIGN CONVENTION<      AK = THETAC - THETA
055896,000335:                                                                                                  #                        WHERE   THETAC = COMMAND ANGLE
055897,000336:                                                                                                  #                                THETA = PRESENT ANGLE
055898,000337: 
055899,000338: 16,2331           31275        NEEDLER            CA       RCSFLAGS                              
055900,000339: 16,2332           76216                           MASK     SIX                                   
055901,000340: 16,2333           00006                           EXTEND                                         
055902,000341: 16,2334           12371                           BZF      NEEDLES3                              
055903,000342: 16,2335           75024                           MASK     BIT3                                  
055904,000343: 16,2336           00006                           EXTEND                                         
055905,000344: 16,2337           12362                           BZF      NEEDLER2                              #  BIT3 = 0, BIT2 = 1
055906,000345: 
055907,000346: 16,2340           45021                           CS       BIT6                                  #  FIRST PASS BIT3 = 1
055908,000347: 16,2341           00006                           EXTEND                                         #  DISABLE IMU ERROR COUNTER TO ZERO DACS
055909,000348: 16,2342           03012                           WAND     CHAN12                                #  MUST WAIT AT LEAST 60 MS BEFORE
055910,000349: 16,2343           45030        NEEDLE11           CS       ZERO                                  #  ENABLING COUNTERS.
055911,000350: 16,2344           55754                           TS       AK                                    #  ZERO THE INPUTS ON FIRST PASS
055912,000351: 16,2345           55755                           TS       AK1                                   
055913,000352: 16,2346           55756                           TS       AK2                                   
055914,000353: 16,2347           55757                           TS       EDRIVEX                               #  ZERO THE DISPLAY REGISTERS
055915,000354: 16,2350           55760                           TS       EDRIVEY                               
055916,000355: 16,2351           55761                           TS       EDRIVEZ                               
055917,000356: 16,2352           54050                           TS       CDUXCMD                               #  ZERO THE OUT COUNTERS
055918,000357: 16,2353           54051                           TS       CDUYCMD                               
055919,000358: 16,2354           54052                           TS       CDUZCMD                               
055920,000359: 16,2355           46216                           CS       SIX                                   #  RESET RCSFLAGS FOR PASS2
055921,000360: 16,2356           71275                           MASK     RCSFLAGS                              
055922,000361: 16,2357           65025                           AD       BIT2                                  
055923,000362: 16,2360           55275                           TS       RCSFLAGS                              
055924,000363: 16,2361           12061                           TCF      CHEKMORE                              
055925,000364: 
055926,000365: 16,2362           35021        NEEDLER2           CAF      BIT6                                  #  ENABLE IMU ERROR COUNTERS
055927,000366: 16,2363           00006                           EXTEND                                         
055928,000367: 16,2364           05012                           WOR      CHAN12                                
055929,000368: 16,2365           46216                           CS       SIX                                   #  RESET RCSFLAGS TO DISPLAY ATTITUDE
055930,000369: 16,2366           71275                           MASK     RCSFLAGS                              #  ERRORS    WAIT AT LEAST 4 MS FOR
055931,000370: 16,2367           55275                           TS       RCSFLAGS                              #  RELAY CLOSURE
055932,000371: 16,2370           12061                           TCF      CHEKMORE                              
055933,000372: 
055934,000373: 16,2371           35021        NEEDLES3           CAF      BIT6                                  #  CHECK TO SEE IF IMU ERROR COUNTER
055935,000374: 16,2372           00006                           EXTEND                                         #  IS ENABLED
055936,000375: 16,2373           02012                           RAND     CHAN12                                
055937,000376: 16,2374           10000                           CCS      A                                     #  IF NOT, RE-INITIALIZE NEEDLER.
055938,000377: 16,2375           12402                           TCF      NEEDLES                               
055939,000378: 
055940,000379: 16,2376           41275                           CS       RCSFLAGS                              #  SET UP INITIALIZATION FLAG IN RCSFLAGS.
055941,000380: 16,2377           75024                           MASK     BIT3                                  
055942,000381: 16,2400           27275                           ADS      RCSFLAGS                              
055943,000382: 16,2401           12061                           TCF      CHEKMORE                              
055944,000383: 
055945,000384: 16,2402           35025        NEEDLES            CAF      TWO                                   
055946,000385: 16,2403           54063        DACLOOP            TS       DINDX                                 
055947,000386: 16,2404           42443                           CS       ONETENTH                              #  RESCALE INPUTS TO + OR - 1800 DEGREES.
055948,000387: 16,2405           00006                           EXTEND                                         
055949,000388: 16,2406           50063                           INDEX    DINDX                                 
055950,000389: 16,2407           71754                           MP       AK                                    
055951,000390: 16,2410           54001                           TS       L                                     
055952,000391: 16,2411           10000                           CCS      A                                     
055953,000392: 16,2412           32441                           CA       DACLIMIT                              
055954,000393: 16,2413           12415                           TCF      +2                                    
055955,000394: 16,2414           42441                           CS       DACLIMIT                              
055956,000395: 16,2415           60001                           AD       L                                     
055957,000396: 16,2416           54061                           TS       T5TEMP                                #  OVFLO CHK
055958,000397: 16,2417           12423                           TCF      +4                                    
055959,000398: 16,2420           50000                           INDEX    A                                     #  ON OVERFLOW LIMIT OUTPUT TO +-384
055960,000399: 16,2421           32441                           CAF      DACLIMIT                              
055961,000400: 16,2422           54001                           TS       L                                     
055962,000401: 16,2423           50063                           INDEX    DINDX                                 
055963,000402: 16,2424           41757                           CS       EDRIVEX                               #  CURRENT VALUE OF DAC
055964,000403: 16,2425           60001                           AD       L                                     
055965,000404: 16,2426           50063                           INDEX    DINDX                                 
055966,000405: 16,2427           26050                           ADS      CDUXCMD                               
055967,000406: 16,2430           50063                           INDEX    DINDX                                 
055968,000407: 16,2431           23757                           LXCH     EDRIVEX                               
055969,000408: 16,2432           10063                           CCS      DINDX                                 
055970,000409: 16,2433           12403                           TCF      DACLOOP                               
055971,000410: 16,2434           37711                           CAF      13,14,15                              
055972,000411: 16,2435           00006                           EXTEND                                         
055973,000412: 16,2436           05014                           WOR      CHAN14                                #  SET DAC ACTIVITY BITS
055974,000413: 16,2437           12061                           TCF      CHEKMORE                              
055975,000414: 
055976,000415: 16,2440           77177                           DEC      -384       B-14                       
055977,000416: 16,2441           37200        DACLIMIT           DEC      16000      B-14                       
055978,000417: 16,2442           00600                           DEC      384        B-14                       
055979,000418: 
055980,000419: 16,2443           03146        ONETENTH           OCT      03146                                 #  DECIMAL +0.1, SCALED AT 1.
055981,000420: 16,2444     5023               DSPLYALT           EQUALS   BIT4                                  #  100 MS ALTERNATION BIT IN RCSFLAGS

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