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.

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

Page 463

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

Page 464

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

Page 465

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

Page 466

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

Page 467

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