Source Code

These source-code files are part of a reconstructed copy of LM131 revision 1, the final release of the Apollo 13 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The source reconstruction began with source code of Luminary 131 previously transcribed from a digitized copy of that program. A dump of the flight spare core rope memory module B5, part number 2010802-171, serial number RAY 411, was obtained. This module is the only module different between Luminary 131 and LM131 revision 1. The dump was disassembled and all changes were incorporated into these source files. Note that page numbers in the reconstructed code match those on the Luminary 131 printout, although the changed code would likely have changed page numbers for a real LM131 revision 1 listing.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

020800,000002:                                                                                                  ## Copyright:   Public domain.
020801,000003:                                                                                                  ## Filename:    RADAR_LEADIN_ROUTINES.agc
020802,000004:                                                                                                  ## Purpose:     A section of LM131 revision 1.
020803,000005:                                                                                                  ##              It is part of the reconstructed source code for the final
020804,000006:                                                                                                  ##              release of the flight software for the Lunar Module's (LM)
020805,000007:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13. The code has
020806,000008:                                                                                                  ##              been reconstructed from a listing of Luminary 131 and a dump
020807,000009:                                                                                                  ##              of a core rope memory module B5, part number 2010802-171,
020808,000010:                                                                                                  ##              which is the only module different between LM131 revision 1
020809,000011:                                                                                                  ##              and Luminary 131. The executable generated from this source
020810,000012:                                                                                                  ##              has been verified against the module dump, so while the names,
020811,000013:                                                                                                  ##              comments, and ordering may not be exactly correct, the
020812,000014:                                                                                                  ##              resulting binary is.
020813,000015:                                                                                                  ## Reference:   pp. 494-495
020814,000016:                                                                                                  ## Assembler:   yaYUL
020815,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
020816,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
020817,000019:                                                                                                  ## Mod history: 2022-10-28 MAS  Created from Luminary 131.
020818,000020: 

Page 494

020820,000022: 25,2003                                           BANK     25                                    
020821,000023: 25,2000                                           SETLOC   RRLEADIN                              
020822,000024: 25,2000                                           BANK                                           
020823,000025: 
020824,000026: 25,2003  E4,1600                                  EBANK=   RSTACK                                
020825,000027: 
020826,000028:                                                                                                  #  RADAR SAMPLING LOOP.
020827,000029: 25,2003                                           COUNT*   $$/RLEAD                              
020828,000030: 25,2003           11777        RADSAMP            CCS      RSAMPDT                               #  TIMES NORMAL ONCE-PER-SECOND SAMPLING.
020829,000031: 25,2004           12006                           TCF      +2                                    
020830,000032: 25,2005           15261                           TCF      TASKOVER                              #  +0 INSERTED MANUALLY TERMINATES TEST.
020831,000033: 
020832,000034: 25,2006           05203                           TC       WAITLIST                              
020833,000035: 25,2007  E4,1600                                  EBANK=   RSTACK                                
020834,000036: 25,2007           02003 52064                     2CADR    RADSAMP                               
020835,000037: 
020836,000038: 25,2011           37716                           CAF      PRIO25                                
020837,000039: 25,2012           05072                           TC       NOVAC                                 
020838,000040: 25,2013  E4,1600                                  EBANK=   RSTACK                                
020839,000041: 25,2013           02023 52064                     2CADR    DORSAMP                               
020840,000042: 
020841,000043: 25,2015           34736                           CAF      BIT14                                 #  FOR CYCLIC SAMPLING, RTSTDEX=
020842,000044: 25,2016           00006                           EXTEND                                         #  RTSTLOC/2 + RTSTBASE
020843,000045: 25,2017           71776                           MP       RTSTLOC                               
020844,000046: 25,2020           61775                           AD       RTSTBASE                              #  0 FOR RR, 2 FOR LR.
020845,000047: 25,2021           55773                           TS       RTSTDEX                               
020846,000048: 25,2022           15261                           TCF      TASKOVER                              
020847,000049: 
020848,000050:                                                                                                  #  DO THE ACTUAL RADAR SAMPLE.
020849,000051: 
020850,000052: 25,2023           02060        DORSAMP            TC       VARADAR                               #  SELECTS VARIABLE RADAR CHANNEL.
020851,000053: 25,2024           04616                           TC       BANKCALL                              
020852,000054: 25,2025           17705                           CADR     RADSTALL                              
020853,000055: 
020854,000056: 25,2026           25575                           INCR     RFAILCNT                              #  ADVANCE FAIL COUNTER BUT ACCEPT BAD DATA
020855,000057: 
020856,000058: 25,2027           00004        DORSAMP2           INHINT                                         
020857,000059: 25,2030           30101                           CA       FLAGWRD5                              #  DON'T UPDATE RSTACK IF IN R77.
020858,000060: 25,2031           74741                           MASK     R77FLBIT                              
020859,000061: 25,2032           10000                           CCS      A                                     
020860,000062: 25,2033           12050                           TCF      R77IN                                 
020861,000063: 
020862,000064: 25,2034           53101                           DXCH     SAMPLSUM                              
020863,000065: 25,2035           51776                           INDEX    RTSTLOC                               
020864,000066: 25,2036           53601                           DXCH     RSTACK                                
020865,000067: 
020866,000068: 25,2037           30110                           CA       RADMODES                              
020867,000069: 25,2040           00006                           EXTEND                                         
020868,000070: 25,2041           06033                           RXOR     CHAN33                                

Page 495

020870,000072: 25,2042           74746                           MASK     BIT6                                  
020871,000073: 25,2043           00006                           EXTEND                                         
020872,000074: 25,2044           12050                           BZF      R77IN                                 
020873,000075: 
020874,000076: 25,2045           05567                           TC       ALARM                                 
020875,000077: 25,2046           00522                           OCT      522                                   
020876,000078: 25,2047           25575                           INCR     RFAILCNT                              
020877,000079: 
020878,000080: 25,2050           41776        R77IN              CS       RTSTLOC                               #  CYCLE RTSTLOC
020879,000081: 25,2051           61774                           AD       RTSTMAX                               
020880,000082: 25,2052           00006                           EXTEND                                         
020881,000083: 25,2053           12056                           BZF      +3                                    
020882,000084: 25,2054           31776                           CA       RTSTLOC                               
020883,000085: 25,2055           64752                           AD       TWO                                   #  STORAGE IS DP
020884,000086: 25,2056           55776                           TS       RTSTLOC                               
020885,000087: 25,2057           15155                           TCF      ENDOFJOB                              #  CONTINUOUS SAMPLING AND 2N TRIES - GONE.
020886,000088: 
020887,000089:                                                                                                  #  VARIABLE RADAR DATA CALLER FOR ONE MEASUREMENT ONLY.
020888,000090: 
020889,000091: 25,2060           34753        VARADAR            CAF      ONE                                   #  WILL BE SENT TO RADAR ROUTINE IN A BY
020890,000092: 25,2061           54133                           TS       BUF2                                  #  SWCALL.
020891,000093: 25,2062           51773                           INDEX    RTSTDEX                               
020892,000094: 25,2063           32065                           CAF      RDRLOCS                               
020893,000095: 25,2064           14622                           TCF      SWCALL                                #  NOT TOUCHING Q.
020894,000096: 
020895,000097: 25,2065           53114        RDRLOCS            CADR     RRRANGE                               #  = 0
020896,000098: 25,2066           53112                           CADR     RRRDOT                                #  = 1
020897,000099: 25,2067           53110                           CADR     LRVELX                                #  = 2
020898,000100: 25,2070           53106                           CADR     LRVELY                                #  = 3
020899,000101: 25,2071           53104                           CADR     LRVELZ                                #  = 4
020900,000102: 25,2072           53102                           CADR     LRALT                                 #  = 5
020901,000103: 
020902,000104: 

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