Source Code

These source-code files derive from a printout of Luminary 116 (the Apollo 12 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Ron Burkey, and transcribed to source code by a team of volunteers. This colorized, syntax-highlighted form was created by assembling that transcribed source code. Note that the full page images are available on the Virtual AGC project page at archive.org, while reduced-size images are presented at the VirtualAGC project website. Report or fix any transcription errors at the Virtual AGC project code repository.

Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 116 OF AGC PROGRAM LUMINARY BY NASA 2021112-071
	19:09 AUG. 11,1969
Note that the date is the date of the printout, not the date of the program revision.

021012,000002:                                                                                                  ## Copyright:   Public domain.
021013,000003:                                                                                                  ## Filename:    RADAR_LEADIN_ROUTINES.agc
021014,000004:                                                                                                  ## Purpose:     A section of Luminary revision 116.
021015,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM) 
021016,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 12.
021017,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
021018,000008:                                                                                                  ##              that the code format has been changed to conform to the
021019,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
021020,000010:                                                                                                  ##              original YUL assembler.
021021,000011:                                                                                                  ## Reference:   pp. 492-493
021022,000012:                                                                                                  ## Assembler:   yaYUL
021023,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
021024,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
021025,000015:                                                                                                  ## Mod history: 2017-01-22 MAS  Created from Luminary 99.
021026,000016:                                                                                                  ##              2017-02-18 NV   Updated for Luminary 116.
021027,000017:                                                                                                  ##              2017-02-19 HG   Fix opcode RXCR  ->  RXOR
021028,000018:                                                                                                  ##              2017-03-01 RSB  Proofed comment text by diff vs Luminary 131
021029,000019:                                                                                                  ##                              but no errors found.
021030,000020: 

Page 492

021032,000022: 25,2003                                           BANK     25                                    
021033,000023: 25,2000                                           SETLOC   RRLEADIN                              
021034,000024: 25,2000                                           BANK                                           
021035,000025: 
021036,000026: 25,2003  E4,1600                                  EBANK=   RSTACK                                
021037,000027: 
021038,000028:                                                                                                  #  RADAR SAMPLING LOOP.
021039,000029: 
021040,000030: 25,2003                                           COUNT*   $$/RLEAD                              
021041,000031: 25,2003           11777        RADSAMP            CCS      RSAMPDT                               #  TIMES NORMAL ONCE-PER-SECOND SAMPLING.
021042,000032: 25,2004           12006                           TCF      +2                                    
021043,000033: 25,2005           15261                           TCF      TASKOVER                              #  +0 INSERTED MANUALLY TERMINATES TEST.
021044,000034: 
021045,000035: 25,2006           05203                           TC       WAITLIST                              
021046,000036: 25,2007  E4,1600                                  EBANK=   RSTACK                                
021047,000037: 25,2007           02003 52064                     2CADR    RADSAMP                               
021048,000038: 
021049,000039: 25,2011           37716                           CAF      PRIO25                                
021050,000040: 25,2012           05072                           TC       NOVAC                                 
021051,000041: 25,2013  E4,1600                                  EBANK=   RSTACK                                
021052,000042: 25,2013           02023 52064                     2CADR    DORSAMP                               
021053,000043: 
021054,000044: 25,2015           34736                           CAF      BIT14                                 #  FOR CYCLIC SAMPLING, RTSTDEX =
021055,000045: 25,2016           00006                           EXTEND                                         #  RTSTLOC/2 + RTSTBASE
021056,000046: 25,2017           71776                           MP       RTSTLOC                               
021057,000047: 25,2020           61775                           AD       RTSTBASE                              #  0 FOR RR, 2 FOR LR.
021058,000048: 25,2021           55773                           TS       RTSTDEX                               
021059,000049: 25,2022           15261                           TCF      TASKOVER                              
021060,000050: 
021061,000051:                                                                                                  #  DO THE ACTUAL RADAR SAMPLE.
021062,000052: 
021063,000053: 25,2023           02060        DORSAMP            TC       VARADAR                               #  SELECTS VARIABLE RADAR CHANNEL.
021064,000054: 25,2024           04616                           TC       BANKCALL                              
021065,000055: 25,2025           17706                           CADR     RADSTALL                              
021066,000056: 
021067,000057: 25,2026           25575                           INCR     RFAILCNT                              #  ADVANCE FAIL COUNTER BUT ACCEPT BAD DATA
021068,000058: 
021069,000059: 25,2027           00004        DORSAMP2           INHINT                                         
021070,000060: 25,2030           30101                           CA       FLAGWRD5                              #  DON'T UPDATE RSTACK IF IN R77.
021071,000061: 25,2031           74741                           MASK     R77FLBIT                              
021072,000062: 25,2032           10000                           CCS      A                                     
021073,000063: 25,2033           12050                           TCF      R77IN                                 
021074,000064: 
021075,000065: 25,2034           53101                           DXCH     SAMPLSUM                              
021076,000066: 25,2035           51776                           INDEX    RTSTLOC                               
021077,000067: 25,2036           53601                           DXCH     RSTACK                                
021078,000068: 
021079,000069: 25,2037           30110                           CA       RADMODES                              
021080,000070: 25,2040           00006                           EXTEND                                         
021081,000071: 25,2041           06033                           RXOR     CHAN33                                

Page 493

021083,000073: 25,2042           74746                           MASK     BIT6                                  
021084,000074: 25,2043           00006                           EXTEND                                         
021085,000075: 25,2044           12050                           BZF      R77IN                                 
021086,000076: 
021087,000077: 25,2045           05567                           TC       ALARM                                 
021088,000078: 25,2046           00522                           OCT      522                                   
021089,000079: 25,2047           25575                           INCR     RFAILCNT                              
021090,000080: 
021091,000081: 25,2050           41776        R77IN              CS       RTSTLOC                               #  CYCLE RTSTLOC
021092,000082: 25,2051           61774                           AD       RTSTMAX                               
021093,000083: 25,2052           00006                           EXTEND                                         
021094,000084: 25,2053           12056                           BZF      +3                                    
021095,000085: 25,2054           31776                           CA       RTSTLOC                               
021096,000086: 25,2055           64752                           AD       TWO                                   #  STORAGE IS DP
021097,000087: 25,2056           55776                           TS       RTSTLOC                               
021098,000088: 25,2057           15155                           TCF      ENDOFJOB                              #  CONTINUOUS SAMPLING AND 2N TRIES - GONE.
021099,000089: 
021100,000090:                                                                                                  #  VARIABLE RADAR DATA CALLER FOR ONE MEASUREMENT ONLY.
021101,000091: 
021102,000092: 25,2060           34753        VARADAR            CAF      ONE                                   #  WILL BE SENT TO RADAR ROUTINE IN A BY
021103,000093: 25,2061           54133                           TS       BUF2                                  #  SWCALL.
021104,000094: 25,2062           51773                           INDEX    RTSTDEX                               
021105,000095: 25,2063           32065                           CAF      RDRLOCS                               
021106,000096: 25,2064           14622                           TCF      SWCALL                                #  NOT TOUCHING Q.
021107,000097: 
021108,000098: 25,2065           53114        RDRLOCS            CADR     RRRANGE                               #  =0
021109,000099: 25,2066           53112                           CADR     RRRDOT                                #  =1
021110,000100: 25,2067           53110                           CADR     LRVELX                                #  =2
021111,000101: 25,2070           53106                           CADR     LRVELY                                #  =3
021112,000102: 25,2071           53104                           CADR     LRVELZ                                #  =4
021113,000103: 25,2072           53102                           CADR     LRALT                                 #  =5
021114,000104: 
021115,000105: 

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