Source Code

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

The reconstruction began with reconstructed source code for Luminary 97. Changes between revisions 96 and 97 were backed out, as described by anomal report LNY-59. transcribed from a digitized copy of that program. 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 96 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.

059032,000002:                                                                                                  ## Copyright:   Public domain.
059033,000003:                                                                                                  ## Filename:    DAP_INTERFACE_SUBROUTINES.agc
059034,000004:                                                                                                  ## Purpose:     A section of Luminary revision 96.
059035,000005:                                                                                                  ##              It is part of the reconstructed source code for the
059036,000006:                                                                                                  ##              original release of the flight software for the Lunar 
059037,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
059038,000008:                                                                                                  ##              The code has been recreated from a previously reconstructed
059039,000009:                                                                                                  ##              copy of Luminary 97 by undoing changes described in anomaly
059040,000010:                                                                                                  ##              report LNY-59. The code has been adapted such that the
059041,000011:                                                                                                  ##              resulting bugger words exactly match those specified for
059042,000012:                                                                                                  ##              Luminary 96 in NASA drawing 2021152D, which gives relatively
059043,000013:                                                                                                  ##              high confidence that the reconstruction is correct.
059044,000014:                                                                                                  ## Reference:   pp. 1406-1409
059045,000015:                                                                                                  ## Assembler:   yaYUL
059046,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
059047,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
059048,000018:                                                                                                  ## Mod history: 2019-08-04 MAS  Created from Luminary 97.
059049,000019: 

Page 1406

059051,000021: 20,2123                                           BANK     20                                    
059052,000022: 20,2000                                           SETLOC   DAPS3                                 
059053,000023: 20,2000                                           BANK                                           
059054,000024: 
059055,000025: 20,2123  E6,1635                                  EBANK=   CDUXD                                 
059056,000026: 20,2123                                           COUNT*   $$/DAPIF                              
059057,000027: 
059058,000028:                                                                                                  #  MOD 0         DATE    11/15/66        BY GEORGE W. CHERRY
059059,000029:                                                                                                  #  MOD 1                  1/23/67        MODIFICATION BY PETER ADLER
059060,000030: 
059061,000031:                                                                                                  #  FUNCTIONAL DESCRIPTION
059062,000032:                                                                                                  #        HEREIN ARE A COLLECTION OF SUBROUTINES WHICH ALLOW MISSION CONTROL PROGRAMS TO CONTROL THE MODE
059063,000033:                                                                                                  #        AND INTERFACE WITH THE DAP.
059064,000034: 
059065,000035:                                                                                                  #  CALLING SEQUENCES
059066,000036:                                                                                                  #        IN INTERRUPT OR WITH INTERRUPT INHIBITED
059067,000037:                                                                                                  #                TC      IBNKCALL
059068,000038:                                                                                                  #                FCADR   ROUTINE
059069,000039:                                                                                                  #        IN A JOB WITHOUT INTERRUPT INHIBITED
059070,000040:                                                                                                  #                INHINT
059071,000041:                                                                                                  #                TC      IBNKCALL
059072,000042:                                                                                                  #                FCADR   ROUTINE
059073,000043:                                                                                                  #                RELINT
059074,000044: 
059075,000045:                                                                                                  #  OUTPUT
059076,000046:                                                                                                  #        SEE INDIVIDUAL ROUTINES BELOW
059077,000047: 
059078,000048:                                                                                                  #  DEBRIS
059079,000049:                                                                                                  #        A, L, AND SOMETIMES MDUETEMP                    ODE     NOT IN PULSES MODE
059080,000050: 

Page 1407

059082,000052:                                                                                                  #  SUBROUTINE NAMES:
059083,000053:                                                                                                  #        SETMAXDB, SETMINDB, RESTORDB, PFLITEDB
059084,000054:                                                                                                  #  MODIFIED:     30 JANUARY 1968 BY P S WEISSMAN TO CREATE RESTORDB.
059085,000055:                                                                                                  #  MODIFIED:     1 MARCH 1968 BY P S WEISSMAN TO SAVE EBANK AND CREATE PFLITEDB
059086,000056: 
059087,000057:                                                                                                  #  FUNCTIONAL DESCRIPTION:
059088,000058:                                                                                                  #        SETMAXDB - SET DEADBAND TO 5.0 DEGREES
059089,000059:                                                                                                  #        SETMINDB - SET DEADBAND TO 0.3 DEGREE
059090,000060:                                                                                                  #        RESTORDB - SET DEADBAND TO MAX OR MIN ACCORDING TO SETTING OF DBSELECT BIT OF DAPBOOLS
059091,000061:                                                                                                  #        PFLITEDB - SET DEADBAND TO 1.0 DEGREE AND ZERO THE COMMANDED ATTITUDE CHANGE AND COMMANDED RATE
059092,000062: 
059093,000063:                                                                                                  #        ALL ENTRIES SET UP A NOVAC JOB TO DO 1/ACCS SO THAT THE TJETLAW SWITCH CURVES ARE POSITIONED TO
059094,000064:                                                                                                  #        REFLECT THE NEW DEADBAND.  IT SHOULD BE NOTED THAT THE DEADBAND REFERS TO THE ATTITUDE IN THE P-, U-, AND V-AXES.
059095,000065: 
059096,000066:                                                                                                  #  SUBROUTINE CALLED:    NOVAC
059097,000067: 
059098,000068:                                                                                                  #  CALLING SEQUENCE:     SAME AS ABOVE
059099,000069:                                                                                                  #                        OR      TC RESTORDB +1    FROM ALLCOAST
059100,000070: 
059101,000071:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, (ITEMPS IN NOVAC)
059102,000072: 
059103,000073: 20,2123           30111        RESTORDB           CAE      DAPBOOLS                              #  DETERMINE CREW-SELECTED DEADBAND.
059104,000074: 20,2124           74750                           MASK     DBSELECT                              
059105,000075: 20,2125           00006                           EXTEND                                         
059106,000076: 20,2126           12140                           BZF      SETMINDB                              
059107,000077: 
059108,000078: 20,2127           32151        SETMAXDB           CAF      WIDEDB                                #  SET 5 DEGREE DEADBAND.
059109,000079: 20,2130           55346                 +1        TS       DB                                    
059110,000080: 
059111,000081: 20,2131           00006                           EXTEND                                         #  SET UP JOB TO RE-POSITION SWITCH CURVES.
059112,000082: 20,2132           22070                           QXCH     RUPTREG1                              
059113,000083: 20,2133           37715        CALLACCS           CAF      PRIO27                                
059114,000084: 20,2134           05072                           TC       NOVAC                                 
059115,000085: 20,2135  E6,1537                                  EBANK=   AOSQ                                  
059116,000086: 20,2135           02454 40106                     2CADR    1/ACCJOB                              
059117,000087: 
059118,000088: 20,2137           00070                           TC       RUPTREG1                              #  RETURN TO CALLER.
059119,000089: 
059120,000090: 20,2140           32150        SETMINDB           CAF      NARROWDB                              #  SET 0.3 DEGREE DEADBAND.
059121,000091: 20,2141           12130                           TCF      SETMAXDB   +1                         
059122,000092: 
059123,000093: 20,2142           00006        PFLITEDB           EXTEND                                         #  THE RETURN FROM CALLACCS IS TO RUPTREG1.
059124,000094: 20,2143           22070                           QXCH     RUPTREG1                              
059125,000095: 20,2144           02153                           TC       ZATTEROR                              #  ZERO THE ERRORS AND COMMANDED RATES.
059126,000096: 20,2145           32152                           CAF      POWERDB                               #  SET DB TO 1.0 DEG.
059127,000097: 20,2146           55346                           TS       DB                                    
059128,000098: 20,2147           12133                           TCF      CALLACCS                              #  SET UP 1/ACCS AND RETURN TO CALLER.
059129,000099: 20,2150           00155        NARROWDB           OCTAL    00155                                 #  0.3 DEGREE SCALED AT 45.

Page 1408

059131,000101: 20,2151           03434        WIDEDB             OCTAL    03434                                 #  5.0 DEGREES SCALED AT 45.
059132,000102: 20,2152           00554        POWERDB            DEC      .02222                                #  1.0 DEGREE SCALED AT 45.
059133,000103: 
059134,000104: 20,2153           35015        ZATTEROR           CAF      EBANK6                                
059135,000105: 20,2154           56003                           XCH      EBANK                                 
059136,000106: 20,2155           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
059137,000107: 20,2156           30032                           CAE      CDUX                                  
059138,000108: 20,2157           55635                           TS       CDUXD                                 
059139,000109: 20,2160           30033                           CAE      CDUY                                  
059140,000110: 20,2161           55636                           TS       CDUYD                                 
059141,000111: 20,2162           30034                           CAE      CDUZ                                  
059142,000112: 20,2163           55637                           TS       CDUZD                                 
059143,000113: 20,2164           12170                           TCF      STOPRATE   +3                         
059144,000114: 
059145,000115: 20,2165           35015        STOPRATE           CAF      EBANK6                                
059146,000116: 20,2166           56003                           XCH      EBANK                                 
059147,000117: 20,2167           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
059148,000118: 20,2170           34755                 +3        CAF      ZERO                                  
059149,000119: 20,2171           55643                           TS       OMEGAPD                               
059150,000120: 20,2172           55644                           TS       OMEGAQD                               
059151,000121: 20,2173           55645                           TS       OMEGARD                               
059152,000122: 20,2174           55640                           TS       DELCDUX                               
059153,000123: 20,2175           55641                           TS       DELCDUY                               
059154,000124: 20,2176           55642                           TS       DELCDUZ                               
059155,000125: 20,2177           55277                           TS       DELPEROR                              
059156,000126: 20,2200           55300                           TS       DELQEROR                              
059157,000127: 20,2201           55301                           TS       DELREROR                              
059158,000128: 20,2202           22003                           LXCH     EBANK                                 #  RESTORE CALLERS EBANK.
059159,000129: 20,2203           00002                           TC       Q                                     
059160,000130: 
059161,000131:                                                                                                  #  SUBROUTINE NAME:      ALLCOAST
059162,000132:                                                                                                  #  WILL BE CALLED BY FRESH STARTS AND ENGINE OFF ROUTINES.               .
059163,000133: 
059164,000134:                                                                                                  #  CALLING SEQUENCE:     (SAME AS ABOVE)
059165,000135: 
059166,000136:                                                                                                  #  EXIT:                 RETURN TO Q.
059167,000137: 
059168,000138:                                                                                                  #  SUBROUTINES CALLED:   STOPRATE, RESTORDB, NOVAC
059169,000139: 
059170,000140:                                                                                                  #  ZERO:                 (FOR ALL AXES) AOS, ALPHA, AOSTERM, OMEGAD, DELCDU, DELEROR
059171,000141: 
059172,000142:                                                                                                  #  OUTPUT:               DRIFTBIT/DAPBOOLS, DB, JOB TO DO 1/ACCS
059173,000143: 
059174,000144:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, RUPTREG2, (ITEMPS IN NOVAC)
059175,000145: 
059176,000146: 20,2204           00006        ALLCOAST           EXTEND                                         #  SAVE Q FOR RETURN
059177,000147: 20,2205           22071                           QXCH     RUPTREG2                              

Page 1409

059179,000149: 20,2206           02165                           TC       STOPRATE                              #  CLEAR RATE INTERFACE.  RETURN WITH A=0
059180,000150: 20,2207           22003                           LXCH     EBANK                                 #  AND L=EBANK6.  SAVE CALLERS EBANK.
059181,000151: 20,2210           55537                           TS       AOSQ                                  
059182,000152: 20,2211           55540                           TS       AOSQ       +1                         
059183,000153: 20,2212           55541                           TS       AOSR                                  
059184,000154: 20,2213           55542                           TS       AOSR       +1                         
059185,000155: 20,2214           55424                           TS       ALPHAQ                                #  FOR DOWNLIST.
059186,000156: 20,2215           55425                           TS       ALPHAR                                
059187,000157: 20,2216           55545                           TS       AOSQTERM                              
059188,000158: 20,2217           55546                           TS       AOSRTERM                              
059189,000159: 20,2220           22003                           LXCH     EBANK                                 #  RESTORE EBANK (EBANK6 NO LONGER NEEDED)
059190,000160: 
059191,000161: 20,2221           40111                           CS       DAPBOOLS                              #  SET UP DRIFTBIT
059192,000162: 20,2222           74744                           MASK     DRIFTBIT                              
059193,000163: 20,2223           26111                           ADS      DAPBOOLS                              
059194,000164: 20,2224           02124                           TC       RESTORDB   +1                         #  RESTORE DEADBANK TO CREW-SELECTED VALUE.
059195,000165: 
059196,000166: 20,2225           00071                           TC       RUPTREG2                              #  RETURN.
059197,000167: 

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