Source Code

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

The reconstruction began with source code of Zerlina 56, Luminary 210, and Luminary 131, previously transcribed from digitized copies of those programs. The code was created by combining the three, using Zerlina 56 as a base, since it was based off of Luminary 183. The differences between the three were carefully merged using the Luminary memos as a guide, with all changes made after Luminary 178 being backed out. 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 178 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.

059816,000002:                                                                                                  ## Copyright:   Public domain.
059817,000003:                                                                                                  ## Filename:    DAP_INTERFACE_SUBROUTINES.agc
059818,000004:                                                                                                  ## Purpose:     A section of Luminary revision 178.
059819,000005:                                                                                                  ##              It is part of the reconstructed source code for the final
059820,000006:                                                                                                  ##              release of the flight software for the Lunar Module's
059821,000007:                                                                                                  ##              (LM) Apollo Guidance Computer (AGC) for Apollo 14. The
059822,000008:                                                                                                  ##              code has been recreated from copies of Zerlina 56, Luminary
059823,000009:                                                                                                  ##              210, and Luminary 131, as well as many Luminary memos.
059824,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
059825,000011:                                                                                                  ##              exactly match those specified for Luminary 178 in NASA
059826,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
059827,000013:                                                                                                  ##              that the reconstruction is correct.
059828,000014:                                                                                                  ## Reference:   pp. 1394-1397
059829,000015:                                                                                                  ## Assembler:   yaYUL
059830,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
059831,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
059832,000018:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Zerlina 56.
059833,000019: 

Page 1394

059835,000021: 20,2115                                           BANK     20                                    
059836,000022: 20,2000                                           SETLOC   DAPS3                                 
059837,000023: 20,2000                                           BANK                                           
059838,000024: 
059839,000025: 20,2115  E6,1634                                  EBANK=   CDUXD                                 
059840,000026: 20,2115                                           COUNT*   $$/DAPIF                              
059841,000027: 
059842,000028:                                                                                                  #  MOD 0              DATE  11/15/66          BY  GEORGE W. CHERRY
059843,000029: 
059844,000030:                                                                                                  #  MOD 1                     1/23/67          MODIFICATION BY PETER ADLER
059845,000031: 
059846,000032:                                                                                                  #  FUNCTIONAL DESCRIPTION
059847,000033: 
059848,000034:                                                                                                  #           HEREIN ARE A COLLECTION OF SUBROUTINES WHICH ALLOW MISSION CONTROL PROGRAMS TO CONTROL THE MODE
059849,000035:                                                                                                  #           AND INTERFACE WITH THE DAP.
059850,000036: 
059851,000037:                                                                                                  #  CALLING SEQUENCES
059852,000038: 
059853,000039:                                                                                                  #  IN INTERRUPT OR WITH INTERRUPT INHIBITED
059854,000040:                                                                                                  #           TC     IBNKCALL
059855,000041:                                                                                                  #           FCADR  ROUTINE
059856,000042: 
059857,000043:                                                                                                  #  IN A JOB WITHOUT INTERRUPT INHIBITED
059858,000044:                                                                                                  #           INHINT
059859,000045:                                                                                                  #           TC     IBNKCALL
059860,000046:                                                                                                  #           FCADR  ROUTINE
059861,000047:                                                                                                  #           RELINT
059862,000048: 
059863,000049:                                                                                                  #  OUTPUT
059864,000050: 
059865,000051:                                                                                                  #           SEE INDIVIDUAL ROUTINES BELOW
059866,000052: 
059867,000053:                                                                                                  #  DEBRIS
059868,000054: 
059869,000055:                                                                                                  #           A,L, AND SOMETIMES MDUETEMP                                    ODE      NOT IN PULSES MODE
059870,000056: 

Page 1395

059872,000058:                                                                                                  #  SUBROUTINE NAMES:
059873,000059:                                                                                                  #           SETMAXDB, SETMINDB, RESTORDB, PFLITEDB
059874,000060: 
059875,000061:                                                                                                  #  MODIFIED: 30 JANUARY 1968 BY P S WEISSMAN TO CREATE RESTORDB.
059876,000062: 
059877,000063:                                                                                                  #  MODIFIED: 1 MARCH 1968 BY P S WEISSMAN TO SAVE EBANK AND CREATE PFLITEDB
059878,000064: 
059879,000065:                                                                                                  #  FUNCTIONAL DESCRIPTION:
059880,000066:                                                                                                  #           SETMAXDB - SET DEADBAND TO 5.0 DEGREES
059881,000067:                                                                                                  #           SETMINDB - SET DEADBAND TO 0.3 DEGREE
059882,000068:                                                                                                  #           RESTORDB - SET DEADBAND TO .3,1, OR 5 ACCORDING TO BITS 4 AND 5 OF DAPBOOLS
059883,000069:                                                                                                  #           PFLITEDB - SET DEADBAND TO 1.0 DEGREE AND ZERO THE COMMANDED ATTITUDE CHANGE AND COMMANDED RATE
059884,000070:                                                                                                  #           ALL ENTRIES SET UP A NOVAC JOB TO DO 1/ACCS SO THAT THE TJETLAW SWITCH CURVES ARE POSITIONED TO
059885,000071:                                                                                                  #  REFLECT THE NEW DEADBAND.  IT SHOULD BE NOTED THAT THE DEADBAND REFERS TO THE ATTITUDE IN THE P-,U-,AND V-AXES.
059886,000072: 
059887,000073:                                                                                                  #  SUBROUTINE CALLED:  NOVAC
059888,000074: 
059889,000075:                                                                                                  #  CALLING SEQUENCE: SAME AS ABOVE
059890,000076:                                                                                                  #                                          OR       TC     RESTORDB +1     FROM ALLCOAST
059891,000077:                                                                                                  #  DEBRIS:  A, L, Q, RUPTREG1, (ITEMPS IN NOVAC)
059892,000078: 
059893,000079: 20,2115           30111        RESTORDB           CAE      DAPBOOLS                              #  DETERMINE CREW-SELECTED DEADBAND.
059894,000080: 20,2116           74747                           MASK     DBSLECT2                              #  CHECK FOR MAX DB (5 DEG)
059895,000081: 20,2117           00006                           EXTEND                                         
059896,000082: 20,2120           12122                           BZF      +2                                    
059897,000083: 20,2121           12130                           TCF      SETMAXDB                              #  BIT5 DAPBOOLS IS SET - CREW WANTS 5 DEG
059898,000084: 20,2122           30111                           CAE      DAPBOOLS                              
059899,000085: 20,2123           74750                           MASK     DBSELECT                              #  CHECK FOR 1 DEG DEADBAND SELECTION
059900,000086: 20,2124           00006                           EXTEND                                         
059901,000087: 20,2125           12141                           BZF      SETMINDB                              
059902,000088: 
059903,000089: 20,2126           32153                           CAF      POWERDB                               #  BIT4 DAPBOOLS IS SET - CREW WANTS 1 DEG
059904,000090: 20,2127           12131                           TCF      SETMAXDB   +1                         
059905,000091: 20,2130           32152        SETMAXDB           CAF      WIDEDB                                #  SET 5 DEGREE DEADBAND.
059906,000092: 20,2131           55343                 +1        TS       DB                                    
059907,000093: 
059908,000094: 20,2132           00006                           EXTEND                                         #  SET UP JOB TO RE-POSITION SWITCH CURVES.
059909,000095: 20,2133           22070                           QXCH     RUPTREG1                              
059910,000096: 20,2134           37720        CALLACCS           CAF      PRIO27                                
059911,000097: 20,2135           05072                           TC       NOVAC                                 
059912,000098: 20,2136  E6,1536                                  EBANK=   AOSQ                                  
059913,000099: 20,2136           03430 42106                     2CADR    1/ACCJOB                              
059914,000100: 
059915,000101: 
059916,000102: 20,2140           00070                           TC       RUPTREG1                              #  RETURN TO CALLER.
059917,000103: 
059918,000104: 20,2141           32151        SETMINDB           CAF      NARROWDB                              #  SET 0.3 DEGREE DEADBAND.
059919,000105: 20,2142           12131                           TCF      SETMAXDB   +1                         
059920,000106: 

Page 1396

059922,000108: 20,2143           00006        PFLITEDB           EXTEND                                         #  THE RETURN FROM CALLACCS IS TO RUPTREG1.
059923,000109: 20,2144           22070                           QXCH     RUPTREG1                              
059924,000110: 20,2145           02154                           TC       ZATTEROR                              #  ZERO THE ERRORS AND COMMANDED RATES.
059925,000111: 20,2146           32153                           CAF      POWERDB                               #  SET DB TO 1.0 DEG.
059926,000112: 20,2147           55343                           TS       DB                                    
059927,000113: 20,2150           12134                           TCF      CALLACCS                              #  SET UP 1/ACCS AND RETURN TO CALLER.
059928,000114: 20,2151           00155        NARROWDB           OCTAL    00155                                 #  0.3 DEGREE SCALED AT 45.
059929,000115: 20,2152           03434        WIDEDB             OCTAL    03434                                 #  5.0 DEGREES SCALED AT 45.
059930,000116: 20,2153           00554        POWERDB            DEC      .02222                                #  1.0 DEGREE SCALED AT 45.
059931,000117: 
059932,000118: 
059933,000119: 20,2154           35015        ZATTEROR           CAF      EBANK6                                
059934,000120: 20,2155           56003                           XCH      EBANK                                 
059935,000121: 20,2156           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
059936,000122: 20,2157           30032                           CAE      CDUX                                  
059937,000123: 20,2160           55634                           TS       CDUXD                                 
059938,000124: 20,2161           30033                           CAE      CDUY                                  
059939,000125: 20,2162           55635                           TS       CDUYD                                 
059940,000126: 20,2163           30034                           CAE      CDUZ                                  
059941,000127: 20,2164           55636                           TS       CDUZD                                 
059942,000128: 20,2165           12171                           TCF      STOPRATE   +3                         
059943,000129: 
059944,000130: 
059945,000131: 20,2166           35015        STOPRATE           CAF      EBANK6                                
059946,000132: 20,2167           56003                           XCH      EBANK                                 
059947,000133: 20,2170           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
059948,000134: 20,2171           34755                 +3        CAF      ZERO                                  
059949,000135: 20,2172           55642                           TS       OMEGAPD                               
059950,000136: 20,2173           55643                           TS       OMEGAQD                               
059951,000137: 20,2174           55644                           TS       OMEGARD                               
059952,000138: 20,2175           55637                           TS       DELCDUX                               
059953,000139: 20,2176           55640                           TS       DELCDUY                               
059954,000140: 20,2177           55641                           TS       DELCDUZ                               
059955,000141: 20,2200           55274                           TS       DELPEROR                              
059956,000142: 20,2201           55275                           TS       DELQEROR                              
059957,000143: 20,2202           55276                           TS       DELREROR                              
059958,000144: 20,2203           22003                           LXCH     EBANK                                 #  RESTORE CALLERS EBANK.
059959,000145: 20,2204           00002                           TC       Q                                     
059960,000146: 
059961,000147:                                                                                                  #  SUBROUTINE NAME:  ALLCOAST
059962,000148: 
059963,000149:                                                                                                  #  WILL BE CALLED BY FRESH STARTS AND ENGINE OFF ROUTINES.                 .
059964,000150: 
059965,000151:                                                                                                  #  CALLING SEQUENCE: (SAME AS ABOVE)
059966,000152: 
059967,000153:                                                                                                  #  EXIT:  RETURN TO Q.
059968,000154: 
059969,000155:                                                                                                  #  SUBROUTINES CALLED:  STOPRATE, RESTORDB, NOVAC
059970,000156: 
059971,000157:                                                                                                  #  ZERO:  (FOR ALL AXES) AOS, ALPHA, AOSTERM, OMEGAD, DELCDU, DELEROR
059972,000158: 

Page 1397

059974,000160:                                                                                                  #  OUTPUT:  DRIFTBIT/DAPBOOLS, DB, JOB TO DO 1/ACCS
059975,000161: 
059976,000162:                                                                                                  #  DEBRIS:  A, L, Q, RUPTREG1, RUPTREG2, (ITEMPS IN NOVAC)
059977,000163: 
059978,000164: 20,2205           00006        ALLCOAST           EXTEND                                         #  SAVE Q FOR RETURN
059979,000165: 20,2206           22071                           QXCH     RUPTREG2                              
059980,000166: 20,2207           02166                           TC       STOPRATE                              #  CLEAR RATE INTERFACE.  RETURN WITH A=0
059981,000167: 20,2210           22003                           LXCH     EBANK                                 #    AND L=EBANK6.  SAVE CALLERS EBANK.
059982,000168: 20,2211           55536                           TS       AOSQ                                  
059983,000169: 20,2212           55537                           TS       AOSQ       +1                         
059984,000170: 20,2213           55540                           TS       AOSR                                  
059985,000171: 20,2214           55541                           TS       AOSR       +1                         
059986,000172: 20,2215           55424                           TS       ALPHAQ                                #  FOR DOWNLIST.
059987,000173: 20,2216           55425                           TS       ALPHAR                                
059988,000174: 20,2217           55544                           TS       AOSQTERM                              
059989,000175: 20,2220           55545                           TS       AOSRTERM                              
059990,000176: 20,2221           22003                           LXCH     EBANK                                 #  RESTORE EBANK  (EBANK6 NO LONGER NEEDED)
059991,000177: 
059992,000178: 20,2222           40111                           CS       DAPBOOLS                              #  SET UP DRIFTBIT
059993,000179: 20,2223           74744                           MASK     DRIFTBIT                              
059994,000180: 20,2224           26111                           ADS      DAPBOOLS                              
059995,000181: 20,2225           02116                           TC       RESTORDB   +1                         #  RESTORE DEADBANK TO CREW-SELECTED VALUE.
059996,000182: 
059997,000183: 20,2226           00071                           TC       RUPTREG2                              #  RETURN.

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