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.

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

Page 498

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

Page 499

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

Page 500

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

Page 501

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

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