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.

054209,000002:                                                                                                  ## Copyright:   Public domain.
054210,000003:                                                                                                  ## Filename:    INFLIGHT_ALIGNMENT_ROUTINES.agc
054211,000004:                                                                                                  ## Purpose:     A log section of Zerlina 56, the final revision of
054212,000005:                                                                                                  ##              Don Eyles's offline development program for the variable 
054213,000006:                                                                                                  ##              guidance period servicer. It also includes a new P66 with LPD 
054214,000007:                                                                                                  ##              (Landing Point Designator) capability, based on an idea of John 
054215,000008:                                                                                                  ##              Young's. Neither of these advanced features were actually flown,
054216,000009:                                                                                                  ##              but Zerlina was also the birthplace of other big improvements to
054217,000010:                                                                                                  ##              Luminary including the terrain model and new (Luminary 1E)
054218,000011:                                                                                                  ##              analog display programs. Zerlina was branched off of Luminary 145,
054219,000012:                                                                                                  ##              and revision 56 includes all changes up to and including Luminary
054220,000013:                                                                                                  ##              183. It is therefore quite close to the Apollo 14 program,
054221,000014:                                                                                                  ##              Luminary 178, where not modified with new features.
054222,000015:                                                                                                  ## Reference:   pp. 1238-1247
054223,000016:                                                                                                  ## Assembler:   yaYUL
054224,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
054225,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
054226,000019:                                                                                                  ## Mod history: 2017-07-28 MAS  Created from Luminary 210.
054227,000020:                                                                                                  ##              2017-08-29 RSB  Transcribed.
054228,000021: 

Page 1238

054230,000023: 22,3745                                           BANK     22                                    
054231,000024: 23,2000                                           SETLOC   INFLIGHT                              
054232,000025: 23,2000                                           BANK                                           
054233,000026: 
054234,000027: 23,3245  E5,1642                                  EBANK=   XSM                                   
054235,000028: 
054236,000029:                                                                                                  #  CALCGTA COMPUTES THE GYRO TORQUE ANGLES REQUIRED TO BRING THE STABLE MEMBER INTO THE DESIRED ORIENTATION.
054237,000030: 
054238,000031:                                                                                                  #  THE INPUT IS THE DESIRED STABLE MEMBER COORDINATES REFERRED TO PRESENT STABLE MEMBER COORDINATES. THE THREE
054239,000032:                                                                                                  #  HALF-UNIT VECTORS ARE STORED AT XDC, YDC, AND ZDC.
054240,000033: 
054241,000034:                                                                                                  #  THE OUTPUTS ARE THE THREE GYRO TORQUING ANGLES TO BE APPLIED TO THE Y, Z, AND X GYROS AND ARE STORED DP AT IGC,
054242,000035:                                                                                                  #  MGC, AND OGC RESPECTIVELY.
054243,000036: 
054244,000037: 23,3245                                           COUNT*   $$/INFLT                              
054245,000038: 23,3245           71220        CALCGTA            ITA      DLOAD                                 #  PUSHDOWN  00-03,16D-27D,34D-37D
054246,000039: 23,3246           00051                                    S2                                    #  XDC = (XD1 XD2 XD3)
054247,000040: 23,3247           02665                                    XDC                                   #  YDC = (YD1 YD2 YD3)
054248,000041: 23,3250           65325                           PDDL     PDDL                                  #  ZDC = (ZD1 ZD2 ZD3)
054249,000042: 23,3251           06520                                    HI6ZEROS                              
054250,000043: 23,3252           02671                                    XDC        +4                         
054251,000044: 23,3253           55476                           DCOMP    VDEF                                  
054252,000045: 23,3254           77656                           UNIT                                           
054253,000046: 23,3255           14027                           STODL    ZPRIME                                #  ZP = UNIT(-XD3 0 XD1) = (ZP1 ZP2 ZP3)
054254,000047: 23,3256           00027                                    ZPRIME                                
054255,000048: 
054256,000049: 23,3257           77742                           SR1                                            
054257,000050: 23,3260           14023                           STODL    SINTH                                 #  SIN(IGC) = ZP1
054258,000051: 23,3261           00033                                    ZPRIME     +4                         
054259,000052: 23,3262           77742                           SR1                                            
054260,000053: 23,3263           34021                           STCALL   COSTH                                 #  COS(IGC) = ZP3
054261,000054: 23,3264           47316                                    ARCTRIG                               
054262,000055: 
054263,000056: 23,3265           16742                           STODL    IGC                                   #  Y GYRO TORQUING ANGLE   FRACTION OF REV.
054264,000057: 23,3266           02667                                    XDC        +2                         
054265,000058: 23,3267           77742                           SR1                                            
054266,000059: 23,3270           14023                           STODL    SINTH                                 #  SIN(MGC) = XD2
054267,000060: 23,3271           00027                                    ZPRIME                                
054268,000061: 
054269,000062: 23,3272           65205                           DMP      PDDL                                  
054270,000063: 23,3273           02671                                    XDC        +4                         #  PD00 = (ZP1)(XD3)
054271,000064: 23,3274           00033                                    ZPRIME     +4                         
054272,000065: 
054273,000066: 23,3275           45205                           DMP      DSU                                   
054274,000067: 23,3276           02665                                    XDC                                   #  MPAC = (ZP3)(XD1)
054275,000068: 23,3277           77626                           STADR                                          
054276,000069: 23,3300           43756                           STCALL   COSTH                                 #  COS(MGC) = MPAC - PD00
054277,000070: 23,3301           47316                                    ARCTRIG                               

Page 1239

054279,000072: 23,3302           26744                           STOVL    MGC                                   #  Z GYRO TORQUING ANGLE   FRACTION OF REV.
054280,000073: 23,3303           00027                                    ZPRIME                                
054281,000074: 23,3304           77641                           DOT                                            
054282,000075: 23,3305           02701                                    ZDC                                   
054283,000076: 23,3306           24021                           STOVL    COSTH                                 #  COS(OGC) = ZP . ZDC
054284,000077: 23,3307           00027                                    ZPRIME                                
054285,000078: 23,3310           77641                           DOT                                            
054286,000079: 23,3311           02673                                    YDC                                   
054287,000080: 23,3312           34023                           STCALL   SINTH                                 #  SIN(OGC) = ZP . YDC
054288,000081: 23,3313           47316                                    ARCTRIG                               
054289,000082: 
054290,000083: 23,3314           36740                           STCALL   OGC                                   #  X GYRO TORQUING ANGLE   FRACTION OF REV.
054291,000084: 23,3315           00051                                    S2                                    
054292,000085: 

Page 1240

054294,000087:                                                                                                  #  ARCTRIG COMPUTES AN ANGLE GIVEN THE SINE AND COSINE OF THIS ANGLE.
054295,000088: 
054296,000089:                                                                                                  #  THE INPUTS ARE SIN/4 AND COS/4 STORED DP AT SINTH AND COSTH.
054297,000090: 
054298,000091:                                                                                                  #  THE OUTPUT IS THE CALCULATED ANGLE BETWEEN +.5 AND -.5 REVOLUTIONS AND STORED AT THETA.  THE OUTPUT IS ALSO
054299,000092:                                                                                                  #  AVAILABLE AT MPAC.
054300,000093: 
054301,000094: 23,3316           51545        ARCTRIG            DLOAD    ABS                                   #  PUSHDOWN  16D-21D
054302,000095: 23,3317           00023                                    SINTH                                 
054303,000096: 23,3320           50025                           DSU      BMN                                   
054304,000097: 23,3321           07532                                    QTSN45                                #  ABS(SIN/4) - SIN(45)/4
054305,000098: 23,3322           47331                                    TRIG1                                 #  IF (-45,45) OR (135,-135)
054306,000099: 
054307,000100: 23,3323           72545                           DLOAD    SL1                                   #  (45,135) OR (-135,-45)
054308,000101: 23,3324           00021                                    COSTH                                 
054309,000102: 23,3325           75326                           ACOS     SIGN                                  
054310,000103: 23,3326           00023                                    SINTH                                 
054311,000104: 23,3327           00025                           STORE    THETA                                 #  X = ARCCOS(COS) WITH SIGN(SIN)
054312,000105: 23,3330           77616                           RVQ                                            
054313,000106: 
054314,000107: 23,3331           72545        TRIG1              DLOAD    SL1                                   #  (-45,45) OR (135,-135)
054315,000108: 23,3332           00023                                    SINTH                                 
054316,000109: 23,3333           77736                           ASIN                                           
054317,000110: 23,3334           14025                           STODL    THETA                                 #  X = ARCSIN(SIN) WITH SIGN(SIN)
054318,000111: 23,3335           00021                                    COSTH                                 
054319,000112: 23,3336           77640                           BMN                                            
054320,000113: 23,3337           47342                                    TRIG2                                 #  IF (135,-135)
054321,000114: 
054322,000115: 23,3340           43545                           DLOAD    RVQ                                   
054323,000116: 23,3341           00025                                    THETA                                 #  X = ARCSIN(SIN)   (-45,45)
054324,000117: 
054325,000118: 23,3342           75345        TRIG2              DLOAD    SIGN                                  #  (135,-135)
054326,000119: 23,3343           06516                                    HIDPHALF                              
054327,000120: 23,3344           00023                                    SINTH                                 
054328,000121: 23,3345           77625                           DSU                                            
054329,000122: 23,3346           00025                                    THETA                                 
054330,000123: 23,3347           00025                           STORE    THETA                                 #  X = .5 WITH SIGN(SIN) - ARCSIN(SIN)
054331,000124: 23,3350           77616                           RVQ                                            #                   (+) - (+) OR (-) - (-)
054332,000125: 

Page 1241

054334,000127:                                                                                                  #      SMNB, NBSM, AND AXISROT, WHICH USED TO APPEAR HERE, HAVE BEEN
054335,000128:                                                                                                  #  COMBINED IN A ROUTINE CALLED AX*SR*T, WHICH APPEARS AMONG THE POWERED
054336,000129:                                                                                                  #  FLIGHT SUBROUTINES.
054337,000130: 

Page 1242

054339,000132:                                                                                                  #  CALCGA COMPUTES THE CDU DRIVING ANGLES REQUIRED TO BRING THE STABLE MEMBER INTO THE DESIRED ORIENTATION.
054340,000133: 
054341,000134:                                                                                                  #  THE INPUTS ARE  1) THE NAVIGATION BASE COORDINATES REFERRED TO ANY COORDINATE SYSTEM. THE THREE HALF-UNIT
054342,000135:                                                                                                  #  VECTORS ARE STORED AT XNB,YNB, AND ZNB.  2) THE DESIRED STABLE MEMBER COORDINATES REFERRED TO THE SAME
054343,000136:                                                                                                  #  COORDINATE SYSTEM ARE STORED AT XSM, YSM, AND ZSM.
054344,000137: 
054345,000138:                                                                                                  #  THE OUTPUTS ARE THE THREE CDU DRIVING ANGLES AND ARE STORED SP AT THETAD, THETAD +1, AND THETAD +2.
054346,000139: 
054347,000140: 23,3351           77601        CALCGA             SETPD                                          #  PUSHDOWN  00-05, 16D-21D, 34D-37D
054348,000141: 23,3352           00001                                    0                                     
054349,000142: 23,3353           47375                           VLOAD    VXV                                   
054350,000143: 23,3354           02665                                    XNB                                   #  XNB = OGA (OUTER GIMBAL AXIS)
054351,000144: 23,3355           02651                                    YSM                                   #  YSM = IGA (INNER GIMBAL AXIS)
054352,000145: 23,3356           41456                           UNIT     PUSH                                  #  PD0 = UNIT(OGA X IGA) = MGA
054353,000146: 
054354,000147: 23,3357           44041                           DOT      ITA                                   
054355,000148: 23,3360           02701                                    ZNB                                   
054356,000149: 23,3361           00051                                    S2                                    
054357,000150: 23,3362           24021                           STOVL    COSTH                                 #  COS(OG) = MGA . ZNB
054358,000151: 23,3363           00001                                    0                                     
054359,000152: 23,3364           77641                           DOT                                            
054360,000153: 23,3365           02673                                    YNB                                   
054361,000154: 23,3366           34023                           STCALL   SINTH                                 #  SIN(OG) = MGA . YNB
054362,000155: 23,3367           47316                                    ARCTRIG                               
054363,000156: 23,3370           26740                           STOVL    OGC                                   
054364,000157: 23,3371           00001                                    0                                     
054365,000158: 
054366,000159: 23,3372           50235                           VXV      DOT                                   #  PROVISION FOR MG ANGLE OF 90 DEGREES
054367,000160: 23,3373           02665                                    XNB                                   
054368,000161: 23,3374           02651                                    YSM                                   
054369,000162: 23,3375           77752                           SL1                                            
054370,000163: 23,3376           24021                           STOVL    COSTH                                 #  COS(MG) = IGA . (MGA X OGA)
054371,000164: 23,3377           02651                                    YSM                                   
054372,000165: 23,3400           77641                           DOT                                            
054373,000166: 23,3401           02665                                    XNB                                   
054374,000167: 23,3402           34023                           STCALL   SINTH                                 #  SIN(MG) = IGA . OGA
054375,000168: 23,3403           47316                                    ARCTRIG                               
054376,000169: 23,3404           02744                           STORE    MGC                                   
054377,000170: 
054378,000171: 23,3405           45246                           ABS      DSU                                   
054379,000172: 23,3406           07534                                    .166...                               
054380,000173: 23,3407           77644                           BPL                                            
054381,000174: 23,3410           47427                                    GIMLOCK1                              #  IF ANGLE GREATER THAN 60 DEGREES
054382,000175: 
054383,000176: 23,3411           50375        CALCGA1            VLOAD    DOT                                   
054384,000177: 23,3412           02657                                    ZSM                                   
054385,000178: 23,3413           00001                                    0                                     
054386,000179: 23,3414           24021                           STOVL    COSTH                                 #  COS(IG) = ZSM . MGA
054387,000180: 23,3415           02643                                    XSM                                   

Page 1243

054389,000182: 23,3416           45441                           DOT      STADR                                 
054390,000183: 23,3417           43754                           STCALL   SINTH                                 #  SIN(IG) = XSM . MGA
054391,000184: 23,3420           47316                                    ARCTRIG                               
054392,000185: 
054393,000186: 23,3421           26742                           STOVL    IGC                                   
054394,000187: 23,3422           02740                                    OGC                                   
054395,000188: 23,3423           77634                           RTB                                            
054396,000189: 23,3424           21602                                    V1STO2S                               
054397,000190: 23,3425           34322                           STCALL   THETAD                                
054398,000191: 23,3426           00051                                    S2                                    
054399,000192: 
054400,000193: 23,3427           77776        GIMLOCK1           EXIT                                           
054401,000194: 23,3430           05600                           TC       ALARM                                 
054402,000195: 23,3431           00401                           OCT      00401                                 
054403,000196: 23,3432           05515                           TC       UPFLAG                                #  GIMBAL LOCK HAS OCCURED
054404,000197: 23,3433           00056                           ADRES    GLOKFAIL                              
054405,000198: 
054406,000199: 23,3434           06051                           TC       INTPRET                               
054407,000200: 23,3435           77650                           GOTO                                           
054408,000201: 23,3436           47411                                    CALCGA1                               
054409,000202: 

Page 1244

054411,000204:                                                                                                  #  AXISGEN COMPUTES THE COORDINATES OF ONE COORDINATE SYSTEM REFERRED TO ANOTHER COORDINATE SYSTEM.
054412,000205: 
054413,000206:                                                                                                  #  THE INPUTS ARE  1) THE STAR1 VECTOR REFERRED TO COORDINATE SYSTEM A STORED AT STARAD.  2) THE STAR2 VECTOR
054414,000207:                                                                                                  #  REFERRED TO COORDINATE SYSTEM A STORED AT STARAD +6.  3) THE STAR1 VECTOR REFERRED TO COORDINATE SYSTEM B STORED
054415,000208:                                                                                                  #  AT LOCATION 6 OF THE VAC AREA.  4) THE STAR2 VECTOR REFERRED TO COORDINATE SYSTEM B STORED AT LOCATION 12D OF
054416,000209:                                                                                                  #  THE VAC AREA.
054417,000210: 
054418,000211:                                                                                                  #  THE OUTPUT DEFINES COORDINATE SYSTEM A REFERRED TO COORDINATE SYSTEM B. THE THREE HALF-UNIT VECTORS ARE STORED
054419,000212:                                                                                                  #  AT LOCATIONS XDC, XDC +6, XDC +12D, AND STARAD, STARAD +6, STARAD +12D.
054420,000213: 
054421,000214: 23,3437           66370        AXISGEN            AXT,1    SSP                                   #  PUSHDOWN  00-30D,34D-37D
054422,000215: 23,3440           02714                                    STARAD     +6                         
054423,000216: 23,3441           00051                                    S1                                    
054424,000217: 23,3442           02700                                    STARAD     -6                         
054425,000218: 
054426,000219: 23,3443           77601                           SETPD                                          
054427,000220: 23,3444           00001                                    0                                     
054428,000221: 23,3445           46773        AXISGEN1           VLOAD*   VXV*                                  #  06D   UA = S1
054429,000222: 23,3446           02723                                    STARAD     +12D,1                     #         STARAD +00D   UB = S1
054430,000223: 23,3447           02731                                    STARAD     +18D,1                     
054431,000224: 23,3450           77656                           UNIT                                           #  12D   VA = UNIT(S1 X S2)
054432,000225: 23,3451           06731                           STORE    STARAD     +18D,1                     #         STARAD +06D   VB = UNIT(S1 X S2)
054433,000226: 23,3452           77773                           VLOAD*                                         
054434,000227: 23,3453           02723                                    STARAD     +12D,1                     
054435,000228: 
054436,000229: 23,3454           76433                           VXV*     VSL1                                  
054437,000230: 23,3455           02731                                    STARAD     +18D,1                     #  18D   WA = UA X VA
054438,000231: 23,3456           06737                           STORE    STARAD     +24D,1                     #         STARAD +12D   WB = UB X VB
054439,000232: 
054440,000233: 23,3457           77700                           TIX,1                                          
054441,000234: 23,3460           47445                                    AXISGEN1                              
054442,000235: 
054443,000236: 23,3461           66160                           AXC,1    SXA,1                                 
054444,000237: 23,3462           00006                                    6                                     
054445,000238: 23,3463           00036                                    30D                                   
054446,000239: 
054447,000240: 23,3464           66370                           AXT,1    SSP                                   
054448,000241: 23,3465           00022                                    18D                                   
054449,000242: 23,3466           00051                                    S1                                    
054450,000243: 23,3467           00006                                    6                                     
054451,000244: 
054452,000245: 23,3470           66374                           AXT,2    SSP                                   
054453,000246: 23,3471           00006                                    6                                     
054454,000247: 23,3472           00052                                    S2                                    
054455,000248: 23,3473           00002                                    2                                     
054456,000249: 
054457,000250: 23,3474           76720        AXISGEN2           XCHX,1   VLOAD*                                
054458,000251: 23,3475           00036                                    30D                                   #  X1=-6 X2=+6   X1=-6 X2=+4   X1=-6 X2=+2
054459,000252: 23,3476           00001                                    0,1                                   
054460,000253: 

Page 1245

054462,000255: 23,3477           62757                           VXSC*    PDVL*                                 #  J=(UA)(UB1)   J=(UA)(UB2)   J=(UA)(UB3)
054463,000256: 23,3500           75062                                    STARAD     +6,2                       
054464,000257: 23,3501           00007                                    6,1                                   
054465,000258: 23,3502           77757                           VXSC*                                          
054466,000259: 23,3503           75054                                    STARAD     +12D,2                     
054467,000260: 23,3504           30031                           STOVL*   24D                                   #  K=(VA)(VB1)   J=(VA)(VB2)   J=(VA)(VB3)
054468,000261: 23,3505           00015                                    12D,1                                 
054469,000262: 
054470,000263: 23,3506           53357                           VXSC*    VAD                                   
054471,000264: 23,3507           75046                                    STARAD     +18D,2                     #  L=(WA)(WB1)   J=(WA)(WB2)   J=(WA)(WB3)
054472,000265: 23,3510           76455                           VAD      VSL1                                  
054473,000266: 23,3511           00031                                    24D                                   
054474,000267: 23,3512           53520                           XCHX,1   UNIT                                  
054475,000268: 23,3513           00036                                    30D                                   
054476,000269: 23,3514           06707                           STORE    XDC        +18D,1                     #  XDC = L+J+K   YDC = L+J+K   ZDC = L+J+K
054477,000270: 
054478,000271: 23,3515           77700                           TIX,1                                          
054479,000272: 23,3516           47517                                    AXISGEN3                              
054480,000273: 
054481,000274: 23,3517           77704        AXISGEN3           TIX,2                                          
054482,000275: 23,3520           47474                                    AXISGEN2                              
054483,000276: 
054484,000277: 23,3521           77775                           VLOAD                                          
054485,000278: 23,3522           02665                                    XDC                                   
054486,000279: 23,3523           26707                           STOVL    STARAD                                
054487,000280: 23,3524           02673                                    YDC                                   
054488,000281: 23,3525           26715                           STOVL    STARAD     +6                         
054489,000282: 23,3526           02701                                    ZDC                                   
054490,000283: 23,3527           02723                           STORE    STARAD     +12D                       
054491,000284: 
054492,000285: 23,3530           77616                           RVQ                                            
054493,000286: 

Page 1246

054495,000288: 23,3531           05520 26075  QTSN45             2DEC     .1768                                 
054496,000289: 23,3533           05252 25253  .166...            2DEC     .1666666667                            
054497,000290: 

Page 1247 There is no source code on this page of the original assembly listing.


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