Source Code

This is an attempt to recreate Luminary 99 Rev 2, otherwise known as LUM99R2, from Luminary 99 Rev 1 and ephemeris data from Luminary 116. The differences are confined to the last 10-12 lines of the CONTROLLED CONSTANTS. Luminary 99 Rev 1 source-code was transcribed from a printout in the MIT Museum, while Luminary 116 source code was transcribed from a printout belonging to Don Eyles. AGC developer James Kernan, the "rope mother" for the Apollo 11 Lunar Module's AGC, explains as follows: "At the last minute, Dan Lickly, our chief engineer, appeared with ephemerides updates and it took two tries to get it right. The result was that we created Lum99 Revision 1 and Lum99 Revision 2." It is suspected that the former is what's in the MIT Museum, and the latter is what we are trying to recreate here. As for which revision actually flew in Apollo 11, all of the other available surviving evidence points to Rev 1 rather than to Rev 2, so we're just not sure!

020476,000002:                                                                                                  ## Copyright:   Public domain.
020477,000003:                                                                                                  ## Filename:    S-BAND_ANTENNA_FOR_LM.agc
020478,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
020479,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
020480,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
020481,000007:                                                                                                  ## Assembler:   yaYUL
020482,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
020483,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
020484,000010:                                                                                                  ## Pages:       486-489
020485,000011:                                                                                                  ## Mod history: 2009-05-17 RSB  Adapted from the corresponding 
020486,000012:                                                                                                  ##                              Luminary131 file, using page 
020487,000013:                                                                                                  ##                              images from Luminary 1A.
020488,000014:                                                                                                  ##              2009-06-07 RSB  Corrected a misprint.
020489,000015:                                                                                                  ##              2016-12-14 RSB  Proofed text comments with octopus/ProoferComments
020490,000016:                                                                                                  ##                              and corrected the errors found.
020491,000017:                                                                                                  ##              2017-03-03 RSB  Snapshot of Luminary 99 Rev 1. 
020492,000018: 

Page 486

020494,000020:                                                                                                  #  SUBROUTINE NAME: R05 - S-BAND ANTENNA FOR LM
020495,000021: 
020496,000022:                                                                                                  #  MOD0 BY T. JAMES
020497,000023:                                                                                                  #  MOD1 BY P. SHAKIR
020498,000024: 
020499,000025:                                                                                                  #  FUNCTIONAL DESCRIPTION
020500,000026: 
020501,000027:                                                                                                  #  THE S-BAND ANTENNA ROUTINE, R05, COMPUTES AND DISPLAYS THE PITCH AND
020502,000028:                                                                                                  #  YAW ANTENNA GIMBAL ANGLES REQUIRED TO POINT THE LM STEERABLE ANTENNA
020503,000029:                                                                                                  #  TOWARD THE CENTER OF THE EARTH.  THIS ROUTINE IS SELECTED BY THE ASTRO-
020504,000030:                                                                                                  #  NAUT VIA DSKY ENTRY DURING COASTING FLIGHT OR WHEN THE LM IS ON THE MOON
020505,000031:                                                                                                  #  SURFACE.  THE EARTH OR MOON REFERENCE COORDINATE SYSTEM IS USED DEPENDING
020506,000032:                                                                                                  #  ON WHETHER THE LM IS ABOUT TO ENTER OR HAS ALREADY ENTERED THE MOON
020507,000033:                                                                                                  #  SPHERE OF INFLUENCE, RESPECTIVELY
020508,000034: 
020509,000035:                                                                                                  #  TO CALL SUBROUTINE, ASTRONAUT KEYS IN V 64 E
020510,000036: 
020511,000037:                                                                                                  #  SUBROUTINES CALLED -
020512,000038:                                                                                                  #        R02BOTH
020513,000039:                                                                                                  #        INTPRET
020514,000040:                                                                                                  #        LOADTIME
020515,000041:                                                                                                  #        LEMCONIC
020516,000042:                                                                                                  #        LUNPOS
020517,000043:                                                                                                  #        CDUTRIG
020518,000044:                                                                                                  #        *SMNB*
020519,000045:                                                                                                  #        BANKCALL
020520,000046:                                                                                                  #        B5OFF
020521,000047:                                                                                                  #        ENDOFJOB
020522,000048:                                                                                                  #        BLANKET
020523,000049: 
020524,000050:                                                                                                  #  RETURNS WITH
020525,000051:                                                                                                  #        PITCH ANGLE IN PITCHANG         REV. B0
020526,000052:                                                                                                  #        YAW ANGLE IN YAWANG             REV. B0
020527,000053: 
020528,000054:                                                                                                  #  ERASABLES USED
020529,000055:                                                                                                  #        PITCHANG
020530,000056:                                                                                                  #        YAWANG
020531,000057:                                                                                                  #        RLM
020532,000058:                                                                                                  #        VAC AREA
020533,000059: 
020534,000060: 41,3731                                           BANK     41                                    
020535,000061: 42,2000                                           SETLOC   SBAND                                 
020536,000062: 42,2000                                           BANK                                           
020537,000063: 
020538,000064: 42,3606  E7,1471                                  EBANK=   WHOCARES                              
020539,000065: 42,3606                                           COUNT*   $$/R05                                
020540,000066: 42,3606           04616        SBANDANT           TC       BANKCALL                              

Page 487

020542,000068: 42,3607           11254                           CADR     R02BOTH                               #  CHECK IF IMU IS ON AND ALIGNED
020543,000069: 42,3610           06037                           TC       INTPRET                               
020544,000070: 42,3611           47001                           SETPD    RTB                                   
020545,000071: 42,3612           00001                                    0D                                    
020546,000072: 42,3613           21573                                    LOADTIME                              #  PICK UP CURRENT TIME
020547,000073: 42,3614           34041                           STCALL   TDEC1                                 #  ADVANCE INTEGRATION TO TIME IN TDEC1
020548,000074: 42,3615           27100                                    LEMCONIC                              #  USING CONIC INTEGRATION
020549,000075: 42,3616           46135                           SLOAD    BHIZ                                  
020550,000076: 42,3617           00050                                    X2                                    #  X2 =0 EARTH SPHERE, X2 =2 MOON SPHERE
020551,000077: 42,3620           65636                                    CONV4                                 
020552,000078: 42,3621           77775                           VLOAD                                          
020553,000079: 42,3622           00001                                    RATT                                  
020554,000080: 42,3623           16205                           STODL    RLM                                   
020555,000081: 42,3624           00015                                    TAT                                   
020556,000082: 42,3625           77624        CONV3              CALL                                           
020557,000083: 42,3626           33664                                    LUNPOS                                #  UNIT POSITION VECTOR FROM EARTH TO MOON
020558,000084: 42,3627           74375                           VLOAD    VXSC                                  
020559,000085: 42,3630           02723                                    VMOON                                 
020560,000086: 42,3631           24001                                    REMDIST                               #  MEAN DISTANCE FROM EARTH TO MOON
020561,000087: 42,3632           53372                           VSL1     VAD                                   
020562,000088: 42,3633           02205                                    RLM                                   
020563,000089: 42,3634           77650                           GOTO                                           
020564,000090: 42,3635           65640                                    CONV5                                 
020565,000091: 42,3636           77775        CONV4              VLOAD                                          
020566,000092: 42,3637           00001                                    RATT                                  #  UE = -UNIT(RATT)              EARTH SPHERE
020567,000093: 42,3640           53401        CONV5              SETPD    UNIT                                  #  UE = -UNIT((REM)(UEM) + RL)   MOON SPHERE
020568,000094: 42,3641           00001                                    0D                                    #  SET PL POINTER TO 0
020569,000095: 42,3642           45076                           VCOMP    CALL                                  
020570,000096: 42,3643           47537                                    CDUTRIG                               #  COMPUTE SINES AND COSINES OF CDU ANGLES
020571,000097: 42,3644           76521                           MXV      VSL1                                  #  TRANSFORM REF. COORDINATE SYSTEM TO
020572,000098: 42,3645           01734                                    REFSMMAT                              #  STABLE MEMBER B-1 X B-1 X B+1 = B-1
020573,000099: 42,3646           71206                           PUSH     DLOAD                                 #  8D
020574,000100: 42,3647           06522                                    HI6ZEROS                              
020575,000101: 42,3650           02201                           STORE    PITCHANG                              
020576,000102: 42,3651           26203                           STOVL    YAWANG                                #  ZERO OUT ANGLES
020577,000103: 42,3652           77624                           CALL                                           
020578,000104: 42,3653           47671                                    *SMNB*                                
020579,000105: 42,3654           16205                           STODL    RLM                                   #  PRE-MULTIPLY RLM BY (NBSA) MATRIX(B0)
020580,000106: 42,3655           02207                                    RLM        +2                         
020581,000107: 42,3656           45206                           PUSH     DSU                                   
020582,000108: 42,3657           02205                                    RLM                                   
020583,000109: 42,3660           77605                           DMP                                            
020584,000110: 42,3661           25771                                    1OVSQRT2                              
020585,000111: 42,3662           16207                           STODL    RLM        +2                         
020586,000112: 42,3663           41215                           DAD      DMP                                   
020587,000113: 42,3664           02205                                    RLM                                   
020588,000114: 42,3665           25771                                    1OVSQRT2                              
020589,000115: 42,3666           26205                           STOVL    RLM                                   #  R B-1
020590,000116: 42,3667           02205                                    RLM                                   
020591,000117: 42,3670           63256                           UNIT     PDVL                                  

Page 488

020593,000119: 42,3671           02205                                    RLM                                   
020594,000120: 42,3672           72431                           VPROJ    VSL2                                  #  PROJECTION OF R ONTO LM XZ PLANE
020595,000121: 42,3673           06516                                    HIUNITY                               
020596,000122: 42,3674           40045                           BVSU     BOV                                   #  CLEAR OVERFLOW INDICATOR IF ON
020597,000123: 42,3675           02205                                    RLM                                   
020598,000124: 42,3676           65677                                    COVCNV                                
020599,000125: 42,3677           40056        COVCNV             UNIT     BOV                                   #  EXIT ON OVERFLOW
020600,000126: 42,3700           65745                                    SBANDEX                               
020601,000127: 42,3701           47206                           PUSH     VXV                                   #  URP VECTOR B-1
020602,000128: 42,3702           06514                                    HIUNITZ                               
020603,000129: 42,3703           57572                           VSL1     VCOMP                                 #  UZ X URP = -(URP X UZ)
020604,000130: 42,3704           02205                           STORE    RLM                                   #  X VEC B-1
020605,000131: 42,3705           63241                           DOT      PDVL                                  #  SGN(X.UY) UNSCALED
020606,000132: 42,3706           06516                                    HIUNITY                               
020607,000133: 42,3707           02205                                    RLM                                   
020608,000134: 42,3710           75246                           ABVAL    SIGN                                  
020609,000135: 42,3711           77736                           ASIN                                           #  ASIN((SGN(X.UY))ABV(X))       REV B0
020610,000136: 42,3712           26201                           STOVL    PITCHANG                              
020611,000137: 42,3713           00007                                    URP                                   
020612,000138: 42,3714           51041                           DOT      BPL                                   
020613,000139: 42,3715           06514                                    HIUNITZ                               
020614,000140: 42,3716           65723                                    NOADJUST                              #  YES, -90 TO +90
020615,000141: 42,3717           45345                           DLOAD    DSU                                   
020616,000142: 42,3720           06520                                    HIDPHALF                              
020617,000143: 42,3721           02201                                    PITCHANG                              
020618,000144: 42,3722           02201                           STORE    PITCHANG                              
020619,000145: 42,3723           47375        NOADJUST           VLOAD    VXV                                   
020620,000146: 42,3724           00001                                    UR                                    #  Z = (UR X URP)
020621,000147: 42,3725           00007                                    URP                                   
020622,000148: 42,3726           77772                           VSL1                                           
020623,000149: 42,3727           16205                           STODL    RLM                                   #  Z VEC B-1
020624,000150: 42,3730           02201                                    PITCHANG                              
020625,000151: 42,3731           74356                           SIN      VXSC                                  
020626,000152: 42,3732           06514                                    HIUNITZ                               
020627,000153: 42,3733           71525                           PDDL     COS                                   
020628,000154: 42,3734           02201                                    PITCHANG                              
020629,000155: 42,3735           52361                           VXSC     VSU                                   
020630,000156: 42,3736           06520                                    HIUNITX                               #  (UX COS ALPHA) - (UZ SIN ALPHA)
020631,000157: 42,3737           63241                           DOT      PDVL                                  #  YAW.Z
020632,000158: 42,3740           02205                                    RLM                                   
020633,000159: 42,3741           02205                                    RLM                                   
020634,000160: 42,3742           75246                           ABVAL    SIGN                                  
020635,000161: 42,3743           77736                           ASIN                                           
020636,000162: 42,3744           02203                           STORE    YAWANG                                
020637,000163: 42,3745           77776        SBANDEX            EXIT                                           
020638,000164: 42,3746           31044                           CA       EXTVBACT                              
020639,000165: 42,3747           74747                           MASK     BIT5                                  #  IS BIT5 STILL ON
020640,000166: 42,3750           00006                           EXTEND                                         
020641,000167: 42,3751           15472                           BZF      ENDEXT                                #  NO
020642,000168: 42,3752           35017                           CAF      PRIO5                                 

Page 489

020644,000170: 42,3753           05146                           TC       PRIOCHNG                              
020645,000171: 42,3754           33767                           CAF      V06N51                                #  DISPLAY ANGLES
020646,000172: 42,3755           04616                           TC       BANKCALL                              
020647,000173: 42,3756           20353                           CADR     GOMARKFR                              
020648,000174: 42,3757           05563                           TC       B5OFF                                 #  TERMINATE
020649,000175: 42,3760           05563                           TC       B5OFF                                 #  PROCEED
020650,000176: 42,3761           05155                           TC       ENDOFJOB                              #  RECYCLE
020651,000177: 42,3762           34751                           CAF      BIT3                                  #  IMMEDIATE RETURN
020652,000178: 42,3763           05464                           TC       BLANKET                               #  BLANK R3
020653,000179: 42,3764           34740                           CAF      PRIO4                                 
020654,000180: 42,3765           05146                           TC       PRIOCHNG                              
020655,000181: 42,3766           03610                           TC       SBANDANT   +2                         #  YES, CONTINUE DISPLAYING ANGLES
020656,000182: 42,3767           01463        V06N51             VN       0651                                  
020657,000183: 42,3770           26501 07463  1OVSQRT2           2DEC     .7071067815                            #  1/SQRT(2)
020658,000184: 
020659,000185: 42,3772                        UR                 EQUALS   0D                                    
020660,000186: 42,3772                        URP                EQUALS   6D                                    
020661,000187: 42,3772  30,2000                                  SBANK=   LOWSUPER                              
020662,000188: 

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