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.

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

Page 1238

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

Page 1239

054292,000072: 23,3302           26744                           STOVL    MGC                                   #  Z GYRO TORQUING ANGLE   FRACTION OF REV.
054293,000073: 23,3303           00027                                    ZPRIME                                
054294,000074: 23,3304           77641                           DOT                                            
054295,000075: 23,3305           02701                                    ZDC                                   
054296,000076: 23,3306           24021                           STOVL    COSTH                                 #  COS(OGC) = ZP . ZDC
054297,000077: 23,3307           00027                                    ZPRIME                                
054298,000078: 23,3310           77641                           DOT                                            
054299,000079: 23,3311           02673                                    YDC                                   
054300,000080: 23,3312           34023                           STCALL   SINTH                                 #  SIN(OGC) = ZP . YDC
054301,000081: 23,3313           47316                                    ARCTRIG                               
054302,000082: 
054303,000083: 23,3314           36740                           STCALL   OGC                                   #  X GYRO TORQUING ANGLE   FRACTION OF REV.
054304,000084: 23,3315           00051                                    S2                                    
054305,000085: 

Page 1240

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

Page 1241

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

Page 1242

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

Page 1243

054402,000182: 23,3416           45441                           DOT      STADR                                 
054403,000183: 23,3417           43754                           STCALL   SINTH                                 #  SIN(IG) = XSM . MGA
054404,000184: 23,3420           47316                                    ARCTRIG                               
054405,000185: 
054406,000186: 23,3421           26742                           STOVL    IGC                                   
054407,000187: 23,3422           02740                                    OGC                                   
054408,000188: 23,3423           77634                           RTB                                            
054409,000189: 23,3424           21602                                    V1STO2S                               
054410,000190: 23,3425           34322                           STCALL   THETAD                                
054411,000191: 23,3426           00051                                    S2                                    
054412,000192: 
054413,000193: 23,3427           77776        GIMLOCK1           EXIT                                           
054414,000194: 23,3430           05600                           TC       ALARM                                 
054415,000195: 23,3431           00401                           OCT      00401                                 
054416,000196: 23,3432           05515                           TC       UPFLAG                                #  GIMBAL LOCK HAS OCCURED
054417,000197: 23,3433           00056                           ADRES    GLOKFAIL                              
054418,000198: 
054419,000199: 23,3434           06051                           TC       INTPRET                               
054420,000200: 23,3435           77650                           GOTO                                           
054421,000201: 23,3436           47411                                    CALCGA1                               
054422,000202: 

Page 1244

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

Page 1245

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

Page 1246

054508,000288: 23,3531           05520 26075  QTSN45             2DEC     .1768                                 
054509,000289: 23,3533           05252 25253  .166...            2DEC     .1666666667                            
054510,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