Source Code

This is a reconstructed version of Luminary 130, the initial AGC program released in November 1969 for the Apollo 13 LM. Three more releases followed before the flown revision was finally manufactured in February 1970.

This reconstruction was created from a previous transcription of the original listing of Luminary 131, combined with Luminary memo #129 which describes the small difference between the Luminary 130 and 131. The reconstructed source code was verified by matching memory-bank checksums to those listed for Luminary 130 in drawing 2021152G.

In this source code, program comments from the original (Luminary 131) code are prefixed with '#', while those added later by the Virtual AGC project are prefixed with '##'.

059367,000002:                                                                                                  ## Copyright:   Public domain.
059368,000003:                                                                                                  ## Filename:    DAP_INTERFACE_SUBROUTINES.agc
059369,000004:                                                                                                  ## Purpose:     A section of the reconstructed source code for Luminary 130.
059370,000005:                                                                                                  ##              This was the original program released for the Apollo 13 LM,
059371,000006:                                                                                                  ##              although several more revisions would follow. It has been
059372,000007:                                                                                                  ##              reconstructed from a listing of Luminary 131, from which it
059373,000008:                                                                                                  ##              differs on only two lines in P70-P71. The difference is
059374,000009:                                                                                                  ##              described in detail in Luminary memo #129, which was used
059375,000010:                                                                                                  ##              to perform the reconstruction. This file is intended to be a
059376,000011:                                                                                                  ##              faithful reconstruction, except that the code format has been
059377,000012:                                                                                                  ##              changed to conform to the requirements of the yaYUL assembler
059378,000013:                                                                                                  ##              rather than the original YUL assembler.
059379,000014:                                                                                                  ## Reference:   pp. 1398-1401
059380,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
059381,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
059382,000017:                                                                                                  ## Mod history: 06/07/03 RSB.   Began transcribing.
059383,000018:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
059384,000019:                                                                                                  ##              2010-10-25 JL   Indentation fixes.
059385,000020:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
059386,000021:                                                                                                  ##                              original hardcopy, as opposed to the PDF page
059387,000022:                                                                                                  ##                              numbers in 1701.pdf.
059388,000023:                                                                                                  ##              2017-02-28 RSB  Proofed comment text using octopus/ProoferComments.
059389,000024:                                                                                                  ##              2017-03-01 RSB  Fixed lingering comment-text typos.
059390,000025:                                                                                                  ##              2017-03-10 RSB  Comment-text fixes noted in proofing Luminary 116.
059391,000026:                                                                                                  ##              2018-09-04 MAS  Copied from Luminary 131 for Luminary 130.
059392,000027: 

Page 1398

059394,000029: 20,2115                                           BANK     20                                    
059395,000030: 20,2000                                           SETLOC   DAPS3                                 
059396,000031: 20,2000                                           BANK                                           
059397,000032: 
059398,000033: 20,2115  E6,1634                                  EBANK=   CDUXD                                 
059399,000034: 20,2115                                           COUNT*   $$/DAPIF                              
059400,000035: 
059401,000036:                                                                                                  #  MOD 0         DATE    11/15/66        BY GEORGE W. CHERRY
059402,000037:                                                                                                  #  MOD 1                  1/23/67        MODIFICATION BY PETER ADLER
059403,000038: 
059404,000039:                                                                                                  #  FUNCTIONAL DESCRIPTION
059405,000040:                                                                                                  #        HEREIN ARE A COLLECTION OF SUBROUTINES WHICH ALLOW MISSION CONTROL PROGRAMS TO CONTROL THE MODE
059406,000041:                                                                                                  #        AND INTERFACE WITH THE DAP.
059407,000042: 
059408,000043:                                                                                                  #  CALLING SEQUENCES
059409,000044:                                                                                                  #        IN INTERRUPT OR WITH INTERRUPT INHIBITED
059410,000045:                                                                                                  #                TC      IBNKCALL
059411,000046:                                                                                                  #                FCADR   ROUTINE
059412,000047:                                                                                                  #        IN A JOB WITHOUT INTERRUPT INHIBITED
059413,000048:                                                                                                  #                INHINT
059414,000049:                                                                                                  #                TC      IBNKCALL
059415,000050:                                                                                                  #                FCADR   ROUTINE
059416,000051:                                                                                                  #                RELINT
059417,000052: 
059418,000053:                                                                                                  #  OUTPUT
059419,000054:                                                                                                  #        SEE INDIVIDUAL ROUTINES BELOW
059420,000055: 
059421,000056:                                                                                                  #  DEBRIS
059422,000057:                                                                                                  #        A, L, AND SOMETIMES MDUETEMP                                    ODE     NOT IN PULSES MODE
059423,000058: 

Page 1399

059425,000060:                                                                                                  #  SUBROUTINE NAMES:
059426,000061:                                                                                                  #        SETMAXDB, SETMINDB, RESTORDB, PFLITEDB
059427,000062:                                                                                                  #  MODIFIED:     30 JANUARY 1968 BY P S WEISSMAN TO CREATE RESTORDB.
059428,000063:                                                                                                  #  MODIFIED:     1 MARCH 1968 BY P S WEISSMAN TO SAVE EBANK AND CREATE PFLITEDB
059429,000064: 
059430,000065:                                                                                                  #  FUNCTIONAL DESCRIPTION:
059431,000066:                                                                                                  #        SETMAXDB - SET DEADBAND TO 5.0 DEGREES
059432,000067:                                                                                                  #        SETMINDB - SET DEADBAND TO 0.3 DEGREE
059433,000068:                                                                                                  #        RESTORDB - SET DEADBAND TO .3, 1, OR 5 ACCORDING TO BITS 4 AND 5 OF DAPBOOLS
059434,000069:                                                                                                  #        PFLITEDB - SET DEADBAND TO 1.0 DEGREE AND ZERO THE COMMANDED ATTITUDE CHANGE AND COMMANDED RATE
059435,000070: 
059436,000071:                                                                                                  #        ALL ENTRIES SET UP A NOVAC JOB TO DO 1/ACCS SO THAT THE TJETLAW SWITCH CURVES ARE POSITIONED TO
059437,000072:                                                                                                  #        REFLECT THE NEW DEADBAND.  IT SHOULD BE NOTED THAT THE DEADBAND REFERS TO THE ATTITUDE IN THE P-, U-, AND V-AXES.
059438,000073: 
059439,000074:                                                                                                  #  SUBROUTINE CALLED:    NOVAC
059440,000075: 
059441,000076:                                                                                                  #  CALLING SEQUENCE:     SAME AS ABOVE
059442,000077:                                                                                                  #                        OR      TC RESTORDB +1    FROM ALLCOAST
059443,000078: 
059444,000079:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, (ITEMPS IN NOVAC)
059445,000080: 
059446,000081: 20,2115           30111        RESTORDB           CAE      DAPBOOLS                              #  DETERMINE CREW-SELECTED DEADBAND.
059447,000082: 20,2116           74747                           MASK     DBSLECT2                              #  CHECK FOR MAX DB (5 DEG)
059448,000083: 20,2117           00006                           EXTEND                                         
059449,000084: 20,2120           12122                           BZF      +2                                    
059450,000085: 20,2121           12130                           TCF      SETMAXDB                              #  BIT5 DAPBOOLS IS SET - CREW WANTS 5 DEG
059451,000086: 20,2122           30111                           CAE      DAPBOOLS                              
059452,000087: 20,2123           74750                           MASK     DBSELECT                              #  CHECK FOR 1 DEG DEADBAND SELECTION
059453,000088: 20,2124           00006                           EXTEND                                         
059454,000089: 20,2125           12141                           BZF      SETMINDB                              
059455,000090: 
059456,000091: 20,2126           32153                           CAF      POWERDB                               #  BIT4 DAPBOOLS IS SET - CREW WANTS 1 DEG
059457,000092: 20,2127           12131                           TCF      SETMAXDB   +1                         
059458,000093: 20,2130           32152        SETMAXDB           CAF      WIDEDB                                #  SET 5 DEGREE DEADBAND.
059459,000094: 20,2131           55343                 +1        TS       DB                                    
059460,000095: 
059461,000096: 20,2132           00006                           EXTEND                                         #  SET UP JOB TO RE-POSITION SWITCH CURVES.
059462,000097: 20,2133           22070                           QXCH     RUPTREG1                              
059463,000098: 20,2134           37720        CALLACCS           CAF      PRIO27                                
059464,000099: 20,2135           05072                           TC       NOVAC                                 
059465,000100: 20,2136  E6,1536                                  EBANK=   AOSQ                                  
059466,000101: 20,2136           03652 42106                     2CADR    1/ACCJOB                              
059467,000102: 
059468,000103: 20,2140           00070                           TC       RUPTREG1                              #  RETURN TO CALLER.
059469,000104: 
059470,000105: 20,2141           32151        SETMINDB           CAF      NARROWDB                              #  SET 0.3 DEGREE DEADBAND.
059471,000106: 20,2142           12131                           TCF      SETMAXDB   +1                         
059472,000107: 

Page 1400

059474,000109: 20,2143           00006        PFLITEDB           EXTEND                                         #  THE RETURN FROM CALLACCS IS TO RUPTREG1.
059475,000110: 20,2144           22070                           QXCH     RUPTREG1                              
059476,000111: 20,2145           02154                           TC       ZATTEROR                              #  ZERO THE ERRORS AND COMMANDED RATES.
059477,000112: 20,2146           32153                           CAF      POWERDB                               #  SET DB TO 1.0 DEG.
059478,000113: 20,2147           55343                           TS       DB                                    
059479,000114: 20,2150           12134                           TCF      CALLACCS                              #  SET UP 1/ACCS AND RETURN TO CALLER.
059480,000115: 20,2151           00155        NARROWDB           OCTAL    00155                                 #  0.3 DEGREE SCALED AT 45.
059481,000116: 20,2152           03434        WIDEDB             OCTAL    03434                                 #  5.0 DEGREES SCALED AT 45.
059482,000117: 20,2153           00554        POWERDB            DEC      .02222                                #  1.0 DEGREE SCALED AT 45.
059483,000118: 
059484,000119: 20,2154           35015        ZATTEROR           CAF      EBANK6                                
059485,000120: 20,2155           56003                           XCH      EBANK                                 
059486,000121: 20,2156           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
059487,000122: 20,2157           30032                           CAE      CDUX                                  
059488,000123: 20,2160           55634                           TS       CDUXD                                 
059489,000124: 20,2161           30033                           CAE      CDUY                                  
059490,000125: 20,2162           55635                           TS       CDUYD                                 
059491,000126: 20,2163           30034                           CAE      CDUZ                                  
059492,000127: 20,2164           55636                           TS       CDUZD                                 
059493,000128: 20,2165           12171                           TCF      STOPRATE   +3                         
059494,000129: 
059495,000130: 20,2166           35015        STOPRATE           CAF      EBANK6                                
059496,000131: 20,2167           56003                           XCH      EBANK                                 
059497,000132: 20,2170           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
059498,000133: 20,2171           34755                 +3        CAF      ZERO                                  
059499,000134: 20,2172           55642                           TS       OMEGAPD                               
059500,000135: 20,2173           55643                           TS       OMEGAQD                               
059501,000136: 20,2174           55644                           TS       OMEGARD                               
059502,000137: 20,2175           55637                           TS       DELCDUX                               
059503,000138: 20,2176           55640                           TS       DELCDUY                               
059504,000139: 20,2177           55641                           TS       DELCDUZ                               
059505,000140: 20,2200           55274                           TS       DELPEROR                              
059506,000141: 20,2201           55275                           TS       DELQEROR                              
059507,000142: 20,2202           55276                           TS       DELREROR                              
059508,000143: 20,2203           22003                           LXCH     EBANK                                 #  RESTORE CALLERS EBANK.
059509,000144: 20,2204           00002                           TC       Q                                     
059510,000145: 
059511,000146:                                                                                                  #  SUBROUTINE NAME:      ALLCOAST
059512,000147:                                                                                                  #  WILL BE CALLED BY FRESH STARTS AND ENGINE OFF ROUTINES.               .
059513,000148: 
059514,000149:                                                                                                  #  CALLING SEQUENCE:     (SAME AS ABOVE)
059515,000150: 
059516,000151:                                                                                                  #  EXIT:                 RETURN TO Q.
059517,000152: 
059518,000153:                                                                                                  #  SUBROUTINES CALLED:   STOPRATE, RESTORDB, NOVAC
059519,000154: 
059520,000155:                                                                                                  #  ZERO:                 (FOR ALL AXES) AOS, ALPHA, AOSTERM, OMEGAD, DELCDU, DELEROR

Page 1401

059522,000157: 
059523,000158:                                                                                                  #  OUTPUT:               DRIFTBIT/DAPBOOLS, DB, JOB TO DO 1/ACCS
059524,000159: 
059525,000160:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, RUPTREG2, (ITEMPS IN NOVAC)
059526,000161: 
059527,000162: 20,2205           00006        ALLCOAST           EXTEND                                         #  SAVE Q FOR RETURN
059528,000163: 20,2206           22071                           QXCH     RUPTREG2                              
059529,000164: 20,2207           02166                           TC       STOPRATE                              #  CLEAR RATE INTERFACE.  RETURN WITH A=0
059530,000165: 20,2210           22003                           LXCH     EBANK                                 #  AND L=EBANK6.  SAVE CALLERS EBANK.
059531,000166: 20,2211           55536                           TS       AOSQ                                  
059532,000167: 20,2212           55537                           TS       AOSQ       +1                         
059533,000168: 20,2213           55540                           TS       AOSR                                  
059534,000169: 20,2214           55541                           TS       AOSR       +1                         
059535,000170: 20,2215           55424                           TS       ALPHAQ                                #  FOR DOWNLIST.
059536,000171: 20,2216           55425                           TS       ALPHAR                                
059537,000172: 20,2217           55544                           TS       AOSQTERM                              
059538,000173: 20,2220           55545                           TS       AOSRTERM                              
059539,000174: 20,2221           22003                           LXCH     EBANK                                 #  RESTORE EBANK (EBANK6 NO LONGER NEEDED)
059540,000175: 
059541,000176: 20,2222           40111                           CS       DAPBOOLS                              #  SET UP DRIFTBIT
059542,000177: 20,2223           74744                           MASK     DRIFTBIT                              
059543,000178: 20,2224           26111                           ADS      DAPBOOLS                              
059544,000179: 20,2225           02116                           TC       RESTORDB   +1                         #  RESTORE DEADBANK TO CREW-SELECTED VALUE.
059545,000180: 
059546,000181: 20,2226           00071                           TC       RUPTREG2                              #  RETURN.
059547,000182: 
059548,000183: 
059549,000184: 

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