Source Code

These source-code files are part of a reconstructed copy of Luminary 97, the second release of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software. It was created to fix two incorrect ephemeris constants in Luminary 96, as described by anomaly report LNY-59.

The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memos 83 and 85, using asterisks indicating changed lines in the listing as a guide. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152D. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 97 listing.

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.

059368,000002:                                                                                                  ## Copyright:   Public domain.
059369,000003:                                                                                                  ## Filename:    DAP_INTERFACE_SUBROUTINES.agc
059370,000004:                                                                                                  ## Purpose:     A section of Luminary revision 97.
059371,000005:                                                                                                  ##              It is part of the reconstructed source code for the
059372,000006:                                                                                                  ##              second release of the flight software for the Lunar 
059373,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
059374,000008:                                                                                                  ##              It was created to fix two incorrect ephemeris constants in
059375,000009:                                                                                                  ##              Luminary 96, as described by anomaly report LNY-59.
059376,000010:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
059377,000011:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
059378,000012:                                                                                                  ##              the listing and Luminary Memos #83 and #85, which list 
059379,000013:                                                                                                  ##              changes between Luminary 97 and 98, and 98 and 99. The
059380,000014:                                                                                                  ##              code has been adapted such that the resulting bugger words
059381,000015:                                                                                                  ##              exactly match those specified for Luminary 97 in NASA drawing
059382,000016:                                                                                                  ##              2021152D, which gives relatively high confidence that the
059383,000017:                                                                                                  ##              reconstruction is correct.
059384,000018:                                                                                                  ## Reference:   pp. 1406-1409
059385,000019:                                                                                                  ## Assembler:   yaYUL
059386,000020:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
059387,000021:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
059388,000022:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
059389,000023: 

Page 1406

059391,000025: 20,2123                                           BANK     20                                    
059392,000026: 20,2000                                           SETLOC   DAPS3                                 
059393,000027: 20,2000                                           BANK                                           
059394,000028: 
059395,000029: 20,2123  E6,1635                                  EBANK=   CDUXD                                 
059396,000030: 20,2123                                           COUNT*   $$/DAPIF                              
059397,000031: 
059398,000032:                                                                                                  #  MOD 0         DATE    11/15/66        BY GEORGE W. CHERRY
059399,000033:                                                                                                  #  MOD 1                  1/23/67        MODIFICATION BY PETER ADLER
059400,000034: 
059401,000035:                                                                                                  #  FUNCTIONAL DESCRIPTION
059402,000036:                                                                                                  #        HEREIN ARE A COLLECTION OF SUBROUTINES WHICH ALLOW MISSION CONTROL PROGRAMS TO CONTROL THE MODE
059403,000037:                                                                                                  #        AND INTERFACE WITH THE DAP.
059404,000038: 
059405,000039:                                                                                                  #  CALLING SEQUENCES
059406,000040:                                                                                                  #        IN INTERRUPT OR WITH INTERRUPT INHIBITED
059407,000041:                                                                                                  #                TC      IBNKCALL
059408,000042:                                                                                                  #                FCADR   ROUTINE
059409,000043:                                                                                                  #        IN A JOB WITHOUT INTERRUPT INHIBITED
059410,000044:                                                                                                  #                INHINT
059411,000045:                                                                                                  #                TC      IBNKCALL
059412,000046:                                                                                                  #                FCADR   ROUTINE
059413,000047:                                                                                                  #                RELINT
059414,000048: 
059415,000049:                                                                                                  #  OUTPUT
059416,000050:                                                                                                  #        SEE INDIVIDUAL ROUTINES BELOW
059417,000051: 
059418,000052:                                                                                                  #  DEBRIS
059419,000053:                                                                                                  #        A, L, AND SOMETIMES MDUETEMP                    ODE     NOT IN PULSES MODE
059420,000054: 

Page 1407

059422,000056:                                                                                                  #  SUBROUTINE NAMES:
059423,000057:                                                                                                  #        SETMAXDB, SETMINDB, RESTORDB, PFLITEDB
059424,000058:                                                                                                  #  MODIFIED:     30 JANUARY 1968 BY P S WEISSMAN TO CREATE RESTORDB.
059425,000059:                                                                                                  #  MODIFIED:     1 MARCH 1968 BY P S WEISSMAN TO SAVE EBANK AND CREATE PFLITEDB
059426,000060: 
059427,000061:                                                                                                  #  FUNCTIONAL DESCRIPTION:
059428,000062:                                                                                                  #        SETMAXDB - SET DEADBAND TO 5.0 DEGREES
059429,000063:                                                                                                  #        SETMINDB - SET DEADBAND TO 0.3 DEGREE
059430,000064:                                                                                                  #        RESTORDB - SET DEADBAND TO MAX OR MIN ACCORDING TO SETTING OF DBSELECT BIT OF DAPBOOLS
059431,000065:                                                                                                  #        PFLITEDB - SET DEADBAND TO 1.0 DEGREE AND ZERO THE COMMANDED ATTITUDE CHANGE AND COMMANDED RATE
059432,000066: 
059433,000067:                                                                                                  #        ALL ENTRIES SET UP A NOVAC JOB TO DO 1/ACCS SO THAT THE TJETLAW SWITCH CURVES ARE POSITIONED TO
059434,000068:                                                                                                  #        REFLECT THE NEW DEADBAND.  IT SHOULD BE NOTED THAT THE DEADBAND REFERS TO THE ATTITUDE IN THE P-, U-, AND V-AXES.
059435,000069: 
059436,000070:                                                                                                  #  SUBROUTINE CALLED:    NOVAC
059437,000071: 
059438,000072:                                                                                                  #  CALLING SEQUENCE:     SAME AS ABOVE
059439,000073:                                                                                                  #                        OR      TC RESTORDB +1    FROM ALLCOAST
059440,000074: 
059441,000075:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, (ITEMPS IN NOVAC)
059442,000076: 
059443,000077: 20,2123           30111        RESTORDB           CAE      DAPBOOLS                              #  DETERMINE CREW-SELECTED DEADBAND.
059444,000078: 20,2124           74750                           MASK     DBSELECT                              
059445,000079: 20,2125           00006                           EXTEND                                         
059446,000080: 20,2126           12140                           BZF      SETMINDB                              
059447,000081: 
059448,000082: 20,2127           32151        SETMAXDB           CAF      WIDEDB                                #  SET 5 DEGREE DEADBAND.
059449,000083: 20,2130           55346                 +1        TS       DB                                    
059450,000084: 
059451,000085: 20,2131           00006                           EXTEND                                         #  SET UP JOB TO RE-POSITION SWITCH CURVES.
059452,000086: 20,2132           22070                           QXCH     RUPTREG1                              
059453,000087: 20,2133           37715        CALLACCS           CAF      PRIO27                                
059454,000088: 20,2134           05072                           TC       NOVAC                                 
059455,000089: 20,2135  E6,1537                                  EBANK=   AOSQ                                  
059456,000090: 20,2135           02454 40106                     2CADR    1/ACCJOB                              
059457,000091: 
059458,000092: 20,2137           00070                           TC       RUPTREG1                              #  RETURN TO CALLER.
059459,000093: 
059460,000094: 20,2140           32150        SETMINDB           CAF      NARROWDB                              #  SET 0.3 DEGREE DEADBAND.
059461,000095: 20,2141           12130                           TCF      SETMAXDB   +1                         
059462,000096: 
059463,000097: 20,2142           00006        PFLITEDB           EXTEND                                         #  THE RETURN FROM CALLACCS IS TO RUPTREG1.
059464,000098: 20,2143           22070                           QXCH     RUPTREG1                              
059465,000099: 20,2144           02153                           TC       ZATTEROR                              #  ZERO THE ERRORS AND COMMANDED RATES.
059466,000100: 20,2145           32152                           CAF      POWERDB                               #  SET DB TO 1.0 DEG.
059467,000101: 20,2146           55346                           TS       DB                                    
059468,000102: 20,2147           12133                           TCF      CALLACCS                              #  SET UP 1/ACCS AND RETURN TO CALLER.
059469,000103: 20,2150           00155        NARROWDB           OCTAL    00155                                 #  0.3 DEGREE SCALED AT 45.

Page 1408

059471,000105: 20,2151           03434        WIDEDB             OCTAL    03434                                 #  5.0 DEGREES SCALED AT 45.
059472,000106: 20,2152           00554        POWERDB            DEC      .02222                                #  1.0 DEGREE SCALED AT 45.
059473,000107: 
059474,000108: 20,2153           35015        ZATTEROR           CAF      EBANK6                                
059475,000109: 20,2154           56003                           XCH      EBANK                                 
059476,000110: 20,2155           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
059477,000111: 20,2156           30032                           CAE      CDUX                                  
059478,000112: 20,2157           55635                           TS       CDUXD                                 
059479,000113: 20,2160           30033                           CAE      CDUY                                  
059480,000114: 20,2161           55636                           TS       CDUYD                                 
059481,000115: 20,2162           30034                           CAE      CDUZ                                  
059482,000116: 20,2163           55637                           TS       CDUZD                                 
059483,000117: 20,2164           12170                           TCF      STOPRATE   +3                         
059484,000118: 
059485,000119: 20,2165           35015        STOPRATE           CAF      EBANK6                                
059486,000120: 20,2166           56003                           XCH      EBANK                                 
059487,000121: 20,2167           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
059488,000122: 20,2170           34755                 +3        CAF      ZERO                                  
059489,000123: 20,2171           55643                           TS       OMEGAPD                               
059490,000124: 20,2172           55644                           TS       OMEGAQD                               
059491,000125: 20,2173           55645                           TS       OMEGARD                               
059492,000126: 20,2174           55640                           TS       DELCDUX                               
059493,000127: 20,2175           55641                           TS       DELCDUY                               
059494,000128: 20,2176           55642                           TS       DELCDUZ                               
059495,000129: 20,2177           55277                           TS       DELPEROR                              
059496,000130: 20,2200           55300                           TS       DELQEROR                              
059497,000131: 20,2201           55301                           TS       DELREROR                              
059498,000132: 20,2202           22003                           LXCH     EBANK                                 #  RESTORE CALLERS EBANK.
059499,000133: 20,2203           00002                           TC       Q                                     
059500,000134: 
059501,000135:                                                                                                  #  SUBROUTINE NAME:      ALLCOAST
059502,000136:                                                                                                  #  WILL BE CALLED BY FRESH STARTS AND ENGINE OFF ROUTINES.               .
059503,000137: 
059504,000138:                                                                                                  #  CALLING SEQUENCE:     (SAME AS ABOVE)
059505,000139: 
059506,000140:                                                                                                  #  EXIT:                 RETURN TO Q.
059507,000141: 
059508,000142:                                                                                                  #  SUBROUTINES CALLED:   STOPRATE, RESTORDB, NOVAC
059509,000143: 
059510,000144:                                                                                                  #  ZERO:                 (FOR ALL AXES) AOS, ALPHA, AOSTERM, OMEGAD, DELCDU, DELEROR
059511,000145: 
059512,000146:                                                                                                  #  OUTPUT:               DRIFTBIT/DAPBOOLS, DB, JOB TO DO 1/ACCS
059513,000147: 
059514,000148:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, RUPTREG2, (ITEMPS IN NOVAC)
059515,000149: 
059516,000150: 20,2204           00006        ALLCOAST           EXTEND                                         #  SAVE Q FOR RETURN
059517,000151: 20,2205           22071                           QXCH     RUPTREG2                              

Page 1409

059519,000153: 20,2206           02165                           TC       STOPRATE                              #  CLEAR RATE INTERFACE.  RETURN WITH A=0
059520,000154: 20,2207           22003                           LXCH     EBANK                                 #  AND L=EBANK6.  SAVE CALLERS EBANK.
059521,000155: 20,2210           55537                           TS       AOSQ                                  
059522,000156: 20,2211           55540                           TS       AOSQ       +1                         
059523,000157: 20,2212           55541                           TS       AOSR                                  
059524,000158: 20,2213           55542                           TS       AOSR       +1                         
059525,000159: 20,2214           55424                           TS       ALPHAQ                                #  FOR DOWNLIST.
059526,000160: 20,2215           55425                           TS       ALPHAR                                
059527,000161: 20,2216           55545                           TS       AOSQTERM                              
059528,000162: 20,2217           55546                           TS       AOSRTERM                              
059529,000163: 20,2220           22003                           LXCH     EBANK                                 #  RESTORE EBANK (EBANK6 NO LONGER NEEDED)
059530,000164: 
059531,000165: 20,2221           40111                           CS       DAPBOOLS                              #  SET UP DRIFTBIT
059532,000166: 20,2222           74744                           MASK     DRIFTBIT                              
059533,000167: 20,2223           26111                           ADS      DAPBOOLS                              
059534,000168: 20,2224           02124                           TC       RESTORDB   +1                         #  RESTORE DEADBANK TO CREW-SELECTED VALUE.
059535,000169: 
059536,000170: 20,2225           00071                           TC       RUPTREG2                              #  RETURN.
059537,000171: 

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