Source Code

These source-code files were transcribed from scans made from Don Eyles's personal copy of Luminary 069. They were scanned at archive.org's Boston facility, and the scanning was sponsored by Onno Hommes. The code was transcribed from these scans by a team of volunteers who are referenced in the program comments. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". In some cases, where similar code blocks exist in previously-transcribed AGC programs (primarily Luminary 99, from Apollo 11) those code blocks were used as a starting point and then corrected to agree with the Luminary 69 scans. The full scans are available at the Virtual AGC project's collection at archive.org, while more-convenient reduced-size (but reduced-quality) images are available at the main Virtual AGC website. Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 069 OF AGC PROGRAM LUMINARY BY NASA 2021112-011
	19:02 NOV. 25,1968
Note that the date is the date of the printout, not the date of the program revision.

060824,000002:                                                                                                  ## Copyright:   Public domain.
060825,000003:                                                                                                  ## Filename:    DAP_INTERFACE_SUBROUTINES.agc
060826,000004:                                                                                                  ## Purpose:     The main source file for Luminary revision 069.
060827,000005:                                                                                                  ##              It is part of the source code for the original release
060828,000006:                                                                                                  ##              of the flight software for the Lunar Module's (LM) Apollo
060829,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 10. The actual flown
060830,000008:                                                                                                  ##              version was Luminary 69 revision 2, which included a
060831,000009:                                                                                                  ##              newer lunar gravity model and only affected module 2.
060832,000010:                                                                                                  ##              This file is intended to be a faithful transcription, except
060833,000011:                                                                                                  ##              that the code format has been changed to conform to the
060834,000012:                                                                                                  ##              requirements of the yaYUL assembler rather than the
060835,000013:                                                                                                  ##              original YUL assembler.
060836,000014:                                                                                                  ## Reference:   pp. 1401-1404
060837,000015:                                                                                                  ## Assembler:   yaYUL
060838,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
060839,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
060840,000018:                                                                                                  ## Mod history: 2016-12-13 MAS  Created from Luminary 99.
060841,000019:                                                                                                  ##              2016-12-18 MAS  Updated from comment-proofed Luminary 99 version.
060842,000020:                                                                                                  ##              2016-12-24 RRB  Updated for Luminary 69.
060843,000021:                                                                                                  ##              2017-01-28 RSB  Proofed comment text using octopus/prooferComments
060844,000022:                                                                                                  ##                              but no errors found.
060845,000023:                                                                                                  ##              2017-03-10 RSB  Comment-text fixes noted in proofing Luminary 116.
060846,000024: 

Page 1401

060848,000026: 20,2123                                           BANK     20                                    
060849,000027: 20,2000                                           SETLOC   DAPS3                                 
060850,000028: 20,2000                                           BANK                                           
060851,000029: 
060852,000030: 20,2123  E6,1633                                  EBANK=   CDUXD                                 
060853,000031: 20,2123                                           COUNT*   $$/DAPIF                              
060854,000032: 
060855,000033:                                                                                                  #  MOD 0         DATE    11/15/66        BY GEORGE W. CHERRY
060856,000034:                                                                                                  #  MOD 1                  1/23/67        MODIFICATION BY PETER ADLER
060857,000035: 
060858,000036:                                                                                                  #  FUNCTIONAL DESCRIPTION
060859,000037:                                                                                                  #        HEREIN ARE A COLLECTION OF SUBROUTINES WHICH ALLOW MISSION CONTROL PROGRAMS TO CONTROL THE MODE
060860,000038:                                                                                                  #        AND INTERFACE WITH THE DAP.
060861,000039: 
060862,000040:                                                                                                  #  CALLING SEQUENCES
060863,000041:                                                                                                  #        IN INTERRUPT OR WITH INTERRUPT INHIBITED
060864,000042:                                                                                                  #                TC      IBNKCALL
060865,000043:                                                                                                  #                FCADR   ROUTINE
060866,000044:                                                                                                  #        IN A JOB WITHOUT INTERRUPT INHIBITED
060867,000045:                                                                                                  #                INHINT
060868,000046:                                                                                                  #                TC      IBNKCALL
060869,000047:                                                                                                  #                FCADR   ROUTINE
060870,000048:                                                                                                  #                RELINT
060871,000049: 
060872,000050:                                                                                                  #  OUTPUT
060873,000051:                                                                                                  #        SEE INDIVIDUAL ROUTINES BELOW
060874,000052: 
060875,000053:                                                                                                  #  DEBRIS
060876,000054:                                                                                                  #        A, L, AND SOMETIMES MDUETEMP                    ODE     NOT IN PULSES MODE
060877,000055: 

Page 1402

060879,000057:                                                                                                  #  SUBROUTINE NAMES:
060880,000058:                                                                                                  #        SETMAXDB, SETMINDB, RESTORDB, PFLITEDB
060881,000059:                                                                                                  #  MODIFIED:     30 JANUARY 1968 BY P S WEISSMAN TO CREATE RESTORDB.
060882,000060:                                                                                                  #  MODIFIED:     1 MARCH 1968 BY P S WEISSMAN TO SAVE EBANK AND CREATE PFLITEDB
060883,000061: 
060884,000062:                                                                                                  #  FUNCTIONAL DESCRIPTION:
060885,000063:                                                                                                  #        SETMAXDB - SET DEADBAND TO 5.0 DEGREES
060886,000064:                                                                                                  #        SETMINDB - SET DEADBAND TO 0.3 DEGREE
060887,000065:                                                                                                  #        RESTORDB - SET DEADBAND TO MAX OR MIN ACCORDING TO SETTING OF DBSELECT BIT OF DAPBOOLS
060888,000066:                                                                                                  #        PFLITEDB - SET DEADBAND TO 1.0 DEGREE AND ZERO THE COMMANDED ATTITUDE CHANGE AND COMMANDED RATE
060889,000067: 
060890,000068:                                                                                                  #        ALL ENTRIES SET UP A NOVAC JOB TO DO 1/ACCS SO THAT THE TJETLAW SWITCH CURVES ARE POSITIONED TO
060891,000069:                                                                                                  #        REFLECT THE NEW DEADBAND.  IT SHOULD BE NOTED THAT THE DEADBAND REFERS TO THE ATTITUDE IN THE P-, U-, AND V-AXES.
060892,000070: 
060893,000071:                                                                                                  #  SUBROUTINE CALLED:    NOVAC
060894,000072: 
060895,000073:                                                                                                  #  CALLING SEQUENCE:     SAME AS ABOVE
060896,000074:                                                                                                  #                        OR      TC RESTORDB +1    FROM ALLCOAST
060897,000075: 
060898,000076:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, (ITEMPS IN NOVAC)
060899,000077: 
060900,000078: 20,2123           30111        RESTORDB           CAE      DAPBOOLS                              #  DETERMINE CREW-SELECTED DEADBAND.
060901,000079: 20,2124           74750                           MASK     DBSELECT                              
060902,000080: 20,2125           00006                           EXTEND                                         
060903,000081: 20,2126           12140                           BZF      SETMINDB                              
060904,000082: 
060905,000083: 20,2127           32151        SETMAXDB           CAF      WIDEDB                                #  SET 5 DEGREE DEADBAND.
060906,000084: 20,2130           55346                 +1        TS       DB                                    
060907,000085: 
060908,000086: 20,2131           00006                           EXTEND                                         #  SET UP JOB TO RE-POSITION SWITCH CURVES.
060909,000087: 20,2132           22070                           QXCH     RUPTREG1                              
060910,000088: 20,2133           37714        CALLACCS           CAF      PRIO27                                
060911,000089: 20,2134           05072                           TC       NOVAC                                 
060912,000090: 20,2135  E6,1537                                  EBANK=   AOSQ                                  
060913,000091: 20,2135           02454 40106                     2CADR    1/ACCJOB                              
060914,000092: 
060915,000093: 20,2137           00070                           TC       RUPTREG1                              #  RETURN TO CALLER.
060916,000094: 
060917,000095: 20,2140           32150        SETMINDB           CAF      NARROWDB                              #  SET 0.3 DEGREE DEADBAND.
060918,000096: 20,2141           12130                           TCF      SETMAXDB   +1                         
060919,000097: 
060920,000098: 20,2142           00006        PFLITEDB           EXTEND                                         #  THE RETURN FROM CALLACCS IS TO RUPTREG1.
060921,000099: 20,2143           22070                           QXCH     RUPTREG1                              
060922,000100: 20,2144           02153                           TC       ZATTEROR                              #  ZERO THE ERRORS AND COMMANDED RATES.
060923,000101: 20,2145           32152                           CAF      POWERDB                               #  SET DB TO 1.0 DEG.
060924,000102: 20,2146           55346                           TS       DB                                    
060925,000103: 20,2147           12133                           TCF      CALLACCS                              #  SET UP 1/ACCS AND RETURN TO CALLER.
060926,000104: 20,2150           00155        NARROWDB           OCTAL    00155                                 #  0.3 DEGREE SCALED AT 45.

Page 1403

060928,000106: 20,2151           03434        WIDEDB             OCTAL    03434                                 #  5.0 DEGREES SCALED AT 45.
060929,000107: 20,2152           00554        POWERDB            DEC      .02222                                #  1.0 DEGREE SCALED AT 45.
060930,000108: 
060931,000109: 20,2153           35015        ZATTEROR           CAF      EBANK6                                
060932,000110: 20,2154           56003                           XCH      EBANK                                 
060933,000111: 20,2155           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
060934,000112: 20,2156           30032                           CAE      CDUX                                  
060935,000113: 20,2157           55633                           TS       CDUXD                                 
060936,000114: 20,2160           30033                           CAE      CDUY                                  
060937,000115: 20,2161           55634                           TS       CDUYD                                 
060938,000116: 20,2162           30034                           CAE      CDUZ                                  
060939,000117: 20,2163           55635                           TS       CDUZD                                 
060940,000118: 20,2164           12170                           TCF      STOPRATE   +3                         
060941,000119: 
060942,000120: 20,2165           35015        STOPRATE           CAF      EBANK6                                
060943,000121: 20,2166           56003                           XCH      EBANK                                 
060944,000122: 20,2167           54001                           TS       L                                     #  SAVE CALLERS EBANK IN L.
060945,000123: 20,2170           34755                 +3        CAF      ZERO                                  
060946,000124: 20,2171           55641                           TS       OMEGAPD                               
060947,000125: 20,2172           55642                           TS       OMEGAQD                               
060948,000126: 20,2173           55643                           TS       OMEGARD                               
060949,000127: 20,2174           55636                           TS       DELCDUX                               
060950,000128: 20,2175           55637                           TS       DELCDUY                               
060951,000129: 20,2176           55640                           TS       DELCDUZ                               
060952,000130: 20,2177           55277                           TS       DELPEROR                              
060953,000131: 20,2200           55300                           TS       DELQEROR                              
060954,000132: 20,2201           55301                           TS       DELREROR                              
060955,000133: 20,2202           22003                           LXCH     EBANK                                 #  RESTORE CALLERS EBANK.
060956,000134: 20,2203           00002                           TC       Q                                     
060957,000135: 
060958,000136:                                                                                                  #  SUBROUTINE NAME:      ALLCOAST
060959,000137:                                                                                                  #  WILL BE CALLED BY FRESH STARTS AND ENGINE OFF ROUTINES.               .
060960,000138: 
060961,000139:                                                                                                  #  CALLING SEQUENCE:     (SAME AS ABOVE)
060962,000140: 
060963,000141:                                                                                                  #  EXIT:                 RETURN TO Q.
060964,000142: 
060965,000143:                                                                                                  #  SUBROUTINES CALLED:   STOPRATE, RESTORDB, NOVAC
060966,000144: 
060967,000145:                                                                                                  #  ZERO:                 (FOR ALL AXES) AOS, ALPHA, AOSTERM, OMEGAD, DELCDU, DELEROR
060968,000146: 
060969,000147:                                                                                                  #  OUTPUT:               DRIFTBIT/DAPBOOLS, DB, JOB TO DO 1/ACCS
060970,000148: 
060971,000149:                                                                                                  #  DEBRIS:               A, L, Q, RUPTREG1, RUPTREG2, (ITEMPS IN NOVAC)
060972,000150: 
060973,000151: 20,2204           00006        ALLCOAST           EXTEND                                         #  SAVE Q FOR RETURN
060974,000152: 20,2205           22071                           QXCH     RUPTREG2                              

Page 1404

060976,000154: 20,2206           02165                           TC       STOPRATE                              #  CLEAR RATE INTERFACE.  RETURN WITH A=0
060977,000155: 20,2207           22003                           LXCH     EBANK                                 #  AND L=EBANK6.  SAVE CALLERS EBANK.
060978,000156: 20,2210           55537                           TS       AOSQ                                  
060979,000157: 20,2211           55540                           TS       AOSQ       +1                         
060980,000158: 20,2212           55541                           TS       AOSR                                  
060981,000159: 20,2213           55542                           TS       AOSR       +1                         
060982,000160: 20,2214           55422                           TS       ALPHAQ                                #  FOR DOWNLIST.
060983,000161: 20,2215           55423                           TS       ALPHAR                                
060984,000162: 20,2216           55545                           TS       AOSQTERM                              
060985,000163: 20,2217           55546                           TS       AOSRTERM                              
060986,000164: 20,2220           22003                           LXCH     EBANK                                 #  RESTORE EBANK (EBANK6 NO LONGER NEEDED)
060987,000165: 
060988,000166: 20,2221           40111                           CS       DAPBOOLS                              #  SET UP DRIFTBIT
060989,000167: 20,2222           74744                           MASK     DRIFTBIT                              
060990,000168: 20,2223           26111                           ADS      DAPBOOLS                              
060991,000169: 20,2224           02124                           TC       RESTORDB   +1                         #  RESTORE DEADBANK TO CREW-SELECTED VALUE.
060992,000170: 
060993,000171: 20,2225           00071                           TC       RUPTREG2                              #  RETURN.
060994,000172: 

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