Source Code

This is the source-code for the Apollo 9 Command Module's Guidance Computer. These files were derived originally from the scan from MIT's Dibner Institute's now-discontinued website titled "History of Recent Science and Technology", which in turn was originally created by Gary Neff, though his high-quality scans were unfortunately reduced in legibility when presented online. The markings on the front of the printout imply that it was the original AGC developer Norm Brodeur's copy. A scan by Ron Burkey has superceded it, made from a more-legible copy from the collection of original AGC developer Fred Martin. The source code was transcribed from those images by Ron Burkey. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	ASSEMBLE REVISION 249 OF AGC PROGRAM COLOSSUS BY NASA 2021111-041
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

017211,000002:                                                                                                  ## Copyright:   Public domain.
017212,000003:                                                                                                  ## Filename:    ANGLFIND.agc
017213,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus, build 249.
017214,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
017215,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 9.
017216,000007:                                                                                                  ## Assembler:   yaYUL
017217,000008:                                                                                                  ## Reference:   pp. 392-404.
017218,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
017219,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
017220,000011:                                                                                                  ## Mod history: 08/10/04 RSB.   Began transcribing.
017221,000012:                                                                                                  ##              2017-01-02 RSB  Fixed a couple of comment errors, detected by
017222,000013:                                                                                                  ##                              comparison to Colossus 237 and Comanche 55.
017223,000014:                                                                                                  ##                              Lots more to come.
017224,000015:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
017225,000016:                                                                                                  ##                              original harcopy, as opposed to the PDF page
017226,000017:                                                                                                  ##                              numbers in 1701.pdf.
017227,000018:                                                                                                  ##              2017-01-07 RSB  Cross-diff'd comment text (not whitespace)
017228,000019:                                                                                                  ##                              vs the already-proofed corresponding Colossus
017229,000020:                                                                                                  ##                              237 and Comanche 55 source-code files
017230,000021:                                                                                                  ##                              and corrected all remaining errors found.
017231,000022:                                                                                                  ##              2021-05-30 ABS  CK* -> OK* for a number of symbols.
017232,000023:                                                                                                  ##                              ENDOCM -> ENDDCM
017233,000024:                                                                                                  ##                              ZEROERROR -> ZEROEROR
017234,000025:                                                                                                  ##
017235,000026:                                                                                                  ## The contents of the "Colossus249" files, in general, are transcribed 
017236,000027:                                                                                                  ## from a scanned copy of the program listing.  Notations on this
017237,000028:                                                                                                  ## document read, in part:
017238,000029:                                                                                                  ##
017239,000030:                                                                                                  ##      Assemble revision 249 of AGC program Colossus by NASA
017240,000031:                                                                                                  ##      2021111-041.  October 28, 1968.  
017241,000032:                                                                                                  ##
017242,000033:                                                                                                  ##      This AGC program shall also be referred to as
017243,000034:                                                                                                  ##                              Colossus 1A
017244,000035:                                                                                                  ##
017245,000036:                                                                                                  ##      Prepared by
017246,000037:                                                                                                  ##                      Massachusetts Institute of Technology
017247,000038:                                                                                                  ##                      75 Cambridge Parkway
017248,000039:                                                                                                  ##                      Cambridge, Massachusetts
017249,000040:                                                                                                  ##      under NASA contract NAS 9-4065.
017250,000041:                                                                                                  ##
017251,000042:                                                                                                  ## Refer directly to the online document mentioned above for further information.
017252,000043:                                                                                                  ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
017253,000044:                                                                                                  ##
017254,000045:                                                                                                  ## In some cases, where the source code for Luminary 131 overlaps that of 
017255,000046:                                                                                                  ## Colossus 249, this code is instead copied from the corresponding Luminary 131
017256,000047:                                                                                                  ## source file, and then is proofed to incorporate any changes.
017257,000048: 

Page 392

017259,000050: 15,2000                                           BANK     15                                    
017260,000051: 22,2000                                           SETLOC   KALCMON1                              
017261,000052: 22,2000                                           BANK                                           
017262,000053: 
017263,000054: 22,2000  E6,1661                                  EBANK=   BCDU                                  
017264,000055: 
017265,000056: 22,2000                                           COUNT    22/KALC                               
017266,000057: 
017267,000058: 22,2000           06006        KALCMAN3           TC       INTPRET                               
017268,000059: 22,2001           77634                           RTB                                            
017269,000060: 22,2002           44376                                    READCDUK                              #  PICK UP CURRENT CDU ANGLES
017270,000061: 22,2003           03262                           STORE    BCDU                                  #  STORE THE INITIAL S/C ANGLES
017271,000062: 22,2004           72364                           AXC,2    TLOAD                                 #  COMPUTE THE TRANSFORMATION FROM
017272,000063: 22,2005           03320                                    MIS                                   #  INITIAL S/C AXES TO STABLE MEMBER AXES
017273,000064: 22,2006           03262                                    BCDU                                  #  (MIS)
017274,000065: 22,2007           77624                           CALL                                           
017275,000066: 22,2010           44405                                    CDUTODCM                              
017276,000067: 22,2011           72364                           AXC,2    TLOAD                                 #  COMPUTE THE TRANSFORMATION FROM
017277,000068: 22,2012           03425                                    MFS                                   #  FINAL S/C AXES TO STABLE MEMBER AXES
017278,000069: 22,2013           01156                                    CPHI                                  #  (MFS)
017279,000070: 22,2014           77624                           CALL                                           
017280,000071: 22,2015           44405                                    CDUTODCM                              
017281,000072: 22,2016           45160        SECAD              AXC,1    CALL                                  #  MIS AND MFS ARRAYS CALCULATED         $2
017282,000073: 22,2017           03320                                    MIS                                   
017283,000074: 22,2020           44334                                    TRANSPOS                              
017284,000075: 22,2021           77775                           VLOAD                                          
017285,000076: 22,2022           77626                           STADR                                          
017286,000077: 22,2023           50474                           STOVL    TMIS       +12D                       
017287,000078: 22,2024           77626                           STADR                                          
017288,000079: 22,2025           50502                           STOVL    TMIS       +6                         
017289,000080: 22,2026           77626                           STADR                                          
017290,000081: 22,2027           74510                           STORE    TMIS                                  #  TMIS = TRANSPOSE(MIS) SCALED BY 2
017291,000082: 22,2030           75160                           AXC,1    AXC,2                                 
017292,000083: 22,2031           03266                                    TMIS                                  
017293,000084: 22,2032           03425                                    MFS                                   
017294,000085: 22,2033           77624                           CALL                                           
017295,000086: 22,2034           44304                                    MXM3                                  
017296,000087: 22,2035           45575                           VLOAD    STADR                                 
017297,000088: 22,2036           50335                           STOVL    MFI        +12D                       
017298,000089: 22,2037           77626                           STADR                                          
017299,000090: 22,2040           50343                           STOVL    MFI        +6                         
017300,000091: 22,2041           77626                           STADR                                          
017301,000092: 22,2042           74351                           STORE    MFI                                   #  MFI = TMIS MFS (SCALED BY 4)
017302,000093: 22,2043           45001                           SETPD    CALL                                  #  TRANSPOSE MFI IN PD LIST
017303,000094: 22,2044           00023                                    18D                                   
017304,000095: 22,2045           44343                                    TRNSPSPD                              
017305,000096: 22,2046           45575                           VLOAD    STADR                                 
017306,000097: 22,2047           50474                           STOVL    TMFI       +12D                       
017307,000098: 22,2050           77626                           STADR                                          
017308,000099: 22,2051           50502                           STOVL    TMFI       +6                         

Page 393

017310,000101: 22,2052           77626                           STADR                                          
017311,000102: 22,2053           74510                           STORE    TMFI                                  #  TMFI = TRANSPOSE (MFI) SCALED BY 4
017312,000103: 
017313,000104:                                                                                                  #  CALCULATE COFSKEW AND MFISYM
017314,000105: 
017315,000106: 22,2054           45345                           DLOAD    DSU                                   
017316,000107: 22,2055           03271                                    TMFI       +2                         
017317,000108: 22,2056           03430                                    MFI        +2                         
017318,000109: 22,2057           45325                           PDDL     DSU                                   #  CALCULATE COF SCALED BY 2/SIN(AM)
017319,000110: 22,2060           03432                                    MFI        +4                         
017320,000111: 22,2061           03273                                    TMFI       +4                         
017321,000112: 22,2062           45325                           PDDL     DSU                                   
017322,000113: 22,2063           03301                                    TMFI       +10D                       
017323,000114: 22,2064           03440                                    MFI        +10D                       
017324,000115: 22,2065           77666                           VDEF                                           
017325,000116: 22,2066           03311                           STORE    COFSKEW                               #  EQUALS MFISKEW
017326,000117: 
017327,000118:                                                                                                  #  CALCULATE AM AND PROCEED ACCORDING TO ITS MAGNITUDE
017328,000119: 
017329,000120: 22,2067           43345                           DLOAD    DAD                                   
017330,000121: 22,2070           03426                                    MFI                                   
017331,000122: 22,2071           03446                                    MFI        +16D                       
017332,000123: 22,2072           43225                           DSU      DAD                                   
017333,000124: 22,2073           15322                                    DP1/4TH                               
017334,000125: 22,2074           03436                                    MFI        +8D                        
017335,000126: 22,2075           03317                           STORE    CAM                                   #  CAM = (MFI0+MFI4+MFI8-1)/2 HALF SCALE
017336,000127: 22,2076           77726                           ARCCOS                                         
017337,000128: 22,2077           03365                           STORE    AM                                    #  AM=ARCCOS(CAM)  (AM SCALED BY 2)
017338,000129: 22,2100           51025                           DSU      BPL                                   
017339,000130: 22,2101           04367                                    MINANG                                
017340,000131: 22,2102           44111                                    CHECKMAX                              
017341,000132: 22,2103           77776                           EXIT                                           #  MANEUVER LESS THAN 0.25 DEG
017342,000133: 22,2104           00004                           INHINT                                         #  GO DIRECTLY INTO ATTITUDE HOLD
017343,000134: 22,2105           44712                           CS       ONE                                   #  ABOUT COMMANDED ANGLES
017344,000135: 22,2106           55332                           TS       HOLDFLAG                              #  NOGO WILL STOP ANY RATE AND SET UP FOR A
017345,000136: 22,2107           03301                           TC       LOADCDUD                              #  GOOD RETURN
017346,000137: 22,2110           12727                           TCF      NOGO                                  
017347,000138: 
017348,000139: 22,2111           45345        CHECKMAX           DLOAD    DSU                                   
017349,000140: 22,2112           03365                                    AM                                    
017350,000141: 22,2113           04370                                    MAXANG                                
017351,000142: 22,2114           77244                           BPL      VLOAD                                 
017352,000143: 22,2115           44123                                    ALTCALC                               #  UNIT
017353,000144: 22,2116           03311                                    COFSKEW                               #  COFSKEW
017354,000145: 22,2117           77656                           UNIT                                           
017355,000146: 22,2120           03343                           STORE    COF                                   #  COF IS THE MANEUVER AXIS
017356,000147: 22,2121           77650                           GOTO                                           #  SEE IF MANEUVER GOES THRU GIMBAL LOCK
017357,000148: 22,2122           44736                                    LOCSKIRT                              
017358,000149: 22,2123           53375        ALTCALC            VLOAD    VAD                                   #  IF AM GREATER THAN 170 DEGREES
017359,000150: 22,2124           03426                                    MFI                                   

Page 394

017361,000152: 22,2125           03267                                    TMFI                                  
017362,000153: 22,2126           77762                           VSR1                                           
017363,000154: 22,2127           27267                           STOVL    MFISYM                                
017364,000155: 22,2130           03434                                    MFI        +6                         
017365,000156: 22,2131           74455                           VAD      VSR1                                  
017366,000157: 22,2132           03275                                    TMFI       +6                         
017367,000158: 22,2133           27275                           STOVL    MFISYM     +6                         
017368,000159: 22,2134           03442                                    MFI        +12D                       
017369,000160: 22,2135           74455                           VAD      VSR1                                  
017370,000161: 22,2136           03303                                    TMFI       +12D                       
017371,000162: 22,2137           03303                           STORE    MFISYM     +12D                       #  MFISYM=(MFI+TMFI)/2   SCALED BY 4
017372,000163: 
017373,000164:                                                                                                  #  CALCULATE COF
017374,000165: 
017375,000166: 22,2140           70545                           DLOAD    SR1                                   
017376,000167: 22,2141           03317                                    CAM                                   
017377,000168: 22,2142           45325                           PDDL     DSU                                   #  PD0 CAM                       $4
017378,000169: 22,2143           15330                                    DPHALF                                
017379,000170: 22,2144           03317                                    CAM                                   
017380,000171: 22,2145           65204                           BOVB     PDDL                                  #  PD2 1 - CAM                   $2
017381,000172: 22,2146           45707                                    SIGNMPAC                              
017382,000173: 22,2147           03307                                    MFISYM     +16D                       
017383,000174: 22,2150           56225                           DSU      DDV                                   
017384,000175: 22,2151           00001                                    0                                     
017385,000176: 22,2152           00003                                    2                                     
017386,000177: 22,2153           65366                           SQRT     PDDL                                  #  COFZ = SQRT(MFISYM8-CAM)/1-CAM)
017387,000178: 22,2154           03277                                    MFISYM     +8D                        #                                $ ROOT 2
017388,000179: 22,2155           56225                           DSU      DDV                                   
017389,000180: 22,2156           00001                                    0                                     
017390,000181: 22,2157           00003                                    2                                     
017391,000182: 22,2160           65366                           SQRT     PDDL                                  #  COFY = SQRT(MFISYM4-CAM)/(1-CAM) $ROOT2
017392,000183: 22,2161           03267                                    MFISYM                                
017393,000184: 22,2162           56225                           DSU      DDV                                   
017394,000185: 22,2163           00001                                    0                                     
017395,000186: 22,2164           00003                                    2                                     
017396,000187: 22,2165           55566                           SQRT     VDEF                                  #  COFX = SQRT(MFISYM-CAM)/(1-CAM) $ROOT 2
017397,000188: 22,2166           77656                           UNIT                                           
017398,000189: 22,2167           03343                           STORE    COF                                   
017399,000190: 
017400,000191:                                                                                                  #  DETERMINE LARGEST COF AND ADJUST ACCORDINGLY
017401,000192: 
017402,000193: 22,2170           45345        COFMAXGO           DLOAD    DSU                                   
017403,000194: 22,2171           03343                                    COF                                   
017404,000195: 22,2172           03345                                    COF        +2                         
017405,000196: 22,2173           71240                           BMN      DLOAD                                 #  COFY G COFX
017406,000197: 22,2174           44203                                    COMP12                                
017407,000198: 22,2175           03343                                    COF                                   
017408,000199: 22,2176           50025                           DSU      BMN                                   
017409,000200: 22,2177           03347                                    COF        +4                         

Page 395

017411,000202: 22,2200           44260                                    METHOD3                               #  COFZ G COFX OR COFY
017412,000203: 22,2201           77650                           GOTO                                           
017413,000204: 22,2202           44234                                    METHOD1                               #  COFX G COFY OR COFZ
017414,000205: 22,2203           45345        COMP12             DLOAD    DSU                                   
017415,000206: 22,2204           03345                                    COF        +2                         
017416,000207: 22,2205           03347                                    COF        +4                         
017417,000208: 22,2206           77640                           BMN                                            
017418,000209: 22,2207           44260                                    METHOD3                               #  COFZ G COFY OR COFX
017419,000210: 
017420,000211: 22,2210           51145        METHOD2            DLOAD    BPL                                   #  COFY MAX
017421,000212: 22,2211           03313                                    COFSKEW    +2                         #  UY
017422,000213: 22,2212           44216                                    U2POS                                 
017423,000214: 22,2213           57575                           VLOAD    VCOMP                                 
017424,000215: 22,2214           03343                                    COF                                   
017425,000216: 22,2215           03343                           STORE    COF                                   
017426,000217: 22,2216           51145        U2POS              DLOAD    BPL                                   
017427,000218: 22,2217           03271                                    MFISYM     +2                         #  UX UY
017428,000219: 22,2220           44224                                    OKU21                                 
017429,000220: 22,2221           57545                           DLOAD    DCOMP                                 #  SIGN OF UX OPPOSITE TO UY
017430,000221: 22,2222           03343                                    COF                                   
017431,000222: 22,2223           03343                           STORE    COF                                   
017432,000223: 22,2224           51145        OKU21              DLOAD    BPL                                   
017433,000224: 22,2225           03301                                    MFISYM     +10D                       #  UY UZ
017434,000225: 22,2226           44736                                    LOCSKIRT                              
017435,000226: 22,2227           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
017436,000227: 22,2230           03347                                    COF        +4                         
017437,000228: 22,2231           03347                           STORE    COF        +4                         
017438,000229: 22,2232           77650                           GOTO                                           
017439,000230: 22,2233           44736                                    LOCSKIRT                              
017440,000231: 22,2234           51145        METHOD1            DLOAD    BPL                                   #  COFX MAX
017441,000232: 22,2235           03311                                    COFSKEW                               #  UX
017442,000233: 22,2236           44242                                    U1POS                                 
017443,000234: 22,2237           57575                           VLOAD    VCOMP                                 
017444,000235: 22,2240           03343                                    COF                                   
017445,000236: 22,2241           03343                           STORE    COF                                   
017446,000237: 22,2242           51145        U1POS              DLOAD    BPL                                   
017447,000238: 22,2243           03271                                    MFISYM     +2                         #  UX UY
017448,000239: 22,2244           44250                                    OKU12                                 
017449,000240: 22,2245           57545                           DLOAD    DCOMP                                 
017450,000241: 22,2246           03345                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UX
017451,000242: 22,2247           03345                           STORE    COF        +2                         
017452,000243: 22,2250           51145        OKU12              DLOAD    BPL                                   
017453,000244: 22,2251           03273                                    MFISYM     +4                         #  UX UZ
017454,000245: 22,2252           44736                                    LOCSKIRT                              
017455,000246: 22,2253           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
017456,000247: 22,2254           03347                                    COF        +4                         
017457,000248: 22,2255           03347                           STORE    COF        +4                         
017458,000249: 22,2256           77650                           GOTO                                           
017459,000250: 22,2257           44736                                    LOCSKIRT                              
017460,000251: 22,2260           51145        METHOD3            DLOAD    BPL                                   #  COFZ MAX

Page 396

017462,000253: 22,2261           03315                                    COFSKEW    +4                         #  UZ
017463,000254: 22,2262           44266                                    U3POS                                 
017464,000255: 22,2263           57575                           VLOAD    VCOMP                                 
017465,000256: 22,2264           03343                                    COF                                   
017466,000257: 22,2265           03343                           STORE    COF                                   
017467,000258: 22,2266           51145        U3POS              DLOAD    BPL                                   
017468,000259: 22,2267           03273                                    MFISYM     +4                         #  UX UZ
017469,000260: 22,2270           44274                                    OKU31                                 
017470,000261: 22,2271           57545                           DLOAD    DCOMP                                 
017471,000262: 22,2272           03343                                    COF                                   #  SIGN OF UX OPPOSITE TO UZ
017472,000263: 22,2273           03343                           STORE    COF                                   
017473,000264: 22,2274           51145        OKU31              DLOAD    BPL                                   
017474,000265: 22,2275           03301                                    MFISYM     +10D                       #  UY UZ
017475,000266: 22,2276           44736                                    LOCSKIRT                              
017476,000267: 22,2277           57545                           DLOAD    DCOMP                                 
017477,000268: 22,2300           03345                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UZ
017478,000269: 22,2301           03345                           STORE    COF        +2                         
017479,000270: 22,2302           77650                           GOTO                                           
017480,000271: 22,2303           44736                                    LOCSKIRT                              
017481,000272: 

Page 397

017483,000274:                                                                                                  #  MATRIX OPERATIONS
017484,000275: 
017485,000276: 22,2304           77601        MXM3               SETPD                                          #  MXM3 MULTIPLIES 2 3X3 MATRICES
017486,000277: 22,2305           00001                                    0                                     #  AND LEAVES RESULT IN PD LIST
017487,000278: 22,2306           64743                           DLOAD*   PDDL*                                 #  ADDRESS OF 1ST MATRIX IN XR1
017488,000279: 22,2307           77762                                    12D,2                                 #  ADDRESS OF 2ND MATRIX IN XR2
017489,000280: 22,2310           77770                                    6,2                                   
017490,000281: 22,2311           55523                           PDDL*    VDEF                                  #  DEFINE VECTOR M2(COL 1)
017491,000282: 22,2312           77776                                    0,2                                   
017492,000283: 22,2313           64717                           MXV*     PDDL*                                 #  M1XM2(COL 1) IN PD
017493,000284: 22,2314           00001                                    0,1                                   
017494,000285: 22,2315           77760                                    14D,2                                 
017495,000286: 22,2316           64723                           PDDL*    PDDL*                                 
017496,000287: 22,2317           77766                                    8D,2                                  
017497,000288: 22,2320           77774                                    2,2                                   
017498,000289: 22,2321           63666                           VDEF     MXV*                                  #  DEFINE VECTOR M2(COL 2)
017499,000290: 22,2322           00001                                    0,1                                   
017500,000291: 22,2323           64723                           PDDL*    PDDL*                                 #  M1XM2(COL2) IN PD
017501,000292: 22,2324           77756                                    16D,2                                 
017502,000293: 22,2325           77764                                    10D,2                                 
017503,000294: 22,2326           55523                           PDDL*    VDEF                                  #  DEFINE VECTOR M2(COL 3)
017504,000295: 22,2327           77772                                    4,2                                   
017505,000296: 22,2330           41517                           MXV*     PUSH                                  #  M1XM2(COL 3) IN PD
017506,000297: 22,2331           00001                                    0,1                                   
017507,000298: 22,2332           77650                           GOTO                                           
017508,000299: 22,2333           44343                                    TRNSPSPD                              #  REVERSE ROWS AND COLS IN PD AND
017509,000300:                                                                                                  #  RETURN WITH M1XM2 IN PD LIST
017510,000301: 22,2334           76601        TRANSPOS           SETPD    VLOAD*                                #  TRANSPOS TRANSPOSES A 3X3 MATRIX
017511,000302: 22,2335           00001                                    0                                     #        AND LEAVES RESULT IN PD LIST
017512,000303: 22,2336           00001                                    0,1                                   #  MATRIX ADDRESS IN XR1
017513,000304: 22,2337           62713                           PDVL*    PDVL*                                 
017514,000305: 22,2340           00007                                    6,1                                   
017515,000306: 22,2341           00015                                    12D,1                                 
017516,000307: 22,2342           77606                           PUSH                                           #  MATRIX IN PD
017517,000308: 22,2343           65345        TRNSPSPD           DLOAD    PDDL                                  #  ENTER WITH MATRIX IN PD LIST
017518,000309: 22,2344           00003                                    2                                     
017519,000310: 22,2345           00007                                    6                                     
017520,000311: 22,2346           14003                           STODL    2                                     
017521,000312: 22,2347           77626                           STADR                                          
017522,000313: 22,2350           63770                           STODL    6                                     
017523,000314: 22,2351           00005                                    4                                     
017524,000315: 22,2352           77725                           PDDL                                           
017525,000316: 22,2353           00015                                    12D                                   
017526,000317: 22,2354           14005                           STODL    4                                     
017527,000318: 22,2355           77626                           STADR                                          
017528,000319: 22,2356           63762                           STODL    12D                                   
017529,000320: 22,2357           00013                                    10D                                   
017530,000321: 22,2360           77725                           PDDL                                           

Page 398

017532,000323: 22,2361           00017                                    14D                                   
017533,000324: 22,2362           14013                           STODL    10D                                   
017534,000325: 22,2363           77626                           STADR                                          
017535,000326: 22,2364           77760                           STORE    14D                                   
017536,000327: 22,2365           77616                           RVQ                                            #  RETURN WITH TRANSPOSED MATRIX IN PD LIST
017537,000328: 22,2366           00013        MINANG             DEC      .00069375                             
017538,000329: 22,2367           17071        MAXANG             DEC      .472222                               
017539,000330: 
017540,000331:                                                                                                  #  GIMBAL LOCK CONSTANTS
017541,000332: 
017542,000333:                                                                                                  #  D = MGA CORRESPONDING TO GIMBAL LOCK = 60 DEGREES
017543,000334:                                                                                                  #  NGL = BUFFER ANGLE (TO AVOID DIVISIONS BY ZERO) = 2 DEGREES
017544,000335: 
017545,000336: 22,2370           15667        SD                 DEC      .433015                               #  = SIN(D)                              $2
017546,000337: 22,2371           33555        K3S1               DEC      .86603                                #  = SIN(D)                              $1
017547,000338: 22,2372           67777        K4                 DEC      -.25                                  #  = -COS(D)                             $2
017548,000339: 22,2373           04000        K4SQ               DEC      .125                                  #  = COS(D)COS(D)                        $2
017549,000340: 22,2374           00217        SNGLCD             DEC      .008725                               #  = SIN(NGL)COS(D)                      $2
017550,000341: 22,2375           17773        CNGL               DEC      .499695                               #  = COS(NGL)                            $2
017551,000342: 22,2376           00004        READCDUK           INHINT                                         #  LOAD T(MPAC) WITH THE CURRENT CDU ANGLES
017552,000343: 22,2377           30034                           CA       CDUZ                                  
017553,000344: 22,2400           54156                           TS       MPAC       +2                         
017554,000345: 22,2401           00006                           EXTEND                                         
017555,000346: 22,2402           30033                           DCA      CDUX                                  
017556,000347: 22,2403           00003                           RELINT                                         
017557,000348: 22,2404           16445                           TCF      TLOAD      +6                         
017558,000349: 16,2000                                           BANK     16                                    
017559,000350: 22,2000                                           SETLOC   KALCMON2                              
017560,000351: 22,2000                                           BANK                                           
017561,000352: 
017562,000353: 22,2405                                           COUNT*   $$/KALC                               
017563,000354: 
017564,000355: 22,2405           66370        CDUTODCM           AXT,1    SSP                                   #  SUBROUTINE TO COMPUTE DIRECTION COSINE
017565,000356: 22,2406           00003                           OCT      3                                     #  MATRIX RELATING S/C AXES TO STABLE
017566,000357: 22,2407           00051                                    S1                                    #  MEMBER AXES FROM 3 CDU ANGLES IN T(MPAC)
017567,000358: 22,2410           00001                           OCT      1                                     #  SET XR1, S1 AND PD FOR LOOP
017568,000359: 22,2411           00010                           STORE    7                                     
017569,000360: 22,2412           77601                           SETPD                                          
017570,000361: 22,2413           00001                                    0                                     
017571,000362: 22,2414           47133        LOOPSIN            SLOAD*   RTB                                   
017572,000363: 22,2415           00013                                    10D,1                                 
017573,000364: 22,2416           45510                                    CDULOGIC                              
017574,000365: 22,2417           00013                           STORE    10D                                   #  LOAD PD WITH 0        SIN(PHI)
017575,000366: 22,2420           65356                           SIN      PDDL                                  #               2        COS(PHI)
017576,000367: 22,2421           00013                                    10D                                   #               4        SIN(THETA)
017577,000368: 22,2422           41546                           COS      PUSH                                  #               6        COS(THETA)
017578,000369: 22,2423           71300                           TIX,1    DLOAD                                 #               8        SIN(PSI)
017579,000370: 22,2424           44414                                    LOOPSIN                               #              10        COS(PSI)
017580,000371: 22,2425           00007                                    6                                     
017581,000372: 22,2426           72405                           DMP      SL1                                   
017582,000373: 22,2427           00013                                    10D                                   

Page 399

017584,000375: 22,2430           10001                           STORE    0,2                                   
017585,000376: 22,2431           77745                           DLOAD                                          
017586,000377: 22,2432           00005                                    4                                     
017587,000378: 22,2433           65205                           DMP      PDDL                                  
017588,000379: 22,2434           00001                                    0                                     #  (PD6 SIN(THETA)SIN(PHI))
017589,000380: 22,2435           00007                                    6                                     
017590,000381: 22,2436           41205                           DMP      DMP                                   
017591,000382: 22,2437           00011                                    8D                                    
017592,000383: 22,2440           00003                                    2                                     
017593,000384: 22,2441           44352                           SL1      BDSU                                  
017594,000385: 22,2442           00015                                    12D                                   
017595,000386: 22,2443           77752                           SL1                                            
017596,000387: 22,2444           10003                           STORE    2,2                                   
017597,000388: 22,2445           77745                           DLOAD                                          
017598,000389: 22,2446           00003                                    2                                     
017599,000390: 22,2447           65205                           DMP      PDDL                                  #  (PD7 COS(PHI)SIN(THETA)) SCALED 4
017600,000391: 22,2450           00005                                    4                                     
017601,000392: 22,2451           00007                                    6                                     
017602,000393: 22,2452           41205                           DMP      DMP                                   
017603,000394: 22,2453           00011                                    8D                                    
017604,000395: 22,2454           00001                                    0                                     
017605,000396: 22,2455           77752                           SL1                                            
017606,000397: 22,2456           72415                           DAD      SL1                                   
017607,000398: 22,2457           00017                                    14D                                   
017608,000399: 22,2460           10005                           STORE    4,2                                   
017609,000400: 22,2461           77745                           DLOAD                                          
017610,000401: 22,2462           00011                                    8D                                    
017611,000402: 22,2463           10007                           STORE    6,2                                   
017612,000403: 22,2464           77745                           DLOAD                                          
017613,000404: 22,2465           00013                                    10D                                   
017614,000405: 22,2466           72405                           DMP      SL1                                   
017615,000406: 22,2467           00003                                    2                                     
017616,000407: 22,2470           10011                           STORE    8D,2                                  
017617,000408: 22,2471           77745                           DLOAD                                          
017618,000409: 22,2472           00013                                    10D                                   
017619,000410: 22,2473           57405                           DMP      DCOMP                                 
017620,000411: 22,2474           00001                                    0                                     
017621,000412: 22,2475           77752                           SL1                                            
017622,000413: 22,2476           10013                           STORE    10D,2                                 
017623,000414: 22,2477           77745                           DLOAD                                          
017624,000415: 22,2500           00005                                    4                                     
017625,000416: 22,2501           57405                           DMP      DCOMP                                 
017626,000417: 22,2502           00013                                    10D                                   
017627,000418: 22,2503           77752                           SL1                                            
017628,000419: 22,2504           10015                           STORE    12D,2                                 
017629,000420: 22,2505           77745                           DLOAD                                          
017630,000421: 22,2506           72405                           DMP      SL1                                   #  (PUSH UP 7)
017631,000422: 22,2507           00011                                    8D                                    
017632,000423: 22,2510           41325                           PDDL     DMP                                   #  (PD7 COS(PHI)SIN(THETA)SIN(PSI)) SCALE 4
017633,000424: 22,2511           00007                                    6                                     

Page 400

017635,000426: 22,2512           00001                                    0                                     
017636,000427: 22,2513           72415                           DAD      SL1                                   #  (PUSH UP 7)
017637,000428: 22,2514           77626                           STADR                                          #  C7=COS(PHI)SIN(THETA)SIN(PSI)
017638,000429: 22,2515           67760                           STORE    14D,2                                 
017639,000430: 22,2516           77745                           DLOAD                                          
017640,000431: 22,2517           72405                           DMP      SL1                                   #  (PUSH UP 6)
017641,000432: 22,2520           00011                                    8D                                    
017642,000433: 22,2521           41325                           PDDL     DMP                                   #  (PD6 SIN(THETA)SIN(PHI)SIN(PSI)) SCALE 4
017643,000434: 22,2522           00007                                    6                                     
017644,000435: 22,2523           00003                                    2                                     
017645,000436: 22,2524           72425                           DSU      SL1                                   #  (PUSH UP 6)
017646,000437: 22,2525           77626                           STADR                                          
017647,000438: 22,2526           67756                           STORE    16D,2                                 #  C8=-SIN(THETA)SIN(PHI)SIN(PSI)
017648,000439: 22,2527           77616                           RVQ                                            #     +COS(THETA)COS(PHI)
017649,000440: 22,2530                        ENDDCM             EQUALS                                         
017650,000441: 15,2000                                           BANK     15                                    
017651,000442: 22,2000                                           SETLOC   KALCMON1                              
017652,000443: 22,2000                                           BANK                                           
017653,000444: 
017654,000445:                                                                                                  #  CALCULATION OF THE MATRIX DEL......
017655,000446: 
017656,000447:                                                                                                  #        *      *               --T           *
017657,000448:                                                                                                  #        DEL = (IDMATRIX)COS(A)+UU (1-COS(A))+UX SIN(A)          SCALED 1
017658,000449: 
017659,000450:                                                                                                  #              -
017660,000451:                                                                                                  #        WHERE U IS A UNIT VECTOR (DP SCALED 2) ALONG THE AXIS OF ROTATION.
017661,000452:                                                                                                  #        A IS THE ANGLE OF ROTATION (DP SCALED 2)
017662,000453:                                                                                                  #                                           -
017663,000454:                                                                                                  #        UPON ENTRY THE STARTING ADDRESS OF U IS COF, AND A IS IN MPAC
017664,000455: 
017665,000456: 22,2530                                           COUNT    22/KALC                               
017666,000457: 
017667,000458: 22,2530           41401        DELCOMP            SETPD    PUSH                                  #  MPAC CONTAINS THE ANGLE A
017668,000459: 22,2531           00001                                    0                                     
017669,000460: 22,2532           65356                           SIN      PDDL                                  #  PD0 = SIN(A)
017670,000461: 22,2533           41546                           COS      PUSH                                  #  PD2 = COS(A)
017671,000462: 22,2534           65302                           SR2      PDDL                                  #  PD2 = COS(A)                          $8
017672,000463: 22,2535           41021                           BDSU     BOVB                                  #  PD4 = 1-COS(A)                        $2
017673,000464: 22,2536           15330                                    DPHALF                                
017674,000465: 22,2537           45707                                    SIGNMPAC                              
017675,000466: 
017676,000467:                                                                                                  #  COMPUTE THE DIAGONAL COMPONENTS OF DEL
017677,000468: 
017678,000469: 22,2540           77725                           PDDL                                           
017679,000470: 22,2541           03343                                    COF                                   
017680,000471: 22,2542           41316                           DSQ      DMP                                   
017681,000472: 22,2543           00005                                    4                                     
017682,000473: 22,2544           52415                           DAD      SL3                                   

Page 401

017684,000475: 22,2545           00003                                    2                                     
017685,000476: 22,2546           77604                           BOVB                                           
017686,000477: 22,2547           45707                                    SIGNMPAC                              
017687,000478: 22,2550           17426                           STODL    DEL                                   #  UX UX(U-COS(A)) +COS(A)               $1
017688,000479: 22,2551           03345                                    COF        +2                         
017689,000480: 22,2552           41316                           DSQ      DMP                                   
017690,000481: 22,2553           00005                                    4                                     
017691,000482: 22,2554           52415                           DAD      SL3                                   
017692,000483: 22,2555           00003                                    2                                     
017693,000484: 22,2556           77604                           BOVB                                           
017694,000485: 22,2557           45707                                    SIGNMPAC                              
017695,000486: 22,2560           17436                           STODL    DEL        +8D                        #  UY UY(1-COS(A)) +COS(A)               $1
017696,000487: 22,2561           03347                                    COF        +4                         
017697,000488: 22,2562           41316                           DSQ      DMP                                   
017698,000489: 22,2563           00005                                    4                                     
017699,000490: 22,2564           52415                           DAD      SL3                                   
017700,000491: 22,2565           00003                                    2                                     
017701,000492: 22,2566           77604                           BOVB                                           
017702,000493: 22,2567           45707                                    SIGNMPAC                              
017703,000494: 22,2570           03446                           STORE    DEL        +16D                       #  UZ UZ(1-COS(A)) +COS(A)               $1
017704,000495: 
017705,000496:                                                                                                  #  COMPUTE THE OFF DIAGONAL TERMS OF DEL
017706,000497: 
017707,000498: 22,2571           41345                           DLOAD    DMP                                   
017708,000499: 22,2572           03343                                    COF                                   
017709,000500: 22,2573           03345                                    COF        +2                         
017710,000501: 22,2574           72405                           DMP      SL1                                   
017711,000502: 22,2575           00005                                    4                                     
017712,000503: 22,2576           41325                           PDDL     DMP                                   #  D6    UX UY (1-COS A)                 $ 4
017713,000504: 22,2577           03347                                    COF        +4                         
017714,000505: 22,2600           00001                                    0                                     
017715,000506: 22,2601           43206                           PUSH     DAD                                   #  D8    UZ SIN A                        $ 4
017716,000507: 22,2602           00007                                    6                                     
017717,000508: 22,2603           41112                           SL2      BOVB                                  
017718,000509: 22,2604           45707                                    SIGNMPAC                              
017719,000510: 22,2605           17434                           STODL    DEL        +6                         
017720,000511: 22,2606           62421                           BDSU     SL2                                   
017721,000512: 22,2607           77604                           BOVB                                           
017722,000513: 22,2610           45707                                    SIGNMPAC                              
017723,000514: 22,2611           17430                           STODL    DEL        +2                         
017724,000515: 22,2612           03343                                    COF                                   
017725,000516: 22,2613           41205                           DMP      DMP                                   
017726,000517: 22,2614           03347                                    COF        +4                         
017727,000518: 22,2615           00005                                    4                                     
017728,000519: 22,2616           65352                           SL1      PDDL                                  #  D6    UX UZ (1-COS A )                $ 4
017729,000520: 22,2617           03345                                    COF        +2                         
017730,000521: 22,2620           41405                           DMP      PUSH                                  #  D8    UY SIN(A)
017731,000522: 22,2621           00001                                    0                                     
017732,000523: 22,2622           62415                           DAD      SL2                                   
017733,000524: 22,2623           00007                                    6                                     

Page 402

017735,000526: 22,2624           77604                           BOVB                                           
017736,000527: 22,2625           45707                                    SIGNMPAC                              
017737,000528: 22,2626           17432                           STODL    DEL        +4                         #  UX UZ (1-COS(A))+UY SIN(A)
017738,000529: 22,2627           62421                           BDSU     SL2                                   
017739,000530: 22,2630           77604                           BOVB                                           
017740,000531: 22,2631           45707                                    SIGNMPAC                              
017741,000532: 22,2632           17442                           STODL    DEL        +12D                       #  UX UZ (U-COS(A))-UY SIN(A)
017742,000533: 22,2633           03345                                    COF        +2                         
017743,000534: 22,2634           41205                           DMP      DMP                                   
017744,000535: 22,2635           03347                                    COF        +4                         
017745,000536: 22,2636           00005                                    4                                     
017746,000537: 22,2637           65352                           SL1      PDDL                                  #  D6    UY UZ (1-COS(A))                $ 4
017747,000538: 22,2640           03343                                    COF                                   
017748,000539: 22,2641           41405                           DMP      PUSH                                  #  D8    UX SIN(A)
017749,000540: 22,2642           00001                                    0                                     
017750,000541: 22,2643           62415                           DAD      SL2                                   
017751,000542: 22,2644           00007                                    6                                     
017752,000543: 22,2645           77604                           BOVB                                           
017753,000544: 22,2646           45707                                    SIGNMPAC                              
017754,000545: 22,2647           17444                           STODL    DEL        +14D                       #  UY UZ(1-COS(A)) +UX SIN(A)
017755,000546: 22,2650           62421                           BDSU     SL2                                   
017756,000547: 22,2651           77604                           BOVB                                           
017757,000548: 22,2652           45707                                    SIGNMPAC                              
017758,000549: 22,2653           03440                           STORE    DEL        +10D                       #  UY UZ(1-COS(A)) -UX SIN(A)
017759,000550: 22,2654           77616                           RVQ                                            
017760,000551: 
017761,000552:                                                                                                  #  DIRECTION COSINE MATRIX TO CDU ANGLE ROUTINE
017762,000553:                                                                                                  #  X1 CONTAINS THE COMPLEMENT OF THE STARTING ADDRESS FOR MATRIX (SCALED 2)
017763,000554:                                                                                                  #  LEAVES CDU ANGLES SCALED 2PI IN V(MPAC)
017764,000555:                                                                                                  #  COS(MGA) WILL BE LEFT IN S1 (SCALED 1)
017765,000556: 
017766,000557:                                                                                                  #  THE DIRECTION COSINE MATRIX RELATING S/C AXES TO STABLE MEMBER AXES CAN BE WRITTEN AS ***
017767,000558: 
017768,000559:                                                                                                  #        C =COS(THETA)COS(PSI)
017769,000560:                                                                                                  #         0
017770,000561: 
017771,000562:                                                                                                  #        C =-COS(THETA)SIN(PSI)COS(PHI)+SI (THETA)SIN(PHI)
017772,000563:                                                                                                  #         1
017773,000564: 
017774,000565:                                                                                                  #        C =COS(THETA)SIN(PSI)SIN(PHI)+S N(THETA)COS(PHI)
017775,000566:                                                                                                  #         2
017776,000567: 
017777,000568:                                                                                                  #        C =SIN(PSI)
017778,000569:                                                                                                  #         3
017779,000570: 
017780,000571:                                                                                                  #        C =COS(PSI)COS(PHI)
017781,000572:                                                                                                  #         4
017782,000573: 
017783,000574:                                                                                                  #        C =-COS(PSI)SIN(PHI)
017784,000575:                                                                                                  #         5
017785,000576: 
017786,000577:                                                                                                  #        C =-SIN(THETA)COS(PSI)
017787,000578:                                                                                                  #         6
017788,000579: 
017789,000580:                                                                                                  #        C =SIN(THETA)SIN(PSI)COS(PHI)+COS THETA)SIN(PHI)
017790,000581:                                                                                                  #         7

Page 403

017792,000583:                                                                                                  #        C =-SIN(THETA)SIN(PSI)SIN(PHI)+CO (THETA)COS(PHI)
017793,000584:                                                                                                  #         8
017794,000585: 
017795,000586:                                                                                                  #        WHERE   PHI = OGA
017796,000587:                                                                                                  #                THETA = IGA
017797,000588:                                                                                                  #                PSI = MGA
017798,000589: 
017799,000590: 22,2655           67543        DCMTOCDU           DLOAD*   ARCSIN                                
017800,000591: 22,2656           00007                                    6,1                                   
017801,000592: 22,2657           71406                           PUSH     COS                                   #  PD +0         PSI
017802,000593: 22,2660           41152                           SL1      BOVB                                  
017803,000594: 22,2661           45707                                    SIGNMPAC                              
017804,000595: 22,2662           00051                           STORE    S1                                    
017805,000596: 22,2663           57543                           DLOAD*   DCOMP                                 
017806,000597: 22,2664           00015                                    12D,1                                 
017807,000598: 22,2665           67471                           DDV      ARCSIN                                
017808,000599: 22,2666           00051                                    S1                                    
017809,000600: 22,2667           51123                           PDDL*    BPL                                   #  PD +2         THETA
017810,000601: 22,2670           00001                                    0,1                                   #  MUST CHECK THE SIGN OF COS(THETA)
017811,000602: 22,2671           44703                                    OKTHETA                               #  TO DETERMINE THE PROPER QUADRANT
017812,000603: 22,2672           57545                           DLOAD    DCOMP                                 
017813,000604: 22,2673           43244                           BPL      DAD                                   
017814,000605: 22,2674           44700                                    SUHALFA                               
017815,000606: 22,2675           15330                                    DPHALF                                
017816,000607: 22,2676           77650                           GOTO                                           
017817,000608: 22,2677           44702                                    CALCPHI                               
017818,000609: 22,2700           77625        SUHALFA            DSU                                            
017819,000610: 22,2701           15330                                    DPHALF                                
017820,000611: 22,2702           77606        CALCPHI            PUSH                                           
017821,000612: 22,2703           57543        OKTHETA            DLOAD*   DCOMP                                 
017822,000613: 22,2704           00013                                    10D,1                                 
017823,000614: 22,2705           67471                           DDV      ARCSIN                                
017824,000615: 22,2706           00051                                    S1                                    
017825,000616: 22,2707           51123                           PDDL*    BPL                                   #  PUSH DOWN PHI
017826,000617: 22,2710           00011                                    8D,1                                  
017827,000618: 22,2711           44723                                    OKPHI                                 
017828,000619: 22,2712           57545                           DLOAD    DCOMP                                 #  PUSH UP PHI
017829,000620: 22,2713           43244                           BPL      DAD                                   
017830,000621: 22,2714           44720                                    SUHALFAP                              
017831,000622: 22,2715           15330                                    DPHALF                                
017832,000623: 22,2716           77650                           GOTO                                           
017833,000624: 22,2717           44724                                    VECOFANG                              
017834,000625: 22,2720           52025        SUHALFAP           DSU      GOTO                                  
017835,000626: 22,2721           15330                                    DPHALF                                
017836,000627: 22,2722           44724                                    VECOFANG                              
017837,000628: 22,2723           77745        OKPHI              DLOAD                                          #  PUSH UP PHI
017838,000629: 22,2724           43466        VECOFANG           VDEF     RVQ                                   
017839,000630: 

Page 404

017841,000632:                                                                                                  #  ROUTINE FOR TERMINATING AUTOMATIC MANEUVERS
017842,000633: 
017843,000634: 22,2725           00004        NOGOM2             INHINT                                         #  THIS LOCATION ACCESSED BY A BZMF NOGO -2
017844,000635: 22,2726           03272                           TC       ZEROEROR                              
017845,000636: 
017846,000637: 22,2727           00004        NOGO               INHINT                                         
017847,000638: 22,2730           03245                           TC       STOPRATE                              
017848,000639: 
017849,000640:                                                                                                  #  TERMINATE MANEUVER
017850,000641: 22,2731           34711                           CAF      TWO                                   #  NOTE - ALL RETURNS ARE NOW MADE VIA
017851,000642: 22,2732           05140                           TC       WAITLIST                              #  GOODEND
017852,000643: 22,2733  40,2000                                  SBANK=   PINSUPER                              
017853,000644: 22,2733  E6,1661                                  EBANK=   BCDU                                  
017854,000645: 22,2733           03237 44106                     2CADR    ENDMANU                               
017855,000646: 
017856,000647: 22,2735           15112                           TCF      ENDOFJOB                              
017857,000648: 

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