Source Code

These source-code files were transcribed from a printout in Don Eyles's personal collection, scanned by archive.org, and financially sponsored by Peter McDermott. A team of volunteers performed the transcription and proof-reading. The scanned page images are available at the Virtual AGC Project website, as well as higher-quality (but much larger) images at the Virtual AGC Project's collection in the Internet Archive. Report any problems by creating "issues" at the Virtual AGC Project's GitHub Repository.

Notations on the program listing read, in part:

	YUL SYSTEM FOR AGC: NEW PROGRAM SHEPATIN BY EYLES
	DEC 13, 1966

	THIS PROGRAM WAS ASSEMBLED AS A VERSION OF REVISION 37 
        OF PROGRAM SUNBURST BY LEM GROUP
Note that the date is the date of the printout, not the date of the program revision.

020061,000002:                                                                                                  ## Copyright:   Public domain.
020062,000003:                                                                                                  ## Filename:    DAPIDLER_PROGRAM.agc
020063,000004:                                                                                                  ## Purpose:     A section of Sunburst revision 37, or Shepatin revision 0.
020064,000005:                                                                                                  ##              It is part of an early development version of the software
020065,000006:                                                                                                  ##              for Apollo Guidance Computer (AGC) on the unmanned Lunar
020066,000007:                                                                                                  ##              Module (LM) flight Apollo 5. Sunburst 37 was the program
020067,000008:                                                                                                  ##              upon which Don Eyles's offline development program Shepatin
020068,000009:                                                                                                  ##              was based; the listing herein transcribed was actually for
020069,000010:                                                                                                  ##              the equivalent revision 0 of Shepatin.
020070,000011:                                                                                                  ##              This file is intended to be a faithful transcription, except
020071,000012:                                                                                                  ##              that the code format has been changed to conform to the
020072,000013:                                                                                                  ##              requirements of the yaYUL assembler rather than the
020073,000014:                                                                                                  ##              original YUL assembler.
020074,000015:                                                                                                  ## Reference:   pp. 463-467
020075,000016:                                                                                                  ## Assembler:   yaYUL
020076,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
020077,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
020078,000019:                                                                                                  ## Mod history: 2017-05-24 MAS  Created from Sunburst 120.
020079,000020:                                                                                                  ##              2017-05-30 HG   Transcribed
020080,000021:                                                                                                  ##              2017-06-03 HG   Add missing constant DGBF                
020081,000022:                                                                                                  ##              2017-06-22 RSB  Proofed comment text with
020082,000023:                                                                                                  ##                              octopus/ProoferComments.
020083,000024: 

Page 463

020085,000026:                                                                                                  #  THE DAPIDLER PROGRAM IS STARTED BY FRESH START AND RESTART.             THE DAPIDLER PROGRAM IS DONE 10 TIMES
020086,000027:                                                                                                  #  PER SECOND UNTIL THE ASTRONAUT DESIRES THE DAP TO WAKE UP, AND THE IMU AND CDUS ARE READY FOR USE BY THE DAP.
020087,000028:                                                                                                  #  THE NECESSARY INITIALIZATION OF THE DAP IS DONE BY THE DAPIDLER PROGRAM.
020088,000029:                                                                                                  #  ADDITIONAL WORK MUST BE DONE ON DAPIDLER IN THE FUTURE.
020089,000030: 
020090,000031: 
020091,000032: 
020092,000033: 16,2104                                           BANK     16                                    
020093,000034: 16,2104  E6,1541                                  EBANK=   DT                                    
020094,000035: 
020095,000036: 16,2104           37750        CHEKBITS           CAF      BIT6                                  
020096,000037: 16,2105           70365                           MASK     IMODES30                              
020097,000038: 16,2106           10000                           CCS      A                                     
020098,000039: 16,2107           12305                           TCF      MOREIDLE                              
020099,000040: 
020100,000041: 16,2110           37752                           CAF      BIT4                                  
020101,000042: 16,2111           67751                           AD       BIT5                                  
020102,000043: 16,2112           00006                           EXTEND                                         
020103,000044: 16,2113           02012                           RAND     12                                    
020104,000045: 
020105,000046: 16,2114           10000                           CCS      A                                     
020106,000047: 16,2115           12305                           TCF      MOREIDLE                              
020107,000048: 
020108,000049: 16,2116           37744                           CAF      BIT10                                 #  BIT10 OF 30 IS PNGCS CONTROL OF S/C
020109,000050: 16,2117           00006                           EXTEND                                         
020110,000051: 16,2120           02030                           RAND     30                                    #  BITS IN 30 ARE INVERTED
020111,000052: 16,2121           10000                           CCS      A                                     
020112,000053: 16,2122           12305                           TCF      MOREIDLE                              
020113,000054: 
020114,000055: 16,2123           00006                           EXTEND                                         
020115,000056: 16,2124           00031                           READ     31                                    #  IF BOTH    BIT13 AND BIT14 ARE ONE
020116,000057: 16,2125           40000                           COM                                            #  THEN MODE SELECT SWITCH IS IN OFF
020117,000058: 16,2126           75226                           MASK     BIT13-14                              #  POSITION.
020118,000059: 16,2127           00006                           EXTEND                                         
020119,000060: 16,2130           12305                           BZF      MOREIDLE                              #  HENCE DAP SHOULD BE OFF.
020120,000061: 
020121,000062: 16,2131           37743                           CAF      GODAPGO                               
020122,000063: 16,2132           70077                           MASK     DAPBOOLS                              
020123,000064: 16,2133           00006                           EXTEND                                         
020124,000065: 16,2134           12305                           BZF      MOREIDLE                              
020125,000066: 
020126,000067: 16,2135           00002                           RETURN                                         
020127,000068: 

Page 464

020129,000070:                                                                                                  #  DAPIDLER ENTRY.
020130,000071: 
020131,000072: 16,2136           22016        DAPIDLER           LXCH     BANKRUPT                              #  INTERRUPT LEAD INS (CONTINUED)
020132,000073: 16,2137           00006                           EXTEND                                         
020133,000074: 16,2140           22012                           QXCH     QRUPT                                 
020134,000075: 
020135,000076: 16,2141           02104                           TC       CHEKBITS                              #  CHECK TO SEE IF LM DAP IS TO GO ON.
020136,000077: 
020137,000078:                                                                                                  #  THIS SUBROUTINE CALL PERFORMS THE FOLLOWING INITIALIZATION FUNCTIONS:
020138,000079:                                                                                                  #          1. THE DESIRED RATE VECTOR IS ZEROED.
020139,000080:                                                                                                  #          2. THE DELCDU VECTOR IS ZEROED.
020140,000081:                                                                                                  #          3. THE DESIRED CDU REGISTERS ARE SET EQUAL TO THE CDU REGISTERS.
020141,000082: 
020142,000083: 16,2142           02057        STARTDAP           TC       STOPRATE                              #  USE DAP INTERFACE SUBROUTINE
020143,000084: 
020144,000085:                                                                                                  #  THIS SUBROUTINE CALL PERFORMS THE FOLLOWING INITIALIZATION FUNCTIONS:
020145,000086:                                                                                                  #           1. THE MINIMUM IMPULSE DEADBANDS ARE SET.
020146,000087:                                                                                                  #           2. THE OFFSET ACCELERATION ESTIMATES ARE ZEROED.
020147,000088:                                                                                                  #           3. THE RATE DERIVATION ACCELERATION TERMS ARE ZEROED.
020148,000089:                                                                                                  #           4. THE NJ FLAGS ARE CLEARED.
020149,000090:                                                                                                  #           5. THE URGENCY FUNCTION CORRECTION RATIOS ARE SET TO ONE.
020150,000091: 
020151,000092: 16,2143           05307                           TC       IBNKCALL                              
020152,000093: 16,2144           40057                           FCADR    ALLCOAST                              
020153,000094: 
020154,000095: 16,2145           37761                           CAF      ZERO                                  #  ********** INITIALIZE: **********
020155,000096: 
020156,000097: 16,2146           54031                           TS       TIME6                                 #  T6RUPT CLOCK
020157,000098: 16,2147           55610                           TS       TP                                    #  RATE DERIVATION DTS
020158,000099: 16,2150           55611                           TS       TQR                                   
020159,000100: 16,2151           55463                           TS       LASTPER                               #  ATTITUDE ERROR RECORDS FOR EIGHTBALL.
020160,000101: 16,2152           55464                           TS       LASTQER                               
020161,000102: 16,2153           55465                           TS       LASTRER                               
020162,000103: 16,2154           55466                           TS       PERROR                                
020163,000104: 16,2155           55467                           TS       QERROR                                
020164,000105: 16,2156           55470                           TS       RERROR                                
020165,000106: 16,2157           55416                           TS       OMEGAP                                #  RATES IN BODY (PILOT) COORDINATES.
020166,000107: 16,2160           55417                           TS       OMEGAQ                                
020167,000108: 16,2161           55421                           TS       OMEGAR                                
020168,000109: 16,2162           55002                           TS       T6NEXT                                #  JTLST VARIABLES.
020169,000110: 16,2163           55003                           TS       T6NEXT     +1                         
020170,000111: 16,2164           55473                           TS       ADDT6JTS                              
020171,000112: 16,2165           55474                           TS       ADDTLT6                               
020172,000113: 16,2166           55007                           TS       DELAYCTR                              #  MINIMUM IMPULSE RHC MODE COUNTER.
020173,000114: 16,2167           55420                           TS       ALPHAQ                                #  DESCENT ACCELERATION ESTIMATES.
020174,000115: 16,2170           55422                           TS       ALPHAR                                
020175,000116: 16,2171           55514                           TS       DISPLACT                              #  EIGHTBALL ROUTINE SWITCH.
020176,000117: 16,2172           55636                           TS       (1-K)                                 #  K=1 FIRST PASS.
020177,000118: 16,2173           55637                           TS       (1-K)/8                               
020178,000119: 
020179,000120: 16,2174           55502                           TS       CH5MASK                               #  TEMP. INIT. FOR FAILURE MONITOR
020180,000121: 

Page 465

020182,000123: 16,2175           55503                           TS       CH6MASK                               
020183,000124: 
020184,000125: 
020185,000126: 
020186,000127:                                                                                                  #  SET UP "OLD" MEASURED CDU ANGLES:
020187,000128: 
020188,000129: 16,2176           00006                           EXTEND                                         
020189,000130: 16,2177           30033                           DCA      CDUX                                  #  OLDXFORP AND OLDYFORP
020190,000131: 
020191,000132: 16,2200           53427                           DXCH     OLDXFORP                              
020192,000133: 16,2201           00006                           EXTEND                                         
020193,000134: 16,2202           30034                           DCA      CDUY                                  #  OLDYFORQ AND OLDZFORQ
020194,000135: 16,2203           53431                           DXCH     OLDYFORQ                              
020195,000136: 
020196,000137: 16,2204           32331                           CAF      0.62170                               
020197,000138: 16,2205           55455                           TS       4JETTORK                              
020198,000139: 16,2206           32332                           CAF      .68387                                #  2200 FT LBS. SCALED AT 2(10) X PI.
020199,000140: 16,2207           55456                           TS       JETTORK4                              #  QR AXIS JET TORQUE FOR 4 JETS.
020200,000141:                                                                                                  #  SET UP THE TORQUE VECTOR RECONSTRUCTION SWITCHES:
020201,000142: 
020202,000143: 16,2210           00006                           EXTEND                                         
020203,000144: 16,2211           32343                           DCA      VISNORMQ                              #  PJUMPADR AND QJUMPADR
020204,000145: 16,2212           53647                           DXCH     PJUMPADR                              
020205,000146: 
020206,000147:                                                                                                  #  SET UP INITIAL VALUES FOR WFORP AND WFORQR:
020207,000148: 
020208,000149: 16,2213           00006                           EXTEND                                         #  SCALED AT 16:
020209,000150: 16,2214           32345                           DCA      WFORPQRK                              #  WFORP  = K/DT = K/.1  = 1/.1  = 0.625
020210,000151: 16,2215           53635                           DXCH     WFORP                                 #  WFORQR = K/DT = K/.15 = 1/.15 = 0.41667
020211,000152: 
020212,000153:                                                                                                  #  SET UP WAITLIST CALL TO RESET WFORP AND WFORQR:
020213,000154: 
020214,000155: 16,2216           32340                           CAF      180MS                                 
020215,000156: 16,2217           05701                           TC       WAITLIST                              
020216,000157: 16,2220  E6,1635                                  EBANK=   WFORQR                                
020217,000158: 16,2220           03322 40006                     2CADR    WCHANGER                              
020218,000159: 
020219,000160: 16,2222           37755                           CAF      ONE                                   
020220,000161: 16,2223           05701                           TC       WAITLIST                              
020221,000162: 16,2224  E6,1452                                  EBANK=   IXX                                   
020222,000163: 16,2224           02441 54006                     2CADR    IXXTASK                               
020223,000164: 
020224,000165: 16,2226           37755                           CA       ONE                                   
020225,000166: 16,2227           05701                           TC       WAITLIST                              
020226,000167: 16,2230  E6,1453                                  EBANK=   IYY                                   
020227,000168: 16,2230           02452 54006                     2CADR    IYYTASK                               
020228,000169: 
020229,000170: 16,2232           37755                           CA       ONE                                   
020230,000171: 16,2233           05701                           TC       WAITLIST                              
020231,000172: 16,2234  E6,1454                                  EBANK=   IZZ                                   
020232,000173: 16,2234           02463 54006                     2CADR    IZZTASK                               
020233,000174: 

Page 466

020235,000176:                                                                                                  #  THIS SECTION COMPUTES THE RATE OF CHANGE OF ACCELERATION DUE TO THE
020236,000177:                                                                                                  #   ROTATION OF THE GIMBAL ENGINE. THE EQUATION IMPLEMENTED IN BOTH THE
020237,000178:                                                                                                  #   Y-X PLANE AND THE Z-X PLANE IS -- D(ALPHA)/DT = T L/I * D(DELTA)/DT
020238,000179:                                                                                                  #   WHERE ----
020239,000180:                                                                                                  #              T = ENGINE THRUST COMMAND
020240,000181:                                                                                                  #              L = PIVOT TO CG DISTANCE OF THE GIMBAL ENGINE
020241,000182:                                                                                                  #              I = INERTIA
020242,000183:                                                                                                  #              DELTA = GIMBAL ENGINE ANGLE MEASURED FROM THE X AXIS.
020243,000184: 
020244,000185: 16,2236           32334                           CAF      DELTADOT                              #  0.2 DEG/SEC SCALED AT PI/64
020245,000186: 16,2237           00006                           EXTEND                                         
020246,000187: 16,2240           71451                           MP       L,PVT-CG                              #  GIMBAL PIVOT TO C.G. DISTANCE ,SCALE=8.
020247,000188: 16,2241           00006                           EXTEND                                         
020248,000189: 16,2242           71523                           MP       THRSTCMD                              #  COMMANDED THRUST SCALED AT 2(14) =16384.        
020249,000190: 
020250,000191: 16,2243           52062                           DXCH     ITEMP1                                
020251,000192: 16,2244           00006                           EXTEND                                         
020252,000193: 16,2245           30062                           DCA      ITEMP1                                
020253,000194: 16,2246           00006                           EXTEND                                         
020254,000195: 16,2247           11454                           DV       IZZ                                   #  AT 2(18)
020255,000196: 16,2250           55533                           TS       ACCDOTR                               #  AT PI/2(7)
020256,000197: 16,2251           52062                           DXCH     ITEMP1                                
020257,000198: 16,2252           00006                           EXTEND                                         
020258,000199: 16,2253           11453                           DV       IYY                                   #  AT 2(18)
020259,000200: 16,2254           55531                           TS       ACCDOTQ                               #  AT PI/2(7)
020260,000201: 
020261,000202: 16,2255           00006                           EXTEND                                         #  .3ACCDOTQ AT PI/2(8)
020262,000203: 16,2256           72335                           MP       DGBF                                  
020263,000204: 16,2257           55525                           TS       KQ                                    
020264,000205: 16,2260           00006                           EXTEND                                         
020265,000206: 16,2261           70000                           SQUARE                                         
020266,000207: 16,2262           55526                           TS       KQ2                                   #  KQ(2)
020267,000208: 
020268,000209: 16,2263           31533                           CAE      ACCDOTR                               #  .3ACCDOTR AT PI/2(8)
020269,000210: 16,2264           00006                           EXTEND                                         
020270,000211: 16,2265           72335                           MP       DGBF                                  
020271,000212: 16,2266           55527                           TS       KRDAP                                 
020272,000213: 16,2267           00006                           EXTEND                                         
020273,000214: 
020274,000215: 16,2270           70000                           SQUARE                                         
020275,000216: 16,2271           55530                           TS       KR2                                   
020276,000217: 
020277,000218: 
020278,000219: 16,2272           00006                           EXTEND                                         #  SET UP P-AXIS TO GO TO DUMMYFIL
020279,000220: 16,2273           32326                           DCA      DF2CADR                               
020280,000221: 16,2274           53572                           DXCH     PFILTADR                              
020281,000222: 
020282,000223: 16,2275           00006                           EXTEND                                         
020283,000224: 16,2276           32324                           DCA      PAXADIDL                              
020284,000225: 16,2277           53001                           DXCH     T5ADR                                 
020285,000226: 16,2300           32327        SETTIME5           CAF      MS100                                 
020286,000227: 16,2301           54030                           TS       TIME5                                 
020287,000228: 16,2302           15751                           TCF      RESUME                                
020288,000229: 

Page 467

020290,000231: 16,2303  E6,1541                                  EBANK=   DT                                    
020291,000232: 16,2303           02136 34006  IDLERADR           2CADR    DAPIDLER                              #  DAP SHOULD BE OFF
020292,000233: 16,2305           00006        MOREIDLE           EXTEND                                         
020293,000234: 16,2306           32304                           DCA      IDLERADR                              
020294,000235: 16,2307           53001                           DXCH     T5ADR                                 
020295,000236: 
020296,000237: 16,2310           37761                           CAF      ZERO                                  #  COMMAND JETS OFF
020297,000238: 16,2311           00006                           EXTEND                                         
020298,000239: 16,2312           01005                           WRITE    5                                     
020299,000240: 16,2313           00006                           EXTEND                                         
020300,000241: 16,2314           01006                           WRITE    6                                     
020301,000242: 
020302,000243: 16,2315           42321                           CS       BGIM23                                #  TURN TRIM GIMBAL OFF
020303,000244: 16,2316           00006                           EXTEND                                         
020304,000245: 16,2317           03012                           WAND     12                                    
020305,000246: 
020306,000247: 16,2320           12300                           TCF      SETTIME5                              
020307,000248: 
020308,000249: 16,2321           07400        BGIM23             OCTAL    07400                                 
020309,000250: 16,2322           26501        .707P              DEC      .70711                                #  SQUARE ROOT OF 1/2
020310,000251: 16,2323  E6,1416                                  EBANK=   OMEGAP                                
020311,000252: 16,2323           02346 34006  PAXADIDL           2CADR    PAXIS                                 
020312,000253: 
020313,000254: 16,2325  E6,1420                                  EBANK=   ALPHAQ                                
020314,000255: 16,2325           03631 34006  DF2CADR            2CADR    DUMMYFIL                              
020315,000256: 
020316,000257: 16,2327           37766        MS100              OCTAL    37766                                 
020317,000258: 16,2330           00033        0.00167            DEC      0.00167                               
020318,000259: 16,2331           23712        0.62170            DEC      0.62170                               
020319,000260: 16,2332           25705        .68387             DEC      0.68387                               
020320,000261: 16,2333           12000        0.31250            DEC      0.31250                               
020321,000262: 
020322,000263: 16,2334           02215        DELTADOT           DEC      0.07111                               #  0.2 DEG/SEC SCALED AT PI/64
020323,000264: 16,2335           23146        DGBF               DEC      0.6                                   
020324,000265: 16,2336           11643        .5ACCMIN           DEC      0.30680                               
020325,000266: 16,2337           00033        DBMNMP             DEC      0.00167                               #  .3 DEGREES SCALED AT PI RADIANS
020326,000267:                                                                                                  #  TORQUE AND WEIGHTING CONSTANTS:
020327,000268: 
020328,000269: 16,2340           00022        180MS              DEC      18         B-14                       #  180 MS WAITLIST DT.
020329,000270: 16,2341           02315        .075DEC            DEC      0.075                                 #  100 MS JET PULSE TORQUE TERM WITH K = .5
020330,000271: 16,2342           02454        VISNORMQ           GENADR   CHKVISFZ                              #  D.P. GENADR FOR INITIALIZATION OF THE
020331,000272: 16,2343           02077                           GENADR   NORMALQ                               #  TORQUE VECTOR RECONSTRUCTION SWITCHES.
020332,000273: 
020333,000274: 16,2344           24000        10AT16             DEC      0.625                                 #  INITIAL VALUE FOR WFORP.
020334,000275: 16,2345           15253        6.6AT16            DEC      0.41667                               #  INITIAL VALUE FOR WFORQR.
020335,000276: 16,2346  16,2344               WFORPQRK           EQUALS   10AT16                                #  D.P. NAME FOR BOTH CONSTANTS.

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