Source Code

These source-code files are part of a reconstructed copy of Comanche 67, the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 12.

They have been adapted from sources files for Comanche 55, and updated via disassembly of binary dumps of original core rope memory modules, part numbers 2003972-1081, 2003972-1091, 2003972-1111, 2003972-1121, 2003972-1131, and 2003972-1141.

Since only binary dumps (rather than listings) of Comanche 67 are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

016680,000002:                                                                                                  ## Copyright:   Public domain.
016681,000003:                                                                                                  ## Filename:    ANGLFIND.agc
016682,000004:                                                                                                  ## Purpose:     A section of Comanche revision 067.
016683,000005:                                                                                                  ##              It is part of the reconstructed source code for the flight
016684,000006:                                                                                                  ##              software for the Command Module's (CM) Apollo Guidance Computer
016685,000007:                                                                                                  ##              (AGC) for Apollo 12. No original listings of this program are
016686,000008:                                                                                                  ##              available; instead, this file was created via dissassembly of
016687,000009:                                                                                                  ##              dumps of Comanche 067 core rope modules and comparison with
016688,000010:                                                                                                  ##              other AGC programs.
016689,000011:                                                                                                  ## Assembler:   yaYUL
016690,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
016691,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
016692,000014:                                                                                                  ## Mod history: 2023-08-16 MAS  Created from Comanche 055.
016693,000015: 
016694,000016: 15,2000                                           BANK     15                                    
016695,000017: 22,2000                                           SETLOC   KALCMON1                              
016696,000018: 22,2000                                           BANK                                           
016697,000019: 
016698,000020: 22,2000  E6,1661                                  EBANK=   BCDU                                  
016699,000021: 
016700,000022: 22,2000                                           COUNT    22/KALC                               
016701,000023: 
016702,000024: 22,2000           06006        KALCMAN3           TC       INTPRET                               
016703,000025: 22,2001           77634                           RTB                                            
016704,000026: 22,2002           44376                                    READCDUK                              #  PICK UP CURRENT CDU ANGLES
016705,000027: 22,2003           03262                           STORE    BCDU                                  #  STORE THE INITIAL S/C ANGLES
016706,000028: 22,2004           72364                           AXC,2    TLOAD                                 #  COMPUTE THE TRANSFORMATION FROM
016707,000029: 22,2005           03320                                    MIS                                   #  INITIAL S/C AXES TO STABLE MEMBER AXES
016708,000030: 22,2006           03262                                    BCDU                                  #  (MIS)
016709,000031: 22,2007           77624                           CALL                                           
016710,000032: 22,2010           44405                                    CDUTODCM                              
016711,000033: 22,2011           72364                           AXC,2    TLOAD                                 #  COMPUTE THE TRANSFORMATION FROM
016712,000034: 22,2012           03425                                    MFS                                   #  FINAL S/C AXES TO STABLE MEMBER AXES
016713,000035: 22,2013           01156                                    CPHI                                  #  (MFS)
016714,000036: 22,2014           77624                           CALL                                           
016715,000037: 22,2015           44405                                    CDUTODCM                              
016716,000038: 22,2016           45160        SECAD              AXC,1    CALL                                  #  MIS AND MFS ARRAYS CALCULATED         $2
016717,000039: 22,2017           03320                                    MIS                                   
016718,000040: 22,2020           44334                                    TRANSPOS                              
016719,000041: 22,2021           77775                           VLOAD                                          
016720,000042: 22,2022           77626                           STADR                                          
016721,000043: 22,2023           50474                           STOVL    TMIS       +12D                       
016722,000044: 22,2024           77626                           STADR                                          
016723,000045: 22,2025           50502                           STOVL    TMIS       +6                         
016724,000046: 22,2026           77626                           STADR                                          
016725,000047: 22,2027           74510                           STORE    TMIS                                  #  TMIS = TRANSPOSE(MIS) SCALED BY 2
016726,000048: 22,2030           75160                           AXC,1    AXC,2                                 
016727,000049: 22,2031           03266                                    TMIS                                  
016728,000050: 22,2032           03425                                    MFS                                   
016729,000051: 22,2033           77624                           CALL                                           
016730,000052: 22,2034           44304                                    MXM3                                  
016731,000053: 22,2035           45575                           VLOAD    STADR                                 
016732,000054: 22,2036           50335                           STOVL    MFI        +12D                       
016733,000055: 22,2037           77626                           STADR                                          
016734,000056: 22,2040           50343                           STOVL    MFI        +6                         
016735,000057: 22,2041           77626                           STADR                                          
016736,000058: 22,2042           74351                           STORE    MFI                                   #  MFI = TMIS MFS (SCALED BY 4)
016737,000059: 22,2043           45001                           SETPD    CALL                                  #  TRANSPOSE MFI IN PD LIST
016738,000060: 22,2044           00023                                    18D                                   
016739,000061: 22,2045           44343                                    TRNSPSPD                              
016740,000062: 22,2046           45575                           VLOAD    STADR                                 
016741,000063: 22,2047           50474                           STOVL    TMFI       +12D                       
016742,000064: 22,2050           77626                           STADR                                          
016743,000065: 22,2051           50502                           STOVL    TMFI       +6                         
016744,000066: 22,2052           77626                           STADR                                          
016745,000067: 22,2053           74510                           STORE    TMFI                                  #  TMFI = TRANSPOSE (MFI) SCALED BY 4
016746,000068: 
016747,000069:                                                                                                  #  CALCULATE COFSKEW AND MFISYM
016748,000070: 
016749,000071: 22,2054           45345                           DLOAD    DSU                                   
016750,000072: 22,2055           03271                                    TMFI       +2                         
016751,000073: 22,2056           03430                                    MFI        +2                         
016752,000074: 22,2057           45325                           PDDL     DSU                                   #  CALCULATE COF SCALED BY 2/SIN(AM)
016753,000075: 22,2060           03432                                    MFI        +4                         
016754,000076: 22,2061           03273                                    TMFI       +4                         
016755,000077: 22,2062           45325                           PDDL     DSU                                   
016756,000078: 22,2063           03301                                    TMFI       +10D                       
016757,000079: 22,2064           03440                                    MFI        +10D                       
016758,000080: 22,2065           77666                           VDEF                                           
016759,000081: 22,2066           03311                           STORE    COFSKEW                               #  EQUALS MFISKEW
016760,000082: 
016761,000083:                                                                                                  #  CALCULATE AM AND PROCEED ACCORDING TO ITS MAGNITUDE
016762,000084: 
016763,000085: 22,2067           43345                           DLOAD    DAD                                   
016764,000086: 22,2070           03426                                    MFI                                   
016765,000087: 22,2071           03446                                    MFI        +16D                       
016766,000088: 22,2072           43225                           DSU      DAD                                   
016767,000089: 22,2073           15324                                    DP1/4TH                               
016768,000090: 22,2074           03436                                    MFI        +8D                        
016769,000091: 22,2075           03317                           STORE    CAM                                   #  CAM = (MFI0+MFI4+MFI8-1)/2 HALF SCALE
016770,000092: 22,2076           77726                           ARCCOS                                         
016771,000093: 22,2077           03365                           STORE    AM                                    #  AM=ARCCOS(CAM)  (AM SCALED BY 2)
016772,000094: 22,2100           51025                           DSU      BPL                                   
016773,000095: 22,2101           04367                                    MINANG                                
016774,000096: 22,2102           44111                                    CHECKMAX                              
016775,000097: 22,2103           77776                           EXIT                                           #  MANEUVER LESS THAN 0.25 DEG
016776,000098: 22,2104           00004                           INHINT                                         #  GO DIRECTLY INTO ATTITUDE HOLD
016777,000099: 22,2105           45033                           CS       ONE                                   #  ABOUT COMMANDED ANGLES
016778,000100: 22,2106           55332                           TS       HOLDFLAG                              #  NOGO WILL STOP ANY RATE AND SET UP FOR A
016779,000101: 22,2107           03142                           TC       LOADCDUD                              #  GOOD RETURN
016780,000102: 22,2110           12730                           TCF      NOGO                                  
016781,000103: 
016782,000104: 22,2111           45345        CHECKMAX           DLOAD    DSU                                   
016783,000105: 22,2112           03365                                    AM                                    
016784,000106: 22,2113           04370                                    MAXANG                                
016785,000107: 22,2114           77244                           BPL      VLOAD                                 
016786,000108: 22,2115           44123                                    ALTCALC                               #  UNIT
016787,000109: 22,2116           03311                                    COFSKEW                               #  COFSKEW
016788,000110: 22,2117           77656                           UNIT                                           
016789,000111: 22,2120           03343                           STORE    COF                                   #  COF IS THE MANEUVER AXIS
016790,000112: 22,2121           77650                           GOTO                                           #  SEE IF MANEUVER GOES THRU GIMBAL LOCK
016791,000113: 22,2122           44737                                    LOCSKIRT                              
016792,000114: 22,2123           53375        ALTCALC            VLOAD    VAD                                   #  IF AM GREATER THAN 170 DEGREES
016793,000115: 22,2124           03426                                    MFI                                   
016794,000116: 22,2125           03267                                    TMFI                                  
016795,000117: 22,2126           77762                           VSR1                                           
016796,000118: 22,2127           27267                           STOVL    MFISYM                                
016797,000119: 22,2130           03434                                    MFI        +6                         
016798,000120: 22,2131           74455                           VAD      VSR1                                  
016799,000121: 22,2132           03275                                    TMFI       +6                         
016800,000122: 22,2133           27275                           STOVL    MFISYM     +6                         
016801,000123: 22,2134           03442                                    MFI        +12D                       
016802,000124: 22,2135           74455                           VAD      VSR1                                  
016803,000125: 22,2136           03303                                    TMFI       +12D                       
016804,000126: 22,2137           03303                           STORE    MFISYM     +12D                       #  MFISYM=(MFI+TMFI)/2   SCALED BY 4
016805,000127: 
016806,000128:                                                                                                  #  CALCULATE COF
016807,000129: 
016808,000130: 22,2140           70545                           DLOAD    SR1                                   
016809,000131: 22,2141           03317                                    CAM                                   
016810,000132: 22,2142           45325                           PDDL     DSU                                   #  PD0 CAM                              $4
016811,000133: 22,2143           15332                                    DPHALF                                
016812,000134: 22,2144           03317                                    CAM                                   
016813,000135: 22,2145           65204                           BOVB     PDDL                                  #  PD2 1 - CAM                          $2
016814,000136: 22,2146           45712                                    SIGNMPAC                              
016815,000137: 22,2147           03307                                    MFISYM     +16D                       
016816,000138: 22,2150           56225                           DSU      DDV                                   
016817,000139: 22,2151           00001                                    0                                     
016818,000140: 22,2152           00003                                    2                                     
016819,000141: 22,2153           65366                           SQRT     PDDL                                  #  COFZ = SQRT(MFISYM8-CAM)/1-CAM)
016820,000142: 22,2154           03277                                    MFISYM     +8D                        #                                 $ ROOT 2
016821,000143: 22,2155           56225                           DSU      DDV                                   
016822,000144: 22,2156           00001                                    0                                     
016823,000145: 22,2157           00003                                    2                                     
016824,000146: 22,2160           65366                           SQRT     PDDL                                  #  COFY = SQRT(MFISYM4-CAM)/(1-CAM) $ROOT2
016825,000147: 22,2161           03267                                    MFISYM                                
016826,000148: 22,2162           56225                           DSU      DDV                                   
016827,000149: 22,2163           00001                                    0                                     
016828,000150: 22,2164           00003                                    2                                     
016829,000151: 22,2165           55566                           SQRT     VDEF                                  #  COFX = SQRT(MFISYM-CAM)/(1-CAM) $ROOT 2
016830,000152: 22,2166           77656                           UNIT                                           
016831,000153: 22,2167           03343                           STORE    COF                                   
016832,000154: 
016833,000155:                                                                                                  #  DETERMINE LARGEST COF AND ADJUST ACCORDINGLY
016834,000156: 
016835,000157: 22,2170           45345        COFMAXGO           DLOAD    DSU                                   
016836,000158: 22,2171           03343                                    COF                                   
016837,000159: 22,2172           03345                                    COF        +2                         
016838,000160: 22,2173           71240                           BMN      DLOAD                                 #  COFY G COFX
016839,000161: 22,2174           44203                                    COMP12                                
016840,000162: 22,2175           03343                                    COF                                   
016841,000163: 22,2176           50025                           DSU      BMN                                   
016842,000164: 22,2177           03347                                    COF        +4                         
016843,000165: 22,2200           44260                                    METHOD3                               #  COFZ G COFX OR COFY
016844,000166: 22,2201           77650                           GOTO                                           
016845,000167: 22,2202           44234                                    METHOD1                               #  COFX G COFY OR COFZ
016846,000168: 22,2203           45345        COMP12             DLOAD    DSU                                   
016847,000169: 22,2204           03345                                    COF        +2                         
016848,000170: 22,2205           03347                                    COF        +4                         
016849,000171: 22,2206           77640                           BMN                                            
016850,000172: 22,2207           44260                                    METHOD3                               #  COFZ G COFY OR COFX
016851,000173: 
016852,000174: 22,2210           51145        METHOD2            DLOAD    BPL                                   #  COFY MAX
016853,000175: 22,2211           03313                                    COFSKEW    +2                         #  UY
016854,000176: 22,2212           44216                                    U2POS                                 
016855,000177: 22,2213           57575                           VLOAD    VCOMP                                 
016856,000178: 22,2214           03343                                    COF                                   
016857,000179: 22,2215           03343                           STORE    COF                                   
016858,000180: 22,2216           51145        U2POS              DLOAD    BPL                                   
016859,000181: 22,2217           03271                                    MFISYM     +2                         #  UX UY
016860,000182: 22,2220           44224                                    OKU21                                 
016861,000183: 22,2221           57545                           DLOAD    DCOMP                                 #  SIGN OF UX OPPOSITE TO UY
016862,000184: 22,2222           03343                                    COF                                   
016863,000185: 22,2223           03343                           STORE    COF                                   
016864,000186: 22,2224           51145        OKU21              DLOAD    BPL                                   
016865,000187: 22,2225           03301                                    MFISYM     +10D                       #  UY UZ
016866,000188: 22,2226           44737                                    LOCSKIRT                              
016867,000189: 22,2227           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
016868,000190: 22,2230           03347                                    COF        +4                         
016869,000191: 22,2231           03347                           STORE    COF        +4                         
016870,000192: 22,2232           77650                           GOTO                                           
016871,000193: 22,2233           44737                                    LOCSKIRT                              
016872,000194: 22,2234           51145        METHOD1            DLOAD    BPL                                   #  COFX MAX
016873,000195: 22,2235           03311                                    COFSKEW                               #  UX
016874,000196: 22,2236           44242                                    U1POS                                 
016875,000197: 22,2237           57575                           VLOAD    VCOMP                                 
016876,000198: 22,2240           03343                                    COF                                   
016877,000199: 22,2241           03343                           STORE    COF                                   
016878,000200: 22,2242           51145        U1POS              DLOAD    BPL                                   
016879,000201: 22,2243           03271                                    MFISYM     +2                         #  UX UY
016880,000202: 22,2244           44250                                    OKU12                                 
016881,000203: 22,2245           57545                           DLOAD    DCOMP                                 
016882,000204: 22,2246           03345                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UX
016883,000205: 22,2247           03345                           STORE    COF        +2                         
016884,000206: 22,2250           51145        OKU12              DLOAD    BPL                                   
016885,000207: 22,2251           03273                                    MFISYM     +4                         #  UX UZ
016886,000208: 22,2252           44737                                    LOCSKIRT                              
016887,000209: 22,2253           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
016888,000210: 22,2254           03347                                    COF        +4                         
016889,000211: 22,2255           03347                           STORE    COF        +4                         
016890,000212: 22,2256           77650                           GOTO                                           
016891,000213: 22,2257           44737                                    LOCSKIRT                              
016892,000214: 22,2260           51145        METHOD3            DLOAD    BPL                                   #  COFZ MAX
016893,000215: 22,2261           03315                                    COFSKEW    +4                         #  UZ
016894,000216: 22,2262           44266                                    U3POS                                 
016895,000217: 22,2263           57575                           VLOAD    VCOMP                                 
016896,000218: 22,2264           03343                                    COF                                   
016897,000219: 22,2265           03343                           STORE    COF                                   
016898,000220: 22,2266           51145        U3POS              DLOAD    BPL                                   
016899,000221: 22,2267           03273                                    MFISYM     +4                         #  UX UZ
016900,000222: 22,2270           44274                                    OKU31                                 
016901,000223: 22,2271           57545                           DLOAD    DCOMP                                 
016902,000224: 22,2272           03343                                    COF                                   #  SIGN OF UX OPPOSITE TO UZ
016903,000225: 22,2273           03343                           STORE    COF                                   
016904,000226: 22,2274           51145        OKU31              DLOAD    BPL                                   
016905,000227: 22,2275           03301                                    MFISYM     +10D                       #  UY UZ
016906,000228: 22,2276           44737                                    LOCSKIRT                              
016907,000229: 22,2277           57545                           DLOAD    DCOMP                                 
016908,000230: 22,2300           03345                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UZ
016909,000231: 22,2301           03345                           STORE    COF        +2                         
016910,000232: 22,2302           77650                           GOTO                                           
016911,000233: 22,2303           44737                                    LOCSKIRT                              
016912,000234: 
016913,000235:                                                                                                  #  MATRIX OPERATIONS
016914,000236: 
016915,000237: 22,2304           77601        MXM3               SETPD                                          #  MXM3 MULTIPLIES 2 3X3 MATRICES
016916,000238: 22,2305           00001                                    0                                     #  AND LEAVES RESULT IN PD LIST
016917,000239: 22,2306           64743                           DLOAD*   PDDL*                                 #  ADDRESS OF 1ST MATRIX IN XR1
016918,000240: 22,2307           77762                                    12D,2                                 #  ADDRESS OF 2ND MATRIX IN XR2
016919,000241: 22,2310           77770                                    6,2                                   
016920,000242: 22,2311           55523                           PDDL*    VDEF                                  #  DEFINE VECTOR M2(COL 1)
016921,000243: 22,2312           77776                                    0,2                                   
016922,000244: 22,2313           64717                           MXV*     PDDL*                                 #  M1XM2(COL 1) IN PD
016923,000245: 22,2314           00001                                    0,1                                   
016924,000246: 22,2315           77760                                    14D,2                                 
016925,000247: 22,2316           64723                           PDDL*    PDDL*                                 
016926,000248: 22,2317           77766                                    8D,2                                  
016927,000249: 22,2320           77774                                    2,2                                   
016928,000250: 22,2321           63666                           VDEF     MXV*                                  #  DEFINE VECTOR M2(COL 2)
016929,000251: 22,2322           00001                                    0,1                                   
016930,000252: 22,2323           64723                           PDDL*    PDDL*                                 #  M1XM2(COL2) IN PD
016931,000253: 22,2324           77756                                    16D,2                                 
016932,000254: 22,2325           77764                                    10D,2                                 
016933,000255: 22,2326           55523                           PDDL*    VDEF                                  #  DEFINE VECTOR M2(COL 3)
016934,000256: 22,2327           77772                                    4,2                                   
016935,000257: 22,2330           41517                           MXV*     PUSH                                  #  M1XM2(COL 3) IN PD
016936,000258: 22,2331           00001                                    0,1                                   
016937,000259: 22,2332           77650                           GOTO                                           
016938,000260: 22,2333           44343                                    TRNSPSPD                              #  REVERSE ROWS AND COLS IN PD AND
016939,000261: 
016940,000262:                                                                                                  #  RETURN WITH M1XM2 IN PD LIST
016941,000263: 22,2334           76601        TRANSPOS           SETPD    VLOAD*                                #  TRANSPOS TRANSPOSES A 3X3 MATRIX
016942,000264: 22,2335           00001                                    0                                     #        AND LEAVES RESULT IN PD LIST
016943,000265: 22,2336           00001                                    0,1                                   #  MATRIX ADDRESS IN XR1
016944,000266: 22,2337           62713                           PDVL*    PDVL*                                 
016945,000267: 22,2340           00007                                    6,1                                   
016946,000268: 22,2341           00015                                    12D,1                                 
016947,000269: 22,2342           77606                           PUSH                                           #  MATRIX IN PD
016948,000270: 22,2343           65345        TRNSPSPD           DLOAD    PDDL                                  #  ENTER WITH MATRIX IN PD LIST
016949,000271: 22,2344           00003                                    2                                     
016950,000272: 22,2345           00007                                    6                                     
016951,000273: 22,2346           14003                           STODL    2                                     
016952,000274: 22,2347           77626                           STADR                                          
016953,000275: 22,2350           63770                           STODL    6                                     
016954,000276: 22,2351           00005                                    4                                     
016955,000277: 22,2352           77725                           PDDL                                           
016956,000278: 22,2353           00015                                    12D                                   
016957,000279: 22,2354           14005                           STODL    4                                     
016958,000280: 22,2355           77626                           STADR                                          
016959,000281: 22,2356           63762                           STODL    12D                                   
016960,000282: 22,2357           00013                                    10D                                   
016961,000283: 22,2360           77725                           PDDL                                           
016962,000284: 22,2361           00017                                    14D                                   
016963,000285: 22,2362           14013                           STODL    10D                                   
016964,000286: 22,2363           77626                           STADR                                          
016965,000287: 22,2364           77760                           STORE    14D                                   
016966,000288: 22,2365           77616                           RVQ                                            #  RETURN WITH TRANSPOSED MATRIX IN PD LIST
016967,000289: 22,2366           00013        MINANG             DEC      .00069375                             
016968,000290: 22,2367           17071        MAXANG             DEC      .472222                               
016969,000291: 
016970,000292:                                                                                                  #  GIMBAL LOCK CONSTANTS
016971,000293: 
016972,000294:                                                                                                  #  D = MGA CORRESPONDING TO GIMBAL LOCK = 60 DEGREES
016973,000295:                                                                                                  #  NGL = BUFFER ANGLE (TO AVOID DIVISIONS BY ZERO) = 2 DEGREES
016974,000296: 
016975,000297: 22,2370           15667        SD                 DEC      .433015                               #  = SIN(D)                              $2
016976,000298: 22,2371           33555        K3S1               DEC      .86603                                #  = SIN(D)                              $1
016977,000299: 22,2372           67777        K4                 DEC      -.25                                  #  = -COS(D)                             $2
016978,000300: 22,2373           04000        K4SQ               DEC      .125                                  #  = COS(D)COS(D)                        $2
016979,000301: 22,2374           00217        SNGLCD             DEC      .008725                               #  = SIN(NGL)COS(D)                      $2
016980,000302: 22,2375           17773        CNGL               DEC      .499695                               #  = COS(NGL)                            $2
016981,000303: 22,2376           00004        READCDUK           INHINT                                         #  LOAD T(MPAC) WITH THE CURRENT CDU ANGLES
016982,000304: 22,2377           30034                           CA       CDUZ                                  
016983,000305: 22,2400           54156                           TS       MPAC       +2                         
016984,000306: 22,2401           00006                           EXTEND                                         
016985,000307: 22,2402           30033                           DCA      CDUX                                  
016986,000308: 22,2403           00003                           RELINT                                         
016987,000309: 22,2404           16445                           TCF      TLOAD      +6                         
016988,000310: 16,2000                                           BANK     16                                    
016989,000311: 22,2000                                           SETLOC   KALCMON2                              
016990,000312: 22,2000                                           BANK                                           
016991,000313: 
016992,000314: 22,2405                                           COUNT*   $$/KALC                               
016993,000315: 
016994,000316: 22,2405           66370        CDUTODCM           AXT,1    SSP                                   #  SUBROUTINE TO COMPUTE DIRECTION COSINE
016995,000317: 22,2406           00003                           OCT      3                                     #  MATRIX RELATING S/C AXES TO STABLE
016996,000318: 22,2407           00051                                    S1                                    #  MEMBER AXES FROM 3 CDU ANGLES IN T(MPAC)
016997,000319: 22,2410           00001                           OCT      1                                     #  SET XR1, S1 AND PD FOR LOOP
016998,000320: 22,2411           00010                           STORE    7                                     
016999,000321: 22,2412           77601                           SETPD                                          
017000,000322: 22,2413           00001                                    0                                     
017001,000323: 22,2414           47133        LOOPSIN            SLOAD*   RTB                                   
017002,000324: 22,2415           00013                                    10D,1                                 
017003,000325: 22,2416           45513                                    CDULOGIC                              
017004,000326: 22,2417           00013                           STORE    10D                                   #  LOAD PD WITH 0        SIN(PHI)
017005,000327: 22,2420           65356                           SIN      PDDL                                  #               2        COS(PHI)
017006,000328: 22,2421           00013                                    10D                                   #               4        SIN(THETA)
017007,000329: 22,2422           41546                           COS      PUSH                                  #               6        COS(THETA)
017008,000330: 22,2423           71300                           TIX,1    DLOAD                                 #               8        SIN(PSI)
017009,000331: 22,2424           44414                                    LOOPSIN                               #              10        COS(PSI)
017010,000332: 22,2425           00007                                    6                                     
017011,000333: 22,2426           72405                           DMP      SL1                                   
017012,000334: 22,2427           00013                                    10D                                   
017013,000335: 22,2430           10001                           STORE    0,2                                   
017014,000336: 22,2431           77745                           DLOAD                                          
017015,000337: 22,2432           00005                                    4                                     
017016,000338: 22,2433           65205                           DMP      PDDL                                  
017017,000339: 22,2434           00001                                    0                                     #  (PD6 SIN(THETA)SIN(PHI))
017018,000340: 22,2435           00007                                    6                                     
017019,000341: 22,2436           41205                           DMP      DMP                                   
017020,000342: 22,2437           00011                                    8D                                    
017021,000343: 22,2440           00003                                    2                                     
017022,000344: 22,2441           44352                           SL1      BDSU                                  
017023,000345: 22,2442           00015                                    12D                                   
017024,000346: 22,2443           77752                           SL1                                            
017025,000347: 22,2444           10003                           STORE    2,2                                   
017026,000348: 22,2445           77745                           DLOAD                                          
017027,000349: 22,2446           00003                                    2                                     
017028,000350: 22,2447           65205                           DMP      PDDL                                  #  (PD7 COS(PHI)SIN(THETA)) SCALED 4
017029,000351: 22,2450           00005                                    4                                     
017030,000352: 22,2451           00007                                    6                                     
017031,000353: 22,2452           41205                           DMP      DMP                                   
017032,000354: 22,2453           00011                                    8D                                    
017033,000355: 22,2454           00001                                    0                                     
017034,000356: 22,2455           77752                           SL1                                            
017035,000357: 22,2456           72415                           DAD      SL1                                   
017036,000358: 22,2457           00017                                    14D                                   
017037,000359: 22,2460           10005                           STORE    4,2                                   
017038,000360: 22,2461           77745                           DLOAD                                          
017039,000361: 22,2462           00011                                    8D                                    
017040,000362: 22,2463           10007                           STORE    6,2                                   
017041,000363: 22,2464           77745                           DLOAD                                          
017042,000364: 22,2465           00013                                    10D                                   
017043,000365: 22,2466           72405                           DMP      SL1                                   
017044,000366: 22,2467           00003                                    2                                     
017045,000367: 22,2470           10011                           STORE    8D,2                                  
017046,000368: 22,2471           77745                           DLOAD                                          
017047,000369: 22,2472           00013                                    10D                                   
017048,000370: 22,2473           57405                           DMP      DCOMP                                 
017049,000371: 22,2474           00001                                    0                                     
017050,000372: 22,2475           77752                           SL1                                            
017051,000373: 22,2476           10013                           STORE    10D,2                                 
017052,000374: 22,2477           77745                           DLOAD                                          
017053,000375: 22,2500           00005                                    4                                     
017054,000376: 22,2501           57405                           DMP      DCOMP                                 
017055,000377: 22,2502           00013                                    10D                                   
017056,000378: 22,2503           77752                           SL1                                            
017057,000379: 22,2504           10015                           STORE    12D,2                                 
017058,000380: 22,2505           77745                           DLOAD                                          
017059,000381: 22,2506           72405                           DMP      SL1                                   #  (PUSH UP 7)
017060,000382: 22,2507           00011                                    8D                                    
017061,000383: 22,2510           41325                           PDDL     DMP                                   #  (PD7 COS(PHI)SIN(THETA)SIN(PSI)) SCALE 4
017062,000384: 22,2511           00007                                    6                                     
017063,000385: 22,2512           00001                                    0                                     
017064,000386: 22,2513           72415                           DAD      SL1                                   #  (PUSH UP 7)
017065,000387: 22,2514           77626                           STADR                                          #  C7=COS(PHI)SIN(THETA)SIN(PSI)
017066,000388: 22,2515           67760                           STORE    14D,2                                 
017067,000389: 22,2516           77745                           DLOAD                                          
017068,000390: 22,2517           72405                           DMP      SL1                                   #  (PUSH UP 6)
017069,000391: 22,2520           00011                                    8D                                    
017070,000392: 22,2521           41325                           PDDL     DMP                                   #  (PD6 SIN(THETA)SIN(PHI)SIN(PSI)) SCALE 4
017071,000393: 22,2522           00007                                    6                                     
017072,000394: 22,2523           00003                                    2                                     
017073,000395: 22,2524           72425                           DSU      SL1                                   #  (PUSH UP 6)
017074,000396: 22,2525           77626                           STADR                                          
017075,000397: 22,2526           67756                           STORE    16D,2                                 #  C8=-SIN(THETA)SIN(PHI)SIN(PSI)
017076,000398: 22,2527           77616                           RVQ                                            #     +COS(THETA)COS(PHI)
017077,000399: 22,2530                        ENDDCM             EQUALS                                         
017078,000400: 
017079,000401: 15,2000                                           BANK     15                                    
017080,000402: 22,2000                                           SETLOC   KALCMON1                              
017081,000403: 22,2000                                           BANK                                           
017082,000404: 
017083,000405:                                                                                                  #  CALCULATION OF THE MATRIX DEL......
017084,000406: 
017085,000407:                                                                                                  #        *      *               --T           *
017086,000408:                                                                                                  #        DEL = (IDMATRIX)COS(A)+UU (1-COS(A))+UX SIN(A)          SCALED 1
017087,000409: 
017088,000410:                                                                                                  #              -
017089,000411:                                                                                                  #        WHERE U IS A UNIT VECTOR (DP SCALED 2) ALONG THE AXIS OF ROTATION.
017090,000412:                                                                                                  #        A IS THE ANGLE OF ROTATION (DP SCALED 2)
017091,000413:                                                                                                  #                                           -
017092,000414:                                                                                                  #        UPON ENTRY THE STARTING ADDRESS OF U IS COF, AND A IS IN MPAC
017093,000415: 
017094,000416: 22,2530                                           COUNT    22/KALC                               
017095,000417: 
017096,000418: 22,2530           41401        DELCOMP            SETPD    PUSH                                  #  MPAC CONTAINS THE ANGLE A
017097,000419: 22,2531           00001                                    0                                     
017098,000420: 22,2532           65356                           SIN      PDDL                                  #  PD0 = SIN(A)
017099,000421: 22,2533           41546                           COS      PUSH                                  #  PD2 = COS(A)
017100,000422: 22,2534           65302                           SR2      PDDL                                  #  PD2 = COS(A)                          $8
017101,000423: 22,2535           41021                           BDSU     BOVB                                  #  PD4 = 1-COS(A)                        $2
017102,000424: 22,2536           15332                                    DPHALF                                
017103,000425: 22,2537           45712                                    SIGNMPAC                              
017104,000426: 
017105,000427:                                                                                                  #  COMPUTE THE DIAGONAL COMPONENTS OF DEL
017106,000428: 
017107,000429: 22,2540           77725                           PDDL                                           
017108,000430: 22,2541           03343                                    COF                                   
017109,000431: 22,2542           41316                           DSQ      DMP                                   
017110,000432: 22,2543           00005                                    4                                     
017111,000433: 22,2544           52415                           DAD      SL3                                   
017112,000434: 22,2545           00003                                    2                                     
017113,000435: 22,2546           77604                           BOVB                                           
017114,000436: 22,2547           45712                                    SIGNMPAC                              
017115,000437: 22,2550           17426                           STODL    DEL                                   #  UX UX(U-COS(A)) +COS(A)               $1
017116,000438: 22,2551           03345                                    COF        +2                         
017117,000439: 22,2552           41316                           DSQ      DMP                                   
017118,000440: 22,2553           00005                                    4                                     
017119,000441: 22,2554           52415                           DAD      SL3                                   
017120,000442: 22,2555           00003                                    2                                     
017121,000443: 22,2556           77604                           BOVB                                           
017122,000444: 22,2557           45712                                    SIGNMPAC                              
017123,000445: 22,2560           17436                           STODL    DEL        +8D                        #  UY UY(1-COS(A)) +COS(A)               $1
017124,000446: 22,2561           03347                                    COF        +4                         
017125,000447: 22,2562           41316                           DSQ      DMP                                   
017126,000448: 22,2563           00005                                    4                                     
017127,000449: 22,2564           52415                           DAD      SL3                                   
017128,000450: 22,2565           00003                                    2                                     
017129,000451: 22,2566           77604                           BOVB                                           
017130,000452: 22,2567           45712                                    SIGNMPAC                              
017131,000453: 22,2570           03446                           STORE    DEL        +16D                       #  UZ UZ(1-COS(A)) +COS(A)               $1
017132,000454: 
017133,000455:                                                                                                  #  COMPUTE THE OFF DIAGONAL TERMS OF DEL
017134,000456: 
017135,000457: 22,2571           41345                           DLOAD    DMP                                   
017136,000458: 22,2572           03343                                    COF                                   
017137,000459: 22,2573           03345                                    COF        +2                         
017138,000460: 22,2574           72405                           DMP      SL1                                   
017139,000461: 22,2575           00005                                    4                                     
017140,000462: 22,2576           41325                           PDDL     DMP                                   #  D6    UX UY (1-COS A)                 $ 4
017141,000463: 22,2577           03347                                    COF        +4                         
017142,000464: 22,2600           00001                                    0                                     
017143,000465: 22,2601           43206                           PUSH     DAD                                   #  D8    UZ SIN A                        $ 4
017144,000466: 22,2602           00007                                    6                                     
017145,000467: 22,2603           41112                           SL2      BOVB                                  
017146,000468: 22,2604           45712                                    SIGNMPAC                              
017147,000469: 22,2605           17434                           STODL    DEL        +6                         
017148,000470: 22,2606           62421                           BDSU     SL2                                   
017149,000471: 22,2607           77604                           BOVB                                           
017150,000472: 22,2610           45712                                    SIGNMPAC                              
017151,000473: 22,2611           17430                           STODL    DEL        +2                         
017152,000474: 22,2612           03343                                    COF                                   
017153,000475: 22,2613           41205                           DMP      DMP                                   
017154,000476: 22,2614           03347                                    COF        +4                         
017155,000477: 22,2615           00005                                    4                                     
017156,000478: 22,2616           65352                           SL1      PDDL                                  #  D6    UX UZ (1-COS A )                $ 4
017157,000479: 22,2617           03345                                    COF        +2                         
017158,000480: 22,2620           41405                           DMP      PUSH                                  #  D8    UY SIN(A)
017159,000481: 22,2621           00001                                    0                                     
017160,000482: 22,2622           62415                           DAD      SL2                                   
017161,000483: 22,2623           00007                                    6                                     
017162,000484: 22,2624           77604                           BOVB                                           
017163,000485: 22,2625           45712                                    SIGNMPAC                              
017164,000486: 22,2626           17432                           STODL    DEL        +4                         #  UX UZ (1-COS(A))+UY SIN(A)
017165,000487: 22,2627           62421                           BDSU     SL2                                   
017166,000488: 22,2630           77604                           BOVB                                           
017167,000489: 22,2631           45712                                    SIGNMPAC                              
017168,000490: 22,2632           17442                           STODL    DEL        +12D                       #  UX UZ (U-COS(A))-UY SIN(A)
017169,000491: 22,2633           03345                                    COF        +2                         
017170,000492: 22,2634           41205                           DMP      DMP                                   
017171,000493: 22,2635           03347                                    COF        +4                         
017172,000494: 22,2636           00005                                    4                                     
017173,000495: 22,2637           65352                           SL1      PDDL                                  #  D6    UY UZ (1-COS(A))                $ 4
017174,000496: 22,2640           03343                                    COF                                   
017175,000497: 22,2641           41405                           DMP      PUSH                                  #  D8    UX SIN(A)
017176,000498: 22,2642           00001                                    0                                     
017177,000499: 22,2643           62415                           DAD      SL2                                   
017178,000500: 22,2644           00007                                    6                                     
017179,000501: 22,2645           77604                           BOVB                                           
017180,000502: 22,2646           45712                                    SIGNMPAC                              
017181,000503: 22,2647           17444                           STODL    DEL        +14D                       #  UY UZ(1-COS(A)) +UX SIN(A)
017182,000504: 22,2650           62421                           BDSU     SL2                                   
017183,000505: 22,2651           77604                           BOVB                                           
017184,000506: 22,2652           45712                                    SIGNMPAC                              
017185,000507: 22,2653           03440                           STORE    DEL        +10D                       #  UY UZ(1-COS(A)) -UX SIN(A)
017186,000508: 22,2654           77616                           RVQ                                            
017187,000509: 
017188,000510:                                                                                                  #  DIRECTION COSINE MATRIX TO CDU ANGLE ROUTINE
017189,000511:                                                                                                  #  X1 CONTAINS THE COMPLEMENT OF THE STARTING ADDRESS FOR MATRIX (SCALED 2)
017190,000512:                                                                                                  #  LEAVES CDU ANGLES SCALED 2PI IN V(MPAC)
017191,000513:                                                                                                  #  COS(MGA) WILL BE LEFT IN S1 (SCALED 1)
017192,000514: 
017193,000515:                                                                                                  #  THE DIRECTION COSINE MATRIX RELATING S/C AXES TO STABLE MEMBER AXES CAN BE WRITTEN AS ***
017194,000516: 
017195,000517:                                                                                                  #        C =COS(THETA)COS(PSI)
017196,000518:                                                                                                  #         0
017197,000519: 
017198,000520:                                                                                                  #        C =-COS(THETA)SIN(PSI)COS(PHI)+SI (THETA)SIN(PHI)
017199,000521:                                                                                                  #         1
017200,000522: 
017201,000523:                                                                                                  #        C =COS(THETA)SIN(PSI)SIN(PHI)+S N(THETA)COS(PHI)
017202,000524:                                                                                                  #         2
017203,000525: 
017204,000526:                                                                                                  #        C =SIN(PSI)
017205,000527:                                                                                                  #         3
017206,000528: 
017207,000529:                                                                                                  #        C =COS(PSI)COS(PHI)
017208,000530:                                                                                                  #         4
017209,000531: 
017210,000532:                                                                                                  #        C =-COS(PSI)SIN(PHI)
017211,000533:                                                                                                  #         5
017212,000534: 
017213,000535:                                                                                                  #        C =-SIN(THETA)COS(PSI)
017214,000536:                                                                                                  #         6
017215,000537: 
017216,000538:                                                                                                  #        C =SIN(THETA)SIN(PSI)COS(PHI)+COS THETA)SIN(PHI)
017217,000539:                                                                                                  #         7
017218,000540:                                                                                                  #        C =-SIN(THETA)SIN(PSI)SIN(PHI)+CO (THETA)COS(PHI)
017219,000541:                                                                                                  #         8
017220,000542: 
017221,000543:                                                                                                  #        WHERE   PHI = OGA
017222,000544:                                                                                                  #                THETA = IGA
017223,000545:                                                                                                  #                PSI = MGA
017224,000546: 
017225,000547: 22,2655           67543        DCMTOCDU           DLOAD*   ARCSIN                                
017226,000548: 22,2656           00007                                    6,1                                   
017227,000549: 22,2657           71406                           PUSH     COS                                   #  PD +0         PSI
017228,000550: 22,2660           41152                           SL1      BOVB                                  
017229,000551: 22,2661           45712                                    SIGNMPAC                              
017230,000552: 22,2662           00051                           STORE    S1                                    
017231,000553: 22,2663           57543                           DLOAD*   DCOMP                                 
017232,000554: 22,2664           00015                                    12D,1                                 
017233,000555: 22,2665           67471                           DDV      ARCSIN                                
017234,000556: 22,2666           00051                                    S1                                    
017235,000557: 22,2667           51123                           PDDL*    BPL                                   #  PD +2         THETA
017236,000558: 22,2670           00001                                    0,1                                   #  MUST CHECK THE SIGN OF COS(THETA)
017237,000559: 22,2671           44703                                    OKTHETA                               #  TO DETERMINE THE PROPER QUADRANT
017238,000560: 22,2672           57545                           DLOAD    DCOMP                                 
017239,000561: 22,2673           43244                           BPL      DAD                                   
017240,000562: 22,2674           44700                                    SUHALFA                               
017241,000563: 22,2675           15332                                    DPHALF                                
017242,000564: 22,2676           77650                           GOTO                                           
017243,000565: 22,2677           44702                                    CALCPHI                               
017244,000566: 22,2700           77625        SUHALFA            DSU                                            
017245,000567: 22,2701           15332                                    DPHALF                                
017246,000568: 22,2702           77606        CALCPHI            PUSH                                           
017247,000569: 22,2703           57543        OKTHETA            DLOAD*   DCOMP                                 
017248,000570: 22,2704           00013                                    10D,1                                 
017249,000571: 22,2705           67471                           DDV      ARCSIN                                
017250,000572: 22,2706           00051                                    S1                                    
017251,000573: 22,2707           51123                           PDDL*    BPL                                   #  PUSH DOWN PHI
017252,000574: 22,2710           00011                                    8D,1                                  
017253,000575: 22,2711           44723                                    OKPHI                                 
017254,000576: 22,2712           57545                           DLOAD    DCOMP                                 #  PUSH UP PHI
017255,000577: 22,2713           43244                           BPL      DAD                                   
017256,000578: 22,2714           44720                                    SUHALFAP                              
017257,000579: 22,2715           15332                                    DPHALF                                
017258,000580: 22,2716           77650                           GOTO                                           
017259,000581: 22,2717           44724                                    VECOFANG                              
017260,000582: 22,2720           52025        SUHALFAP           DSU      GOTO                                  
017261,000583: 22,2721           15332                                    DPHALF                                
017262,000584: 22,2722           44724                                    VECOFANG                              
017263,000585: 22,2723           77745        OKPHI              DLOAD                                          #  PUSH UP PHI
017264,000586: 22,2724           43466        VECOFANG           VDEF     RVQ                                   
017265,000587: 
017266,000588:                                                                                                  #  ROUTINE FOR TERMINATING AUTOMATIC MANEUVERS
017267,000589: 
017268,000590: 22,2725           00004        NOGOM2             INHINT                                         #  THIS LOCATION ACCESSED BY A BZMF NOGO -2
017269,000591: 22,2726           04676                           TC       BANKCALL                              
017270,000592: 22,2727           40155                           CADR     ZEROEROR                              
017271,000593: 
017272,000594: 22,2730           00004        NOGO               INHINT                                         
017273,000595: 22,2731           04526                           TC       STOPRATE                              
017274,000596: 
017275,000597:                                                                                                  #  TERMINATE MANEUVER
017276,000598: 22,2732           35032                           CAF      TWO                                   #  NOTE - ALL RETURNS ARE NOW MADE VIA
017277,000599: 22,2733           05261                           TC       WAITLIST                              #  GOODEND
017278,000600: 22,2734  E6,1661                                  EBANK=   BCDU                                  
017279,000601: 22,2734           02020 42066                     2CADR    ENDMANU                               
017280,000602: 
017281,000603: 22,2736           15233                           TCF      ENDOFJOB                              
017282,000604: 

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