Source Code

These source-code files were transcribed from a printout in Don Eyles's personal collection, scanned by archive.org, and financially sponsored by Linden Sims. A team of volunteers performed the transcription and proof-reading. The scanned page images are available at the Virtual AGC Project website, as well as higher-quality (but much larger) images at the Virtual AGC Project's collection in the Internet Archive. Report any problems by creating "issues" at the Virtual AGC Project's GitHub Repository.

Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 56 OF AGC PROGRAM ZERLINA BY ZOROASTER
	9:12 OCT. 21,1970
Note that the date is the date of the printout, not the date of the program revision.

014540,000002:                                                                                                  ## Copyright:   Public domain.
014541,000003:                                                                                                  ## Filename:    LEM_GEOMETRY.agc
014542,000004:                                                                                                  ## Purpose:     A log section of Zerlina 56, the final revision of
014543,000005:                                                                                                  ##              Don Eyles's offline development program for the variable 
014544,000006:                                                                                                  ##              guidance period servicer. It also includes a new P66 with LPD 
014545,000007:                                                                                                  ##              (Landing Point Designator) capability, based on an idea of John 
014546,000008:                                                                                                  ##              Young's. Neither of these advanced features were actually flown,
014547,000009:                                                                                                  ##              but Zerlina was also the birthplace of other big improvements to
014548,000010:                                                                                                  ##              Luminary including the terrain model and new (Luminary 1E)
014549,000011:                                                                                                  ##              analog display programs. Zerlina was branched off of Luminary 145,
014550,000012:                                                                                                  ##              and revision 56 includes all changes up to and including Luminary
014551,000013:                                                                                                  ##              183. It is therefore quite close to the Apollo 14 program,
014552,000014:                                                                                                  ##              Luminary 178, where not modified with new features.
014553,000015:                                                                                                  ## Reference:   pp. 325-330
014554,000016:                                                                                                  ## Assembler:   yaYUL
014555,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
014556,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
014557,000019:                                                                                                  ## Mod history: 2017-07-28 MAS  Created from Luminary 210.
014558,000020:                                                                                                  ##              2017-08-21 RSB  Transcribed.
014559,000021: 

Page 332

014561,000023: 23,2041                                           BANK     23                                    
014562,000024: 13,2000                                           SETLOC   LEMGEOM                               
014563,000025: 13,2000                                           BANK                                           
014564,000026: 
014565,000027: 13,2070  30,2000                                  SBANK=   LOWSUPER                              
014566,000028: 13,2070  E5,1642                                  EBANK=   XSM                                   
014567,000029: 
014568,000030:                                                                                                  #  THESE TWO ROUTINES COMPUTE THE ACTUAL STATE VECTOR FOR LM,CSM BY ADDING
014569,000031:                                                                                                  #  THE CONIC R,V AND THE DEVIATIONSR,V. THE STATE VECTORS ARE CONVERTED TO
014570,000032:                                                                                                  #  METERS B-29 AND METERS/CSEC B-7 AND STORED APPROPRIATELY IN RN,VN OR
014571,000033:                                                                                                  #  R-OTHER , V-OTHER FOR DOWNLINK. THE ROUTINES NAMES ARE SWITCHED IN THE
014572,000034:                                                                                                  #  OTHER VEHICLES COMPUTER.
014573,000035: 
014574,000036:                                                                                                  #  INPUT
014575,000037:                                                                                                  #    STATE VECTOR IN TEMPORARY STORAGE AREA
014576,000038:                                                                                                  #    IF STATE VECTOR IS SCALED POS B27 AND VEL B5
014577,000039:                                                                                                  #       SET X2 TO +2
014578,000040:                                                                                                  #    IF STATE VECTOR IS SCALED POS B29 AND VEL B7
014579,000041:                                                                                                  #       SET X2 TO 0
014580,000042: 
014581,000043:                                                                                                  #  OUTPUT
014582,000044:                                                                                                  #    R(T) IN RN, V(T) IN VN, T IN PIPTIME
014583,000045:                                                                                                  #  OR
014584,000046:                                                                                                  #    R(T) IN R-OTHER, V(T) IN V-OTHER   (T IS DEFINED BY T-OTHER)
014585,000047: 
014586,000048: 13,2070                                           COUNT*   $$/GEOM                               
014587,000049: 13,2070           43414        SVDWN2             BOF      RVQ                                   #  SW=1=AVETOMID DOING W-MATRIX INTEG.
014588,000050: 13,2071           04756                                    AVEMIDSW                              
014589,000051: 13,2072           26073                                    +1                                    
014590,000052: 13,2073           53775                           VLOAD    VSL*                                  
014591,000053: 13,2074           01521                                    TDELTAV                               
014592,000054: 13,2075           57605                                    0          -7,2                       
014593,000055: 13,2076           53655                           VAD      VSL*                                  
014594,000056: 13,2077           01535                                    RCV                                   
014595,000057: 13,2100           57576                                    0,2                                   
014596,000058: 13,2101           25220                           STOVL    RN                                    
014597,000059: 13,2102           01527                                    TNUV                                  
014598,000060: 13,2103           53257                           VSL*     VAD                                   
014599,000061: 13,2104           57602                                    0          -4,2                       
014600,000062: 13,2105           01543                                    VCV                                   
014601,000063: 13,2106           77657                           VSL*                                           
014602,000064: 13,2107           57576                                    0,2                                   
014603,000065: 13,2110           15226                           STODL    VN                                    
014604,000066: 13,2111           01517                                    TET                                   
014605,000067: 13,2112           01234                           STORE    PIPTIME                               
014606,000068: 13,2113           77616                           RVQ                                            
014607,000069: 

Page 326

014609,000071: 13,2114           53775        SVDWN1             VLOAD    VSL*                                  
014610,000072: 13,2115           01521                                    TDELTAV                               
014611,000073: 13,2116           57605                                    0          -7,2                       
014612,000074: 13,2117           53655                           VAD      VSL*                                  
014613,000075: 13,2120           01535                                    RCV                                   
014614,000076: 13,2121           57576                                    0,2                                   
014615,000077: 13,2122           25716                           STOVL    R-OTHER                               
014616,000078: 13,2123           01527                                    TNUV                                  
014617,000079: 13,2124           53257                           VSL*     VAD                                   
014618,000080: 13,2125           57602                                    0          -4,2                       
014619,000081: 13,2126           01543                                    VCV                                   
014620,000082: 13,2127           77657                           VSL*                                           
014621,000083: 13,2130           57576                                    0,2                                   
014622,000084: 13,2131           01724                           STORE    V-OTHER                               
014623,000085: 13,2132           77616                           RVQ                                            
014624,000086: 

Page 327

014626,000088:                                                                                                  #           THE FOLLOWING ROUTINE TAKES A HALF UNIT TARGET VECTOR REFERRED TO NAV BASE COORDINATES AND FINDS BOTH
014627,000089:                                                                                                  #  GIMBAL ORIENTATIONS AT WHICH THE RR MIGHT SIGHT THE TARGET. THE GIMBAL ANGLES CORRESPONDING TO THE PRESENT MODE
014628,000090:                                                                                                  #  ARE LEFT IN MODEA AND THOSE WHICH WOULD BE USED AFTER A REMODE IN MODEB. THIS ROUTINE ASSUMES MODE 1 IS TRUNNION
014629,000091:                                                                                                  #  ANGLE LESS THAN 90 DEGS IN ABS VALUE WITH ARBITRARY SHAFT, WITH A CORRESPONDING DEFINITION FOR MODE 2. MODE
014630,000092:                                                                                                  #  SELECTION AND LIMIT CHECKING ARE DONE ELSEWHERE.
014631,000093: 
014632,000094:                                                                                                  #           THE MODE 1 CONFIGURATION IS CALCULATED FROM THE VECTOR AND THEN MODE 2 IS FOUND USING THE RELATIONS
014633,000095: 
014634,000096:                                                                                                  #           S(2) = 180 + S(1)
014635,000097:                                                                                                  #           T(2) = 180 - T(1)
014636,000098: 
014637,000099:                                                                                                  #      THE VECTOR ARRIVES IN MPAC WHERE TRG*SMNG OR *SMNB* WILL HAVE LEFT IT.
014638,000100: 
014639,000101: 13,2133           00041        RRANGLES           STORE    32D                                   
014640,000102: 13,2134           57545                           DLOAD    DCOMP                                 #  SINCE WE WILL FIND THE MODE 1 SHAFT
014641,000103: 13,2135           00043                                    34D                                   #  ANGLE LATER, WE CAN FIND THE MODE 1
014642,000104: 13,2136           67401                           SETPD    ASIN                                  #  TRUNNION BY SIMPLY TAKING THE ARCSIN OF
014643,000105: 13,2137           00001                                    0                                     #  THE Y COMPONENT, THE ASIN GIVING AN
014644,000106: 13,2140           44206                           PUSH     BDSU                                  #  ANSWER WHOSE ABS VAL IS LESS THAN 90 DEG
014645,000107: 13,2141           24005                                    LODPHALF                              
014646,000108: 13,2142           14005                           STODL    4                                     #  MODE 2 TRUNNION TO 4.
014647,000109: 
014648,000110: 13,2143           24007                                    LO6ZEROS                              
014649,000111: 13,2144           24043                           STOVL    34D                                   #  UNIT THE PROJECTION OF THE VECTOR
014650,000112: 13,2145           00041                                    32D                                   #    IN THE X-Z PLANE
014651,000113: 13,2146           41056                           UNIT     BOVB                                  #  IF OVERFLOW,TARGET VECTOR IS ALONG Y
014652,000114: 13,2147           52412                                    LUNDESCH                              #  CALL FOR MANEUVER UNLESS ON LUNAR SURF
014653,000115: 13,2150           14041                           STODL    32D                                   #  PROJECTION VECTOR.
014654,000116: 13,2151           00041                                    32D                                   
014655,000117: 13,2152           44142                           SR1      STQ                                   
014656,000118: 13,2153           00051                                    S2                                    
014657,000119: 13,2154           14023                           STODL    SINTH                                 #  USE ARCTRIG SINCE SHAFT COULD BE ARB.
014658,000120: 13,2155           00045                                    36D                                   
014659,000121: 13,2156           77742                           SR1                                            
014660,000122: 13,2157           34021                           STCALL   COSTH                                 
014661,000123: 13,2160           47316                                    ARCTRIG                               
014662,000124: 

Page 328

014664,000126: 13,2161           43206                           PUSH     DAD                                   #  MODE 1 SHAFT TO 2.
014665,000127: 13,2162           24005                                    LODPHALF                              
014666,000128: 13,2163           24007                           STOVL    6                                     
014667,000129: 13,2164           00005                                    4                                     
014668,000130: 13,2165           77634                           RTB                                            #  FIND MODE 2 CDU ANGLES.
014669,000131: 13,2166           21617                                    2V1STO2S                              
014670,000132: 13,2167           25111                           STOVL    MODEB                                 
014671,000133: 13,2170           00001                                    0                                     
014672,000134: 13,2171           77634                           RTB                                            #  MODE 1 ANGLES TO MODE A.
014673,000135: 13,2172           21617                                    2V1STO2S                              
014674,000136: 13,2173           01107                           STORE    MODEA                                 
014675,000137: 13,2174           77776                           EXIT                                           
014676,000138: 
014677,000139: 13,2175           40110                           CS       RADMODES                              #  SWAP MODEA AND MODEB IF RR IN MODE 2.
014678,000140: 13,2176           74740                           MASK     ANTENBIT                              
014679,000141: 13,2177           10000                           CCS      A                                     
014680,000142: 13,2200           12204                           TCF      +4                                    
014681,000143: 
014682,000144: 13,2201           53107                           DXCH     MODEA                                 
014683,000145: 13,2202           53111                           DXCH     MODEB                                 
014684,000146: 13,2203           53107                           DXCH     MODEA                                 
014685,000147: 
014686,000148: 13,2204           06051                           TC       INTPRET                               
014687,000149: 13,2205           77650                           GOTO                                           
014688,000150: 13,2206           00051                                    S2                                    
014689,000151: 

Page 329

014691,000153:                                                                                                  #  GIVEN RR TRUNNION AND SHAFT (T,S) IN TANGNB,+1,FIND THE ASSOCIATED
014692,000154:                                                                                                  #  LINE OF SIGHT IN NAV BASE AXES.  THE HALF UNIT VECTOR, .5(SIN(S)COS(T),
014693,000155:                                                                                                  #  -SIN(T),COS(S)COS(T)) IS LEFT IN MPAC AND 32D.
014694,000156: 
014695,000157: 23,2000                                           SETLOC   INFLIGHT                              
014696,000158: 23,2000                                           BANK                                           
014697,000159: 
014698,000160: 23,2041                                           COUNT*   $$/GEOM                               
014699,000161: 
014700,000162: 23,2041           47135        RRNB               SLOAD    RTB                                   
014701,000163: 23,2042           03753                                    TANGNB                                
014702,000164: 23,2043           21560                                    CDULOGIC                              
014703,000165: 23,2044           41401                           SETPD    PUSH                                  #  TRUNNION ANGLE TO 0
014704,000166: 23,2045           00001                                    0                                     
014705,000167: 23,2046           57556                           SIN      DCOMP                                 
014706,000168: 23,2047           14043                           STODL    34D                                   #  Y COMPONENT
014707,000169: 
014708,000170: 23,2050           41546                           COS      PUSH                                  #  .5 COS(T) TO 0
014709,000171: 23,2051           47135                           SLOAD    RTB                                   
014710,000172: 23,2052           03754                                    TANGNB     +1                         
014711,000173: 23,2053           21560                                    CDULOGIC                              
014712,000174: 23,2054           71406        RRNB1              PUSH     COS                                   #  SHAFT ANGLE TO 2
014713,000175: 23,2055           72405                           DMP      SL1                                   
014714,000176: 23,2056           00001                                    0                                     
014715,000177: 23,2057           14045                           STODL    36D                                   #  Z COMPONENT
014716,000178: 
014717,000179: 23,2060           41356                           SIN      DMP                                   
014718,000180: 23,2061           77752                           SL1                                            
014719,000181: 23,2062           24041                           STOVL    32D                                   
014720,000182: 23,2063           00041                                    32D                                   
014721,000183: 23,2064           77616                           RVQ                                            
014722,000184: 
014723,000185:                                                                                                  #  THIS ENTRY TO RRNB REQUIRES THE TRUNNION AND SHAFT ANGLES IN MPAC AND MPAC +1 RESPECTIVELY
014724,000186: 
014725,000187: 23,2065           14025        RRNBMPAC           STODL    20D                                   #  SAVE SHAFT CDU IN 21.
014726,000188: 23,2066           00155                                    MPAC                                  #  SET MODE TO DP.  (THE PRECEEDING STORE
014727,000189:                                                                                                  #  MAY BE DP, TP OR VECTOR.)
014728,000190: 23,2067           40234                           RTB      SETPD                                 
014729,000191: 23,2070           21560                                    CDULOGIC                              
014730,000192: 23,2071           00001                                    0                                     
014731,000193: 23,2072           73406                           PUSH     SIN                                   #  TRUNNION ANGLE TO 0
014732,000194: 23,2073           77676                           DCOMP                                          
014733,000195: 23,2074           14043                           STODL    34D                                   #  Y COMPONENT
014734,000196: 23,2075           41546                           COS      PUSH                                  #  .5COS(T) TO 0
014735,000197: 23,2076           47135                           SLOAD    RTB                                   #  PICK UP CDU'S.
014736,000198: 23,2077           00026                                    21D                                   
014737,000199: 23,2100           21560                                    CDULOGIC                              
014738,000200: 23,2101           77650                           GOTO                                           
014739,000201: 23,2102           46054                                    RRNB1                                 

Page 330 Note: This page is empty in the printout of the assembly listing.


End of include-file LEM_GEOMETRY.agc.  Parent file is MAIN.agc