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.

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

Page 453

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

Page 454

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

Page 455

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

Page 456

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

Page 457

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

Page 458

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

Page 459

019909,000300:                                                                                                  #  ****************************************************************************************************************
019910,000301: 
019911,000302: 20,2162           00004        DESDCAP            INHINT                                         #  (MISSION ENTRY)
019912,000303: 
019913,000304: 20,2163           32167                           CAF      DBAUTO                                #  SINCE ENGINE IS ON:
019914,000305: 20,2164           55415                           TS       DB                                    #  SET DEADBAND TO 1.0 DEGREES
019915,000306: 
019916,000307: 20,2165           00003        ASCDAP1            RELINT                                         #  LET INTERRUPTS LOOSE.
019917,000308: 
019918,000309: 20,2166           00002                           TC       Q                                     #  RETURN.
019919,000310: 
019920,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