Source Code

These source-code files were from the printout at the MIT Museum, with many thanks to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing it to us. The printout was digitally photographed by Paul Fjeld. A team of volunteers transcribed the source code manually from these images or, where appropriate, modified already-transcribed but similar source Luminary 131 (Apollo 13) source code to agree with the images from the printout. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 001 OF AGC PROGRAM LMY99 BY NASA 2021112-061
	16:27 JULY 14,1969
Note that the date is the date of the printout, not the date of the program revision.

020903,000002:                                                                                                  ## Copyright:   Public domain.
020904,000003:                                                                                                  ## Filename:    S-BAND_ANTENNA_FOR_LM.agc
020905,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
020906,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
020907,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
020908,000007:                                                                                                  ## Assembler:   yaYUL
020909,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
020910,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
020911,000010:                                                                                                  ## Pages:       486-489
020912,000011:                                                                                                  ## Mod history: 2009-05-17 RSB  Adapted from the corresponding 
020913,000012:                                                                                                  ##                              Luminary131 file, using page 
020914,000013:                                                                                                  ##                              images from Luminary 1A.
020915,000014:                                                                                                  ##              2009-06-07 RSB  Corrected a misprint.
020916,000015:                                                                                                  ##              2016-12-14 RSB  Proofed text comments with octopus/ProoferComments
020917,000016:                                                                                                  ##                              and corrected the errors found.
020918,000017:                                                                                                  ##
020919,000018:                                                                                                  ## This source code has been transcribed or otherwise adapted from
020920,000019:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
020921,000020:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
020922,000021:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
020923,000022:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
020924,000023:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
020925,000024:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
020926,000025:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
020927,000026:                                                                                                  ## actually created.
020928,000027:                                                                                                  ##
020929,000028:                                                                                                  ## Notations on the hardcopy document read, in part:
020930,000029:                                                                                                  ##
020931,000030:                                                                                                  ##      Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
020932,000031:                                                                                                  ##      16:27 JULY 14, 1969 
020933,000032: 

Page 486

020935,000034:                                                                                                  #  SUBROUTINE NAME: R05 - S-BAND ANTENNA FOR LM
020936,000035: 
020937,000036:                                                                                                  #  MOD0 BY T. JAMES
020938,000037:                                                                                                  #  MOD1 BY P. SHAKIR
020939,000038: 
020940,000039:                                                                                                  #  FUNCTIONAL DESCRIPTION
020941,000040: 
020942,000041:                                                                                                  #  THE S-BAND ANTENNA ROUTINE, R05, COMPUTES AND DISPLAYS THE PITCH AND
020943,000042:                                                                                                  #  YAW ANTENNA GIMBAL ANGLES REQUIRED TO POINT THE LM STEERABLE ANTENNA
020944,000043:                                                                                                  #  TOWARD THE CENTER OF THE EARTH.  THIS ROUTINE IS SELECTED BY THE ASTRO-
020945,000044:                                                                                                  #  NAUT VIA DSKY ENTRY DURING COASTING FLIGHT OR WHEN THE LM IS ON THE MOON
020946,000045:                                                                                                  #  SURFACE.  THE EARTH OR MOON REFERENCE COORDINATE SYSTEM IS USED DEPENDING
020947,000046:                                                                                                  #  ON WHETHER THE LM IS ABOUT TO ENTER OR HAS ALREADY ENTERED THE MOON
020948,000047:                                                                                                  #  SPHERE OF INFLUENCE, RESPECTIVELY
020949,000048: 
020950,000049:                                                                                                  #  TO CALL SUBROUTINE, ASTRONAUT KEYS IN V 64 E
020951,000050: 
020952,000051:                                                                                                  #  SUBROUTINES CALLED -
020953,000052:                                                                                                  #        R02BOTH
020954,000053:                                                                                                  #        INTPRET
020955,000054:                                                                                                  #        LOADTIME
020956,000055:                                                                                                  #        LEMCONIC
020957,000056:                                                                                                  #        LUNPOS
020958,000057:                                                                                                  #        CDUTRIG
020959,000058:                                                                                                  #        *SMNB*
020960,000059:                                                                                                  #        BANKCALL
020961,000060:                                                                                                  #        B5OFF
020962,000061:                                                                                                  #        ENDOFJOB
020963,000062:                                                                                                  #        BLANKET
020964,000063: 
020965,000064:                                                                                                  #  RETURNS WITH
020966,000065:                                                                                                  #        PITCH ANGLE IN PITCHANG         REV. B0
020967,000066:                                                                                                  #        YAW ANGLE IN YAWANG             REV. B0
020968,000067: 
020969,000068:                                                                                                  #  ERASABLES USED
020970,000069:                                                                                                  #        PITCHANG
020971,000070:                                                                                                  #        YAWANG
020972,000071:                                                                                                  #        RLM
020973,000072:                                                                                                  #        VAC AREA
020974,000073: 
020975,000074: 41,3731                                           BANK     41                                    
020976,000075: 42,2000                                           SETLOC   SBAND                                 
020977,000076: 42,2000                                           BANK                                           
020978,000077: 
020979,000078: 42,3606  E7,1471                                  EBANK=   WHOCARES                              
020980,000079: 42,3606                                           COUNT*   $$/R05                                
020981,000080: 42,3606           04616        SBANDANT           TC       BANKCALL                              

Page 487

020983,000082: 42,3607           11254                           CADR     R02BOTH                               #  CHECK IF IMU IS ON AND ALIGNED
020984,000083: 42,3610           06037                           TC       INTPRET                               
020985,000084: 42,3611           47001                           SETPD    RTB                                   
020986,000085: 42,3612           00001                                    0D                                    
020987,000086: 42,3613           21573                                    LOADTIME                              #  PICK UP CURRENT TIME
020988,000087: 42,3614           34041                           STCALL   TDEC1                                 #  ADVANCE INTEGRATION TO TIME IN TDEC1
020989,000088: 42,3615           27100                                    LEMCONIC                              #  USING CONIC INTEGRATION
020990,000089: 42,3616           46135                           SLOAD    BHIZ                                  
020991,000090: 42,3617           00050                                    X2                                    #  X2 =0 EARTH SPHERE, X2 =2 MOON SPHERE
020992,000091: 42,3620           65636                                    CONV4                                 
020993,000092: 42,3621           77775                           VLOAD                                          
020994,000093: 42,3622           00001                                    RATT                                  
020995,000094: 42,3623           16205                           STODL    RLM                                   
020996,000095: 42,3624           00015                                    TAT                                   
020997,000096: 42,3625           77624        CONV3              CALL                                           
020998,000097: 42,3626           33664                                    LUNPOS                                #  UNIT POSITION VECTOR FROM EARTH TO MOON
020999,000098: 42,3627           74375                           VLOAD    VXSC                                  
021000,000099: 42,3630           02723                                    VMOON                                 
021001,000100: 42,3631           24001                                    REMDIST                               #  MEAN DISTANCE FROM EARTH TO MOON
021002,000101: 42,3632           53372                           VSL1     VAD                                   
021003,000102: 42,3633           02205                                    RLM                                   
021004,000103: 42,3634           77650                           GOTO                                           
021005,000104: 42,3635           65640                                    CONV5                                 
021006,000105: 42,3636           77775        CONV4              VLOAD                                          
021007,000106: 42,3637           00001                                    RATT                                  #  UE = -UNIT(RATT)              EARTH SPHERE
021008,000107: 42,3640           53401        CONV5              SETPD    UNIT                                  #  UE = -UNIT((REM)(UEM) + RL)   MOON SPHERE
021009,000108: 42,3641           00001                                    0D                                    #  SET PL POINTER TO 0
021010,000109: 42,3642           45076                           VCOMP    CALL                                  
021011,000110: 42,3643           47537                                    CDUTRIG                               #  COMPUTE SINES AND COSINES OF CDU ANGLES
021012,000111: 42,3644           76521                           MXV      VSL1                                  #  TRANSFORM REF. COORDINATE SYSTEM TO
021013,000112: 42,3645           01734                                    REFSMMAT                              #  STABLE MEMBER B-1 X B-1 X B+1 = B-1
021014,000113: 42,3646           71206                           PUSH     DLOAD                                 #  8D
021015,000114: 42,3647           06522                                    HI6ZEROS                              
021016,000115: 42,3650           02201                           STORE    PITCHANG                              
021017,000116: 42,3651           26203                           STOVL    YAWANG                                #  ZERO OUT ANGLES
021018,000117: 42,3652           77624                           CALL                                           
021019,000118: 42,3653           47671                                    *SMNB*                                
021020,000119: 42,3654           16205                           STODL    RLM                                   #  PRE-MULTIPLY RLM BY (NBSA) MATRIX(B0)
021021,000120: 42,3655           02207                                    RLM        +2                         
021022,000121: 42,3656           45206                           PUSH     DSU                                   
021023,000122: 42,3657           02205                                    RLM                                   
021024,000123: 42,3660           77605                           DMP                                            
021025,000124: 42,3661           25771                                    1OVSQRT2                              
021026,000125: 42,3662           16207                           STODL    RLM        +2                         
021027,000126: 42,3663           41215                           DAD      DMP                                   
021028,000127: 42,3664           02205                                    RLM                                   
021029,000128: 42,3665           25771                                    1OVSQRT2                              
021030,000129: 42,3666           26205                           STOVL    RLM                                   #  R B-1
021031,000130: 42,3667           02205                                    RLM                                   
021032,000131: 42,3670           63256                           UNIT     PDVL                                  

Page 488

021034,000133: 42,3671           02205                                    RLM                                   
021035,000134: 42,3672           72431                           VPROJ    VSL2                                  #  PROJECTION OF R ONTO LM XZ PLANE
021036,000135: 42,3673           06516                                    HIUNITY                               
021037,000136: 42,3674           40045                           BVSU     BOV                                   #  CLEAR OVERFLOW INDICATOR IF ON
021038,000137: 42,3675           02205                                    RLM                                   
021039,000138: 42,3676           65677                                    COVCNV                                
021040,000139: 42,3677           40056        COVCNV             UNIT     BOV                                   #  EXIT ON OVERFLOW
021041,000140: 42,3700           65745                                    SBANDEX                               
021042,000141: 42,3701           47206                           PUSH     VXV                                   #  URP VECTOR B-1
021043,000142: 42,3702           06514                                    HIUNITZ                               
021044,000143: 42,3703           57572                           VSL1     VCOMP                                 #  UZ X URP = -(URP X UZ)
021045,000144: 42,3704           02205                           STORE    RLM                                   #  X VEC B-1
021046,000145: 42,3705           63241                           DOT      PDVL                                  #  SGN(X.UY) UNSCALED
021047,000146: 42,3706           06516                                    HIUNITY                               
021048,000147: 42,3707           02205                                    RLM                                   
021049,000148: 42,3710           75246                           ABVAL    SIGN                                  
021050,000149: 42,3711           77736                           ASIN                                           #  ASIN((SGN(X.UY))ABV(X))       REV B0
021051,000150: 42,3712           26201                           STOVL    PITCHANG                              
021052,000151: 42,3713           00007                                    URP                                   
021053,000152: 42,3714           51041                           DOT      BPL                                   
021054,000153: 42,3715           06514                                    HIUNITZ                               
021055,000154: 42,3716           65723                                    NOADJUST                              #  YES, -90 TO +90
021056,000155: 42,3717           45345                           DLOAD    DSU                                   
021057,000156: 42,3720           06520                                    HIDPHALF                              
021058,000157: 42,3721           02201                                    PITCHANG                              
021059,000158: 42,3722           02201                           STORE    PITCHANG                              
021060,000159: 42,3723           47375        NOADJUST           VLOAD    VXV                                   
021061,000160: 42,3724           00001                                    UR                                    #  Z = (UR X URP)
021062,000161: 42,3725           00007                                    URP                                   
021063,000162: 42,3726           77772                           VSL1                                           
021064,000163: 42,3727           16205                           STODL    RLM                                   #  Z VEC B-1
021065,000164: 42,3730           02201                                    PITCHANG                              
021066,000165: 42,3731           74356                           SIN      VXSC                                  
021067,000166: 42,3732           06514                                    HIUNITZ                               
021068,000167: 42,3733           71525                           PDDL     COS                                   
021069,000168: 42,3734           02201                                    PITCHANG                              
021070,000169: 42,3735           52361                           VXSC     VSU                                   
021071,000170: 42,3736           06520                                    HIUNITX                               #  (UX COS ALPHA) - (UZ SIN ALPHA)
021072,000171: 42,3737           63241                           DOT      PDVL                                  #  YAW.Z
021073,000172: 42,3740           02205                                    RLM                                   
021074,000173: 42,3741           02205                                    RLM                                   
021075,000174: 42,3742           75246                           ABVAL    SIGN                                  
021076,000175: 42,3743           77736                           ASIN                                           
021077,000176: 42,3744           02203                           STORE    YAWANG                                
021078,000177: 42,3745           77776        SBANDEX            EXIT                                           
021079,000178: 42,3746           31044                           CA       EXTVBACT                              
021080,000179: 42,3747           74747                           MASK     BIT5                                  #  IS BIT5 STILL ON
021081,000180: 42,3750           00006                           EXTEND                                         
021082,000181: 42,3751           15472                           BZF      ENDEXT                                #  NO
021083,000182: 42,3752           35017                           CAF      PRIO5                                 

Page 489

021085,000184: 42,3753           05146                           TC       PRIOCHNG                              
021086,000185: 42,3754           33767                           CAF      V06N51                                #  DISPLAY ANGLES
021087,000186: 42,3755           04616                           TC       BANKCALL                              
021088,000187: 42,3756           20353                           CADR     GOMARKFR                              
021089,000188: 42,3757           05563                           TC       B5OFF                                 #  TERMINATE
021090,000189: 42,3760           05563                           TC       B5OFF                                 #  PROCEED
021091,000190: 42,3761           05155                           TC       ENDOFJOB                              #  RECYCLE
021092,000191: 42,3762           34751                           CAF      BIT3                                  #  IMMEDIATE RETURN
021093,000192: 42,3763           05464                           TC       BLANKET                               #  BLANK R3
021094,000193: 42,3764           34740                           CAF      PRIO4                                 
021095,000194: 42,3765           05146                           TC       PRIOCHNG                              
021096,000195: 42,3766           03610                           TC       SBANDANT   +2                         #  YES, CONTINUE DISPLAYING ANGLES
021097,000196: 42,3767           01463        V06N51             VN       0651                                  
021098,000197: 42,3770           26501 07463  1OVSQRT2           2DEC     .7071067815                            #  1/SQRT(2)
021099,000198: 
021100,000199: 42,3772                        UR                 EQUALS   0D                                    
021101,000200: 42,3772                        URP                EQUALS   6D                                    
021102,000201: 42,3772  30,2000                                  SBANK=   LOWSUPER                              
021103,000202: 

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