Source Code

These source-code files were transcribed from scans made from Don Eyles's personal copy of Luminary 069. They were scanned at archive.org's Boston facility, and the scanning was sponsored by Onno Hommes. The code was transcribed from these scans by a team of volunteers who are referenced in the program comments. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". In some cases, where similar code blocks exist in previously-transcribed AGC programs (primarily Luminary 99, from Apollo 11) those code blocks were used as a starting point and then corrected to agree with the Luminary 69 scans. The full scans are available at the Virtual AGC project's collection at archive.org, while more-convenient reduced-size (but reduced-quality) images are available at the main Virtual AGC website. Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 069 OF AGC PROGRAM LUMINARY BY NASA 2021112-011
	19:02 NOV. 25,1968
Note that the date is the date of the printout, not the date of the program revision.

021965,000002:                                                                                                  ## Copyright:   Public domain.
021966,000003:                                                                                                  ## Filename:    S-BAND_ANTENNA_FOR_LM.agc
021967,000004:                                                                                                  ## Purpose:     The main source file for Luminary revision 069.
021968,000005:                                                                                                  ##              It is part of the source code for the original release
021969,000006:                                                                                                  ##              of the flight software for the Lunar Module's (LM) Apollo
021970,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 10. The actual flown
021971,000008:                                                                                                  ##              version was Luminary 69 revision 2, which included a
021972,000009:                                                                                                  ##              newer lunar gravity model and only affected module 2.
021973,000010:                                                                                                  ##              This file is intended to be a faithful transcription, except
021974,000011:                                                                                                  ##              that the code format has been changed to conform to the
021975,000012:                                                                                                  ##              requirements of the yaYUL assembler rather than the
021976,000013:                                                                                                  ##              original YUL assembler.
021977,000014:                                                                                                  ## Reference:   pp. 498-501
021978,000015:                                                                                                  ## Assembler:   yaYUL
021979,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
021980,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
021981,000018:                                                                                                  ## Mod history: 2016-12-13 MAS  Created from Luminary 99.
021982,000019:                                                                                                  ##              2016-12-14 MAS  Updated from comment-proofed Luminary 99 version.
021983,000020:                                                                                                  ##              2016-12-18 RRB  Updated for Luminary 69.
021984,000021:                                                                                                  ##              2016-12-27 HG   Comment last line *** END OF LEMONAID.070 ***
021985,000022:                                                                                                  ##              2017-01-27 RSB  Proofed comment text using octopus/prooferComments
021986,000023:                                                                                                  ##                              and fixed errors found.
021987,000024: 

Page 498

021989,000026:                                                                                                  #  SUBROUTINE NAME: R05 - S-BAND ANTENNA FOR LM
021990,000027: 
021991,000028:                                                                                                  #  MOD0 BY T. JAMES
021992,000029:                                                                                                  #  MOD1 BY P. SHAKIR
021993,000030: 
021994,000031:                                                                                                  #  FUNCTIONAL DESCRIPTION
021995,000032: 
021996,000033:                                                                                                  #        THE S-BAND ANTENNA ROUTINE, R05, COMPUTES AND DISPLAYS THE PITCH AND
021997,000034:                                                                                                  #  YAW ANTENNA GIMBAL ANGLES REQUIRED TO POINT THE LM STEERABLE ANTENNA
021998,000035:                                                                                                  #  TOWARD THE CENTER OF THE EARTH.  THIS ROUTINE IS SELECTED BY THE ASTRO-
021999,000036:                                                                                                  #  NAUT VIA DSKY ENTRY DURING COASTING FLIGHT OR WHEN THE LM IS ON THE MOON
022000,000037:                                                                                                  #  SURFACE.  THE EARTH OR MOON REFERENCE COORDINATE SYSTEM IS USED DEPENDING
022001,000038:                                                                                                  #  ON WHETHER THE LM IS ABOUT TO ENTER OR HAS ALREADY ENTERED THE MOON
022002,000039:                                                                                                  #  SPHERE OF INFLUENCE, RESPECTIVELY
022003,000040: 
022004,000041:                                                                                                  #  TO CALL SUBROUTINE, ASTRONAUT KEYS IN V 64 E
022005,000042: 
022006,000043:                                                                                                  #  SUBROUTINES CALLED-
022007,000044:                                                                                                  #        R02BOTH
022008,000045:                                                                                                  #        INTPRET
022009,000046:                                                                                                  #        LOADTIME
022010,000047:                                                                                                  #        LEMCONIC
022011,000048:                                                                                                  #        LUNPOS
022012,000049:                                                                                                  #        CDUTRIG
022013,000050:                                                                                                  #        *SMNB*
022014,000051:                                                                                                  #        BANKCALL
022015,000052:                                                                                                  #        B5OFF
022016,000053:                                                                                                  #        ENDOFJOB
022017,000054:                                                                                                  #        BLANKET
022018,000055: 
022019,000056:                                                                                                  #  RETURNS WITH
022020,000057:                                                                                                  #        PITCH ANGLE IN PITCHANG  REV. B0
022021,000058:                                                                                                  #        YAW ANGLE IN YAWANG  REV. B0
022022,000059: 
022023,000060:                                                                                                  #  ERASABLES USED
022024,000061:                                                                                                  #        PITCHANG
022025,000062:                                                                                                  #        YAWANG
022026,000063:                                                                                                  #        RLM
022027,000064:                                                                                                  #        VAC AREA
022028,000065: 
022029,000066: 41,3731                                           BANK     41                                    
022030,000067: 42,2000                                           SETLOC   SBAND                                 
022031,000068: 42,2000                                           BANK                                           
022032,000069: 
022033,000070: 42,3602  E7,1467                                  EBANK=   WHOCARES                              
022034,000071: 42,3602                                           COUNT*   $$/R05                                
022035,000072: 42,3602           04616        SBANDANT           TC       BANKCALL                              

Page 499

022037,000074: 42,3603           11175                           CADR     R02BOTH                               #  CHECK IF IMU IS ON AND ALIGNED
022038,000075: 42,3604           06036                           TC       INTPRET                               
022039,000076: 42,3605           47001                           SETPD    RTB                                   
022040,000077: 42,3606           00001                                    0D                                    
022041,000078: 42,3607           21462                                    LOADTIME                              #  PICK UP CURRENT TIME
022042,000079: 42,3610           34041                           STCALL   TDEC1                                 #  ADVANCE INTEGRATION TO TIME IN TDEC1
022043,000080: 42,3611           27100                                    LEMCONIC                              #  USING CONIC INTEGRATION
022044,000081: 42,3612           46135                           SLOAD    BHIZ                                  
022045,000082: 42,3613           00050                                    X2                                    #  X2 =0 EARTH SPHERE, X2 =2 MOON SPHERE
022046,000083: 42,3614           65632                                    CONV4                                 
022047,000084: 42,3615           77775                           VLOAD                                          
022048,000085: 42,3616           00001                                    RATT                                  
022049,000086: 42,3617           16211                           STODL    RLM                                   
022050,000087: 42,3620           00015                                    TAT                                   
022051,000088: 42,3621           77624        CONV3              CALL                                           
022052,000089: 42,3622           33663                                    LUNPOS                                #  UNIT POSITION VECTOR FROM EARTH TO MOON
022053,000090: 42,3623           74375                           VLOAD    VXSC                                  
022054,000091: 42,3624           02723                                    VMOON                                 
022055,000092: 42,3625           24001                                    REMDIST                               #  MEAN DISTANCE FROM EARTH TO MOON
022056,000093: 42,3626           53372                           VSL1     VAD                                   
022057,000094: 42,3627           02211                                    RLM                                   
022058,000095: 42,3630           77650                           GOTO                                           
022059,000096: 42,3631           65634                                    CONV5                                 
022060,000097: 42,3632           77775        CONV4              VLOAD                                          
022061,000098: 42,3633           00001                                    RATT                                  #  UE = -UNIT(RATT)  EARTH SPHERE
022062,000099: 42,3634           53401        CONV5              SETPD    UNIT                                  #  UE = -UNIT((REM)(UEM) + RL)  MOON SPHERE
022063,000100: 42,3635           00001                                    0D                                    #  SET PL POINTER TO 0
022064,000101: 42,3636           45076                           VCOMP    CALL                                  
022065,000102: 42,3637           47443                                    CDUTRIG                               #  COMPUTE SINES AND COSINES OF CDU ANGLES
022066,000103: 42,3640           76521                           MXV      VSL1                                  #  TRANSFORM REF. COORDINATE SYSTEM TO
022067,000104: 42,3641           01734                                    REFSMMAT                              #  STABLE MEMBER B-1 X B-1 X B+1 = B-1
022068,000105: 42,3642           71206                           PUSH     DLOAD                                 #  8D
022069,000106: 42,3643           06424                                    HI6ZEROS                              
022070,000107: 42,3644           02205                           STORE    PITCHANG                              
022071,000108: 42,3645           26207                           STOVL    YAWANG                                #  ZERO OUT ANGLES
022072,000109: 42,3646           77624                           CALL                                           
022073,000110: 42,3647           47575                                    *SMNB*                                
022074,000111: 42,3650           16211                           STODL    RLM                                   #  PRE-MULTIPLY RLM BY (NBSA) MATRIX(B0)
022075,000112: 42,3651           02213                                    RLM        +2                         
022076,000113: 42,3652           45206                           PUSH     DSU                                   
022077,000114: 42,3653           02211                                    RLM                                   
022078,000115: 42,3654           77605                           DMP                                            
022079,000116: 42,3655           25765                                    1OVSQRT2                              
022080,000117: 42,3656           16213                           STODL    RLM        +2                         
022081,000118: 42,3657           41215                           DAD      DMP                                   
022082,000119: 42,3660           02211                                    RLM                                   
022083,000120: 42,3661           25765                                    1OVSQRT2                              
022084,000121: 42,3662           26211                           STOVL    RLM                                   #  R B-1
022085,000122: 42,3663           02211                                    RLM                                   
022086,000123: 42,3664           63256                           UNIT     PDVL                                  

Page 500

022088,000125: 42,3665           02211                                    RLM                                   
022089,000126: 42,3666           72431                           VPROJ    VSL2                                  #  PROJECTION OF R ONTO LM XZ PLANE
022090,000127: 42,3667           06420                                    HIUNITY                               
022091,000128: 42,3670           40045                           BVSU     BOV                                   #  CLEAR OVERFLOW INDICATOR IF ON
022092,000129: 42,3671           02211                                    RLM                                   
022093,000130: 42,3672           65673                                    COVCNV                                
022094,000131: 42,3673           40056        COVCNV             UNIT     BOV                                   #  EXIT ON OVERFLOW
022095,000132: 42,3674           65741                                    SBANDEX                               
022096,000133: 42,3675           47206                           PUSH     VXV                                   #  URP VECTOR B-1
022097,000134: 42,3676           06416                                    HIUNITZ                               
022098,000135: 42,3677           57572                           VSL1     VCOMP                                 #  UZ X URP = -(URP X UZ)
022099,000136: 42,3700           02211                           STORE    RLM                                   #  X VEC B-1
022100,000137: 42,3701           63241                           DOT      PDVL                                  #  SGN(X.UY) UNSCALED
022101,000138: 42,3702           06420                                    HIUNITY                               
022102,000139: 42,3703           02211                                    RLM                                   
022103,000140: 42,3704           75246                           ABVAL    SIGN                                  
022104,000141: 42,3705           77736                           ASIN                                           #  ASIN((SGN(X.UY))ABV(X)) REV B0
022105,000142: 42,3706           26205                           STOVL    PITCHANG                              
022106,000143: 42,3707           00007                                    URP                                   
022107,000144: 42,3710           51041                           DOT      BPL                                   
022108,000145: 42,3711           06416                                    HIUNITZ                               
022109,000146: 42,3712           65717                                    NOADJUST                              #  YES, -90 TO +90
022110,000147: 42,3713           45345                           DLOAD    DSU                                   
022111,000148: 42,3714           06422                                    HIDPHALF                              
022112,000149: 42,3715           02205                                    PITCHANG                              
022113,000150: 42,3716           02205                           STORE    PITCHANG                              
022114,000151: 42,3717           47375        NOADJUST           VLOAD    VXV                                   
022115,000152: 42,3720           00001                                    UR                                    #  Z = (UR X URP)
022116,000153: 42,3721           00007                                    URP                                   
022117,000154: 42,3722           77772                           VSL1                                           
022118,000155: 42,3723           16211                           STODL    RLM                                   #  Z VEC B-1
022119,000156: 42,3724           02205                                    PITCHANG                              
022120,000157: 42,3725           74356                           SIN      VXSC                                  
022121,000158: 42,3726           06416                                    HIUNITZ                               
022122,000159: 42,3727           71525                           PDDL     COS                                   
022123,000160: 42,3730           02205                                    PITCHANG                              
022124,000161: 42,3731           52361                           VXSC     VSU                                   
022125,000162: 42,3732           06422                                    HIUNITX                               #  (UX COS ALPHA) - (UZ SIN ALPHA)
022126,000163: 42,3733           63241                           DOT      PDVL                                  #  YAW.Z
022127,000164: 42,3734           02211                                    RLM                                   
022128,000165: 42,3735           02211                                    RLM                                   
022129,000166: 42,3736           75246                           ABVAL    SIGN                                  
022130,000167: 42,3737           77736                           ASIN                                           
022131,000168: 42,3740           02207                           STORE    YAWANG                                
022132,000169: 42,3741           77776        SBANDEX            EXIT                                           
022133,000170: 42,3742           31044                           CA       EXTVBACT                              
022134,000171: 42,3743           74747                           MASK     BIT5                                  #  IS BIT5 STILL ON
022135,000172: 42,3744           00006                           EXTEND                                         
022136,000173: 42,3745           15472                           BZF      ENDEXT                                #  NO
022137,000174: 42,3746           35017                           CAF      PRIO5                                 

Page 501

022139,000176: 42,3747           05146                           TC       PRIOCHNG                              
022140,000177: 42,3750           33763                           CAF      V06N51                                #  DISPLAY ANGLES
022141,000178: 42,3751           04616                           TC       BANKCALL                              
022142,000179: 42,3752           20231                           CADR     GOMARKFR                              
022143,000180: 42,3753           05563                           TC       B5OFF                                 #  TERMINATE
022144,000181: 42,3754           05563                           TC       B5OFF                                 #  PROCEED
022145,000182: 42,3755           05155                           TC       ENDOFJOB                              #  RECYCLE
022146,000183: 42,3756           34751                           CAF      BIT3                                  #  IMMEDIATE RETURN
022147,000184: 42,3757           05464                           TC       BLANKET                               #  BLANK R3
022148,000185: 42,3760           34740                           CAF      PRIO4                                 
022149,000186: 42,3761           05146                           TC       PRIOCHNG                              
022150,000187: 42,3762           03604                           TC       SBANDANT   +2                         #  YES, CONTINUE DISPLAYING ANGLES
022151,000188: 42,3763           01463        V06N51             VN       0651                                  
022152,000189: 42,3764           26501 07463  1OVSQRT2           2DEC     .7071067815                            #  1/SQRT(2)
022153,000190: 
022154,000191: 42,3766                        UR                 EQUALS   0D                                    
022155,000192: 42,3766                        URP                EQUALS   6D                                    
022156,000193: 42,3766  30,2000                                  SBANK=   LOWSUPER                              

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