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.

019604,000002:                                                                                                  ## Copyright:   Public domain.
019605,000003:                                                                                                  ## Filename:    DAP_INTERFACE_SUBROUTINES.agc
019606,000004:                                                                                                  ## Purpose:     A section of Sunburst revision 37, or Shepatin revision 0.
019607,000005:                                                                                                  ##              It is part of an early development version of the software
019608,000006:                                                                                                  ##              for Apollo Guidance Computer (AGC) on the unmanned Lunar
019609,000007:                                                                                                  ##              Module (LM) flight Apollo 5. Sunburst 37 was the program
019610,000008:                                                                                                  ##              upon which Don Eyles's offline development program Shepatin
019611,000009:                                                                                                  ##              was based; the listing herein transcribed was actually for
019612,000010:                                                                                                  ##              the equivalent revision 0 of Shepatin.
019613,000011:                                                                                                  ##              This file is intended to be a faithful transcription, except
019614,000012:                                                                                                  ##              that the code format has been changed to conform to the
019615,000013:                                                                                                  ##              requirements of the yaYUL assembler rather than the
019616,000014:                                                                                                  ##              original YUL assembler.
019617,000015:                                                                                                  ## Reference:   pp. 453-459
019618,000016:                                                                                                  ## Assembler:   yaYUL
019619,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
019620,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
019621,000019:                                                                                                  ## Mod history: 2017-05-24 MAS  Created from Sunburst 120.
019622,000020:                                                                                                  ##              2017-05-30 HG   Transcribed
019623,000021:                                                                                                  ##              2017-06-15 HG   Fix operand XCH  -> TS
019624,000022:                                                                                                  ##              2017-06-22 RSB  Proofed comment text with
019625,000023:                                                                                                  ##                              octopus/ProoferComments.
019626,000024: 

Page 453

019628,000026: 16,2000                                           BANK     16                                    
019629,000027: 16,2000  E6,1541                                  EBANK=   DT                                    
019630,000028:                                                                                                  #  MOD 0         DATE    11/15/66        BY GEORGE W. CHERRY
019631,000029: 
019632,000030:                                                                                                  #  FUNCTIONAL DESCRIPTION
019633,000031: 
019634,000032:                                                                                                  #           HEREIN ARE A COLLECTION OF SUBROUTINES WHICH ALLOW MISSION CONTROL PROGRAMS TO CONTROL THE MODE
019635,000033:                                                                                                  #           AND INTERFACE WITH THE DAP.
019636,000034: 
019637,000035:                                                                                                  #  CALLING SEQUENCES
019638,000036: 
019639,000037:                                                                                                  #  IN INTERRUPT OR WITH INTERRUPT INHIBITED
019640,000038:                                                                                                  #           TC     IBNKCALL
019641,000039:                                                                                                  #           FCADR  ROUTINE
019642,000040: 
019643,000041:                                                                                                  #  IN A JOB WITHOUT INTERRUPT INHIBITED
019644,000042:                                                                                                  #           INHINT
019645,000043:                                                                                                  #           TC     IBNKCALL
019646,000044:                                                                                                  #           FCADR  ROUTINE
019647,000045:                                                                                                  #           RELINT
019648,000046: 
019649,000047:                                                                                                  #  OUTPUT
019650,000048:                                                                                                  #           SEE INDIVIDUAL ROUTINES BELOW
019651,000049: 
019652,000050:                                                                                                  #  DEBRIS
019653,000051: 
019654,000052:                                                                                                  #           A,L, AND SOMETIMES MDUETEMP
019655,000053: 

Page 454

019657,000055:                                                                                                  #  DAPBOOLS BITS AND NAMES
019658,000056: 
019659,000057: 16,2000     7755               OURRCBIT           EQUALS   BIT1                                  #  INTERNAL DAP RATE COMMAND ACTIVITY FLAG
019660,000058: 16,2000     7754               TRYGIMBL           EQUALS   BIT2                                  #  DESCENT TRIM GIMBAL CONTROL SYSTEM FLAG
019661,000059: 
019662,000060:                                                                                                  #  STILL AVAILABLE BIT3
019663,000061: 
019664,000062: 16,2000     7752               ACC4OR2X           EQUALS   BIT4                                  #  2 OR 4 JET X-TRANSLATION MODE FLAG
019665,000063: 16,2000     7751               AORBSYST           EQUALS   BIT5                                  #  P-AXIS ROTATION JET SYSTEM (A OR B) FLAG
019666,000064: 16,2000     7750               ULLAGER            EQUALS   BIT6                                  #  INTERNAL ULLAGE REQUEST FLAG
019667,000065: 16,2000     7747               DBSELECT           EQUALS   BIT7                                  #  DAP DEADBAND SELECT FLAG
019668,000066: 16,2000     7746               APSGOING           EQUALS   BIT8                                  #  ASCENT PROPULSION SYSTEM BURN FLAG
019669,000067: 16,2000     7745               VIZPHASE           EQUALS   BIT9                                  #  DESCENT VISIBILITY PHASE FLAG
019670,000068: 16,2000     7744               PULSES             EQUALS   BIT10                                 #  MINIMUM IMPULSE RHC MODE FLAG
019671,000069: 
019672,000070: 16,2000     7743               GODAPGO            EQUALS   BIT11                                 #  DAP ENABLING FLAG
019673,000071: 
019674,000072:                                                                                                  #  STILL AVAILABLE BIT12
019675,000073: 
019676,000074:                                                                                                  #  STILL AVAILABLE BIT13
019677,000075: 
019678,000076: 16,2000     7740               AUTORHLD           EQUALS   BIT14                                 #  AUTOMATIC MODE RATE HOLD FLAG
019679,000077: 16,2000     7737               SPSBACUP           EQUALS   BIT15                                 #  SPS BACKUP DAP FLAG
019680,000078: 
019681,000079: 
019682,000080: 
019683,000081: 16,2000           35650        SETMINDB           CAF      EBANK6                                
019684,000082: 16,2001           54001                           TS       L                                     
019685,000083: 16,2002           22003                           LXCH     EBANK                                 
019686,000084: 16,2003           32075                           CAF      NARROWDB                              
019687,000085: 16,2004           55415                           TS       DB                                    
019688,000086: 16,2005           47747                           CS       DBSELECT                              
019689,000087: 16,2006           70077                           MASK     DAPBOOLS                              
019690,000088: 16,2007           54077                           TS       DAPBOOLS                              
019691,000089: 16,2010           22003                           LXCH     EBANK                                 
019692,000090: 16,2011           00002                           TC       Q                                     
019693,000091: 
019694,000092: 16,2012           35650        SETMAXDB           CAF      EBANK6                                
019695,000093: 
019696,000094: 16,2013           54001                           TS       L                                     
019697,000095: 16,2014           22003                           LXCH     EBANK                                 
019698,000096: 16,2015           32076                           CAF      WIDEDB                                
019699,000097: 16,2016           55415                           TS       DB                                    
019700,000098: 16,2017           40077                           CS       DAPBOOLS                              
019701,000099: 16,2020           77747                           MASK     DBSELECT                              
019702,000100: 16,2021           26077                           ADS      DAPBOOLS                              
019703,000101: 16,2022           22003                           LXCH     EBANK                                 
019704,000102: 16,2023           00002                           TC       Q                                     
019705,000103: 
019706,000104: 16,2024           40077        ULLAGE             CS       DAPBOOLS                              
019707,000105: 16,2025           77750                           MASK     ULLAGER                               
019708,000106: 16,2026           26077                           ADS      DAPBOOLS                              
019709,000107: 

Page 455

019711,000109: 16,2027           00002                           TC       Q                                     
019712,000110: 
019713,000111: 16,2030           47750        NOULLAGE           CS       ULLAGER                               
019714,000112: 16,2031           70077                           MASK     DAPBOOLS                              
019715,000113: 16,2032           54077                           TS       DAPBOOLS                              
019716,000114: 16,2033           00002                           TC       Q                                     
019717,000115: 
019718,000116: 16,2034           35650        HOLDRATE           CAF      EBANK6                                
019719,000117: 16,2035           56003                           XCH      EBANK                                 
019720,000118: 16,2036           55207                           TS       MDUETEMP                              
019721,000119: 16,2037           40077                           CS       DAPBOOLS                              
019722,000120: 16,2040           77740                           MASK     AUTORHLD                              
019723,000121: 16,2041           26077                           ADS      DAPBOOLS                              
019724,000122: 
019725,000123: 16,2042           00006                           EXTEND                                         
019726,000124: 16,2043           31417                           DCA      OMEGAP                                
019727,000125: 16,2044           52775                           DXCH     OMEGAPD                               
019728,000126: 16,2045           31421                           CAE      OMEGAR                                
019729,000127: 16,2046           54776                           TS       OMEGARD                               
019730,000128: 
019731,000129: 16,2047           00006        COMNEXIT           EXTEND                                         
019732,000130: 16,2050           30034                           DCA      CDUY                                  
019733,000131: 16,2051           52770                           DXCH     CDUYD                                 
019734,000132: 16,2052           30032                           CAE      CDUX                                  
019735,000133: 16,2053           54766                           TS       CDUXD                                 
019736,000134: 
019737,000135: 16,2054           31207                           CAE      MDUETEMP                              
019738,000136: 16,2055           54003                           TS       EBANK                                 
019739,000137: 16,2056           00002                           TC       Q                                     
019740,000138: 
019741,000139: 16,2057           35650        STOPRATE           CAF      EBANK6                                
019742,000140: 16,2060           56003                           XCH      EBANK                                 
019743,000141: 16,2061           55207                           TS       MDUETEMP                              
019744,000142: 16,2062           47740                           CS       AUTORHLD                              
019745,000143: 16,2063           70077                           MASK     DAPBOOLS                              
019746,000144: 16,2064           54077                           TS       DAPBOOLS                              
019747,000145: 
019748,000146: 16,2065           37761                           CAF      ZERO                                  
019749,000147: 16,2066           54774                           TS       OMEGAPD                               
019750,000148: 16,2067           54775                           TS       OMEGAQD                               
019751,000149: 16,2070           54776                           TS       OMEGARD                               
019752,000150: 16,2071           54771                           TS       DELCDUX                               
019753,000151: 16,2072           54772                           TS       DELCDUY                               
019754,000152: 
019755,000153: 16,2073           54773                           TS       DELCDUZ                               
019756,000154: 16,2074           12047                           TCF      COMNEXIT                              
019757,000155: 
019758,000156: 16,2075  16,2034               SETRATE            EQUALS   HOLDRATE                              
019759,000157: 16,2075           00033        NARROWDB           DEC      0.00167                               #  0.3 DEGREES SCALED AT PI RADIANS
019760,000158: 16,2076           00707        WIDEDB             DEC      0.02778                               #  5.0 DEGREES SCALED AT PI RADIANS
019761,000159: 

Page 456

019763,000161:                                                                                                  #  SUBROUTINE NAME: 1. UPCOAST     MOD. NO. 1  DATE: DECEMBER 4, 1966
019764,000162:                                                                                                  #                   2. ALLCOAST
019765,000163: 
019766,000164:                                                                                                  #                   3. WCHANGE
019767,000165: 
019768,000166:                                                                                                  #  AUTHOR: JONATHAN D. ADDELSTON (ADAMS ASSOCIATES)
019769,000167: 
019770,000168:                                                                                                  #  "UPCOAST" SETS UP DAP VARIABLES TO THEIR ASCENT-COAST VALUES.
019771,000169: 
019772,000170:                                                                                                  #  GROUNDRULE: IT MUST BE CALLED AS SOON AS ASCENT COAST IS DETECTED.
019773,000171: 
019774,000172:                                                                                                  #  "ALLCOAST" SETS UP MANY DAP VARIABLES FOR "STARTDAP" IN "DAPIDLER".
019775,000173: 
019776,000174:                                                                                                  #  GROUNDRULE: DESCOAST IS CALLED AS SOON AS DESCENT COAST IS DETECTED.
019777,000175: 
019778,000176:                                                                                                  #  "WCHANGE" SETS UP THE VARIABLE FOR "WCHANGER" AS A STORAGE SAVING DEVICE.
019779,000177: 
019780,000178:                                                                                                  #  CALLING SEQUENCE: (SAME AS ABOVE.)
019781,000179: 
019782,000180:                                                                                                  #  SUBROUTINES CALLED: NONE.
019783,000181: 
019784,000182:                                                                                                  #  ZERO: AOSQ,AOSR,AOSU,AOSV,AOSQTERM,AOSRTERM,ALL NUS.
019785,000183: 
019786,000184:                                                                                                  #  SET URGRATQ AND URGRATR TO POSMAX.
019787,000185: 
019788,000186:                                                                                                  #  OUTPUT: WFORP   (1-K)    MINIMPDB  APSGOING/DAPBOOLS
019789,000187: 
019790,000188:                                                                                                  #          WFORQR  (1-K)/8  DBMINIMP
019791,000189: 
019792,000190:                                                                                                  #  DEBRIS: A,L.
019793,000191: 
019794,000192:                                                                                                  #  ***** WARNING. *****  EBANK MUST BE SET TO 6.
019795,000193: 
019796,000194: 20,2056                                           BANK     20                                    
019797,000195: 20,2056  E6,1634                                  EBANK=   WFORP                                 
019798,000196: 
019799,000197: 20,2056           00004        DESCOAST           INHINT                                         #  (MISSION ENTRY)
019800,000198: 
019801,000199: 20,2057           47754        ALLCOAST           CS       TRYGIMBL                              #  SINCE THE DESCENT ENGINE IS OFF, LM DAP
019802,000200: 20,2060           70077                           MASK     DAPBOOLS                              #  USE OF TRIM GIMBAL CONTROL SYSTEM IS
019803,000201: 20,2061           67754                           AD       TRYGIMBL                              #  CLEARLY IMPOSSIBLE.
019804,000202: 20,2062           54077                           TS       DAPBOOLS                              
019805,000203: 
019806,000204: 20,2063           32116                           CAF      0.3DEGDB                              #  SET BOTH MINIMUM IMPULSE DEADBANDS TO
019807,000205: 20,2064           12072                           TCF      MINIMSTO                              #  0.3 DEGREES SCALED AT PI RADIANS.
019808,000206: 
019809,000207: 20,2065           00004        UPCOAST            INHINT                                         #  STOP INTERRUPTS FROM WREAKING HAVOC.
019810,000208: 
019811,000209: 20,2066           47746                           CS       APSGOING                              #  TURN OFF APS BURN BIT IN DAPBOOLS SINCE
019812,000210: 20,2067           70077                           MASK     DAPBOOLS                              #  LEM IS STAGED FOR ASCENT, BUT THE ASCENT
019813,000211: 
019814,000212: 20,2070           54077                           TS       DAPBOOLS                              #  ENGINE IS NOT ON.
019815,000213: 

Page 457

019817,000215: 20,2071           33304                           CAF      0.00444                               #  IN ASCENT COAST, SET BOTH MINIMUM
019818,000216: 20,2072           55626        MINIMSTO           TS       MINIMPDB                              #  IMPULSE DEADBANDS TO 0.08 DEGREES
019819,000217: 20,2073           55625                           TS       DBMINIMP                              #  SCALED AT PI RADIANS.
019820,000218: 
019821,000219: 20,2074           37735                           CAF      POSMAX                                #  SET URGENCY FUNCTION CORRECTION RATIOS
019822,000220: 20,2075           55717                           TS       URGRATQ                               #  TO ALMOST 1 BEFORE BEING SET IN AOSJOB.
019823,000221: 20,2076           55720                           TS       URGRATR                               #  SCALED AT 1.
019824,000222: 
019825,000223: 20,2077           32117                           CAF      13DEC                                 #  ZERO THE FOLLOWING DAP ERASABLES:
019826,000224: 20,2100           55644        CLEARASC           TS       KCOEFCTR                              #  AOSQ  AOSQTERM  NJ+Q  NJ+U
019827,000225: 20,2101           37761                           CAF      ZERO                                  #  AOSR  AOSRTERM  NJ-Q  NJ-U
019828,000226: 20,2102           51644                           INDEX    KCOEFCTR                              #  AOSU            NJ+R  NJ+V
019829,000227: 20,2103           55652                           TS       AOSQ                                  #  AOSV            NJ-R  NJ-V
019830,000228: 20,2104           11644                           CCS      KCOEFCTR                              
019831,000229: 20,2105           12100                           TCF      CLEARASC                              
019832,000230: 
019833,000231: 20,2106           33307        WCHANGE            CAF      0.3125                                #  K = 0.5
019834,000232: 20,2107           55634                           TS       WFORP                                 #  WFORP = WFORQR = K/DT = K/.1 = 10K = 5
019835,000233: 20,2110           55635                           TS       WFORQR                                #  SCALED AT 16 PER SECOND.
019836,000234: 
019837,000235: 20,2111           00006                           EXTEND                                         #  K = 0.5 IMPLIES (1-K) = 0.5:
019838,000236: 20,2112           33320                           DCA      (1-K)S                                #  (1-K)   = 0.5    SINCE SCALED AT 1.
019839,000237: 20,2113           53637                           DXCH     (1-K)                                 #  (1-K)/8 = 0.0625 SINCE SCALED AT 8.
019840,000238: 
019841,000239:                                                                                                  #  *** NOTE THAT STARTDAP RESETS WFORP,WFORQR,(1-K),(1-K)/8. ***
019842,000240: 
019843,000241: 20,2114           00003                           RELINT                                         #  LET INTERRUPTS LOOSE.
019844,000242: 
019845,000243: 20,2115           00002                           TC       Q                                     #  RETURN
019846,000244: 
019847,000245: 
019848,000246: 
019849,000247: 20,2116           00033        0.3DEGDB           DEC      0.00167                               
019850,000248: 20,2117           00015        13DEC              DEC      13         B-14                       
019851,000249: 

Page 458

019853,000251: 20,2120           00004        ASCDAP             INHINT                                         #  (MISSION ENTRY)
019854,000252: 
019855,000253: 20,2121           37746                           CAF      APSGOING                              #  CHECK AOSTASK BIT OF DAPBOOLS
019856,000254: 20,2122           70077                           MASK     DAPBOOLS                              #  IF 0, SET BIT AND INITIATE WAITLIST TASK
019857,000255: 20,2123           10000                           CCS      A                                     #  IF 1, THEN TASK LOOP ALREADY BEGUN
019858,000256: 20,2124           12165                           TCF      ASCDAP1                               #  END OF ASCENT DAP
019859,000257: 20,2125           37746                           CAF      APSGOING                              #  SET BIT TO INDICATE AOSTASK SET UP AND
019860,000258: 20,2126           26077                           ADS      DAPBOOLS                              #  ASCENT LOGIC.  BIT CLEARLY NOT SET YET.
019861,000259: 
019862,000260: 20,2127           41415                           CS       DB                                    #  MODIFY THE TJETLAW FOR ASCENT:
019863,000261: 20,2130           55626                           TS       MINIMPDB                              #  (IN ONE EQUATION DELETE MINIMPDB AND
019864,000262: 20,2131           37761                           CAF      ZERO                                  #  SHIFT THE SWITCHING CURVE TO THE ORIGIN)
019865,000263: 20,2132           55625                           TS       DBMINIMP                              #  MINIMPDB = -DB, DBMINIMP = 0
019866,000264: 
019867,000265: 20,2133           55621                           TS       SUMRATEQ                              #  INITIALIZES SUMS OF JET RATES.
019868,000266: 20,2134           55622                           TS       SUMRATER                              
019869,000267: 20,2135           55644                           TS       KCOEFCTR                              #  INITIALIZE APS BURN TIMER.
019870,000268: 
019871,000269: 20,2136           31417                           CAE      OMEGAQ                                #  CREATE OLD OMEGAQ
019872,000270: 20,2137           55623                           TS       OLDWFORQ                              
019873,000271: 20,2140           31421                           CAE      OMEGAR                                #  CREATE OLD OMEGAR
019874,000272: 20,2141           55624                           TS       OLDWFORR                              
019875,000273: 
019876,000274:                                                                                                  #  ***** EVENTUALLY, USE 2SECWLT4 FROMM FIXED-FIXED AND NEW NAME. *****
019877,000275: 
019878,000276: 20,2142           33316                           CAF      2SECSDAP                              #  SET UP AOSTASK TO BEGIN IN 2 SECONDS
019879,000277: 20,2143           05701                           TC       WAITLIST                              #  IT THEN SETS UP A LOOP ON WAITLIST FOR
019880,000278: 20,2144  E6,1652                                  EBANK=   AOSQ                                  
019881,000279: 20,2144           03112 40006                     2CADR    AOSTASK                               #  2 SECOND INTERVALS AND CHECKS FOR THE
019882,000280:                                                                                                  #  REF   1              20,2145   40006 0                                  SHUTDOWN CONDITION IN BIT8 OF DAPBOOLS     
019883,000281:                                                                                                  #  ****************************************************************************************************************
019884,000282: 
019885,000283:                                                                                                  #  REMOVE THIS AND THE TASKS WHEN THE INERTIA ESTIMATOR WORKS.
019886,000284: 
019887,000285: 20,2146           37755                           CAF      ONE                                   #  *** SPECIAL DAP CHECKOUT SEQUENCE ***
019888,000286: 20,2147           05701                           TC       WAITLIST                              #  THESE THREE CALLS TO WAITLIST BEGIN A
019889,000287: 20,2150  E6,1452                                  EBANK=   IXX                                   
019890,000288: 
019891,000289: 20,2150           02441 54006                     2CADR    IXXTASK                               #  COMPLICATED PROCEDURE TO DECREMENT THE
019892,000290: 20,2152           37755                           CAF      ONE                                   #  INERTIA MATRIX DIAGONAL ELEMENTS (EACH
019893,000291: 20,2153           05701                           TC       WAITLIST                              #  SCALED AT 2(+18) SLUG FEET(2) ) BY ONE
019894,000292: 20,2154  E6,1453                                  EBANK=   IYY                                   
019895,000293: 20,2154           02452 54006                     2CADR    IYYTASK                               #  BIT AS SOON AS APPROPRIATE BY A NOMINAL
019896,000294: 20,2156           37755                           CAF      ONE                                   #  LINEAR APPROXIMATION TO INERTIAL CHANGE.
019897,000295: 20,2157           05701                           TC       WAITLIST                              
019898,000296: 20,2160  E6,1454                                  EBANK=   IZZ                                   
019899,000297: 20,2160           02463 54006                     2CADR    IZZTASK                               #  *** NOT TO BE USED IN MISSIONS ***
019900,000298: 

Page 459

019902,000300:                                                                                                  #  ****************************************************************************************************************
019903,000301: 
019904,000302: 20,2162           00004        DESDCAP            INHINT                                         #  (MISSION ENTRY)
019905,000303: 
019906,000304: 20,2163           32167                           CAF      DBAUTO                                #  SINCE ENGINE IS ON:
019907,000305: 20,2164           55415                           TS       DB                                    #  SET DEADBAND TO 1.0 DEGREES
019908,000306: 
019909,000307: 20,2165           00003        ASCDAP1            RELINT                                         #  LET INTERRUPTS LOOSE.
019910,000308: 
019911,000309: 20,2166           00002                           TC       Q                                     #  RETURN.
019912,000310: 
019913,000311: 20,2167           00133        DBAUTO             DEC      0.00556                               #  1 DEGREE DEADBAND SCALED AT PI RADIANS

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