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
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

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

Page 486

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

Page 487

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

Page 488

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

Page 489

021068,000184: 42,3753           05146                           TC       PRIOCHNG                              
021069,000185: 42,3754           33767                           CAF      V06N51                                #  DISPLAY ANGLES
021070,000186: 42,3755           04616                           TC       BANKCALL                              
021071,000187: 42,3756           20353                           CADR     GOMARKFR                              
021072,000188: 42,3757           05563                           TC       B5OFF                                 #  TERMINATE
021073,000189: 42,3760           05563                           TC       B5OFF                                 #  PROCEED
021074,000190: 42,3761           05155                           TC       ENDOFJOB                              #  RECYCLE
021075,000191: 42,3762           34751                           CAF      BIT3                                  #  IMMEDIATE RETURN
021076,000192: 42,3763           05464                           TC       BLANKET                               #  BLANK R3
021077,000193: 42,3764           34740                           CAF      PRIO4                                 
021078,000194: 42,3765           05146                           TC       PRIOCHNG                              
021079,000195: 42,3766           03610                           TC       SBANDANT   +2                         #  YES, CONTINUE DISPLAYING ANGLES
021080,000196: 42,3767           01463        V06N51             VN       0651                                  
021081,000197: 42,3770           26501 07463  1OVSQRT2           2DEC     .7071067815                            #  1/SQRT(2)
021082,000198: 
021083,000199: 42,3772                        UR                 EQUALS   0D                                    
021084,000200: 42,3772                        URP                EQUALS   6D                                    
021085,000201: 42,3772  30,2000                                  SBANK=   LOWSUPER                              
021086,000202: 

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