Source Code

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

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 memo 85, using asterisks indicating changed lines in the listing as a guide. While no listing of this version is known to exist, nor are the memory-bank checksums available, the reconstruction is believed to be correct because it was an an intermediate step in reconstructing Luminary 97 whose reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152G. 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 98 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.

058899,000002:                                                                                                  ## Copyright:   Public domain.
058900,000003:                                                                                                  ## Filename:    DAP_INTERFACE_SUBROUTINES.agc
058901,000004:                                                                                                  ## Purpose:     A section of Luminary revision 98.
058902,000005:                                                                                                  ##              It is part of the reconstructed source code for the a
058903,000006:                                                                                                  ##              development version of the flight software for the Lunar 
058904,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
058905,000008:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
058906,000009:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
058907,000010:                                                                                                  ##              the listing and Luminary Memo #85, which lists changes between
058908,000011:                                                                                                  ##              Luminary 98 and 99.
058909,000012:                                                                                                  ## Reference:   pp. 1406-1409
058910,000013:                                                                                                  ## Assembler:   yaYUL
058911,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
058912,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
058913,000016:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
058914,000017: 

Page 1406

058916,000019: 20,2123                                           BANK     20                                    
058917,000020: 20,2000                                           SETLOC   DAPS3                                 
058918,000021: 20,2000                                           BANK                                           
058919,000022: 
058920,000023: 20,2123  E6,1635                                  EBANK=   CDUXD                                 
058921,000024: 20,2123                                           COUNT*   $$/DAPIF                              
058922,000025: 
058923,000026:                                                                                                  #  MOD 0         DATE    11/15/66        BY GEORGE W. CHERRY
058924,000027:                                                                                                  #  MOD 1                  1/23/67        MODIFICATION BY PETER ADLER
058925,000028: 
058926,000029:                                                                                                  #  FUNCTIONAL DESCRIPTION
058927,000030:                                                                                                  #        HEREIN ARE A COLLECTION OF SUBROUTINES WHICH ALLOW MISSION CONTROL PROGRAMS TO CONTROL THE MODE
058928,000031:                                                                                                  #        AND INTERFACE WITH THE DAP.
058929,000032: 
058930,000033:                                                                                                  #  CALLING SEQUENCES
058931,000034:                                                                                                  #        IN INTERRUPT OR WITH INTERRUPT INHIBITED
058932,000035:                                                                                                  #                TC      IBNKCALL
058933,000036:                                                                                                  #                FCADR   ROUTINE
058934,000037:                                                                                                  #        IN A JOB WITHOUT INTERRUPT INHIBITED
058935,000038:                                                                                                  #                INHINT
058936,000039:                                                                                                  #                TC      IBNKCALL
058937,000040:                                                                                                  #                FCADR   ROUTINE
058938,000041:                                                                                                  #                RELINT
058939,000042: 
058940,000043:                                                                                                  #  OUTPUT
058941,000044:                                                                                                  #        SEE INDIVIDUAL ROUTINES BELOW
058942,000045: 
058943,000046:                                                                                                  #  DEBRIS
058944,000047:                                                                                                  #        A, L, AND SOMETIMES MDUETEMP                    ODE     NOT IN PULSES MODE
058945,000048: 

Page 1407

058947,000050:                                                                                                  #  SUBROUTINE NAMES:
058948,000051:                                                                                                  #        SETMAXDB, SETMINDB, RESTORDB, PFLITEDB
058949,000052:                                                                                                  #  MODIFIED:     30 JANUARY 1968 BY P S WEISSMAN TO CREATE RESTORDB.
058950,000053:                                                                                                  #  MODIFIED:     1 MARCH 1968 BY P S WEISSMAN TO SAVE EBANK AND CREATE PFLITEDB
058951,000054: 
058952,000055:                                                                                                  #  FUNCTIONAL DESCRIPTION:
058953,000056:                                                                                                  #        SETMAXDB - SET DEADBAND TO 5.0 DEGREES
058954,000057:                                                                                                  #        SETMINDB - SET DEADBAND TO 0.3 DEGREE
058955,000058:                                                                                                  #        RESTORDB - SET DEADBAND TO MAX OR MIN ACCORDING TO SETTING OF DBSELECT BIT OF DAPBOOLS
058956,000059:                                                                                                  #        PFLITEDB - SET DEADBAND TO 1.0 DEGREE AND ZERO THE COMMANDED ATTITUDE CHANGE AND COMMANDED RATE
058957,000060: 
058958,000061:                                                                                                  #        ALL ENTRIES SET UP A NOVAC JOB TO DO 1/ACCS SO THAT THE TJETLAW SWITCH CURVES ARE POSITIONED TO
058959,000062:                                                                                                  #        REFLECT THE NEW DEADBAND.  IT SHOULD BE NOTED THAT THE DEADBAND REFERS TO THE ATTITUDE IN THE P-, U-, AND V-AXES.
058960,000063: 
058961,000064:                                                                                                  #  SUBROUTINE CALLED:    NOVAC
058962,000065: 
058963,000066:                                                                                                  #  CALLING SEQUENCE:     SAME AS ABOVE
058964,000067:                                                                                                  #                        OR      TC RESTORDB +1    FROM ALLCOAST
058965,000068: 
058966,000069:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, (ITEMPS IN NOVAC)
058967,000070: 
058968,000071: 20,2123           30111        RESTORDB           CAE      DAPBOOLS                              #  DETERMINE CREW-SELECTED DEADBAND.
058969,000072: 20,2124           74750                           MASK     DBSELECT                              
058970,000073: 20,2125           00006                           EXTEND                                         
058971,000074: 20,2126           12140                           BZF      SETMINDB                              
058972,000075: 
058973,000076: 20,2127           32151        SETMAXDB           CAF      WIDEDB                                #  SET 5 DEGREE DEADBAND.
058974,000077: 20,2130           55346                 +1        TS       DB                                    
058975,000078: 
058976,000079: 20,2131           00006                           EXTEND                                         #  SET UP JOB TO RE-POSITION SWITCH CURVES.
058977,000080: 20,2132           22070                           QXCH     RUPTREG1                              
058978,000081: 20,2133           37715        CALLACCS           CAF      PRIO27                                
058979,000082: 20,2134           05072                           TC       NOVAC                                 
058980,000083: 20,2135  E6,1537                                  EBANK=   AOSQ                                  
058981,000084: 20,2135           02454 40106                     2CADR    1/ACCJOB                              
058982,000085: 
058983,000086: 20,2137           00070                           TC       RUPTREG1                              #  RETURN TO CALLER.
058984,000087: 
058985,000088: 20,2140           32150        SETMINDB           CAF      NARROWDB                              #  SET 0.3 DEGREE DEADBAND.
058986,000089: 20,2141           12130                           TCF      SETMAXDB   +1                         
058987,000090: 
058988,000091: 20,2142           00006        PFLITEDB           EXTEND                                         #  THE RETURN FROM CALLACCS IS TO RUPTREG1.
058989,000092: 20,2143           22070                           QXCH     RUPTREG1                              
058990,000093: 20,2144           02153                           TC       ZATTEROR                              #  ZERO THE ERRORS AND COMMANDED RATES.
058991,000094: 20,2145           32152                           CAF      POWERDB                               #  SET DB TO 1.0 DEG.
058992,000095: 20,2146           55346                           TS       DB                                    
058993,000096: 20,2147           12133                           TCF      CALLACCS                              #  SET UP 1/ACCS AND RETURN TO CALLER.
058994,000097: 20,2150           00155        NARROWDB           OCTAL    00155                                 #  0.3 DEGREE SCALED AT 45.

Page 1408

058996,000099: 20,2151           03434        WIDEDB             OCTAL    03434                                 #  5.0 DEGREES SCALED AT 45.
058997,000100: 20,2152           00554        POWERDB            DEC      .02222                                #  1.0 DEGREE SCALED AT 45.
058998,000101: 
058999,000102: 20,2153           35015        ZATTEROR           CAF      EBANK6                                
059000,000103: 20,2154           56003                           XCH      EBANK                                 
059001,000104: 20,2155           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
059002,000105: 20,2156           30032                           CAE      CDUX                                  
059003,000106: 20,2157           55635                           TS       CDUXD                                 
059004,000107: 20,2160           30033                           CAE      CDUY                                  
059005,000108: 20,2161           55636                           TS       CDUYD                                 
059006,000109: 20,2162           30034                           CAE      CDUZ                                  
059007,000110: 20,2163           55637                           TS       CDUZD                                 
059008,000111: 20,2164           12170                           TCF      STOPRATE   +3                         
059009,000112: 
059010,000113: 20,2165           35015        STOPRATE           CAF      EBANK6                                
059011,000114: 20,2166           56003                           XCH      EBANK                                 
059012,000115: 20,2167           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
059013,000116: 20,2170           34755                 +3        CAF      ZERO                                  
059014,000117: 20,2171           55643                           TS       OMEGAPD                               
059015,000118: 20,2172           55644                           TS       OMEGAQD                               
059016,000119: 20,2173           55645                           TS       OMEGARD                               
059017,000120: 20,2174           55640                           TS       DELCDUX                               
059018,000121: 20,2175           55641                           TS       DELCDUY                               
059019,000122: 20,2176           55642                           TS       DELCDUZ                               
059020,000123: 20,2177           55277                           TS       DELPEROR                              
059021,000124: 20,2200           55300                           TS       DELQEROR                              
059022,000125: 20,2201           55301                           TS       DELREROR                              
059023,000126: 20,2202           22003                           LXCH     EBANK                                 #  RESTORE CALLERS EBANK.
059024,000127: 20,2203           00002                           TC       Q                                     
059025,000128: 
059026,000129:                                                                                                  #  SUBROUTINE NAME:      ALLCOAST
059027,000130:                                                                                                  #  WILL BE CALLED BY FRESH STARTS AND ENGINE OFF ROUTINES.               .
059028,000131: 
059029,000132:                                                                                                  #  CALLING SEQUENCE:     (SAME AS ABOVE)
059030,000133: 
059031,000134:                                                                                                  #  EXIT:                 RETURN TO Q.
059032,000135: 
059033,000136:                                                                                                  #  SUBROUTINES CALLED:   STOPRATE, RESTORDB, NOVAC
059034,000137: 
059035,000138:                                                                                                  #  ZERO:                 (FOR ALL AXES) AOS, ALPHA, AOSTERM, OMEGAD, DELCDU, DELEROR
059036,000139: 
059037,000140:                                                                                                  #  OUTPUT:               DRIFTBIT/DAPBOOLS, DB, JOB TO DO 1/ACCS
059038,000141: 
059039,000142:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, RUPTREG2, (ITEMPS IN NOVAC)
059040,000143: 
059041,000144: 20,2204           00006        ALLCOAST           EXTEND                                         #  SAVE Q FOR RETURN
059042,000145: 20,2205           22071                           QXCH     RUPTREG2                              

Page 1409

059044,000147: 20,2206           02165                           TC       STOPRATE                              #  CLEAR RATE INTERFACE.  RETURN WITH A=0
059045,000148: 20,2207           22003                           LXCH     EBANK                                 #  AND L=EBANK6.  SAVE CALLERS EBANK.
059046,000149: 20,2210           55537                           TS       AOSQ                                  
059047,000150: 20,2211           55540                           TS       AOSQ       +1                         
059048,000151: 20,2212           55541                           TS       AOSR                                  
059049,000152: 20,2213           55542                           TS       AOSR       +1                         
059050,000153: 20,2214           55424                           TS       ALPHAQ                                #  FOR DOWNLIST.
059051,000154: 20,2215           55425                           TS       ALPHAR                                
059052,000155: 20,2216           55545                           TS       AOSQTERM                              
059053,000156: 20,2217           55546                           TS       AOSRTERM                              
059054,000157: 20,2220           22003                           LXCH     EBANK                                 #  RESTORE EBANK (EBANK6 NO LONGER NEEDED)
059055,000158: 
059056,000159: 20,2221           40111                           CS       DAPBOOLS                              #  SET UP DRIFTBIT
059057,000160: 20,2222           74744                           MASK     DRIFTBIT                              
059058,000161: 20,2223           26111                           ADS      DAPBOOLS                              
059059,000162: 20,2224           02124                           TC       RESTORDB   +1                         #  RESTORE DEADBANK TO CREW-SELECTED VALUE.
059060,000163: 
059061,000164: 20,2225           00071                           TC       RUPTREG2                              #  RETURN.
059062,000165: 

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