Source Code

These source-code files are part of a reconstructed copy of Luminary 98, a development version of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memo 85, using asterisks indicating changed lines in the listing as a guide. While no listing of this version is known to exist, nor are the memory-bank checksums available, the reconstruction is believed to be correct because it was an an intermediate step in reconstructing Luminary 97 whose reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152G. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 98 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.

020363,000002:                                                                                                  ## Copyright:   Public domain.
020364,000003:                                                                                                  ## Filename:    S-BAND_ANTENNA_FOR_LM.agc
020365,000004:                                                                                                  ## Purpose:     A section of Luminary revision 98.
020366,000005:                                                                                                  ##              It is part of the reconstructed source code for the a
020367,000006:                                                                                                  ##              development version of the flight software for the Lunar 
020368,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
020369,000008:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
020370,000009:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
020371,000010:                                                                                                  ##              the listing and Luminary Memo #85, which lists changes between
020372,000011:                                                                                                  ##              Luminary 98 and 99.
020373,000012:                                                                                                  ## Reference:   pp. 486-489
020374,000013:                                                                                                  ## Assembler:   yaYUL
020375,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
020376,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
020377,000016:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
020378,000017: 

Page 486

020380,000019:                                                                                                  #  SUBROUTINE NAME: R05 - S-BAND ANTENNA FOR LM
020381,000020: 
020382,000021:                                                                                                  #  MOD0 BY T. JAMES
020383,000022:                                                                                                  #  MOD1 BY P. SHAKIR
020384,000023: 
020385,000024:                                                                                                  #  FUNCTIONAL DESCRIPTION
020386,000025: 
020387,000026:                                                                                                  #  THE S-BAND ANTENNA ROUTINE, R05, COMPUTES AND DISPLAYS THE PITCH AND
020388,000027:                                                                                                  #  YAW ANTENNA GIMBAL ANGLES REQUIRED TO POINT THE LM STEERABLE ANTENNA
020389,000028:                                                                                                  #  TOWARD THE CENTER OF THE EARTH.  THIS ROUTINE IS SELECTED BY THE ASTRO-
020390,000029:                                                                                                  #  NAUT VIA DSKY ENTRY DURING COASTING FLIGHT OR WHEN THE LM IS ON THE MOON
020391,000030:                                                                                                  #  SURFACE.  THE EARTH OR MOON REFERENCE COORDINATE SYSTEM IS USED DEPENDING
020392,000031:                                                                                                  #  ON WHETHER THE LM IS ABOUT TO ENTER OR HAS ALREADY ENTERED THE MOON
020393,000032:                                                                                                  #  SPHERE OF INFLUENCE, RESPECTIVELY
020394,000033: 
020395,000034:                                                                                                  #  TO CALL SUBROUTINE, ASTRONAUT KEYS IN V 64 E
020396,000035: 
020397,000036:                                                                                                  #  SUBROUTINES CALLED -
020398,000037:                                                                                                  #        R02BOTH
020399,000038:                                                                                                  #        INTPRET
020400,000039:                                                                                                  #        LOADTIME
020401,000040:                                                                                                  #        LEMCONIC
020402,000041:                                                                                                  #        LUNPOS
020403,000042:                                                                                                  #        CDUTRIG
020404,000043:                                                                                                  #        *SMNB*
020405,000044:                                                                                                  #        BANKCALL
020406,000045:                                                                                                  #        B5OFF
020407,000046:                                                                                                  #        ENDOFJOB
020408,000047:                                                                                                  #        BLANKET
020409,000048: 
020410,000049:                                                                                                  #  RETURNS WITH
020411,000050:                                                                                                  #        PITCH ANGLE IN PITCHANG         REV. B0
020412,000051:                                                                                                  #        YAW ANGLE IN YAWANG             REV. B0
020413,000052: 
020414,000053:                                                                                                  #  ERASABLES USED
020415,000054:                                                                                                  #        PITCHANG
020416,000055:                                                                                                  #        YAWANG
020417,000056:                                                                                                  #        RLM
020418,000057:                                                                                                  #        VAC AREA
020419,000058: 
020420,000059: 41,3731                                           BANK     41                                    
020421,000060: 42,2000                                           SETLOC   SBAND                                 
020422,000061: 42,2000                                           BANK                                           
020423,000062: 
020424,000063: 42,3606  E7,1471                                  EBANK=   WHOCARES                              
020425,000064: 42,3606                                           COUNT*   $$/R05                                
020426,000065: 42,3606           04616        SBANDANT           TC       BANKCALL                              

Page 487

020428,000067: 42,3607           11254                           CADR     R02BOTH                               #  CHECK IF IMU IS ON AND ALIGNED
020429,000068: 42,3610           06037                           TC       INTPRET                               
020430,000069: 42,3611           47001                           SETPD    RTB                                   
020431,000070: 42,3612           00001                                    0D                                    
020432,000071: 42,3613           21573                                    LOADTIME                              #  PICK UP CURRENT TIME
020433,000072: 42,3614           34041                           STCALL   TDEC1                                 #  ADVANCE INTEGRATION TO TIME IN TDEC1
020434,000073: 42,3615           27100                                    LEMCONIC                              #  USING CONIC INTEGRATION
020435,000074: 42,3616           46135                           SLOAD    BHIZ                                  
020436,000075: 42,3617           00050                                    X2                                    #  X2 =0 EARTH SPHERE, X2 =2 MOON SPHERE
020437,000076: 42,3620           65636                                    CONV4                                 
020438,000077: 42,3621           77775                           VLOAD                                          
020439,000078: 42,3622           00001                                    RATT                                  
020440,000079: 42,3623           16205                           STODL    RLM                                   
020441,000080: 42,3624           00015                                    TAT                                   
020442,000081: 42,3625           77624        CONV3              CALL                                           
020443,000082: 42,3626           33664                                    LUNPOS                                #  UNIT POSITION VECTOR FROM EARTH TO MOON
020444,000083: 42,3627           74375                           VLOAD    VXSC                                  
020445,000084: 42,3630           02723                                    VMOON                                 
020446,000085: 42,3631           24001                                    REMDIST                               #  MEAN DISTANCE FROM EARTH TO MOON
020447,000086: 42,3632           53372                           VSL1     VAD                                   
020448,000087: 42,3633           02205                                    RLM                                   
020449,000088: 42,3634           77650                           GOTO                                           
020450,000089: 42,3635           65640                                    CONV5                                 
020451,000090: 42,3636           77775        CONV4              VLOAD                                          
020452,000091: 42,3637           00001                                    RATT                                  #  UE = -UNIT(RATT)              EARTH SPHERE
020453,000092: 42,3640           53401        CONV5              SETPD    UNIT                                  #  UE = -UNIT((REM)(UEM) + RL)   MOON SPHERE
020454,000093: 42,3641           00001                                    0D                                    #  SET PL POINTER TO 0
020455,000094: 42,3642           45076                           VCOMP    CALL                                  
020456,000095: 42,3643           47537                                    CDUTRIG                               #  COMPUTE SINES AND COSINES OF CDU ANGLES
020457,000096: 42,3644           76521                           MXV      VSL1                                  #  TRANSFORM REF. COORDINATE SYSTEM TO
020458,000097: 42,3645           01734                                    REFSMMAT                              #  STABLE MEMBER B-1 X B-1 X B+1 = B-1
020459,000098: 42,3646           71206                           PUSH     DLOAD                                 #  8D
020460,000099: 42,3647           06522                                    HI6ZEROS                              
020461,000100: 42,3650           02201                           STORE    PITCHANG                              
020462,000101: 42,3651           26203                           STOVL    YAWANG                                #  ZERO OUT ANGLES
020463,000102: 42,3652           77624                           CALL                                           
020464,000103: 42,3653           47671                                    *SMNB*                                
020465,000104: 42,3654           16205                           STODL    RLM                                   #  PRE-MULTIPLY RLM BY (NBSA) MATRIX(B0)
020466,000105: 42,3655           02207                                    RLM        +2                         
020467,000106: 42,3656           45206                           PUSH     DSU                                   
020468,000107: 42,3657           02205                                    RLM                                   
020469,000108: 42,3660           77605                           DMP                                            
020470,000109: 42,3661           25771                                    1OVSQRT2                              
020471,000110: 42,3662           16207                           STODL    RLM        +2                         
020472,000111: 42,3663           41215                           DAD      DMP                                   
020473,000112: 42,3664           02205                                    RLM                                   
020474,000113: 42,3665           25771                                    1OVSQRT2                              
020475,000114: 42,3666           26205                           STOVL    RLM                                   #  R B-1
020476,000115: 42,3667           02205                                    RLM                                   
020477,000116: 42,3670           63256                           UNIT     PDVL                                  

Page 488

020479,000118: 42,3671           02205                                    RLM                                   
020480,000119: 42,3672           72431                           VPROJ    VSL2                                  #  PROJECTION OF R ONTO LM XZ PLANE
020481,000120: 42,3673           06516                                    HIUNITY                               
020482,000121: 42,3674           40045                           BVSU     BOV                                   #  CLEAR OVERFLOW INDICATOR IF ON
020483,000122: 42,3675           02205                                    RLM                                   
020484,000123: 42,3676           65677                                    COVCNV                                
020485,000124: 42,3677           40056        COVCNV             UNIT     BOV                                   #  EXIT ON OVERFLOW
020486,000125: 42,3700           65745                                    SBANDEX                               
020487,000126: 42,3701           47206                           PUSH     VXV                                   #  URP VECTOR B-1
020488,000127: 42,3702           06514                                    HIUNITZ                               
020489,000128: 42,3703           57572                           VSL1     VCOMP                                 #  UZ X URP = -(URP X UZ)
020490,000129: 42,3704           02205                           STORE    RLM                                   #  X VEC B-1
020491,000130: 42,3705           63241                           DOT      PDVL                                  #  SGN(X.UY) UNSCALED
020492,000131: 42,3706           06516                                    HIUNITY                               
020493,000132: 42,3707           02205                                    RLM                                   
020494,000133: 42,3710           75246                           ABVAL    SIGN                                  
020495,000134: 42,3711           77736                           ASIN                                           #  ASIN((SGN(X.UY))ABV(X))       REV B0
020496,000135: 42,3712           26201                           STOVL    PITCHANG                              
020497,000136: 42,3713           00007                                    URP                                   
020498,000137: 42,3714           51041                           DOT      BPL                                   
020499,000138: 42,3715           06514                                    HIUNITZ                               
020500,000139: 42,3716           65723                                    NOADJUST                              #  YES, -90 TO +90
020501,000140: 42,3717           45345                           DLOAD    DSU                                   
020502,000141: 42,3720           06520                                    HIDPHALF                              
020503,000142: 42,3721           02201                                    PITCHANG                              
020504,000143: 42,3722           02201                           STORE    PITCHANG                              
020505,000144: 42,3723           47375        NOADJUST           VLOAD    VXV                                   
020506,000145: 42,3724           00001                                    UR                                    #  Z = (UR X URP)
020507,000146: 42,3725           00007                                    URP                                   
020508,000147: 42,3726           77772                           VSL1                                           
020509,000148: 42,3727           16205                           STODL    RLM                                   #  Z VEC B-1
020510,000149: 42,3730           02201                                    PITCHANG                              
020511,000150: 42,3731           74356                           SIN      VXSC                                  
020512,000151: 42,3732           06514                                    HIUNITZ                               
020513,000152: 42,3733           71525                           PDDL     COS                                   
020514,000153: 42,3734           02201                                    PITCHANG                              
020515,000154: 42,3735           52361                           VXSC     VSU                                   
020516,000155: 42,3736           06520                                    HIUNITX                               #  (UX COS ALPHA) - (UZ SIN ALPHA)
020517,000156: 42,3737           63241                           DOT      PDVL                                  #  YAW.Z
020518,000157: 42,3740           02205                                    RLM                                   
020519,000158: 42,3741           02205                                    RLM                                   
020520,000159: 42,3742           75246                           ABVAL    SIGN                                  
020521,000160: 42,3743           77736                           ASIN                                           
020522,000161: 42,3744           02203                           STORE    YAWANG                                
020523,000162: 42,3745           77776        SBANDEX            EXIT                                           
020524,000163: 42,3746           31044                           CA       EXTVBACT                              
020525,000164: 42,3747           74747                           MASK     BIT5                                  #  IS BIT5 STILL ON
020526,000165: 42,3750           00006                           EXTEND                                         
020527,000166: 42,3751           15472                           BZF      ENDEXT                                #  NO
020528,000167: 42,3752           35017                           CAF      PRIO5                                 

Page 489

020530,000169: 42,3753           05146                           TC       PRIOCHNG                              
020531,000170: 42,3754           33767                           CAF      V06N51                                #  DISPLAY ANGLES
020532,000171: 42,3755           04616                           TC       BANKCALL                              
020533,000172: 42,3756           20353                           CADR     GOMARKFR                              
020534,000173: 42,3757           05563                           TC       B5OFF                                 #  TERMINATE
020535,000174: 42,3760           05563                           TC       B5OFF                                 #  PROCEED
020536,000175: 42,3761           05155                           TC       ENDOFJOB                              #  RECYCLE
020537,000176: 42,3762           34751                           CAF      BIT3                                  #  IMMEDIATE RETURN
020538,000177: 42,3763           05464                           TC       BLANKET                               #  BLANK R3
020539,000178: 42,3764           34740                           CAF      PRIO4                                 
020540,000179: 42,3765           05146                           TC       PRIOCHNG                              
020541,000180: 42,3766           03610                           TC       SBANDANT   +2                         #  YES, CONTINUE DISPLAYING ANGLES
020542,000181: 42,3767           01463        V06N51             VN       0651                                  
020543,000182: 42,3770           26501 07463  1OVSQRT2           2DEC     .7071067815                            #  1/SQRT(2)
020544,000183: 
020545,000184: 42,3772                        UR                 EQUALS   0D                                    
020546,000185: 42,3772                        URP                EQUALS   6D                                    
020547,000186: 42,3772  30,2000                                  SBANK=   LOWSUPER                              
020548,000187: 

End of include-file S-BAND_ANTENNA_FOR_LM.agc.  Parent file is MAIN.agc