Source Code

These source-code files are part of a reconstructed copy of Luminary 163, the first (unflown) release of the Apollo 14 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with reconstructed source code for Luminary 173. Changes between revision 163 and 173 were backed out, as described by Luminary memos 157 and 158. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 163 listing would be different.

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.

021419,000002:                                                                                                  ## Copyright:   Public domain.
021420,000003:                                                                                                  ## Filename:    S-BAND_ANTENNA_FOR_LM.agc
021421,000004:                                                                                                  ## Purpose:     A section of Luminary revision 163.
021422,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
021423,000006:                                                                                                  ##              (unflown) release of the flight software for the Lunar
021424,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
021425,000008:                                                                                                  ##              The code has been recreated from a reconstructed copy of
021426,000009:                                                                                                  ##              Luminary 173, as well as Luminary memos 157 amd 158.
021427,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
021428,000011:                                                                                                  ##              exactly match those specified for Luminary 163 in NASA
021429,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
021430,000013:                                                                                                  ##              that the reconstruction is correct.
021431,000014:                                                                                                  ## Reference:   pp. 494-497
021432,000015:                                                                                                  ## Assembler:   yaYUL
021433,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
021434,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
021435,000018:                                                                                                  ## Mod history: 2019-08-21 MAS  Created from Luminary 173.
021436,000019: 

Page 494

021438,000021:                                                                                                  #  SUBROUTINE NAME: R05 - S-BAND ANTENNA FOR LM
021439,000022: 
021440,000023:                                                                                                  #  MOD0 BY T. JAMES
021441,000024:                                                                                                  #  MOD1 BY P. SHAKIR
021442,000025: 
021443,000026:                                                                                                  #  FUNCTIONAL DESCRIPTION
021444,000027: 
021445,000028:                                                                                                  #      THE S-BAND ANTENNA ROUTINE, R05, COMPUTES AND DISPLAYS THE PITCH AND
021446,000029:                                                                                                  #  YAW ANTENNA GIMBAL ANGLES REQUIRED TO POINT THE LM STEERABLE ANTENNA
021447,000030:                                                                                                  #  TOWARD THE CENTER OF THE EARTH. THIS ROUTINE IS SELECTED BY THE ASTRO-
021448,000031:                                                                                                  #  NAUT VIA DSKY ENTRY DURING COASTING FLIGHT OR WHEN THE LM IS ON THE MOON
021449,000032:                                                                                                  #  SURFACE. THE EARTH OR MOON REFERENCE COORDINATE SYSTEM IS USED DEPENDING
021450,000033:                                                                                                  #  ON WHETHER THE LM IS ABOUT TO ENTER OR HAS ALREADY ENTERED THE MOON
021451,000034:                                                                                                  #  SPHERE OF INFLUENCE, RESPECTIVELY.  CAN BE CALLED ANY TIME EXCEPT WHEN
021452,000035:                                                                                                  #  ANOTHER EXTENDED VERB IS IN USE. DISPLAY IS MEANINGLESS WITH IMU OFF.
021453,000036: 
021454,000037:                                                                                                  #  TO CALL SUBROUTINE, ASTRONAUT KEYS IN V 64 E
021455,000038: 
021456,000039:                                                                                                  #  SUBROUTINES CALLED-
021457,000040: 
021458,000041:                                                                                                  #      INTPRET
021459,000042:                                                                                                  #      LOADTIME
021460,000043:                                                                                                  #      LEMCONIC
021461,000044:                                                                                                  #      LUNPOS
021462,000045:                                                                                                  #      CDUTRIG
021463,000046:                                                                                                  #      *SMNB*
021464,000047:                                                                                                  #      BANKCALL
021465,000048:                                                                                                  #      B5OFF
021466,000049:                                                                                                  #      ENDOFJOB
021467,000050:                                                                                                  #      BLANKET
021468,000051: 
021469,000052:                                                                                                  #  RETURNS WITH
021470,000053: 
021471,000054:                                                                                                  #      PITCH ANGLE IN PITCHANG  REV. B0
021472,000055:                                                                                                  #      YAW ANGLE IN YAWANG  REV. B0
021473,000056: 
021474,000057:                                                                                                  #  ERASABLES USED
021475,000058: 
021476,000059:                                                                                                  #      PITCHANG
021477,000060:                                                                                                  #      YAWANG
021478,000061:                                                                                                  #      RLM
021479,000062:                                                                                                  #      VAC AREA
021480,000063: 
021481,000064: 41,3755                                           BANK     41                                    
021482,000065: 42,2000                                           SETLOC   SBAND                                 
021483,000066: 42,2000                                           BANK                                           
021484,000067: 
021485,000068: 42,3606  E7,1471                                  EBANK=   WHOCARES                              
021486,000069: 42,3606                                           COUNT*   $$/R05                                
021487,000070: 42,3606           06042        SBANDANT           TC       INTPRET                               

Page 495

021489,000072: 42,3607           47001                           SETPD    RTB                                   
021490,000073: 42,3610           00001                                    0D                                    
021491,000074: 42,3611           21574                                    LOADTIME                              #  PICK UP CURRENT TIME
021492,000075: 42,3612           34041                           STCALL   TDEC1                                 #  ADVANCE INTEGRATION TO TIME IN TDEC1
021493,000076: 42,3613           27077                                    LEMCONIC                              #  USING CONIC INTEGRATION
021494,000077: 42,3614           46135                           SLOAD    BHIZ                                  
021495,000078: 42,3615           00050                                    X2                                    #  X2 =0 EARTH SPHERE, X2 =2 MOON SPHERE
021496,000079: 42,3616           65634                                    CONV4                                 
021497,000080: 42,3617           77775                           VLOAD                                          
021498,000081: 42,3620           00001                                    RATT                                  
021499,000082: 42,3621           16205                           STODL    RLM                                   
021500,000083: 42,3622           00015                                    TAT                                   
021501,000084: 42,3623           77624        CONV3              CALL                                           
021502,000085: 42,3624           33641                                    LUNPOS                                #  UNIT POSITION VECTOR FROM EARTH TO MOON
021503,000086: 42,3625           74375                           VLOAD    VXSC                                  
021504,000087: 42,3626           02723                                    VMOON                                 
021505,000088: 42,3627           24001                                    REMDIST                               #  MEAN DISTANCE FROM EARTH TO MOON
021506,000089: 42,3630           53372                           VSL1     VAD                                   
021507,000090: 42,3631           02205                                    RLM                                   
021508,000091: 42,3632           77650                           GOTO                                           
021509,000092: 42,3633           65636                                    CONV5                                 
021510,000093: 42,3634           77775        CONV4              VLOAD                                          
021511,000094: 42,3635           00001                                    RATT                                  #  UE = -UNIT(RATT)  EARTH SPHERE
021512,000095: 42,3636           53401        CONV5              SETPD    UNIT                                  #  UE = -UNIT((REM)(UEM) + RL)  MOON SPHERE
021513,000096: 42,3637           00001                                    0D                                    #  SET PL POINTER TO 0
021514,000097: 42,3640           45076                           VCOMP    CALL                                  
021515,000098: 42,3641           47535                                    CDUTRIG                               #  COMPUTE SINES AND COSINES OF CDU ANGLES
021516,000099: 42,3642           76521                           MXV      VSL1                                  #  TRANSFORM REF. COORDINATE SYSTEM TO
021517,000100: 42,3643           01732                                    REFSMMAT                              #  STABLE MEMBER  B-1 X B-1 X B+1 = B-1
021518,000101: 42,3644           71206                           PUSH     DLOAD                                 #  8D
021519,000102: 42,3645           06520                                    HI6ZEROS                              
021520,000103: 42,3646           02201                           STORE    PITCHANG                              
021521,000104: 42,3647           26203                           STOVL    YAWANG                                #  ZERO OUT ANGLES
021522,000105: 42,3650           77624                           CALL                                           
021523,000106: 42,3651           47676                                    *SMNB*                                
021524,000107: 42,3652           16205                           STODL    RLM                                   #  PRE-MULTIPLY RLM BY (NBSA) MATRIX(B0)
021525,000108: 42,3653           02207                                    RLM        +2                         
021526,000109: 42,3654           45206                           PUSH     DSU                                   
021527,000110: 42,3655           02205                                    RLM                                   
021528,000111: 42,3656           77605                           DMP                                            
021529,000112: 42,3657           25767                                    1OVSQRT2                              
021530,000113: 42,3660           16207                           STODL    RLM        +2                         
021531,000114: 42,3661           41215                           DAD      DMP                                   
021532,000115: 42,3662           02205                                    RLM                                   
021533,000116: 42,3663           25767                                    1OVSQRT2                              
021534,000117: 42,3664           26205                           STOVL    RLM                                   #  R  B-1
021535,000118: 42,3665           02205                                    RLM                                   
021536,000119: 42,3666           63256                           UNIT     PDVL                                  
021537,000120: 42,3667           02205                                    RLM                                   
021538,000121: 42,3670           72431                           VPROJ    VSL2                                  #  PROJECTION OF R ONTO LM XZ PLANE

Page 496

021540,000123: 42,3671           06514                                    HIUNITY                               
021541,000124: 42,3672           40045                           BVSU     BOV                                   #  CLEAR OVERFLOW INDICATOR IF ON
021542,000125: 42,3673           02205                                    RLM                                   
021543,000126: 42,3674           65675                                    COVCNV                                
021544,000127: 42,3675           40056        COVCNV             UNIT     BOV                                   #  EXIT ON OVERFLOW
021545,000128: 42,3676           65743                                    SBANDEX                               
021546,000129: 42,3677           47206                           PUSH     VXV                                   #  URP VECTOR  B-1
021547,000130: 42,3700           06512                                    HIUNITZ                               
021548,000131: 42,3701           57572                           VSL1     VCOMP                                 #  UZ X URP = -(URP X UZ)
021549,000132: 42,3702           02205                           STORE    RLM                                   #  X VEC  B-1
021550,000133: 42,3703           63241                           DOT      PDVL                                  #  SGN(X.UY) UNSCALED
021551,000134: 42,3704           06514                                    HIUNITY                               
021552,000135: 42,3705           02205                                    RLM                                   
021553,000136: 42,3706           75246                           ABVAL    SIGN                                  
021554,000137: 42,3707           77736                           ASIN                                           #  ASIN((SGN(X.UY))ABV(X)) REV B0
021555,000138: 42,3710           26201                           STOVL    PITCHANG                              
021556,000139: 42,3711           00007                                    URP                                   
021557,000140: 42,3712           51041                           DOT      BPL                                   
021558,000141: 42,3713           06512                                    HIUNITZ                               
021559,000142: 42,3714           65721                                    NOADJUST                              #  YES, -90 TO +90
021560,000143: 42,3715           45345                           DLOAD    DSU                                   
021561,000144: 42,3716           06516                                    HIDPHALF                              
021562,000145: 42,3717           02201                                    PITCHANG                              
021563,000146: 42,3720           02201                           STORE    PITCHANG                              
021564,000147: 42,3721           47375        NOADJUST           VLOAD    VXV                                   
021565,000148: 42,3722           00001                                    UR                                    #  Z = (UR X URP)
021566,000149: 42,3723           00007                                    URP                                   
021567,000150: 42,3724           77772                           VSL1                                           
021568,000151: 42,3725           16205                           STODL    RLM                                   #  Z VEC  B-1
021569,000152: 42,3726           02201                                    PITCHANG                              
021570,000153: 42,3727           74356                           SIN      VXSC                                  
021571,000154: 42,3730           06512                                    HIUNITZ                               
021572,000155: 42,3731           71525                           PDDL     COS                                   
021573,000156: 42,3732           02201                                    PITCHANG                              
021574,000157: 42,3733           52361                           VXSC     VSU                                   
021575,000158: 42,3734           06516                                    HIUNITX                               #  (UX COS ALPHA) - (UZ SIN ALPHA)
021576,000159: 42,3735           63241                           DOT      PDVL                                  #  YAW.Z
021577,000160: 42,3736           02205                                    RLM                                   
021578,000161: 42,3737           02205                                    RLM                                   
021579,000162: 42,3740           75246                           ABVAL    SIGN                                  
021580,000163: 42,3741           77736                           ASIN                                           
021581,000164: 42,3742           02203                           STORE    YAWANG                                
021582,000165: 42,3743           77776        SBANDEX            EXIT                                           
021583,000166: 42,3744           31043                           CA       EXTVBACT                              
021584,000167: 42,3745           74747                           MASK     BIT5                                  #  IS BIT5 STILL ON
021585,000168: 42,3746           00006                           EXTEND                                         
021586,000169: 42,3747           15503                           BZF      ENDEXT                                #  NO
021587,000170: 42,3750           35017                           CAF      PRIO5                                 
021588,000171: 42,3751           05146                           TC       PRIOCHNG                              
021589,000172: 42,3752           33765                           CAF      V06N51                                #  DISPLAY ANGLES
021590,000173: 

Page 497

021592,000175: 42,3753           04616                           TC       BANKCALL                              
021593,000176: 42,3754           20353                           CADR     GOMARKFR                              
021594,000177: 42,3755           05574                           TC       B5OFF                                 #  TERMINATE
021595,000178: 42,3756           05574                           TC       B5OFF                                 #  PROCEED
021596,000179: 42,3757           05155                           TC       ENDOFJOB                              #  RECYCLE
021597,000180: 42,3760           34751                           CAF      BIT3                                  #  IMMEDIATE RETURN
021598,000181: 42,3761           05475                           TC       BLANKET                               #  BLANK R3
021599,000182: 42,3762           34740                           CAF      PRIO4                                 
021600,000183: 42,3763           05146                           TC       PRIOCHNG                              
021601,000184: 42,3764           03606                           TC       SBANDANT                              #  YES, CONTINUE DISPLAYING ANGLES.
021602,000185: 42,3765           01463        V06N51             VN       0651                                  
021603,000186: 42,3766           26501 07463  1OVSQRT2           2DEC     .7071067815                            #  1/SQRT(2)
021604,000187: 
021605,000188: 42,3770                        UR                 EQUALS   0D                                    
021606,000189: 42,3770                        URP                EQUALS   6D                                    
021607,000190: 42,3770  30,2000                                  SBANK=   LOWSUPER                              

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