Source Code

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

The reconstruction began with reconstructed source code for Luminary 178. Changes between revision 173 and 178 were backed out, as described by Luminary memo 167 (revision 1). 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 173 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.

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

Page 494

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

Page 495

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

Page 496

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

Page 497

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

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