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
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

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

Page 1406

060416,000035: 20,2123                                           BANK     20                                    
060417,000036: 20,2000                                           SETLOC   DAPS3                                 
060418,000037: 20,2000                                           BANK                                           
060419,000038: 
060420,000039: 20,2123  E6,1635                                  EBANK=   CDUXD                                 
060421,000040: 20,2123                                           COUNT*   $$/DAPIF                              
060422,000041: 
060423,000042:                                                                                                  #  MOD 0         DATE    11/15/66        BY GEORGE W. CHERRY
060424,000043:                                                                                                  #  MOD 1                  1/23/67        MODIFICATION BY PETER ADLER
060425,000044: 
060426,000045:                                                                                                  #  FUNCTIONAL DESCRIPTION
060427,000046:                                                                                                  #        HEREIN ARE A COLLECTION OF SUBROUTINES WHICH ALLOW MISSION CONTROL PROGRAMS TO CONTROL THE MODE
060428,000047:                                                                                                  #        AND INTERFACE WITH THE DAP.
060429,000048: 
060430,000049:                                                                                                  #  CALLING SEQUENCES
060431,000050:                                                                                                  #        IN INTERRUPT OR WITH INTERRUPT INHIBITED
060432,000051:                                                                                                  #                TC      IBNKCALL
060433,000052:                                                                                                  #                FCADR   ROUTINE
060434,000053:                                                                                                  #        IN A JOB WITHOUT INTERRUPT INHIBITED
060435,000054:                                                                                                  #                INHINT
060436,000055:                                                                                                  #                TC      IBNKCALL
060437,000056:                                                                                                  #                FCADR   ROUTINE
060438,000057:                                                                                                  #                RELINT
060439,000058: 
060440,000059:                                                                                                  #  OUTPUT
060441,000060:                                                                                                  #        SEE INDIVIDUAL ROUTINES BELOW
060442,000061: 
060443,000062:                                                                                                  #  DEBRIS
060444,000063:                                                                                                  #        A, L, AND SOMETIMES MDUETEMP                    ODE     NOT IN PULSES MODE
060445,000064: 

Page 1407

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

Page 1408

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

Page 1409

060544,000163: 20,2206           02165                           TC       STOPRATE                              #  CLEAR RATE INTERFACE.  RETURN WITH A=0
060545,000164: 20,2207           22003                           LXCH     EBANK                                 #  AND L=EBANK6.  SAVE CALLERS EBANK.
060546,000165: 20,2210           55537                           TS       AOSQ                                  
060547,000166: 20,2211           55540                           TS       AOSQ       +1                         
060548,000167: 20,2212           55541                           TS       AOSR                                  
060549,000168: 20,2213           55542                           TS       AOSR       +1                         
060550,000169: 20,2214           55424                           TS       ALPHAQ                                #  FOR DOWNLIST.
060551,000170: 20,2215           55425                           TS       ALPHAR                                
060552,000171: 20,2216           55545                           TS       AOSQTERM                              
060553,000172: 20,2217           55546                           TS       AOSRTERM                              
060554,000173: 20,2220           22003                           LXCH     EBANK                                 #  RESTORE EBANK (EBANK6 NO LONGER NEEDED)
060555,000174: 
060556,000175: 20,2221           40111                           CS       DAPBOOLS                              #  SET UP DRIFTBIT
060557,000176: 20,2222           74744                           MASK     DRIFTBIT                              
060558,000177: 20,2223           26111                           ADS      DAPBOOLS                              
060559,000178: 20,2224           02124                           TC       RESTORDB   +1                         #  RESTORE DEADBANK TO CREW-SELECTED VALUE.
060560,000179: 
060561,000180: 20,2225           00071                           TC       RUPTREG2                              #  RETURN.
060562,000181: 

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