Source Code

This source code is very close to the Apollo Guidance Computer software for the Apollo 13 Lunar module. This revision of the Luminary 131 program is from December of 1969, whereas there was a later revision in January of 1970, and still another revision in February, which is the code that flew on the mission. As far as this transcription is concerned, it was originally from a copy made in 1991 of a printout from the collection of AGC developer Don Eyles for collector David Craig. It was subsequently scanned by Gary Neff, reprocessed for online presentation at the now-discontinued History of Recent Science and Technology (HRST) website of MIT's Dibner Institute (the full-quality scans being discarded in the process), and finally transcribed by Ron Burkey for the Virtual AGC Project. Although a high-quality replacement scan for a completely illegible page was later provided by Gary Neff, the reduced legibility of the reprocessed HRST posting nevertheless caused many errors to be introduced into the transcription. Accordingly, a second scan of the same physical printout was made in 2017 for the Virtual AGC Project's collection at the Internet Archive, and used to correct the transcription errors. All of the scanned materials mentioned, as well as other Luminary 131 related material, are available online. Don Eyles apprently made additional hand-written notes in printout between 1991 and 2017, so the two scans are not identical in that respect. The page-headings in the printout read, in part:
	GAP:  ASSEMBLE REVISION 131 OF AGC PROGRAM LUMINARY BY NASA 2021112-091
	17:53 DEC. 19, 1969
Note that the date is the date the printout was made, not the date on which the program revision was released, although these happen to be very close together.

020956,000002:                                                                                                  ## Copyright:   Public domain.
020957,000003:                                                                                                  ## Filename:    RADAR_LEADIN_ROUTINES.agc
020958,000004:                                                                                                  ## Purpose:     A section of Luminary 1C, revision 131.
020959,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
020960,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13.
020961,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
020962,000008:                                                                                                  ##              that the code format has been changed to conform to the
020963,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the 
020964,000010:                                                                                                  ##              original YUL assembler.
020965,000011:                                                                                                  ## Reference:   pp. 494-495
020966,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
020967,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
020968,000014:                                                                                                  ## Mod history: 05/14/03 RSB.   Began transcribing.
020969,000015:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
020970,000016:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
020971,000017:                                                                                                  ##                              original harcopy, as opposed to the PDF page
020972,000018:                                                                                                  ##                              numbers in 1701.pdf.
020973,000019:                                                                                                  ##              2017-02-24 RSB  Proofed comment text using octopus/ProoferComments.
020974,000020:                                                                                                  ##              2017-03-01 RSB  Fixed a comment-text error found in diff'ing vs Luminary 116.
020975,000021: 

Page 494

020977,000023: 25,2003                                           BANK     25                                    
020978,000024: 25,2000                                           SETLOC   RRLEADIN                              
020979,000025: 25,2000                                           BANK                                           
020980,000026: 
020981,000027: 25,2003  E4,1600                                  EBANK=   RSTACK                                
020982,000028: 
020983,000029:                                                                                                  #  RADAR SAMPLING LOOP.
020984,000030: 25,2003                                           COUNT*   $$/RLEAD                              
020985,000031: 25,2003           11777        RADSAMP            CCS      RSAMPDT                               #  TIMES NORMAL ONCE-PER-SECOND SAMPLING.
020986,000032: 25,2004           12006                           TCF      +2                                    
020987,000033: 25,2005           15261                           TCF      TASKOVER                              #  +0 INSERTED MANUALLY TERMINATES TEST.
020988,000034: 
020989,000035: 25,2006           05203                           TC       WAITLIST                              
020990,000036: 25,2007  E4,1600                                  EBANK=   RSTACK                                
020991,000037: 25,2007           02003 52064                     2CADR    RADSAMP                               
020992,000038: 
020993,000039: 25,2011           37716                           CAF      PRIO25                                
020994,000040: 25,2012           05072                           TC       NOVAC                                 
020995,000041: 25,2013  E4,1600                                  EBANK=   RSTACK                                
020996,000042: 25,2013           02023 52064                     2CADR    DORSAMP                               
020997,000043: 
020998,000044: 25,2015           34736                           CAF      BIT14                                 #  FOR CYCLIC SAMPLING, RTSTDEX=
020999,000045: 25,2016           00006                           EXTEND                                         #  RTSTLOC/2 + RTSTBASE
021000,000046: 25,2017           71776                           MP       RTSTLOC                               
021001,000047: 25,2020           61775                           AD       RTSTBASE                              #  0 FOR RR, 2 FOR LR.
021002,000048: 25,2021           55773                           TS       RTSTDEX                               
021003,000049: 25,2022           15261                           TCF      TASKOVER                              
021004,000050: 
021005,000051:                                                                                                  #  DO THE ACTUAL RADAR SAMPLE.
021006,000052: 
021007,000053: 25,2023           02060        DORSAMP            TC       VARADAR                               #  SELECTS VARIABLE RADAR CHANNEL.
021008,000054: 25,2024           04616                           TC       BANKCALL                              
021009,000055: 25,2025           17705                           CADR     RADSTALL                              
021010,000056: 
021011,000057: 25,2026           25575                           INCR     RFAILCNT                              #  ADVANCE FAIL COUNTER BUT ACCEPT BAD DATA
021012,000058: 
021013,000059: 25,2027           00004        DORSAMP2           INHINT                                         
021014,000060: 25,2030           30101                           CA       FLAGWRD5                              #  DON'T UPDATE RSTACK IF IN R77.
021015,000061: 25,2031           74741                           MASK     R77FLBIT                              
021016,000062: 25,2032           10000                           CCS      A                                     
021017,000063: 25,2033           12050                           TCF      R77IN                                 
021018,000064: 
021019,000065: 25,2034           53101                           DXCH     SAMPLSUM                              
021020,000066: 25,2035           51776                           INDEX    RTSTLOC                               
021021,000067: 25,2036           53601                           DXCH     RSTACK                                
021022,000068: 
021023,000069: 25,2037           30110                           CA       RADMODES                              
021024,000070: 25,2040           00006                           EXTEND                                         
021025,000071: 25,2041           06033                           RXOR     CHAN33                                

Page 495

021027,000073: 25,2042           74746                           MASK     BIT6                                  
021028,000074: 25,2043           00006                           EXTEND                                         
021029,000075: 25,2044           12050                           BZF      R77IN                                 
021030,000076: 
021031,000077: 25,2045           05567                           TC       ALARM                                 
021032,000078: 25,2046           00522                           OCT      522                                   
021033,000079: 25,2047           25575                           INCR     RFAILCNT                              
021034,000080: 
021035,000081: 25,2050           41776        R77IN              CS       RTSTLOC                               #  CYCLE RTSTLOC
021036,000082: 25,2051           61774                           AD       RTSTMAX                               
021037,000083: 25,2052           00006                           EXTEND                                         
021038,000084: 25,2053           12056                           BZF      +3                                    
021039,000085: 25,2054           31776                           CA       RTSTLOC                               
021040,000086: 25,2055           64752                           AD       TWO                                   #  STORAGE IS DP
021041,000087: 25,2056           55776                           TS       RTSTLOC                               
021042,000088: 25,2057           15155                           TCF      ENDOFJOB                              #  CONTINUOUS SAMPLING AND 2N TRIES - GONE.
021043,000089: 
021044,000090:                                                                                                  #  VARIABLE RADAR DATA CALLER FOR ONE MEASUREMENT ONLY.
021045,000091: 
021046,000092: 25,2060           34753        VARADAR            CAF      ONE                                   #  WILL BE SENT TO RADAR ROUTINE IN A BY
021047,000093: 25,2061           54133                           TS       BUF2                                  #  SWCALL.
021048,000094: 25,2062           51773                           INDEX    RTSTDEX                               
021049,000095: 25,2063           32065                           CAF      RDRLOCS                               
021050,000096: 25,2064           14622                           TCF      SWCALL                                #  NOT TOUCHING Q.
021051,000097: 
021052,000098: 25,2065           53114        RDRLOCS            CADR     RRRANGE                               #  = 0
021053,000099: 25,2066           53112                           CADR     RRRDOT                                #  = 1
021054,000100: 25,2067           53110                           CADR     LRVELX                                #  = 2
021055,000101: 25,2070           53106                           CADR     LRVELY                                #  = 3
021056,000102: 25,2071           53104                           CADR     LRVELZ                                #  = 4
021057,000103: 25,2072           53102                           CADR     LRALT                                 #  = 5
021058,000104: 
021059,000105: 

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