Source Code

These source-code files are part of a reconstructed copy of Luminary 163, the first (unflown) release of the Apollo 14 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with reconstructed source code for Luminary 173. Changes between revision 163 and 173 were backed out, as described by Luminary memos 157 and 158. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 163 listing would be different.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

059648,000002:                                                                                                  ## Copyright:   Public domain.
059649,000003:                                                                                                  ## Filename:    DAP_INTERFACE_SUBROUTINES.agc
059650,000004:                                                                                                  ## Purpose:     A section of Luminary revision 163.
059651,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
059652,000006:                                                                                                  ##              (unflown) release of the flight software for the Lunar
059653,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
059654,000008:                                                                                                  ##              The code has been recreated from a reconstructed copy of
059655,000009:                                                                                                  ##              Luminary 173, as well as Luminary memos 157 amd 158.
059656,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
059657,000011:                                                                                                  ##              exactly match those specified for Luminary 163 in NASA
059658,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
059659,000013:                                                                                                  ##              that the reconstruction is correct.
059660,000014:                                                                                                  ## Reference:   pp. 1394-1397
059661,000015:                                                                                                  ## Assembler:   yaYUL
059662,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
059663,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
059664,000018:                                                                                                  ## Mod history: 2019-08-21 MAS  Created from Luminary 173.
059665,000019: 

Page 1394

059667,000021: 20,2115                                           BANK     20                                    
059668,000022: 20,2000                                           SETLOC   DAPS3                                 
059669,000023: 20,2000                                           BANK                                           
059670,000024: 
059671,000025: 20,2115  E6,1634                                  EBANK=   CDUXD                                 
059672,000026: 20,2115                                           COUNT*   $$/DAPIF                              
059673,000027: 
059674,000028:                                                                                                  #  MOD 0              DATE  11/15/66          BY  GEORGE W. CHERRY
059675,000029: 
059676,000030:                                                                                                  #  MOD 1                     1/23/67          MODIFICATION BY PETER ADLER
059677,000031: 
059678,000032:                                                                                                  #  FUNCTIONAL DESCRIPTION
059679,000033: 
059680,000034:                                                                                                  #           HEREIN ARE A COLLECTION OF SUBROUTINES WHICH ALLOW MISSION CONTROL PROGRAMS TO CONTROL THE MODE
059681,000035:                                                                                                  #           AND INTERFACE WITH THE DAP.
059682,000036: 
059683,000037:                                                                                                  #  CALLING SEQUENCES
059684,000038: 
059685,000039:                                                                                                  #  IN INTERRUPT OR WITH INTERRUPT INHIBITED
059686,000040:                                                                                                  #           TC     IBNKCALL
059687,000041:                                                                                                  #           FCADR  ROUTINE
059688,000042: 
059689,000043:                                                                                                  #  IN A JOB WITHOUT INTERRUPT INHIBITED
059690,000044:                                                                                                  #           INHINT
059691,000045:                                                                                                  #           TC     IBNKCALL
059692,000046:                                                                                                  #           FCADR  ROUTINE
059693,000047:                                                                                                  #           RELINT
059694,000048: 
059695,000049:                                                                                                  #  OUTPUT
059696,000050: 
059697,000051:                                                                                                  #           SEE INDIVIDUAL ROUTINES BELOW
059698,000052: 
059699,000053:                                                                                                  #  DEBRIS
059700,000054: 
059701,000055:                                                                                                  #           A,L, AND SOMETIMES MDUETEMP                                    ODE      NOT IN PULSES MODE
059702,000056: 

Page 1395

059704,000058:                                                                                                  #  SUBROUTINE NAMES:
059705,000059:                                                                                                  #           SETMAXDB, SETMINDB, RESTORDB, PFLITEDB
059706,000060: 
059707,000061:                                                                                                  #  MODIFIED: 30 JANUARY 1968 BY P S WEISSMAN TO CREATE RESTORDB.
059708,000062: 
059709,000063:                                                                                                  #  MODIFIED: 1 MARCH 1968 BY P S WEISSMAN TO SAVE EBANK AND CREATE PFLITEDB
059710,000064: 
059711,000065:                                                                                                  #  FUNCTIONAL DESCRIPTION:
059712,000066:                                                                                                  #           SETMAXDB - SET DEADBAND TO 5.0 DEGREES
059713,000067:                                                                                                  #           SETMINDB - SET DEADBAND TO 0.3 DEGREE
059714,000068:                                                                                                  #           RESTORDB - SET DEADBAND TO .3,1, OR 5 ACCORDING TO BITS 4 AND 5 OF DAPBOOLS
059715,000069:                                                                                                  #           PFLITEDB - SET DEADBAND TO 1.0 DEGREE AND ZERO THE COMMANDED ATTITUDE CHANGE AND COMMANDED RATE
059716,000070:                                                                                                  #           ALL ENTRIES SET UP A NOVAC JOB TO DO 1/ACCS SO THAT THE TJETLAW SWITCH CURVES ARE POSITIONED TO
059717,000071:                                                                                                  #  REFLECT THE NEW DEADBAND.  IT SHOULD BE NOTED THAT THE DEADBAND REFERS TO THE ATTITUDE IN THE P-,U-,AND V-AXES.
059718,000072: 
059719,000073:                                                                                                  #  SUBROUTINE CALLED:  NOVAC
059720,000074: 
059721,000075:                                                                                                  #  CALLING SEQUENCE: SAME AS ABOVE
059722,000076:                                                                                                  #                                          OR       TC     RESTORDB +1     FROM ALLCOAST
059723,000077:                                                                                                  #  DEBRIS:  A, L, Q, RUPTREG1, (ITEMPS IN NOVAC)
059724,000078: 
059725,000079: 20,2115           30111        RESTORDB           CAE      DAPBOOLS                              #  DETERMINE CREW-SELECTED DEADBAND.
059726,000080: 20,2116           74747                           MASK     DBSLECT2                              #  CHECK FOR MAX DB (5 DEG)
059727,000081: 20,2117           00006                           EXTEND                                         
059728,000082: 20,2120           12122                           BZF      +2                                    
059729,000083: 20,2121           12130                           TCF      SETMAXDB                              #  BIT5 DAPBOOLS IS SET - CREW WANTS 5 DEG
059730,000084: 20,2122           30111                           CAE      DAPBOOLS                              
059731,000085: 20,2123           74750                           MASK     DBSELECT                              #  CHECK FOR 1 DEG DEADBAND SELECTION
059732,000086: 20,2124           00006                           EXTEND                                         
059733,000087: 20,2125           12141                           BZF      SETMINDB                              
059734,000088: 
059735,000089: 20,2126           32153                           CAF      POWERDB                               #  BIT4 DAPBOOLS IS SET - CREW WANTS 1 DEG
059736,000090: 20,2127           12131                           TCF      SETMAXDB   +1                         
059737,000091: 20,2130           32152        SETMAXDB           CAF      WIDEDB                                #  SET 5 DEGREE DEADBAND.
059738,000092: 20,2131           55343                 +1        TS       DB                                    
059739,000093: 
059740,000094: 20,2132           00006                           EXTEND                                         #  SET UP JOB TO RE-POSITION SWITCH CURVES.
059741,000095: 20,2133           22070                           QXCH     RUPTREG1                              
059742,000096: 20,2134           37720        CALLACCS           CAF      PRIO27                                
059743,000097: 20,2135           05072                           TC       NOVAC                                 
059744,000098: 20,2136  E6,1536                                  EBANK=   AOSQ                                  
059745,000099: 20,2136           03635 42106                     2CADR    1/ACCJOB                              
059746,000100: 
059747,000101: 
059748,000102: 20,2140           00070                           TC       RUPTREG1                              #  RETURN TO CALLER.
059749,000103: 
059750,000104: 20,2141           32151        SETMINDB           CAF      NARROWDB                              #  SET 0.3 DEGREE DEADBAND.
059751,000105: 20,2142           12131                           TCF      SETMAXDB   +1                         
059752,000106: 

Page 1396

059754,000108: 20,2143           00006        PFLITEDB           EXTEND                                         #  THE RETURN FROM CALLACCS IS TO RUPTREG1.
059755,000109: 20,2144           22070                           QXCH     RUPTREG1                              
059756,000110: 20,2145           02154                           TC       ZATTEROR                              #  ZERO THE ERRORS AND COMMANDED RATES.
059757,000111: 20,2146           32153                           CAF      POWERDB                               #  SET DB TO 1.0 DEG.
059758,000112: 20,2147           55343                           TS       DB                                    
059759,000113: 20,2150           12134                           TCF      CALLACCS                              #  SET UP 1/ACCS AND RETURN TO CALLER.
059760,000114: 20,2151           00155        NARROWDB           OCTAL    00155                                 #  0.3 DEGREE SCALED AT 45.
059761,000115: 20,2152           03434        WIDEDB             OCTAL    03434                                 #  5.0 DEGREES SCALED AT 45.
059762,000116: 20,2153           00554        POWERDB            DEC      .02222                                #  1.0 DEGREE SCALED AT 45.
059763,000117: 
059764,000118: 
059765,000119: 20,2154           35015        ZATTEROR           CAF      EBANK6                                
059766,000120: 20,2155           56003                           XCH      EBANK                                 
059767,000121: 20,2156           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
059768,000122: 20,2157           30032                           CAE      CDUX                                  
059769,000123: 20,2160           55634                           TS       CDUXD                                 
059770,000124: 20,2161           30033                           CAE      CDUY                                  
059771,000125: 20,2162           55635                           TS       CDUYD                                 
059772,000126: 20,2163           30034                           CAE      CDUZ                                  
059773,000127: 20,2164           55636                           TS       CDUZD                                 
059774,000128: 20,2165           12171                           TCF      STOPRATE   +3                         
059775,000129: 
059776,000130: 
059777,000131: 20,2166           35015        STOPRATE           CAF      EBANK6                                
059778,000132: 20,2167           56003                           XCH      EBANK                                 
059779,000133: 20,2170           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
059780,000134: 20,2171           34755                 +3        CAF      ZERO                                  
059781,000135: 20,2172           55642                           TS       OMEGAPD                               
059782,000136: 20,2173           55643                           TS       OMEGAQD                               
059783,000137: 20,2174           55644                           TS       OMEGARD                               
059784,000138: 20,2175           55637                           TS       DELCDUX                               
059785,000139: 20,2176           55640                           TS       DELCDUY                               
059786,000140: 20,2177           55641                           TS       DELCDUZ                               
059787,000141: 20,2200           55274                           TS       DELPEROR                              
059788,000142: 20,2201           55275                           TS       DELQEROR                              
059789,000143: 20,2202           55276                           TS       DELREROR                              
059790,000144: 20,2203           22003                           LXCH     EBANK                                 #  RESTORE CALLERS EBANK.
059791,000145: 20,2204           00002                           TC       Q                                     
059792,000146: 
059793,000147:                                                                                                  #  SUBROUTINE NAME:  ALLCOAST
059794,000148: 
059795,000149:                                                                                                  #  WILL BE CALLED BY FRESH STARTS AND ENGINE OFF ROUTINES.                 .
059796,000150: 
059797,000151:                                                                                                  #  CALLING SEQUENCE: (SAME AS ABOVE)
059798,000152: 
059799,000153:                                                                                                  #  EXIT:  RETURN TO Q.
059800,000154: 
059801,000155:                                                                                                  #  SUBROUTINES CALLED:  STOPRATE, RESTORDB, NOVAC
059802,000156: 
059803,000157:                                                                                                  #  ZERO:  (FOR ALL AXES) AOS, ALPHA, AOSTERM, OMEGAD, DELCDU, DELEROR
059804,000158: 

Page 1397

059806,000160:                                                                                                  #  OUTPUT:  DRIFTBIT/DAPBOOLS, DB, JOB TO DO 1/ACCS
059807,000161: 
059808,000162:                                                                                                  #  DEBRIS:  A, L, Q, RUPTREG1, RUPTREG2, (ITEMPS IN NOVAC)
059809,000163: 
059810,000164: 20,2205           00006        ALLCOAST           EXTEND                                         #  SAVE Q FOR RETURN
059811,000165: 20,2206           22071                           QXCH     RUPTREG2                              
059812,000166: 20,2207           02166                           TC       STOPRATE                              #  CLEAR RATE INTERFACE.  RETURN WITH A=0
059813,000167: 20,2210           22003                           LXCH     EBANK                                 #    AND L=EBANK6.  SAVE CALLERS EBANK.
059814,000168: 20,2211           55536                           TS       AOSQ                                  
059815,000169: 20,2212           55537                           TS       AOSQ       +1                         
059816,000170: 20,2213           55540                           TS       AOSR                                  
059817,000171: 20,2214           55541                           TS       AOSR       +1                         
059818,000172: 20,2215           55424                           TS       ALPHAQ                                #  FOR DOWNLIST.
059819,000173: 20,2216           55425                           TS       ALPHAR                                
059820,000174: 20,2217           55544                           TS       AOSQTERM                              
059821,000175: 20,2220           55545                           TS       AOSRTERM                              
059822,000176: 20,2221           22003                           LXCH     EBANK                                 #  RESTORE EBANK  (EBANK6 NO LONGER NEEDED)
059823,000177: 
059824,000178: 20,2222           40111                           CS       DAPBOOLS                              #  SET UP DRIFTBIT
059825,000179: 20,2223           74744                           MASK     DRIFTBIT                              
059826,000180: 20,2224           26111                           ADS      DAPBOOLS                              
059827,000181: 20,2225           02116                           TC       RESTORDB   +1                         #  RESTORE DEADBANK TO CREW-SELECTED VALUE.
059828,000182: 
059829,000183: 20,2226           00071                           TC       RUPTREG2                              #  RETURN.

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