Source Code

These source-code files were obtained by digitally photographing an Artemis 72 (Apollo 15-17 Command Module) program listing from a private collection and then modifying pre-existing Comanche 55 (Apollo 11) source files to incorporate changes. Photography was by Ron Burkey, and transcription was performed by a team of volunteers. Note that the page images presented online are of reduced quality, and that additional images may be available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP: ASSEMBLE REVISION 072 OF AGC PROGRAM ARTEMIS 
	BY NASA 2021114-011 11:40 FEB. 26, 1971
Note that the date is the date of the printout, not the date of the program revision.

017876,000002:                                                                                                  ## Copyright:   Public domain.
017877,000003:                                                                                                  ## Filename:    ANGLFIND.agc
017878,000004:                                                                                                  ## Purpose:     Part of the source code for Artemis (i.e., Colossus 3),
017879,000005:                                                                                                  ##              build 072.  This is for the Command Module's (CM) 
017880,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for 
017881,000007:                                                                                                  ##              Apollo 15-17.
017882,000008:                                                                                                  ## Assembler:   yaYUL
017883,000009:                                                                                                  ## Contact:     Sergio Navarro <sergionavarrog@gmail.com>
017884,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
017885,000011:                                                                                                  ## Page Scans:  www.ibiblio.org/apollo/ScansForConversion/Artemis072/
017886,000012:                                                                                                  ## Mod history: 2009-08-19 SN   Adapted from corresponding Comanche 055 file.
017887,000013:                                                                                                  ##              2009-09-04 JL   Fixed page number comment. Fixed bad octal number in NOGO. 
017888,000014:                                                                                                  ##                              Fixed typos. Added missing code at end.
017889,000015:                                                                                                  ##              2010-02-20 RSB  Un-##'d this header.
017890,000016:                                                                                                  ##              2017-01-21 RSB  Proofed comment text by diff'ing vs Comanche 55
017891,000017:                                                                                                  ##                              and corrected errors found.
017892,000018: 

Page 403

017894,000020: 22,2000                                           SETLOC   KALCMON1                              
017895,000021: 22,2000                                           BANK                                           
017896,000022: 
017897,000023: 22,2000  E6,1661                                  EBANK=   BCDU                                  
017898,000024: 
017899,000025: 22,2000                                           COUNT*   $$/KALC                               
017900,000026: 22,2000           06006        KALCMAN3           TC       INTPRET                               
017901,000027: 22,2001           77634                 +1        RTB                                            
017902,000028: 22,2002           44370                                    READCDUK                              #  PICK UP CURRENT CDU ANGLES
017903,000029: 22,2003           03262                           STORE    BCDU                                  #  STORE THE INITIAL S/C ANGLES
017904,000030: 22,2004           72364                           AXC,2    TLOAD                                 #  COMPUTE THE TRANSFORMATION FROM
017905,000031: 22,2005           03320                                    MIS                                   #  INITIAL S/C AXES TO STABLE MEMBER AXES
017906,000032: 22,2006           03262                                    BCDU                                  #  (MIS)
017907,000033: 22,2007           77624                           CALL                                           
017908,000034: 22,2010           44377                                    CDUTODCM                              
017909,000035: 22,2011           72364                           AXC,2    TLOAD                                 #  COMPUTE THE TRANSFORMATION FROM
017910,000036: 22,2012           03425                                    MFS                                   #  FINAL S/C AXES TO STABLE MEMBER AXES
017911,000037: 22,2013           01310                                    CPHI                                  #  (MFS)
017912,000038: 22,2014           77624                           CALL                                           
017913,000039: 22,2015           44377                                    CDUTODCM                              
017914,000040: 22,2016           45160        SECAD              AXC,1    CALL                                  #  MIS AND MFS ARRAYS CALCULATED         $2
017915,000041: 22,2017           03320                                    MIS                                   
017916,000042: 22,2020           44334                                    TRANSPOS                              
017917,000043: 22,2021           77775                           VLOAD                                          
017918,000044: 22,2022           77626                           STADR                                          
017919,000045: 22,2023           50474                           STOVL    TMIS       +12D                       
017920,000046: 22,2024           77626                           STADR                                          
017921,000047: 22,2025           50502                           STOVL    TMIS       +6                         
017922,000048: 22,2026           77626                           STADR                                          
017923,000049: 22,2027           74510                           STORE    TMIS                                  #  TMIS = TRANSPOSE(MIS) SCALED BY 2
017924,000050: 22,2030           75160                           AXC,1    AXC,2                                 
017925,000051: 22,2031           03266                                    TMIS                                  
017926,000052: 22,2032           03425                                    MFS                                   
017927,000053: 22,2033           77624                           CALL                                           
017928,000054: 22,2034           44304                                    MXM3                                  
017929,000055: 22,2035           45575                           VLOAD    STADR                                 
017930,000056: 22,2036           50335                           STOVL    MFI        +12D                       
017931,000057: 22,2037           77626                           STADR                                          
017932,000058: 22,2040           50343                           STOVL    MFI        +6                         
017933,000059: 22,2041           77626                           STADR                                          
017934,000060: 22,2042           74351                           STORE    MFI                                   #  MFI = TMIS MFS (SCALED BY 4)
017935,000061: 22,2043           45001                           SETPD    CALL                                  #  TRANSPOSE MFI IN PD LIST
017936,000062: 22,2044           00023                                    18D                                   
017937,000063: 22,2045           44343                                    TRNSPSPD                              
017938,000064: 22,2046           45575                           VLOAD    STADR                                 
017939,000065: 22,2047           50474                           STOVL    TMFI       +12D                       
017940,000066: 22,2050           77626                           STADR                                          
017941,000067: 22,2051           50502                           STOVL    TMFI       +6                         
017942,000068: 22,2052           77626                           STADR                                          
017943,000069: 22,2053           74510                           STORE    TMFI                                  #  TMFI = TRANSPOSE (MFI) SCALED BY 4

Page 404

017945,000071: 
017946,000072:                                                                                                  #  CALCULATE COFSKEW AND MFISYM
017947,000073: 
017948,000074: 22,2054           45345                           DLOAD    DSU                                   
017949,000075: 22,2055           03271                                    TMFI       +2                         
017950,000076: 22,2056           03430                                    MFI        +2                         
017951,000077: 22,2057           45325                           PDDL     DSU                                   #  CALCULATE COF SCALED BY 2/SIN(AM)
017952,000078: 22,2060           03432                                    MFI        +4                         
017953,000079: 22,2061           03273                                    TMFI       +4                         
017954,000080: 22,2062           45325                           PDDL     DSU                                   
017955,000081: 22,2063           03301                                    TMFI       +10D                       
017956,000082: 22,2064           03440                                    MFI        +10D                       
017957,000083: 22,2065           77666                           VDEF                                           
017958,000084: 22,2066           03311                           STORE    COFSKEW                               #  EQUALS MFISKEW
017959,000085: 
017960,000086:                                                                                                  #  CALCULATE AM AND PROCEED ACCORDING TO ITS MAGNITUDE
017961,000087: 
017962,000088: 22,2067           43345                           DLOAD    DAD                                   
017963,000089: 22,2070           03426                                    MFI                                   
017964,000090: 22,2071           03446                                    MFI        +16D                       
017965,000091: 22,2072           43225                           DSU      DAD                                   
017966,000092: 22,2073           15326                                    DP1/4TH                               
017967,000093: 22,2074           03436                                    MFI        +8D                        
017968,000094: 22,2075           03317                           STORE    CAM                                   #  CAM = (MFI0+MFI4+MFI8-1)/2 HALF SCALE
017969,000095: 22,2076           77726                           ARCCOS                                         
017970,000096: 22,2077           03365                           STORE    AM                                    #  AM=ARCCOS(CAM)  (AM SCALED BY 2)
017971,000097: 22,2100           51025                           DSU      BPL                                   
017972,000098: 22,2101           04367                                    MINANG                                
017973,000099: 22,2102           44111                                    CHECKMAX                              
017974,000100: 22,2103           77776                           EXIT                                           #  MANEUVER LESS THAN 0.25 DEG
017975,000101: 22,2104           00004                           INHINT                                         #  GO DIRECTLY INTO ATTITUDE HOLD
017976,000102: 22,2105           44770                           CS       ONE                                   #  ABOUT COMMANDED ANGLES
017977,000103: 22,2106           55340                           TS       HOLDFLAG                              #  NOGO WILL STOP ANY RATE AND SET UP FOR A
017978,000104: 22,2107           03163                           TC       LOADCDUD                              #  GOOD RETURN
017979,000105: 22,2110           12723                           TCF      NOGO                                  
017980,000106: 
017981,000107: 22,2111           45345        CHECKMAX           DLOAD    DSU                                   
017982,000108: 22,2112           03365                                    AM                                    
017983,000109: 22,2113           04370                                    MAXANG                                
017984,000110: 22,2114           77244                           BPL      VLOAD                                 
017985,000111: 22,2115           44123                                    ALTCALC                               #  UNIT
017986,000112: 22,2116           03311                                    COFSKEW                               #  COFSKEW
017987,000113: 22,2117           77656                           UNIT                                           
017988,000114: 22,2120           03343                           STORE    COF                                   #  COF IS THE MANEUVER AXIS
017989,000115: 22,2121           77650                           GOTO                                           #  SEE IF MANEUVER GOES THRU GIMBAL LOCK
017990,000116: 22,2122           44745                                    LOCSKIRT                              
017991,000117: 22,2123           53375        ALTCALC            VLOAD    VAD                                   #  IF AM GREATER THAN 170 DEGREES
017992,000118: 22,2124           03426                                    MFI                                   
017993,000119: 22,2125           03267                                    TMFI                                  
017994,000120: 22,2126           77762                           VSR1                                           

Page 405

017996,000122: 22,2127           27267                           STOVL    MFISYM                                
017997,000123: 22,2130           03434                                    MFI        +6                         
017998,000124: 22,2131           74455                           VAD      VSR1                                  
017999,000125: 22,2132           03275                                    TMFI       +6                         
018000,000126: 22,2133           27275                           STOVL    MFISYM     +6                         
018001,000127: 22,2134           03442                                    MFI        +12D                       
018002,000128: 22,2135           74455                           VAD      VSR1                                  
018003,000129: 22,2136           03303                                    TMFI       +12D                       
018004,000130: 22,2137           03303                           STORE    MFISYM     +12D                       #  MFISYM=(MFI+TMFI)/2   SCALED BY 4
018005,000131: 
018006,000132: 
018007,000133:                                                                                                  #  CALCULATE COF
018008,000134: 
018009,000135: 22,2140           70545                           DLOAD    SR1                                   
018010,000136: 22,2141           03317                                    CAM                                   
018011,000137: 22,2142           45325                           PDDL     DSU                                   #  PD0 CAM                              $4
018012,000138: 22,2143           15334                                    DPHALF                                
018013,000139: 22,2144           03317                                    CAM                                   
018014,000140: 22,2145           65204                           BOVB     PDDL                                  #  PD2 1 - CAM                          $2
018015,000141: 22,2146           45761                                    SIGNMPAC                              
018016,000142: 22,2147           03307                                    MFISYM     +16D                       
018017,000143: 22,2150           56225                           DSU      DDV                                   
018018,000144: 22,2151           00001                                    0                                     
018019,000145: 22,2152           00003                                    2                                     
018020,000146: 22,2153           65366                           SQRT     PDDL                                  #  COFZ = SQRT(MFISYM8-CAM)/1-CAM)
018021,000147: 22,2154           03277                                    MFISYM     +8D                        #                                 $ ROOT 2
018022,000148: 22,2155           56225                           DSU      DDV                                   
018023,000149: 22,2156           00001                                    0                                     
018024,000150: 22,2157           00003                                    2                                     
018025,000151: 22,2160           65366                           SQRT     PDDL                                  #  COFY = SQRT(MFISYM4-CAM)/(1-CAM)  $ROOT2
018026,000152: 22,2161           03267                                    MFISYM                                
018027,000153: 22,2162           56225                           DSU      DDV                                   
018028,000154: 22,2163           00001                                    0                                     
018029,000155: 22,2164           00003                                    2                                     
018030,000156: 22,2165           55566                           SQRT     VDEF                                  #  COFX = SQRT(MFISYM-CAM)/(1-CAM)  $ROOT 2
018031,000157: 22,2166           77656                           UNIT                                           
018032,000158: 22,2167           03343                           STORE    COF                                   
018033,000159: 
018034,000160:                                                                                                  #  DETERMINE LARGEST COF AND ADJUST ACCORDINGLY
018035,000161: 
018036,000162: 22,2170           45345        COFMAXGO           DLOAD    DSU                                   
018037,000163: 22,2171           03343                                    COF                                   
018038,000164: 22,2172           03345                                    COF        +2                         
018039,000165: 22,2173           71240                           BMN      DLOAD                                 #  COFY G COFX
018040,000166: 22,2174           44203                                    COMP12                                
018041,000167: 22,2175           03343                                    COF                                   
018042,000168: 22,2176           50025                           DSU      BMN                                   
018043,000169: 22,2177           03347                                    COF        +4                         
018044,000170: 22,2200           44260                                    METHOD3                               #  COFZ G COFX OR COFY
018045,000171: 22,2201           77650                           GOTO                                           

Page 406

018047,000173: 22,2202           44234                                    METHOD1                               #  COFX G COFY OR COFZ
018048,000174: 22,2203           45345        COMP12             DLOAD    DSU                                   
018049,000175: 22,2204           03345                                    COF        +2                         
018050,000176: 22,2205           03347                                    COF        +4                         
018051,000177: 22,2206           77640                           BMN                                            
018052,000178: 22,2207           44260                                    METHOD3                               #  COFZ G COFY OR COFX
018053,000179: 
018054,000180: 22,2210           51145        METHOD2            DLOAD    BPL                                   #  COFY MAX
018055,000181: 22,2211           03313                                    COFSKEW    +2                         #  UY
018056,000182: 22,2212           44216                                    U2POS                                 
018057,000183: 22,2213           57575                           VLOAD    VCOMP                                 
018058,000184: 22,2214           03343                                    COF                                   
018059,000185: 22,2215           03343                           STORE    COF                                   
018060,000186: 22,2216           51145        U2POS              DLOAD    BPL                                   
018061,000187: 22,2217           03271                                    MFISYM     +2                         #  UX UY
018062,000188: 22,2220           44224                                    OKU21                                 
018063,000189: 22,2221           57545                           DLOAD    DCOMP                                 #  SIGN OF UX OPPOSITE TO UY
018064,000190: 22,2222           03343                                    COF                                   
018065,000191: 22,2223           03343                           STORE    COF                                   
018066,000192: 22,2224           51145        OKU21              DLOAD    BPL                                   
018067,000193: 22,2225           03301                                    MFISYM     +10D                       #  UY UZ
018068,000194: 22,2226           44745                                    LOCSKIRT                              
018069,000195: 22,2227           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
018070,000196: 22,2230           03347                                    COF        +4                         
018071,000197: 22,2231           03347                           STORE    COF        +4                         
018072,000198: 22,2232           77650                           GOTO                                           
018073,000199: 22,2233           44745                                    LOCSKIRT                              
018074,000200: 22,2234           51145        METHOD1            DLOAD    BPL                                   #  COFX MAX
018075,000201: 22,2235           03311                                    COFSKEW                               #  UX
018076,000202: 22,2236           44242                                    U1POS                                 
018077,000203: 22,2237           57575                           VLOAD    VCOMP                                 
018078,000204: 22,2240           03343                                    COF                                   
018079,000205: 22,2241           03343                           STORE    COF                                   
018080,000206: 22,2242           51145        U1POS              DLOAD    BPL                                   
018081,000207: 22,2243           03271                                    MFISYM     +2                         #  UX UY
018082,000208: 22,2244           44250                                    OKU12                                 
018083,000209: 22,2245           57545                           DLOAD    DCOMP                                 
018084,000210: 22,2246           03345                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UX
018085,000211: 22,2247           03345                           STORE    COF        +2                         
018086,000212: 22,2250           51145        OKU12              DLOAD    BPL                                   
018087,000213: 22,2251           03273                                    MFISYM     +4                         #  UX UZ
018088,000214: 22,2252           44745                                    LOCSKIRT                              
018089,000215: 22,2253           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
018090,000216: 22,2254           03347                                    COF        +4                         
018091,000217: 22,2255           03347                           STORE    COF        +4                         
018092,000218: 22,2256           77650                           GOTO                                           
018093,000219: 22,2257           44745                                    LOCSKIRT                              
018094,000220: 22,2260           51145        METHOD3            DLOAD    BPL                                   #  COFZ MAX
018095,000221: 22,2261           03315                                    COFSKEW    +4                         #  UZ
018096,000222: 22,2262           44266                                    U3POS                                 

Page 407

018098,000224: 22,2263           57575                           VLOAD    VCOMP                                 
018099,000225: 22,2264           03343                                    COF                                   
018100,000226: 22,2265           03343                           STORE    COF                                   
018101,000227: 22,2266           51145        U3POS              DLOAD    BPL                                   
018102,000228: 22,2267           03273                                    MFISYM     +4                         #  UX UZ
018103,000229: 22,2270           44274                                    OKU31                                 
018104,000230: 22,2271           57545                           DLOAD    DCOMP                                 
018105,000231: 22,2272           03343                                    COF                                   #  SIGN OF UX OPPOSITE TO UZ
018106,000232: 22,2273           03343                           STORE    COF                                   
018107,000233: 22,2274           51145        OKU31              DLOAD    BPL                                   
018108,000234: 22,2275           03301                                    MFISYM     +10D                       #  UY UZ
018109,000235: 22,2276           44745                                    LOCSKIRT                              
018110,000236: 22,2277           57545                           DLOAD    DCOMP                                 
018111,000237: 22,2300           03345                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UZ
018112,000238: 22,2301           03345                           STORE    COF        +2                         
018113,000239: 22,2302           77650                           GOTO                                           
018114,000240: 22,2303           44745                                    LOCSKIRT                              
018115,000241: 

Page 408

018117,000243:                                                                                                  #  MATRIX OPERATIONS
018118,000244: 
018119,000245: 22,2304           77601        MXM3               SETPD                                          #  MXM3 MULTIPLIES 2 3X3 MATRICES
018120,000246: 22,2305           00001                                    0                                     #  AND LEAVES RESULT IN PD LIST
018121,000247: 22,2306           64743                           DLOAD*   PDDL*                                 #  ADDRESS OF 1ST MATRIX IN XR1
018122,000248: 22,2307           77762                                    12D,2                                 #  ADDRESS OF 2ND MATRIX IN XR2
018123,000249: 22,2310           77770                                    6,2                                   
018124,000250: 22,2311           55523                           PDDL*    VDEF                                  #  DEFINE VECTOR M2(COL 1)
018125,000251: 22,2312           77776                                    0,2                                   
018126,000252: 22,2313           64717                           MXV*     PDDL*                                 #  M1XM2(COL 1) IN PD
018127,000253: 22,2314           00001                                    0,1                                   
018128,000254: 22,2315           77760                                    14D,2                                 
018129,000255: 22,2316           64723                           PDDL*    PDDL*                                 
018130,000256: 22,2317           77766                                    8D,2                                  
018131,000257: 22,2320           77774                                    2,2                                   
018132,000258: 22,2321           63666                           VDEF     MXV*                                  #  DEFINE VECTOR M2(COL 2)
018133,000259: 22,2322           00001                                    0,1                                   
018134,000260: 22,2323           64723                           PDDL*    PDDL*                                 #  M1XM2(COL2) IN PD
018135,000261: 22,2324           77756                                    16D,2                                 
018136,000262: 22,2325           77764                                    10D,2                                 
018137,000263: 22,2326           55523                           PDDL*    VDEF                                  #  DEFINE VECTOR M2(COL 3)
018138,000264: 22,2327           77772                                    4,2                                   
018139,000265: 22,2330           41517                           MXV*     PUSH                                  #  M1XM2(COL 3) IN PD
018140,000266: 22,2331           00001                                    0,1                                   
018141,000267: 22,2332           77650                           GOTO                                           
018142,000268: 22,2333           44343                                    TRNSPSPD                              #  REVERSE ROWS AND COLS IN PD AND
018143,000269:                                                                                                  #                                        RETURN WITH M1XM2 IN PD LIST
018144,000270: 
018145,000271: 22,2334           76601        TRANSPOS           SETPD    VLOAD*                                #  TRANSPOS TRANSPOSES A 3X3 MATRIX
018146,000272: 22,2335           00001                                    0                                     #   AND LEAVES RESULT IN PD LIST
018147,000273: 22,2336           00001                                    0,1                                   #  MATRIX ADDRESS IN XR1
018148,000274: 22,2337           62713                           PDVL*    PDVL*                                 
018149,000275: 22,2340           00007                                    6,1                                   
018150,000276: 22,2341           00015                                    12D,1                                 
018151,000277: 22,2342           77606                           PUSH                                           #  MATRIX IN PD
018152,000278: 22,2343           65345        TRNSPSPD           DLOAD    PDDL                                  #  ENTER WITH MATRIX IN PD LIST
018153,000279: 22,2344           00003                                    2                                     
018154,000280: 22,2345           00007                                    6                                     
018155,000281: 22,2346           14003                           STODL    2                                     
018156,000282: 22,2347           77626                           STADR                                          
018157,000283: 22,2350           63770                           STODL    6                                     
018158,000284: 22,2351           00005                                    4                                     
018159,000285: 22,2352           77725                           PDDL                                           
018160,000286: 22,2353           00015                                    12D                                   
018161,000287: 22,2354           14005                           STODL    4                                     
018162,000288: 22,2355           77626                           STADR                                          
018163,000289: 22,2356           63762                           STODL    12D                                   
018164,000290: 22,2357           00013                                    10D                                   
018165,000291: 22,2360           77725                           PDDL                                           

Page 409

018167,000293: 22,2361           00017                                    14D                                   
018168,000294: 22,2362           14013                           STODL    10D                                   
018169,000295: 22,2363           77626                           STADR                                          
018170,000296: 22,2364           77760                           STORE    14D                                   
018171,000297: 22,2365           77616                           RVQ                                            #  RETURN WITH TRANSPOSED MATRIX IN PD LIST
018172,000298: 22,2366           00013        MINANG             DEC      .00069375                             
018173,000299: 22,2367           17071        MAXANG             DEC      .472222                               
018174,000300: 22,2370           00004        READCDUK           INHINT                                         #  LOAD T(MPAC) WITH THE CURRENT CDU ANGLES
018175,000301: 22,2371           30034                           CA       CDUZ                                  
018176,000302: 22,2372           54156                           TS       MPAC       +2                         
018177,000303: 22,2373           00006                           EXTEND                                         
018178,000304: 22,2374           30033                           DCA      CDUX                                  
018179,000305: 22,2375           00003                           RELINT                                         
018180,000306: 22,2376           16445                           TCF      TLOAD      +6                         
018181,000307: 22,2000                                           SETLOC   KALCMON2                              
018182,000308: 22,2000                                           BANK                                           
018183,000309: 
018184,000310: 22,2377                                           COUNT*   $$/KALC                               
018185,000311: 
018186,000312: 22,2377           66370        CDUTODCM           AXT,1    SSP                                   #  SUBROUTINE TO COMPUTE  DIRECTION COSINE
018187,000313: 22,2400           00003                           OCT      3                                     #  MATRIX RELATING S/C AXES TO STABLE
018188,000314: 22,2401           00051                                    S1                                    #  MEMBER AXES FROM 3 CDU ANGLES IN T(MPAC)
018189,000315: 22,2402           00001                           OCT      1                                     #  SET XR1, S1 AND PD FOR LOOP
018190,000316: 22,2403           00010                           STORE    7                                     
018191,000317: 22,2404           77601                           SETPD                                          
018192,000318: 22,2405           00001                                    0                                     
018193,000319: 22,2406           47133        LOOPSIN            SLOAD*   RTB                                   
018194,000320: 22,2407           00013                                    10D,1                                 
018195,000321: 22,2410           51754                                    CDULOGIC                              
018196,000322: 22,2411           00013                           STORE    10D                                   #  LOAD PD WITH 0 SIN(PHI)
018197,000323: 22,2412           65356                           SIN      PDDL                                  #               2 COS(PHI)
018198,000324: 22,2413           00013                                    10D                                   #               4 SIN(THETA)
018199,000325: 22,2414           41546                           COS      PUSH                                  #               6 COS(THETA)
018200,000326: 22,2415           71300                           TIX,1    DLOAD                                 #               8 SIN(PSI)
018201,000327: 22,2416           44406                                    LOOPSIN                               #              10 COS(PSI)
018202,000328: 22,2417           00007                                    6                                     
018203,000329: 22,2420           72405                           DMP      SL1                                   
018204,000330: 22,2421           00013                                    10D                                   
018205,000331: 22,2422           10001                           STORE    0,2                                   
018206,000332: 22,2423           77745                           DLOAD                                          
018207,000333: 22,2424           00005                                    4                                     
018208,000334: 22,2425           65205                           DMP      PDDL                                  
018209,000335: 22,2426           00001                                    0                                     #  (PD6 SIN(THETA)SIN(PHI))
018210,000336: 22,2427           00007                                    6                                     
018211,000337: 22,2430           41205                           DMP      DMP                                   
018212,000338: 22,2431           00011                                    8D                                    
018213,000339: 22,2432           00003                                    2                                     
018214,000340: 22,2433           44352                           SL1      BDSU                                  
018215,000341: 22,2434           00015                                    12D                                   
018216,000342: 22,2435           77752                           SL1                                            

Page 410

018218,000344: 22,2436           10003                           STORE    2,2                                   
018219,000345: 22,2437           77745                           DLOAD                                          
018220,000346: 22,2440           00003                                    2                                     
018221,000347: 22,2441           65205                           DMP      PDDL                                  #  (PD7 COS(PHI)SIN(THETA)) SCALED 4
018222,000348: 22,2442           00005                                    4                                     
018223,000349: 22,2443           00007                                    6                                     
018224,000350: 22,2444           41205                           DMP      DMP                                   
018225,000351: 22,2445           00011                                    8D                                    
018226,000352: 22,2446           00001                                    0                                     
018227,000353: 22,2447           77752                           SL1                                            
018228,000354: 22,2450           72415                           DAD      SL1                                   
018229,000355: 22,2451           00017                                    14D                                   
018230,000356: 22,2452           10005                           STORE    4,2                                   
018231,000357: 22,2453           77745                           DLOAD                                          
018232,000358: 22,2454           00011                                    8D                                    
018233,000359: 22,2455           10007                           STORE    6,2                                   
018234,000360: 22,2456           77745                           DLOAD                                          
018235,000361: 22,2457           00013                                    10D                                   
018236,000362: 22,2460           72405                           DMP      SL1                                   
018237,000363: 22,2461           00003                                    2                                     
018238,000364: 22,2462           10011                           STORE    8D,2                                  
018239,000365: 22,2463           77745                           DLOAD                                          
018240,000366: 22,2464           00013                                    10D                                   
018241,000367: 22,2465           57405                           DMP      DCOMP                                 
018242,000368: 22,2466           00001                                    0                                     
018243,000369: 22,2467           77752                           SL1                                            
018244,000370: 22,2470           10013                           STORE    10D,2                                 
018245,000371: 22,2471           77745                           DLOAD                                          
018246,000372: 22,2472           00005                                    4                                     
018247,000373: 22,2473           57405                           DMP      DCOMP                                 
018248,000374: 22,2474           00013                                    10D                                   
018249,000375: 22,2475           77752                           SL1                                            
018250,000376: 22,2476           10015                           STORE    12D,2                                 
018251,000377: 22,2477           77745                           DLOAD                                          
018252,000378: 22,2500           72405                           DMP      SL1                                   #  (PUSH UP 7)
018253,000379: 22,2501           00011                                    8D                                    
018254,000380: 22,2502           41325                           PDDL     DMP                                   #  (PD7 COS(PHI)SIN(THETA)SIN(PSI)) SCALE4
018255,000381: 22,2503           00007                                    6                                     
018256,000382: 22,2504           00001                                    0                                     
018257,000383: 22,2505           72415                           DAD      SL1                                   #  (PUSH UP 7)
018258,000384: 22,2506           77626                           STADR                                          #  C7=COS(PHI)SIN(THETA)SIN(PSI)
018259,000385: 22,2507           67760                           STORE    14D,2                                 
018260,000386: 22,2510           77745                           DLOAD                                          
018261,000387: 22,2511           72405                           DMP      SL1                                   #  (PUSH UP 6)
018262,000388: 22,2512           00011                                    8D                                    
018263,000389: 22,2513           41325                           PDDL     DMP                                   #  (PD6 SIN(THETA)SIN(PHI)SIN(PSI)) SCALE4
018264,000390: 22,2514           00007                                    6                                     
018265,000391: 22,2515           00003                                    2                                     
018266,000392: 22,2516           72425                           DSU      SL1                                   #  (PUSH UP 6)
018267,000393: 22,2517           77626                           STADR                                          

Page 411

018269,000395: 22,2520           67756                           STORE    16D,2                                 #  C8=-SIN(THETA)SIN(PHI)SIN(PSI)
018270,000396: 22,2521           77616                           RVQ                                            #     +COS(THETA)COS(PHI)
018271,000397: 22,2522                        ENDOCM             EQUALS                                         
018272,000398: 
018273,000399: 22,2000                                           SETLOC   KALCMON1                              
018274,000400: 22,2000                                           BANK                                           
018275,000401: 
018276,000402:                                                                                                  #  CALCULATION OF THE MATRIX DEL......
018277,000403: 
018278,000404:                                                                                                  #        *      *               --T           *
018279,000405:                                                                                                  #        DEL = (IDMATRIX)COS(A)+UU (1-COS(A))+UX SIN(A)          SCALED 1
018280,000406: 
018281,000407:                                                                                                  #              -
018282,000408:                                                                                                  #        WHERE U IS A UNIT VECTOR (DP SCALED 2) ALONG THE AXIS OF ROTATION.
018283,000409:                                                                                                  #        A IS THE ANGLE OF ROTATION (DP SCALED 2)
018284,000410:                                                                                                  #                                           -
018285,000411:                                                                                                  #        UPON ENTRY THE STARTING ADDRESS OF U IS COF, AND A IS IN MPAC
018286,000412: 
018287,000413: 22,2522                                           COUNT*   $$/KALC                               
018288,000414: 22,2522           41401        DELCOMP            SETPD    PUSH                                  #  MPAC CONTAINS THE ANGLE A
018289,000415: 22,2523           00001                                    0                                     
018290,000416: 22,2524           65356                           SIN      PDDL                                  #  PD0 = SIN(A)
018291,000417: 22,2525           41546                           COS      PUSH                                  #  PD2 = COS(A)
018292,000418: 22,2526           65302                           SR2      PDDL                                  #  PD2 = COS(A)                          $8
018293,000419: 22,2527           41021                           BDSU     BOVB                                  #  PD4 = 1-COS(A)                        $2
018294,000420: 22,2530           15334                                    DPHALF                                
018295,000421: 22,2531           45761                                    SIGNMPAC                              
018296,000422: 
018297,000423:                                                                                                  #  COMPUTE THE DIAGONAL COMPONENTS OF DEL
018298,000424: 
018299,000425: 22,2532           77725                           PDDL                                           
018300,000426: 22,2533           03343                                    COF                                   
018301,000427: 22,2534           41316                           DSQ      DMP                                   
018302,000428: 22,2535           00005                                    4                                     
018303,000429: 22,2536           52415                           DAD      SL3                                   
018304,000430: 22,2537           00003                                    2                                     
018305,000431: 22,2540           77604                           BOVB                                           
018306,000432: 22,2541           45761                                    SIGNMPAC                              
018307,000433: 22,2542           17426                           STODL    DEL                                   #  UX UX(U-COS(A)) +COS(A)               $1
018308,000434: 22,2543           03345                                    COF        +2                         
018309,000435: 22,2544           41316                           DSQ      DMP                                   
018310,000436: 22,2545           00005                                    4                                     
018311,000437: 22,2546           52415                           DAD      SL3                                   
018312,000438: 22,2547           00003                                    2                                     
018313,000439: 22,2550           77604                           BOVB                                           
018314,000440: 22,2551           45761                                    SIGNMPAC                              
018315,000441: 22,2552           17436                           STODL    DEL        +8D                        #  UY UY(1-COS(A)) +COS(A)               $1
018316,000442: 22,2553           03347                                    COF        +4                         
018317,000443: 22,2554           41316                           DSQ      DMP                                   

Page 412

018319,000445: 22,2555           00005                                    4                                     
018320,000446: 22,2556           52415                           DAD      SL3                                   
018321,000447: 22,2557           00003                                    2                                     
018322,000448: 22,2560           77604                           BOVB                                           
018323,000449: 22,2561           45761                                    SIGNMPAC                              
018324,000450: 22,2562           03446                           STORE    DEL        +16D                       #  UZ UZ(1-COS(A)) +COS(A)               $1
018325,000451: 
018326,000452:                                                                                                  #  COMPUTE THE OFF DIAGONAL TERMS OF DEL
018327,000453: 
018328,000454: 22,2563           41345                           DLOAD    DMP                                   
018329,000455: 22,2564           03343                                    COF                                   
018330,000456: 22,2565           03345                                    COF        +2                         
018331,000457: 22,2566           72405                           DMP      SL1                                   
018332,000458: 22,2567           00005                                    4                                     
018333,000459: 22,2570           41325                           PDDL     DMP                                   #  D6    UX UY (1-COS A)                 $ 4
018334,000460: 22,2571           03347                                    COF        +4                         
018335,000461: 22,2572           00001                                    0                                     
018336,000462: 22,2573           43206                           PUSH     DAD                                   #  D8    UZ SIN A                        $ 4
018337,000463: 22,2574           00007                                    6                                     
018338,000464: 22,2575           41112                           SL2      BOVB                                  
018339,000465: 22,2576           45761                                    SIGNMPAC                              
018340,000466: 22,2577           17434                           STODL    DEL        +6                         
018341,000467: 22,2600           62421                           BDSU     SL2                                   
018342,000468: 22,2601           77604                           BOVB                                           
018343,000469: 22,2602           45761                                    SIGNMPAC                              
018344,000470: 22,2603           17430                           STODL    DEL        +2                         
018345,000471: 22,2604           03343                                    COF                                   
018346,000472: 22,2605           41205                           DMP      DMP                                   
018347,000473: 22,2606           03347                                    COF        +4                         
018348,000474: 22,2607           00005                                    4                                     
018349,000475: 22,2610           65352                           SL1      PDDL                                  #  D6    UX UZ (1-COS A)                 $ 4
018350,000476: 22,2611           03345                                    COF        +2                         
018351,000477: 22,2612           41405                           DMP      PUSH                                  #  D8    UY SIN(A)
018352,000478: 22,2613           00001                                    0                                     
018353,000479: 22,2614           62415                           DAD      SL2                                   
018354,000480: 22,2615           00007                                    6                                     
018355,000481: 22,2616           77604                           BOVB                                           
018356,000482: 22,2617           45761                                    SIGNMPAC                              
018357,000483: 22,2620           17432                           STODL    DEL        +4                         #  UX UZ (1-COS(A))+UY SIN(A)
018358,000484: 22,2621           62421                           BDSU     SL2                                   
018359,000485: 22,2622           77604                           BOVB                                           
018360,000486: 22,2623           45761                                    SIGNMPAC                              
018361,000487: 22,2624           17442                           STODL    DEL        +12D                       #  UX UZ (U-COS(A))-UY SIN(A)
018362,000488: 22,2625           03345                                    COF        +2                         
018363,000489: 22,2626           41205                           DMP      DMP                                   
018364,000490: 22,2627           03347                                    COF        +4                         
018365,000491: 22,2630           00005                                    4                                     
018366,000492: 22,2631           65352                           SL1      PDDL                                  #  D6    UY UZ (1-COS(A))                $ 4
018367,000493: 22,2632           03343                                    COF                                   
018368,000494: 22,2633           41405                           DMP      PUSH                                  #  D8    UX SIN(A)

Page 413

018370,000496: 22,2634           00001                                    0                                     
018371,000497: 22,2635           62415                           DAD      SL2                                   
018372,000498: 22,2636           00007                                    6                                     
018373,000499: 22,2637           77604                           BOVB                                           
018374,000500: 22,2640           45761                                    SIGNMPAC                              
018375,000501: 22,2641           17444                           STODL    DEL        +14D                       #  UY UZ(1-COS(A)) +UX SIN(A)
018376,000502: 22,2642           62421                           BDSU     SL2                                   
018377,000503: 22,2643           77604                           BOVB                                           
018378,000504: 22,2644           45761                                    SIGNMPAC                              
018379,000505: 22,2645           03440                           STORE    DEL        +10D                       #  UY UZ(1-COS(A)) -UX SIN(A)
018380,000506: 22,2646           77616                           RVQ                                            
018381,000507: 
018382,000508:                                                                                                  #  DIRECTION COSINE MATRIX TO CDU ANGLE ROUTINE
018383,000509:                                                                                                  #  X1 CONTAINS THE COMPLEMENT OF THE STARTING ADDRESS FOR MATRIX (SCALED 2)
018384,000510:                                                                                                  #  LEAVES CDU ANGLES SCALED 2PI IN V(MPAC)
018385,000511:                                                                                                  #  COS(MGA) WILL BE LEFT IN S1 (SCALED 1)
018386,000512: 
018387,000513:                                                                                                  #  THE DIRECTION COSINE MATRIX RELATING S/C AXES TO STABLE MEMBER AXES CAN BE WRITTEN AS ***
018388,000514: 
018389,000515:                                                                                                  #        C =COS(THETA)COS(PSI)
018390,000516:                                                                                                  #         0
018391,000517:                                                                                                  #        C =-COS(THETA)SIN(PSI)COS(PHI)+SI (THETA)SIN(PHI)
018392,000518:                                                                                                  #         1
018393,000519:                                                                                                  #        C =COS(THETA)SIN(PSI)SIN(PHI) + S N(THETA)COS(PHI)
018394,000520:                                                                                                  #         2
018395,000521:                                                                                                  #        C =SIN(PSI)
018396,000522:                                                                                                  #         3
018397,000523:                                                                                                  #        C =COS(PSI)COS(PHI)
018398,000524:                                                                                                  #         4
018399,000525:                                                                                                  #        C =-COS(PSI)SIN(PHI)
018400,000526:                                                                                                  #         5
018401,000527:                                                                                                  #        C =-SIN(THETA)COS(PSI)
018402,000528:                                                                                                  #         6
018403,000529:                                                                                                  #        C =SIN(THETA)SIN(PSI)COS(PHI)+COS THETA)SIN(PHI)
018404,000530:                                                                                                  #         7
018405,000531:                                                                                                  #        C =-SIN(THETA)SIN(PSI)SIN(PHI)+CO (THETA)COS(PHI)
018406,000532:                                                                                                  #         8
018407,000533: 
018408,000534:                                                                                                  #        WHERE   PHI = OGA
018409,000535:                                                                                                  #                THETA = IGA
018410,000536:                                                                                                  #                PSI = MGA
018411,000537: 
018412,000538: 22,2647           67543        DCMTOCDU           DLOAD*   ARCSIN                                
018413,000539: 22,2650           00007                                    6,1                                   
018414,000540: 22,2651           71406                           PUSH     COS                                   #  PD +0         PSI
018415,000541: 22,2652           41152                           SL1      BOVB                                  
018416,000542: 22,2653           45761                                    SIGNMPAC                              
018417,000543: 22,2654           00051                           STORE    S1                                    
018418,000544: 22,2655           57543                           DLOAD*   DCOMP                                 

Page 414

018420,000546: 22,2656           00015                                    12D,1                                 
018421,000547: 22,2657           67471                           DDV      ARCSIN                                
018422,000548: 22,2660           00051                                    S1                                    
018423,000549: 22,2661           51123                           PDDL*    BPL                                   #  PD +2         THETA
018424,000550: 22,2662           00001                                    0,1                                   #  MUST CHECK THE SIGN OF COS(THETA)
018425,000551: 22,2663           44675                                    OKTHETA                               #  TO DETERMINE THE PROPER QUADRANT
018426,000552: 22,2664           57545                           DLOAD    DCOMP                                 
018427,000553: 22,2665           43244                           BPL      DAD                                   
018428,000554: 22,2666           44672                                    SUHALFA                               
018429,000555: 22,2667           15334                                    DPHALF                                
018430,000556: 22,2670           77650                           GOTO                                           
018431,000557: 22,2671           44674                                    CALCPHI                               
018432,000558: 22,2672           77625        SUHALFA            DSU                                            
018433,000559: 22,2673           15334                                    DPHALF                                
018434,000560: 22,2674           77606        CALCPHI            PUSH                                           
018435,000561: 22,2675           57543        OKTHETA            DLOAD*   DCOMP                                 
018436,000562: 22,2676           00013                                    10D,1                                 
018437,000563: 22,2677           67471                           DDV      ARCSIN                                
018438,000564: 22,2700           00051                                    S1                                    
018439,000565: 22,2701           51123                           PDDL*    BPL                                   #  PUSH DOWN PHI
018440,000566: 22,2702           00011                                    8D,1                                  
018441,000567: 22,2703           44715                                    OKPHI                                 
018442,000568: 22,2704           57545                           DLOAD    DCOMP                                 #  PUSH UP PHI
018443,000569: 22,2705           43244                           BPL      DAD                                   
018444,000570: 22,2706           44712                                    SUHALFAP                              
018445,000571: 22,2707           15334                                    DPHALF                                
018446,000572: 22,2710           77650                           GOTO                                           
018447,000573: 22,2711           44716                                    VECOFANG                              
018448,000574: 22,2712           52025        SUHALFAP           DSU      GOTO                                  
018449,000575: 22,2713           15334                                    DPHALF                                
018450,000576: 22,2714           44716                                    VECOFANG                              
018451,000577: 22,2715           77745        OKPHI              DLOAD                                          #  PUSH UP PHI
018452,000578: 22,2716           43466        VECOFANG           VDEF     RVQ                                   
018453,000579: 

Page 415

018455,000581:                                                                                                  #  ROUTINE FOR TERMINATING AUTOMATIC MANEUVERS
018456,000582: 
018457,000583: 22,2717           77776        NOGOM3             EXIT                                           
018458,000584: 22,2720           00004        NOGOM2             INHINT                                         #  THIS LOCATION ACCESSED BY A BZMF NOGO -2
018459,000585: 22,2721           04636                           TC       BANKCALL                              
018460,000586: 22,2722           40203                           CADR     ZEROEROR                              
018461,000587: 
018462,000588: 22,2723           00004        NOGO               INHINT                                         
018463,000589: 22,2724           04463                           TC       STOPRATE                              
018464,000590: 
018465,000591: 22,2725           34767                           CAF      R67BIT                                
018466,000592: 22,2726           70104                           MASK     FLAGWRD8                              
018467,000593: 22,2727           00006                           EXTEND                                         
018468,000594: 22,2730           12740                           BZF      NOTR67ND                              
018469,000595: 
018470,000596: 22,2731           35016                           CAF      1SEC                                  #  WAITLIST TASK IN 1 SECON:
018471,000597: 22,2732           05233                           TC       WAITLIST                              #  RETURN TO UPDTCALL
018472,000598: 22,2733  E6,1661                                  EBANK=   BCDU                                  
018473,000599: 22,2733           02320 74066                     2CADR    R67                                   
018474,000600: 
018475,000601: 22,2735           05402                           TC       PHASCHNG                              
018476,000602: 22,2736           00111                           OCT      00111                                 
018477,000603: 
018478,000604: 22,2737  01,2025               1P11SPT2           =        1.11SPOT                              
018479,000605: 22,2737           05205                           TC       ENDOFJOB                              
018480,000606: 
018481,000607: 22,2740           34767        NOTR67ND           CAF      TWO                                   #  RETURN VIA
018482,000608: 22,2741           05233                           TC       WAITLIST                              #  GOODEND
018483,000609: 22,2742  E6,1661                                  EBANK=   BCDU                                  
018484,000610: 22,2742           02311 20066                     2CADR    ENDMANU                               
018485,000611: 
018486,000612: 22,2744           15205                           TCF      ENDOFJOB                              

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