Source Code

This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the second release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 97. A bug (which had been around since at least Apollo 10, Luminary 69) was discovered in Rev 0 shortly before the Apollo 11 flight, resulting in a last minute revision into Rev 1, which is what actually flew rather than the Rev 0 presented here. A hardcopy of Rev 0 is known to exist — it belonged to AGC developer Allan Klumpp for many years — but unfortunately the Virtual AGC Project has not had access to that hardcopy. Thus the code you see here had been reconstructed (we believe accurately) rather than transcribed. The first step of the reconstruction of the Rev 0 source code was the transcription of the Rev 1 source code from a hardcopy in the MIT Museum collection. The process of reverting the active portion of the source code (i.e., other than program comments) from Rev 1 to Rev 0 was very minor, consisting only of moving the position of the STARTSB1 label in FRESH START AND RESTART. Allan had previously given us the checksums of the memory banks of Rev 0, and we have verified the program presented here has checksums identical to all banks of Allan's listing of Rev 0. The notations on Allan's Rev 0 program listing read, in part:

	GAP:  ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-051

A single program comment is known to differ between Rev 0 and Rev 1, but these are harder to reconstruct and verify than changes to the active portion of the code. Thus it is possible that there are additional differences between the program comments in Rev 0 and Rev 1 that are unknown to us, and therefore are not reflected in the code presented here.

061579,000002:                                                                                                  ## Copyright:   Public domain.
061580,000003:                                                                                                  ## Filename:    DAP_INTERFACE_SUBROUTINES.agc
061581,000004:                                                                                                  ## Purpose:     Part of the reconstructed source code for LMY99 Rev 0,
061582,000005:                                                                                                  ##              otherwise known as Luminary Rev 99, the second release
061583,000006:                                                                                                  ##              of the Apollo Guidance Computer (AGC) software for Apollo 11.
061584,000007:                                                                                                  ##              It differs from LMY99 Rev 1 (the flown version) only in the
061585,000008:                                                                                                  ##              placement of a single label. The corrections shown here have
061586,000009:                                                                                                  ##              been verified to have the same bank checksums as AGC developer
061587,000010:                                                                                                  ##              Allan Klumpp's copy of Luminary Rev 99, and so are believed
061588,000011:                                                                                                  ##              to be accurate. This file is intended to be a faithful 
061589,000012:                                                                                                  ##              recreation, except that the code format has been changed to 
061590,000013:                                                                                                  ##              conform to the requirements of the yaYUL assembler rather than 
061591,000014:                                                                                                  ##              the original YUL assembler.
061592,000015:                                                                                                  ##
061593,000016:                                                                                                  ## Assembler:   yaYUL
061594,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
061595,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo.
061596,000019:                                                                                                  ## Pages:       1406-1409
061597,000020:                                                                                                  ## Mod history: 2009-05-10 SN   (Sergio Navarro).  Started adapting
061598,000021:                                                                                                  ##                              from the Luminary131/ file of the same
061599,000022:                                                                                                  ##                              name, using Luminary099 page images.
061600,000023:                                                                                                  ##              2011-01-06 JL   Fixed pseudo-label indentation.
061601,000024:                                                                                                  ##              2016-12-18 RSB  Proofed text comments with octopus/ProoferComments
061602,000025:                                                                                                  ##                              and corrected the errors found.
061603,000026:                                                                                                  ##              2017-03-10 RSB  Comment-text fixes noted in proofing Luminary 116.
061604,000027:                                                                                                  ##              2017-08-01 MAS  Created from LMY99 Rev 1.
061605,000028: 
061606,000029:                                                                                                  ## This source code has been transcribed or otherwise adapted from
061607,000030:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
061608,000031:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
061609,000032:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
061610,000033:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
061611,000034:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
061612,000035:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
061613,000036:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
061614,000037:                                                                                                  ## actually created.
061615,000038:                                                                                                  ##
061616,000039:                                                                                                  ## The code has been modified to match LMY99 Revision 0, otherwise
061617,000040:                                                                                                  ## known as Luminary Revision 99, the Apollo 11 software release preceeding
061618,000041:                                                                                                  ## the listing from which it was transcribed. It has been verified to
061619,000042:                                                                                                  ## contain the same bank checksums as AGC developer Allan Klumpp's listing
061620,000043:                                                                                                  ## of Luminary Revision 99 (for which we do not have scans).
061621,000044:                                                                                                  ##
061622,000045:                                                                                                  ## Notations on Allan Klumpp's listing read, in part:
061623,000046:                                                                                                  ##
061624,000047:                                                                                                  ##      ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
061625,000048: 

Page 1406

061627,000050: 20,2123                                           BANK     20                                    
061628,000051: 20,2000                                           SETLOC   DAPS3                                 
061629,000052: 20,2000                                           BANK                                           
061630,000053: 
061631,000054: 20,2123  E6,1635                                  EBANK=   CDUXD                                 
061632,000055: 20,2123                                           COUNT*   $$/DAPIF                              
061633,000056: 
061634,000057:                                                                                                  #  MOD 0         DATE    11/15/66        BY GEORGE W. CHERRY
061635,000058:                                                                                                  #  MOD 1                  1/23/67        MODIFICATION BY PETER ADLER
061636,000059: 
061637,000060:                                                                                                  #  FUNCTIONAL DESCRIPTION
061638,000061:                                                                                                  #        HEREIN ARE A COLLECTION OF SUBROUTINES WHICH ALLOW MISSION CONTROL PROGRAMS TO CONTROL THE MODE
061639,000062:                                                                                                  #        AND INTERFACE WITH THE DAP.
061640,000063: 
061641,000064:                                                                                                  #  CALLING SEQUENCES
061642,000065:                                                                                                  #        IN INTERRUPT OR WITH INTERRUPT INHIBITED
061643,000066:                                                                                                  #                TC      IBNKCALL
061644,000067:                                                                                                  #                FCADR   ROUTINE
061645,000068:                                                                                                  #        IN A JOB WITHOUT INTERRUPT INHIBITED
061646,000069:                                                                                                  #                INHINT
061647,000070:                                                                                                  #                TC      IBNKCALL
061648,000071:                                                                                                  #                FCADR   ROUTINE
061649,000072:                                                                                                  #                RELINT
061650,000073: 
061651,000074:                                                                                                  #  OUTPUT
061652,000075:                                                                                                  #        SEE INDIVIDUAL ROUTINES BELOW
061653,000076: 
061654,000077:                                                                                                  #  DEBRIS
061655,000078:                                                                                                  #        A, L, AND SOMETIMES MDUETEMP                    ODE     NOT IN PULSES MODE
061656,000079: 

Page 1407

061658,000081:                                                                                                  #  SUBROUTINE NAMES:
061659,000082:                                                                                                  #        SETMAXDB, SETMINDB, RESTORDB, PFLITEDB
061660,000083:                                                                                                  #  MODIFIED:     30 JANUARY 1968 BY P S WEISSMAN TO CREATE RESTORDB.
061661,000084:                                                                                                  #  MODIFIED:     1 MARCH 1968 BY P S WEISSMAN TO SAVE EBANK AND CREATE PFLITEDB
061662,000085: 
061663,000086:                                                                                                  #  FUNCTIONAL DESCRIPTION:
061664,000087:                                                                                                  #        SETMAXDB - SET DEADBAND TO 5.0 DEGREES
061665,000088:                                                                                                  #        SETMINDB - SET DEADBAND TO 0.3 DEGREE
061666,000089:                                                                                                  #        RESTORDB - SET DEADBAND TO MAX OR MIN ACCORDING TO SETTING OF DBSELECT BIT OF DAPBOOLS
061667,000090:                                                                                                  #        PFLITEDB - SET DEADBAND TO 1.0 DEGREE AND ZERO THE COMMANDED ATTITUDE CHANGE AND COMMANDED RATE
061668,000091: 
061669,000092:                                                                                                  #        ALL ENTRIES SET UP A NOVAC JOB TO DO 1/ACCS SO THAT THE TJETLAW SWITCH CURVES ARE POSITIONED TO
061670,000093:                                                                                                  #        REFLECT THE NEW DEADBAND.  IT SHOULD BE NOTED THAT THE DEADBAND REFERS TO THE ATTITUDE IN THE P-, U-, AND V-AXES.
061671,000094: 
061672,000095:                                                                                                  #  SUBROUTINE CALLED:    NOVAC
061673,000096: 
061674,000097:                                                                                                  #  CALLING SEQUENCE:     SAME AS ABOVE
061675,000098:                                                                                                  #                        OR      TC RESTORDB +1    FROM ALLCOAST
061676,000099: 
061677,000100:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, (ITEMPS IN NOVAC)
061678,000101: 
061679,000102: 20,2123           30111        RESTORDB           CAE      DAPBOOLS                              #  DETERMINE CREW-SELECTED DEADBAND.
061680,000103: 20,2124           74750                           MASK     DBSELECT                              
061681,000104: 20,2125           00006                           EXTEND                                         
061682,000105: 20,2126           12140                           BZF      SETMINDB                              
061683,000106: 
061684,000107: 20,2127           32151        SETMAXDB           CAF      WIDEDB                                #  SET 5 DEGREE DEADBAND.
061685,000108: 20,2130           55346                 +1        TS       DB                                    
061686,000109: 
061687,000110: 20,2131           00006                           EXTEND                                         #  SET UP JOB TO RE-POSITION SWITCH CURVES.
061688,000111: 20,2132           22070                           QXCH     RUPTREG1                              
061689,000112: 20,2133           37715        CALLACCS           CAF      PRIO27                                
061690,000113: 20,2134           05072                           TC       NOVAC                                 
061691,000114: 20,2135  E6,1537                                  EBANK=   AOSQ                                  
061692,000115: 20,2135           02454 40106                     2CADR    1/ACCJOB                              
061693,000116: 
061694,000117: 20,2137           00070                           TC       RUPTREG1                              #  RETURN TO CALLER.
061695,000118: 
061696,000119: 20,2140           32150        SETMINDB           CAF      NARROWDB                              #  SET 0.3 DEGREE DEADBAND.
061697,000120: 20,2141           12130                           TCF      SETMAXDB   +1                         
061698,000121: 
061699,000122: 20,2142           00006        PFLITEDB           EXTEND                                         #  THE RETURN FROM CALLACCS IS TO RUPTREG1.
061700,000123: 20,2143           22070                           QXCH     RUPTREG1                              
061701,000124: 20,2144           02153                           TC       ZATTEROR                              #  ZERO THE ERRORS AND COMMANDED RATES.
061702,000125: 20,2145           32152                           CAF      POWERDB                               #  SET DB TO 1.0 DEG.
061703,000126: 20,2146           55346                           TS       DB                                    
061704,000127: 20,2147           12133                           TCF      CALLACCS                              #  SET UP 1/ACCS AND RETURN TO CALLER.
061705,000128: 20,2150           00155        NARROWDB           OCTAL    00155                                 #  0.3 DEGREE SCALED AT 45.

Page 1408

061707,000130: 20,2151           03434        WIDEDB             OCTAL    03434                                 #  5.0 DEGREES SCALED AT 45.
061708,000131: 20,2152           00554        POWERDB            DEC      .02222                                #  1.0 DEGREE SCALED AT 45.
061709,000132: 
061710,000133: 20,2153           35015        ZATTEROR           CAF      EBANK6                                
061711,000134: 20,2154           56003                           XCH      EBANK                                 
061712,000135: 20,2155           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
061713,000136: 20,2156           30032                           CAE      CDUX                                  
061714,000137: 20,2157           55635                           TS       CDUXD                                 
061715,000138: 20,2160           30033                           CAE      CDUY                                  
061716,000139: 20,2161           55636                           TS       CDUYD                                 
061717,000140: 20,2162           30034                           CAE      CDUZ                                  
061718,000141: 20,2163           55637                           TS       CDUZD                                 
061719,000142: 20,2164           12170                           TCF      STOPRATE   +3                         
061720,000143: 
061721,000144: 20,2165           35015        STOPRATE           CAF      EBANK6                                
061722,000145: 20,2166           56003                           XCH      EBANK                                 
061723,000146: 20,2167           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
061724,000147: 20,2170           34755                 +3        CAF      ZERO                                  
061725,000148: 20,2171           55643                           TS       OMEGAPD                               
061726,000149: 20,2172           55644                           TS       OMEGAQD                               
061727,000150: 20,2173           55645                           TS       OMEGARD                               
061728,000151: 20,2174           55640                           TS       DELCDUX                               
061729,000152: 20,2175           55641                           TS       DELCDUY                               
061730,000153: 20,2176           55642                           TS       DELCDUZ                               
061731,000154: 20,2177           55277                           TS       DELPEROR                              
061732,000155: 20,2200           55300                           TS       DELQEROR                              
061733,000156: 20,2201           55301                           TS       DELREROR                              
061734,000157: 20,2202           22003                           LXCH     EBANK                                 #  RESTORE CALLERS EBANK.
061735,000158: 20,2203           00002                           TC       Q                                     
061736,000159: 
061737,000160:                                                                                                  #  SUBROUTINE NAME:      ALLCOAST
061738,000161:                                                                                                  #  WILL BE CALLED BY FRESH STARTS AND ENGINE OFF ROUTINES.               .
061739,000162: 
061740,000163:                                                                                                  #  CALLING SEQUENCE:     (SAME AS ABOVE)
061741,000164: 
061742,000165:                                                                                                  #  EXIT:                 RETURN TO Q.
061743,000166: 
061744,000167:                                                                                                  #  SUBROUTINES CALLED:   STOPRATE, RESTORDB, NOVAC
061745,000168: 
061746,000169:                                                                                                  #  ZERO:                 (FOR ALL AXES) AOS, ALPHA, AOSTERM, OMEGAD, DELCDU, DELEROR
061747,000170: 
061748,000171:                                                                                                  #  OUTPUT:               DRIFTBIT/DAPBOOLS, DB, JOB TO DO 1/ACCS
061749,000172: 
061750,000173:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, RUPTREG2, (ITEMPS IN NOVAC)
061751,000174: 
061752,000175: 20,2204           00006        ALLCOAST           EXTEND                                         #  SAVE Q FOR RETURN
061753,000176: 20,2205           22071                           QXCH     RUPTREG2                              

Page 1409

061755,000178: 20,2206           02165                           TC       STOPRATE                              #  CLEAR RATE INTERFACE.  RETURN WITH A=0
061756,000179: 20,2207           22003                           LXCH     EBANK                                 #  AND L=EBANK6.  SAVE CALLERS EBANK.
061757,000180: 20,2210           55537                           TS       AOSQ                                  
061758,000181: 20,2211           55540                           TS       AOSQ       +1                         
061759,000182: 20,2212           55541                           TS       AOSR                                  
061760,000183: 20,2213           55542                           TS       AOSR       +1                         
061761,000184: 20,2214           55424                           TS       ALPHAQ                                #  FOR DOWNLIST.
061762,000185: 20,2215           55425                           TS       ALPHAR                                
061763,000186: 20,2216           55545                           TS       AOSQTERM                              
061764,000187: 20,2217           55546                           TS       AOSRTERM                              
061765,000188: 20,2220           22003                           LXCH     EBANK                                 #  RESTORE EBANK (EBANK6 NO LONGER NEEDED)
061766,000189: 
061767,000190: 20,2221           40111                           CS       DAPBOOLS                              #  SET UP DRIFTBIT
061768,000191: 20,2222           74744                           MASK     DRIFTBIT                              
061769,000192: 20,2223           26111                           ADS      DAPBOOLS                              
061770,000193: 20,2224           02124                           TC       RESTORDB   +1                         #  RESTORE DEADBANK TO CREW-SELECTED VALUE.
061771,000194: 
061772,000195: 20,2225           00071                           TC       RUPTREG2                              #  RETURN.
061773,000196: 

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