Source Code

This is a reconstructed version of Luminary 130, the initial AGC program released in November 1969 for the Apollo 13 LM. Three more releases followed before the flown revision was finally manufactured in February 1970.

This reconstruction was created from a previous transcription of the original listing of Luminary 131, combined with Luminary memo #129 which describes the small difference between the Luminary 130 and 131. The reconstructed source code was verified by matching memory-bank checksums to those listed for Luminary 130 in drawing 2021152G.

In this source code, program comments from the original (Luminary 131) code are prefixed with '#', while those added later by the Virtual AGC project are prefixed with '##'.

020901,000002:                                                                                                  ## Copyright:   Public domain.
020902,000003:                                                                                                  ## Filename:    S-BAND_ANTENNA_FOR_LM.agc
020903,000004:                                                                                                  ## Purpose:     A section of the reconstructed source code for Luminary 130.
020904,000005:                                                                                                  ##              This was the original program released for the Apollo 13 LM,
020905,000006:                                                                                                  ##              although several more revisions would follow. It has been
020906,000007:                                                                                                  ##              reconstructed from a listing of Luminary 131, from which it
020907,000008:                                                                                                  ##              differs on only two lines in P70-P71. The difference is
020908,000009:                                                                                                  ##              described in detail in Luminary memo #129, which was used
020909,000010:                                                                                                  ##              to perform the reconstruction. This file is intended to be a
020910,000011:                                                                                                  ##              faithful reconstruction, except that the code format has been
020911,000012:                                                                                                  ##              changed to conform to the requirements of the yaYUL assembler
020912,000013:                                                                                                  ##              rather than the original YUL assembler.
020913,000014:                                                                                                  ## Reference:   pp. 490-493
020914,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
020915,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
020916,000017:                                                                                                  ## Mod history: 05/14/03 RSB.   Began transcribing.
020917,000018:                                                                                                  ##              05/14/05 RSB    Corrected website references above.
020918,000019:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
020919,000020:                                                                                                  ##                              original harcopy, as opposed to the PDF page
020920,000021:                                                                                                  ##                              numbers in 1701.pdf.
020921,000022:                                                                                                  ##              2017-02-24 RSB  Proofed comment text using octopus/ProoferComments.
020922,000023:                                                                                                  ##              2018-09-04 MAS  Copied from Luminary 131 for Luminary 130.
020923,000024: 

Page 490

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

Page 491

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

Page 492

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

Page 493

021075,000176: 42,3753           04616                           TC       BANKCALL                              
021076,000177: 42,3754           20353                           CADR     GOMARKFR                              
021077,000178: 42,3755           05563                           TC       B5OFF                                 #  TERMINATE
021078,000179: 42,3756           05563                           TC       B5OFF                                 #  PROCEED
021079,000180: 42,3757           05155                           TC       ENDOFJOB                              #  RECYCLE
021080,000181: 42,3760           34751                           CAF      BIT3                                  #  IMMEDIATE RETURN
021081,000182: 42,3761           05464                           TC       BLANKET                               #  BLANK R3
021082,000183: 42,3762           34740                           CAF      PRIO4                                 
021083,000184: 42,3763           05146                           TC       PRIOCHNG                              
021084,000185: 42,3764           03606                           TC       SBANDANT                              #  YES, CONTINUE DISPLAYING ANGLES.
021085,000186: 42,3765           01463        V06N51             VN       0651                                  
021086,000187: 42,3766           26501 07463  1OVSQRT2           2DEC     .7071067815                            #  1/SQRT(2)
021087,000188: 
021088,000189: 42,3770                        UR                 EQUALS   0D                                    
021089,000190: 42,3770                        URP                EQUALS   6D                                    
021090,000191: 42,3770  30,2000                                  SBANK=   LOWSUPER                              
021091,000192: 

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