Source Code

These source-code files were from the printout at the MIT Museum, with many thanks to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing it to us. The printout was digitally photographed by Paul Fjeld. A team of volunteers transcribed the source code manually from these images or, where appropriate, modified already-transcribed but similar source Luminary 131 (Apollo 13) source code to agree with the images from the printout. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 001 OF AGC PROGRAM LMY99 BY NASA 2021112-061
	16:27 JULY 14,1969
Note that the date is the date of the printout, not the date of the program revision.

060406,000002:                                                                                                  ## Copyright:   Public domain.
060407,000003:                                                                                                  ## Filename:    DAP_INTERFACE_SUBROUTINES.agc
060408,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
060409,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
060410,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
060411,000007:                                                                                                  ## Assembler:   yaYUL
060412,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
060413,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
060414,000010:                                                                                                  ## Pages:       1406-1409
060415,000011:                                                                                                  ## Mod history: 2009-05-10 SN   (Sergio Navarro).  Started adapting
060416,000012:                                                                                                  ##                              from the Luminary131/ file of the same
060417,000013:                                                                                                  ##                              name, using Luminary099 page images.
060418,000014:                                                                                                  ##              2011-01-06 JL   Fixed pseudo-label indentation.
060419,000015:                                                                                                  ##              2016-12-18 RSB  Proofed text comments with octopus/ProoferComments
060420,000016:                                                                                                  ##                              and corrected the errors found.
060421,000017:                                                                                                  ##              2017-03-10 RSB  Comment-text fixes noted in proofing Luminary 116.
060422,000018: 
060423,000019:                                                                                                  ## This source code has been transcribed or otherwise adapted from
060424,000020:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
060425,000021:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
060426,000022:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
060427,000023:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
060428,000024:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
060429,000025:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
060430,000026:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
060431,000027:                                                                                                  ## actually created.
060432,000028:                                                                                                  ##
060433,000029:                                                                                                  ## Notations on the hardcopy document read, in part:
060434,000030:                                                                                                  ##
060435,000031:                                                                                                  ##      Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
060436,000032:                                                                                                  ##      16:27 JULY 14, 1969 
060437,000033: 

Page 1406

060439,000035: 20,2123                                           BANK     20                                    
060440,000036: 20,2000                                           SETLOC   DAPS3                                 
060441,000037: 20,2000                                           BANK                                           
060442,000038: 
060443,000039: 20,2123  E6,1635                                  EBANK=   CDUXD                                 
060444,000040: 20,2123                                           COUNT*   $$/DAPIF                              
060445,000041: 
060446,000042:                                                                                                  #  MOD 0         DATE    11/15/66        BY GEORGE W. CHERRY
060447,000043:                                                                                                  #  MOD 1                  1/23/67        MODIFICATION BY PETER ADLER
060448,000044: 
060449,000045:                                                                                                  #  FUNCTIONAL DESCRIPTION
060450,000046:                                                                                                  #        HEREIN ARE A COLLECTION OF SUBROUTINES WHICH ALLOW MISSION CONTROL PROGRAMS TO CONTROL THE MODE
060451,000047:                                                                                                  #        AND INTERFACE WITH THE DAP.
060452,000048: 
060453,000049:                                                                                                  #  CALLING SEQUENCES
060454,000050:                                                                                                  #        IN INTERRUPT OR WITH INTERRUPT INHIBITED
060455,000051:                                                                                                  #                TC      IBNKCALL
060456,000052:                                                                                                  #                FCADR   ROUTINE
060457,000053:                                                                                                  #        IN A JOB WITHOUT INTERRUPT INHIBITED
060458,000054:                                                                                                  #                INHINT
060459,000055:                                                                                                  #                TC      IBNKCALL
060460,000056:                                                                                                  #                FCADR   ROUTINE
060461,000057:                                                                                                  #                RELINT
060462,000058: 
060463,000059:                                                                                                  #  OUTPUT
060464,000060:                                                                                                  #        SEE INDIVIDUAL ROUTINES BELOW
060465,000061: 
060466,000062:                                                                                                  #  DEBRIS
060467,000063:                                                                                                  #        A, L, AND SOMETIMES MDUETEMP                    ODE     NOT IN PULSES MODE
060468,000064: 

Page 1407

060470,000066:                                                                                                  #  SUBROUTINE NAMES:
060471,000067:                                                                                                  #        SETMAXDB, SETMINDB, RESTORDB, PFLITEDB
060472,000068:                                                                                                  #  MODIFIED:     30 JANUARY 1968 BY P S WEISSMAN TO CREATE RESTORDB.
060473,000069:                                                                                                  #  MODIFIED:     1 MARCH 1968 BY P S WEISSMAN TO SAVE EBANK AND CREATE PFLITEDB
060474,000070: 
060475,000071:                                                                                                  #  FUNCTIONAL DESCRIPTION:
060476,000072:                                                                                                  #        SETMAXDB - SET DEADBAND TO 5.0 DEGREES
060477,000073:                                                                                                  #        SETMINDB - SET DEADBAND TO 0.3 DEGREE
060478,000074:                                                                                                  #        RESTORDB - SET DEADBAND TO MAX OR MIN ACCORDING TO SETTING OF DBSELECT BIT OF DAPBOOLS
060479,000075:                                                                                                  #        PFLITEDB - SET DEADBAND TO 1.0 DEGREE AND ZERO THE COMMANDED ATTITUDE CHANGE AND COMMANDED RATE
060480,000076: 
060481,000077:                                                                                                  #        ALL ENTRIES SET UP A NOVAC JOB TO DO 1/ACCS SO THAT THE TJETLAW SWITCH CURVES ARE POSITIONED TO
060482,000078:                                                                                                  #        REFLECT THE NEW DEADBAND.  IT SHOULD BE NOTED THAT THE DEADBAND REFERS TO THE ATTITUDE IN THE P-, U-, AND V-AXES.
060483,000079: 
060484,000080:                                                                                                  #  SUBROUTINE CALLED:    NOVAC
060485,000081: 
060486,000082:                                                                                                  #  CALLING SEQUENCE:     SAME AS ABOVE
060487,000083:                                                                                                  #                        OR      TC RESTORDB +1    FROM ALLCOAST
060488,000084: 
060489,000085:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, (ITEMPS IN NOVAC)
060490,000086: 
060491,000087: 20,2123           30111        RESTORDB           CAE      DAPBOOLS                              #  DETERMINE CREW-SELECTED DEADBAND.
060492,000088: 20,2124           74750                           MASK     DBSELECT                              
060493,000089: 20,2125           00006                           EXTEND                                         
060494,000090: 20,2126           12140                           BZF      SETMINDB                              
060495,000091: 
060496,000092: 20,2127           32151        SETMAXDB           CAF      WIDEDB                                #  SET 5 DEGREE DEADBAND.
060497,000093: 20,2130           55346                 +1        TS       DB                                    
060498,000094: 
060499,000095: 20,2131           00006                           EXTEND                                         #  SET UP JOB TO RE-POSITION SWITCH CURVES.
060500,000096: 20,2132           22070                           QXCH     RUPTREG1                              
060501,000097: 20,2133           37715        CALLACCS           CAF      PRIO27                                
060502,000098: 20,2134           05072                           TC       NOVAC                                 
060503,000099: 20,2135  E6,1537                                  EBANK=   AOSQ                                  
060504,000100: 20,2135           02454 40106                     2CADR    1/ACCJOB                              
060505,000101: 
060506,000102: 20,2137           00070                           TC       RUPTREG1                              #  RETURN TO CALLER.
060507,000103: 
060508,000104: 20,2140           32150        SETMINDB           CAF      NARROWDB                              #  SET 0.3 DEGREE DEADBAND.
060509,000105: 20,2141           12130                           TCF      SETMAXDB   +1                         
060510,000106: 
060511,000107: 20,2142           00006        PFLITEDB           EXTEND                                         #  THE RETURN FROM CALLACCS IS TO RUPTREG1.
060512,000108: 20,2143           22070                           QXCH     RUPTREG1                              
060513,000109: 20,2144           02153                           TC       ZATTEROR                              #  ZERO THE ERRORS AND COMMANDED RATES.
060514,000110: 20,2145           32152                           CAF      POWERDB                               #  SET DB TO 1.0 DEG.
060515,000111: 20,2146           55346                           TS       DB                                    
060516,000112: 20,2147           12133                           TCF      CALLACCS                              #  SET UP 1/ACCS AND RETURN TO CALLER.
060517,000113: 20,2150           00155        NARROWDB           OCTAL    00155                                 #  0.3 DEGREE SCALED AT 45.

Page 1408

060519,000115: 20,2151           03434        WIDEDB             OCTAL    03434                                 #  5.0 DEGREES SCALED AT 45.
060520,000116: 20,2152           00554        POWERDB            DEC      .02222                                #  1.0 DEGREE SCALED AT 45.
060521,000117: 
060522,000118: 20,2153           35015        ZATTEROR           CAF      EBANK6                                
060523,000119: 20,2154           56003                           XCH      EBANK                                 
060524,000120: 20,2155           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
060525,000121: 20,2156           30032                           CAE      CDUX                                  
060526,000122: 20,2157           55635                           TS       CDUXD                                 
060527,000123: 20,2160           30033                           CAE      CDUY                                  
060528,000124: 20,2161           55636                           TS       CDUYD                                 
060529,000125: 20,2162           30034                           CAE      CDUZ                                  
060530,000126: 20,2163           55637                           TS       CDUZD                                 
060531,000127: 20,2164           12170                           TCF      STOPRATE   +3                         
060532,000128: 
060533,000129: 20,2165           35015        STOPRATE           CAF      EBANK6                                
060534,000130: 20,2166           56003                           XCH      EBANK                                 
060535,000131: 20,2167           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
060536,000132: 20,2170           34755                 +3        CAF      ZERO                                  
060537,000133: 20,2171           55643                           TS       OMEGAPD                               
060538,000134: 20,2172           55644                           TS       OMEGAQD                               
060539,000135: 20,2173           55645                           TS       OMEGARD                               
060540,000136: 20,2174           55640                           TS       DELCDUX                               
060541,000137: 20,2175           55641                           TS       DELCDUY                               
060542,000138: 20,2176           55642                           TS       DELCDUZ                               
060543,000139: 20,2177           55277                           TS       DELPEROR                              
060544,000140: 20,2200           55300                           TS       DELQEROR                              
060545,000141: 20,2201           55301                           TS       DELREROR                              
060546,000142: 20,2202           22003                           LXCH     EBANK                                 #  RESTORE CALLERS EBANK.
060547,000143: 20,2203           00002                           TC       Q                                     
060548,000144: 
060549,000145:                                                                                                  #  SUBROUTINE NAME:      ALLCOAST
060550,000146:                                                                                                  #  WILL BE CALLED BY FRESH STARTS AND ENGINE OFF ROUTINES.               .
060551,000147: 
060552,000148:                                                                                                  #  CALLING SEQUENCE:     (SAME AS ABOVE)
060553,000149: 
060554,000150:                                                                                                  #  EXIT:                 RETURN TO Q.
060555,000151: 
060556,000152:                                                                                                  #  SUBROUTINES CALLED:   STOPRATE, RESTORDB, NOVAC
060557,000153: 
060558,000154:                                                                                                  #  ZERO:                 (FOR ALL AXES) AOS, ALPHA, AOSTERM, OMEGAD, DELCDU, DELEROR
060559,000155: 
060560,000156:                                                                                                  #  OUTPUT:               DRIFTBIT/DAPBOOLS, DB, JOB TO DO 1/ACCS
060561,000157: 
060562,000158:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, RUPTREG2, (ITEMPS IN NOVAC)
060563,000159: 
060564,000160: 20,2204           00006        ALLCOAST           EXTEND                                         #  SAVE Q FOR RETURN
060565,000161: 20,2205           22071                           QXCH     RUPTREG2                              

Page 1409

060567,000163: 20,2206           02165                           TC       STOPRATE                              #  CLEAR RATE INTERFACE.  RETURN WITH A=0
060568,000164: 20,2207           22003                           LXCH     EBANK                                 #  AND L=EBANK6.  SAVE CALLERS EBANK.
060569,000165: 20,2210           55537                           TS       AOSQ                                  
060570,000166: 20,2211           55540                           TS       AOSQ       +1                         
060571,000167: 20,2212           55541                           TS       AOSR                                  
060572,000168: 20,2213           55542                           TS       AOSR       +1                         
060573,000169: 20,2214           55424                           TS       ALPHAQ                                #  FOR DOWNLIST.
060574,000170: 20,2215           55425                           TS       ALPHAR                                
060575,000171: 20,2216           55545                           TS       AOSQTERM                              
060576,000172: 20,2217           55546                           TS       AOSRTERM                              
060577,000173: 20,2220           22003                           LXCH     EBANK                                 #  RESTORE EBANK (EBANK6 NO LONGER NEEDED)
060578,000174: 
060579,000175: 20,2221           40111                           CS       DAPBOOLS                              #  SET UP DRIFTBIT
060580,000176: 20,2222           74744                           MASK     DRIFTBIT                              
060581,000177: 20,2223           26111                           ADS      DAPBOOLS                              
060582,000178: 20,2224           02124                           TC       RESTORDB   +1                         #  RESTORE DEADBANK TO CREW-SELECTED VALUE.
060583,000179: 
060584,000180: 20,2225           00071                           TC       RUPTREG2                              #  RETURN.
060585,000181: 

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