Source Code

These source code files are an attempted reconstruction of Sundance revision 306, the Apollo 9 LM (Lunar Module) AGC (Apollo Guidance Computer) flight software, created from binary dumps of original core rope program modules, as follows:
  • B1 — Revision 292
  • B2 — Revision 302
  • B3 — Revision 302
  • B4 — Revision 302
  • B5 — Revision 292
  • B6 — Revision 306
These dumps were then modified using memos, checklists, observed address changes, and the Sundance GSOPs to get the entire program to match Sundance revision 306 as closely as possible. Without more information, it is not possible to say how close it actually is; however, this code should be quite close. It is capable of flying the whole Apollo 9 mission using the original checklists and padload. Since only binary dumps (rather than listings) of Sundance are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

055642,000002:                                                                                                  ## Copyright:   Public domain.
055643,000003:                                                                                                  ## Filename:    DAP_INTERFACE_SUBROUTINES.agc
055644,000004:                                                                                                  ## Purpose:     A section of an attempt to reconstruct Sundance revision 306
055645,000005:                                                                                                  ##              as closely as possible with available information. Sundance
055646,000006:                                                                                                  ##              306 is the source code for the Lunar Module's (LM) Apollo
055647,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 9. This program was created
055648,000008:                                                                                                  ##              using the mixed-revision SundanceXXX as a starting point, and
055649,000009:                                                                                                  ##              pulling back features from Luminary 69 believed to have been
055650,000010:                                                                                                  ##              added based on memos, checklists, observed address changes,
055651,000011:                                                                                                  ##              or the Sundance GSOPs.
055652,000012:                                                                                                  ## Assembler:   yaYUL
055653,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
055654,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
055655,000015:                                                                                                  ## Mod history: 2020-07-24 MAS  Created from SundanceXXX.
055656,000016: 
055657,000017: 
055658,000018: 
055659,000019: 20,2204                                           BANK     20                                    
055660,000020: 20,2000                                           SETLOC   DAPS3                                 
055661,000021: 20,2000                                           BANK                                           
055662,000022: 
055663,000023: 20,2204  E6,1632                                  EBANK=   CDUXD                                 
055664,000024: 20,2204                                           COUNT*   $$/DAPIF                              
055665,000025: 
055666,000026:                                                                                                  #  MOD 0         DATE    11/15/66        BY GEORGE W. CHERRY
055667,000027:                                                                                                  #  MOD 1                  1/23/67        MODIFICATION BY PETER ADLER
055668,000028: 
055669,000029:                                                                                                  #  FUNCTIONAL DESCRIPTION
055670,000030:                                                                                                  #        HEREIN ARE A COLLECTION OF SUBROUTINES WHICH ALLOW MISSION CONTROL PROGRAMS TO CONTROL THE MODE
055671,000031:                                                                                                  #        AND INTERFACE WITH THE DAP.
055672,000032: 
055673,000033:                                                                                                  #  CALLING SEQUENCES
055674,000034:                                                                                                  #        IN INTERRUPT OR WITH INTERRUPT INHIBITED
055675,000035:                                                                                                  #                TC      IBNKCALL
055676,000036:                                                                                                  #                FCADR   ROUTINE
055677,000037:                                                                                                  #        IN A JOB WITHOUT INTERRUPT INHIBITED
055678,000038:                                                                                                  #                INHINT
055679,000039:                                                                                                  #                TC      IBNKCALL
055680,000040:                                                                                                  #                FCADR   ROUTINE
055681,000041:                                                                                                  #                RELINT
055682,000042: 
055683,000043:                                                                                                  #  OUTPUT
055684,000044:                                                                                                  #        SEE INDIVIDUAL ROUTINES BELOW
055685,000045: 
055686,000046:                                                                                                  #  DEBRIS
055687,000047:                                                                                                  #        A, L, AND SOMETIMES MDUETEMP                    ODE     NOT IN PULSES MODE
055688,000048: 
055689,000049:                                                                                                  #  SUBROUTINE NAMES:
055690,000050:                                                                                                  #        SETMAXDB, SETMINDB, RESTORDB, PFLITEDB
055691,000051:                                                                                                  #  MODIFIED:     30 JANUARY 1968 BY P S WEISSMAN TO CREATE RESTORDB.
055692,000052:                                                                                                  #  MODIFIED:     1 MARCH 1968 BY P S WEISSMAN TO SAVE EBANK AND CREATE PFLITEDB
055693,000053: 
055694,000054:                                                                                                  #  FUNCTIONAL DESCRIPTION:
055695,000055:                                                                                                  #        SETMAXDB - SET DEADBAND TO 5.0 DEGREES
055696,000056:                                                                                                  #        SETMINDB - SET DEADBAND TO 0.3 DEGREE
055697,000057:                                                                                                  #        RESTORDB - SET DEADBAND TO MAX OR MIN ACCORDING TO SETTING OF DBSELECT BIT OF DAPBOOLS
055698,000058:                                                                                                  #        PFLITEDB - SET DEADBAND TO 1.0 DEGREE AND ZERO THE COMMANDED ATTITUDE CHANGE AND COMMANDED RATE
055699,000059: 
055700,000060:                                                                                                  #        ALL ENTRIES SET UP A NOVAC JOB TO DO 1/ACCS SO THAT THE TJETLAW SWITCH CURVES ARE POSITIONED TO
055701,000061:                                                                                                  #        REFLECT THE NEW DEADBAND.  IT SHOULD BE NOTED THAT THE DEADBAND REFERS TO THE ATTITUDE IN THE P-, U-, AND V-AXES.
055702,000062: 
055703,000063:                                                                                                  #  SUBROUTINE CALLED:    NOVAC
055704,000064: 
055705,000065:                                                                                                  #  CALLING SEQUENCE:     SAME AS ABOVE
055706,000066:                                                                                                  #                        OR      TC RESTORDB +1    FROM ALLCOAST
055707,000067: 
055708,000068:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, (ITEMPS IN NOVAC)
055709,000069: 
055710,000070:                                                                                                  #  DAPBOOLS BITS AND NAMES
055711,000071: 
055712,000072: 20,2204     5026               AUTRATE1           EQUALS   BIT1                                  #  THESE FLAGS ARE USED TOGETHER TO INIDCAT
055713,000073: 20,2204     5025               AUTRATE2           EQUALS   BIT2                                  #  ASTRONAUT-CHOSEN KALCMANU MANEUVER RATES
055714,000074:                                                                                                  #  (0,0)=(BIT2,BIT1)= 0.2 DEG/SEC
055715,000075:                                                                                                  #  (0,1)=  0.5 DEG/SEC
055716,000076: 20,2204     5024               ACCSOKAY           EQUALS   BIT3                                  #  VALUES FROM 1/ACCS USABLE FLAG
055717,000077: 20,2204     5023               DBSELECT           EQUALS   BIT4                                  #  DAP DEADBAND SELECT FLAG
055718,000078: 20,2204     5022               AORBSYST           EQUALS   BIT5                                  #  P-AXIS ROTATION JET SYSTEM (A OR B) FLAG
055719,000079: 20,2204     5021               ULLAGER            EQUALS   BIT6                                  #  INTERNAL ULLAGE REQUEST FLAG
055720,000080: 20,2204     5020               RHCSCALE           EQUALS   BIT7                                  #  RHC SCALE SELECT FLAG
055721,000081: 20,2204     5017               DRIFTBIT           EQUALS   BIT8                                  #  USE OFFSET ACCELERATION FLAG
055722,000082: 20,2204     5016               XOVINHIB           EQUALS   BIT9                                  #  X-AXIS OVERRIDE PERMITTED FLAG
055723,000083: 20,2204     5015               AORBTRAN           EQUALS   BIT10                                 #  X-TRANSLATION JET SYSTEM (A OR B) FLAG
055724,000084: 20,2204     5014               ACC4OR2X           EQUALS   BIT11                                 #  2 OR 4 JET Z-TRANSLATION MODE FLAG
055725,000085: 20,2204     5013               OURRCBIT           EQUALS   BIT12                                 #  INTERNAL DAP RATE COMMAND ACTIVITY FLAG
055726,000086: 20,2204     5012               CSMDOCKD           EQUALS   BIT13                                 #  CSM DOCKED TO LM FLAG
055727,000087: 20,2204     5011               USEQRJTS           EQUALS   BIT14                                 #  TRIM GIMBAL FLAG
055728,000088: 20,2204     5010               PULSES             EQUALS   BIT15                                 #  MINIMUM IMPULSE RHC MODE FLAG
055729,000089: 
055730,000090: 
055731,000091: 20,2204           31102        RESTORDB           CAE      DAPBOOLS                              #  DETERMINE CREW-SELECTED DEADBAND.
055732,000092: 20,2205           75023                           MASK     DBSELECT                              
055733,000093: 20,2206           00006                           EXTEND                                         
055734,000094: 20,2207           12221                           BZF      SETMINDB                              
055735,000095: 
055736,000096: 20,2210           35751        SETMAXDB           CAF      WIDEDB                                #  SET 5 DEGREE DEADBAND.
055737,000097: 20,2211           55356                 +1        TS       DB                                    
055738,000098: 
055739,000099: 20,2212           00006                           EXTEND                                         #  SET UP JOB TO RE-POSITION SWITCH CURVES.
055740,000100: 20,2213           22070                           QXCH     RUPTREG1                              
055741,000101: 20,2214           37667        CALLACCS           CAF      PRIO27                                
055742,000102: 20,2215           05142                           TC       NOVAC                                 
055743,000103: 20,2216  E6,1532                                  EBANK=   AOSQ                                  
055744,000104: 20,2216           02312 40106                     2CADR    1/ACCJOB                              
055745,000105: 
055746,000106: 20,2220           00070                           TC       RUPTREG1                              #  RETURN TO CALLER.
055747,000107: 
055748,000108: 20,2221           35750        SETMINDB           CAF      NARROWDB                              #  SET 0.3 DEGREE DEADBAND.
055749,000109: 20,2222           12211                           TCF      SETMAXDB   +1                         
055750,000110: 
055751,000111: 20,2223           00006        PFLITEDB           EXTEND                                         #  THE RETURN FROM CALLACCS IS TO RUPTREG1.
055752,000112: 20,2224           22070                           QXCH     RUPTREG1                              
055753,000113: 20,2225           02232                           TC       ZATTEROR                              #  ZERO THE ERRORS AND COMMANDED RATES.
055754,000114: 20,2226           32231                           CAF      POWERDB                               #  SET DB TO 1.0 DEG.
055755,000115: 20,2227           55356                           TS       DB                                    
055756,000116: 20,2230           12214                           TCF      CALLACCS                              #  SET UP 1/ACCS AND RETURN TO CALLER.
055757,000117: 
055758,000118: 20,2231           00554        POWERDB            DEC      .02222                                #  1.0 DEGREE SCALED AT 45.
055759,000119: 
055760,000120: 20,2232           35065        ZATTEROR           CAF      EBANK6                                
055761,000121: 20,2233           56003                           XCH      EBANK                                 
055762,000122: 20,2234           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
055763,000123: 20,2235           30032                           CAE      CDUX                                  
055764,000124: 20,2236           55632                           TS       CDUXD                                 
055765,000125: 20,2237           30033                           CAE      CDUY                                  
055766,000126: 20,2240           55633                           TS       CDUYD                                 
055767,000127: 20,2241           30034                           CAE      CDUZ                                  
055768,000128: 20,2242           55634                           TS       CDUZD                                 
055769,000129: 20,2243           12247                           TCF      STOPRATE   +3                         
055770,000130: 
055771,000131: 20,2244           35065        STOPRATE           CAF      EBANK6                                
055772,000132: 20,2245           56003                           XCH      EBANK                                 
055773,000133: 20,2246           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
055774,000134: 20,2247           35030                 +3        CAF      ZERO                                  
055775,000135: 20,2250           55640                           TS       OMEGAPD                               
055776,000136: 20,2251           55641                           TS       OMEGAQD                               
055777,000137: 20,2252           55642                           TS       OMEGARD                               
055778,000138: 20,2253           55635                           TS       DELCDUX                               
055779,000139: 20,2254           55636                           TS       DELCDUY                               
055780,000140: 20,2255           55637                           TS       DELCDUZ                               
055781,000141: 20,2256           55301                           TS       DELPEROR                              
055782,000142: 20,2257           55302                           TS       DELQEROR                              
055783,000143: 20,2260           55303                           TS       DELREROR                              
055784,000144: 20,2261           22003                           LXCH     EBANK                                 #  RESTORE CALLERS EBANK.
055785,000145: 20,2262           00002                           TC       Q                                     
055786,000146: 
055787,000147:                                                                                                  #  SUBROUTINE NAME:      ALLCOAST
055788,000148:                                                                                                  #  WILL BE CALLED BY FRESH STARTS AND ENGINE OFF ROUTINES.               .
055789,000149: 
055790,000150:                                                                                                  #  CALLING SEQUENCE:     (SAME AS ABOVE)
055791,000151: 
055792,000152:                                                                                                  #  EXIT:                 RETURN TO Q.
055793,000153: 
055794,000154:                                                                                                  #  SUBROUTINES CALLED:   STOPRATE, RESTORDB, NOVAC
055795,000155: 
055796,000156:                                                                                                  #  ZERO:                 (FOR ALL AXES) AOS, ALPHA, AOSTERM, OMEGAD, DELCDU, DELEROR
055797,000157: 
055798,000158:                                                                                                  #  OUTPUT:               DRIFTBIT/DAPBOOLS, DB, JOB TO DO 1/ACCS
055799,000159: 
055800,000160:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, RUPTREG2, (ITEMPS IN NOVAC)
055801,000161: 
055802,000162: 20,2263           35065        ALLCOAST           CAF      EBANK6                                
055803,000163: 20,2264           56003                           XCH      EBANK                                 
055804,000164: 20,2265           54066                           TS       ITEMP6                                
055805,000165: 20,2266           45030                           CS       ZERO                                  
055806,000166: 20,2267           55532                           TS       AOSQ                                  
055807,000167: 20,2270           55533                           TS       AOSQ       +1                         
055808,000168: 20,2271           55534                           TS       AOSR                                  
055809,000169: 20,2272           55535                           TS       AOSR       +1                         
055810,000170: 20,2273           55422                           TS       ALPHAQ                                #  FOR DOWNLIST.
055811,000171: 20,2274           55423                           TS       ALPHAR                                
055812,000172: 20,2275           55540                           TS       AOSQTERM                              
055813,000173: 20,2276           55541                           TS       AOSRTERM                              
055814,000174: 20,2277           30066                           CA       ITEMP6                                
055815,000175: 20,2300           54003                           TS       EBANK                                 #  RESTORE EBANK (EBANK6 NO LONGER NEEDED)
055816,000176: 
055817,000177: 20,2301           41102                           CS       DAPBOOLS                              #  SET UP DRIFTBIT
055818,000178: 20,2302           75017                           MASK     DRIFTBIT                              
055819,000179: 20,2303           27102                           ADS      DAPBOOLS                              
055820,000180: 20,2304           12205                           TCF      RESTORDB   +1                         #  RESTORE DEADBANK TO CREW-SELECTED VALUE.
055821,000181: 

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