Source Code

These source-code files are part of a reconstructed copy of Luminary 173, the second (unflown) release of the Apollo 14 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with reconstructed source code for Luminary 178. Changes between revision 173 and 178 were backed out, as described by Luminary memo 167 (revision 1). The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 173 listing would be different.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

020836,000002:                                                                                                  ## Copyright:   Public domain.
020837,000003:                                                                                                  ## Filename:    R60,R62.agc
020838,000004:                                                                                                  ## Purpose:     A section of Luminary revision 173.
020839,000005:                                                                                                  ##              It is part of the reconstructed source code for the second
020840,000006:                                                                                                  ##              (unflown) release of the flight software for the Lunar
020841,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
020842,000008:                                                                                                  ##              The code has been recreated from a reconstructed copy of
020843,000009:                                                                                                  ##              Luminary 178, as well as Luminary memo 167 (revision 1).
020844,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
020845,000011:                                                                                                  ##              exactly match those specified for Luminary 173 in NASA
020846,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
020847,000013:                                                                                                  ##              that the reconstruction is correct.
020848,000014:                                                                                                  ## Reference:   pp. 480-493
020849,000015:                                                                                                  ## Assembler:   yaYUL
020850,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
020851,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
020852,000018:                                                                                                  ## Mod history: 2019-09-18 MAS  Created from Luminary 178.
020853,000019: 

Page 480

020855,000021:                                                                                                  #  MOD NO: 0                        DATE: 1 MAY 1968
020856,000022: 
020857,000023:                                                                                                  #  MOD BY: DIGITAL DEVEL GROUP      LOG SECTION R60,R62
020858,000024: 
020859,000025:                                                                                                  #  FUNCTIONAL DESCRIPTION:
020860,000026: 
020861,000027:                                                                                                  #  CALLED AS A GENERAL SUBROUTINE TO MANEUVER THE LM TO A SPECIFIED
020862,000028:                                                                                                  #  ATTITUDE.
020863,000029: 
020864,000030:                                                                                                  #  1. IF THE 3-AXIS FLAG IS NOT SET THE FINAL CDU ANGLES ARE
020865,000031:                                                                                                  #  CALCULATED (VECPOINT).
020866,000032: 
020867,000033:                                                                                                  #  2. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
020868,000034: 
020869,000035:                                                                                                  #  3. REQUEST FLASHING DISPLAY V50 N18 PLEASE PERFORM AUTO MANEUVER.
020870,000036: 
020871,000037:                                                                                                  #  4. IF PRIORITY DISPLAY FLAG IS SET DO A PHASECHANGE. THEN AWAIT
020872,000038:                                                                                                  #  ASTRONAUT RESPONSE.
020873,000039: 
020874,000040:                                                                                                  #  5. DISPLAY RESPONSE RETURNS:
020875,000041: 
020876,000042:                                                                                                  #      A. ENTER - RESET 3-AXIS FLAG AND RETURN TO CLIENT.
020877,000043: 
020878,000044:                                                                                                  #      B. TERMINATE - IF IN P00 GO TO STEP 5A. OTHERWISE CHECK IF R61 IS
020879,000045:                                                                                                  #         THE CALLING PROGRAM. IF IN R61 AN EXIT IS MADE TO GOTOV56. IF
020880,000046:                                                                                                  #         NOT IN R61 AN EXIT IS DONE VIA GOTOP00H.
020881,000047: 
020882,000048:                                                                                                  #      C. PROCEED - CONTINUE WITH PROGRAM AT STEP 6.
020883,000049: 
020884,000050:                                                                                                  #  6. IF THE 3-AXISFLAG IS NOT SET, THE FINAL CDU ANGLES ARE CALCULATED
020885,000051:                                                                                                  #     (VECPOINT).
020886,000052: 
020887,000053:                                                                                                  #  7. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
020888,000054: 
020889,000055:                                                                                                  #  8. IF THE G+N SWITCH IS NOT SET GO BACK TO STEP 3.
020890,000056: 
020891,000057:                                                                                                  #  9. IF THE AUTO SWITCH IS NOT SET GO BACK TO STEP 3.
020892,000058: 
020893,000059:                                                                                                  #  10. NONFLASHING DISPLAY V06N18 (FDAI ANGLES).
020894,000060: 
020895,000061:                                                                                                  #  11. DO A PHASECHANGE.
020896,000062: 
020897,000063:                                                                                                  #  12. DO A MANEUVER CALCULATION AND ICDU DRIVE ROUTINE TO ACHIEVE FINAL
020898,000064: 
020899,000065:                                                                                                  #      GIMBAL ANGLES (GOMANUR).
020900,000066:                                                                                                  #  13. AT END OF MANEUVER GO TO STEP 3.
020901,000067: 
020902,000068:                                                                                                  #           IF SATISFACTORY MANEUVER STEP 5A EXITS R60.
020903,000069:                                                                                                  #           FOR FURTHER ADJUSTMENT OF THE VEHICLE ATTITUDE ABOUT THE
020904,000070:                                                                                                  #           DESIRED VECTOR, THE ROUTINE MAY BE PERFORMED AGAIN STARTING AT

Page 481

020906,000072:                                                                                                  #           STEP 5C.
020907,000073: 
020908,000074:                                                                                                  #  CALLING SEQUENCE:  TC BANKCALL
020909,000075:                                                                                                  #                     CADR R60LEM
020910,000076: 
020911,000077:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED : SCAXIS, POINTVSM (FOR VECPOINT)
020912,000078:                                                                                                  #                                     3AXISFLG.
020913,000079: 
020914,000080:                                                                                                  #  SUBROUTINES CALLED: VECPOINT, BALLANGS, GOPERF2R, LINUS, GODSPER,
020915,000081:                                                                                                  #                     GOMANUR, DOWNFLAG, PHASCHNG, UPFLAG
020916,000082: 
020917,000083:                                                                                                  #  NORMAL EXIT MODES: CAE TEMPR60   (CALLERS RETURN ADDRESS)
020918,000084:                                                                                                  #                     TC  BANKJUMP
020919,000085: 
020920,000086:                                                                                                  #  ALARMS: NONE
020921,000087: 
020922,000088:                                                                                                  #  OUTPUT: NONE
020923,000089: 
020924,000090:                                                                                                  #  DEBRIS: CPHI, CTHETA, CPSI, 3AXISFLG, TBASE2
020925,000091: 
020926,000092: 
020927,000093: 34,2000                                           BANK     34                                    
020928,000094: 26,2000                                           SETLOC   MANUVER                               
020929,000095: 26,2000                                           BANK                                           
020930,000096: 
020931,000097: 26,2125     1163                                  EBANK=   TEMPR60                               
020932,000098: 
020933,000099: 26,2125                                           COUNT*   $$/R06                                
020934,000100: 26,2125           04645        R60LEM             TC       MAKECADR                              
020935,000101: 26,2126           55163                           TS       TEMPR60                               
020936,000102: 
020937,000103: 26,2127           34746        REDOMANN           CAF      3AXISBIT                              
020938,000104: 26,2130           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
020939,000105: 26,2131           10000                           CCS      A                                     
020940,000106: 26,2132           12140                           TCF      TOBALL                                #  YES
020941,000107: 26,2133           06042                           TC       INTPRET                               
020942,000108: 26,2134           77624                           CALL                                           
020943,000109: 26,2135           56040                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
020944,000110: 26,2136           00322                           STORE    CPHI                                  #  STORE FINAL ANGLES - CPHI,CTHETA,CPSI
020945,000111: 26,2137           77776                           EXIT                                           
020946,000112: 
020947,000113: 26,2140           05515        TOBALL             TC       UPFLAG                                #  INSURE THAT TOTAL ATTITUDE ERRORS ARE
020948,000114: 26,2141           00013                           ADRES    NEEDLFLG                              #  DISPLAYED ON FDAI ERROR NEEDLES
020949,000115: 26,2142           05527                           TC       DOWNFLAG                              
020950,000116: 26,2143           00000                           ADRES    NEED2FLG                              
020951,000117: 26,2144           04616                           TC       BANKCALL                              
020952,000118: 26,2145           54274                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
020953,000119: 26,2146           32262        TOBALLA            CAF      V06N18                                
020954,000120: 26,2147           04616                           TC       BANKCALL                              

Page 482

020956,000122: 26,2150           20711                           CADR     GOPERF2R                              #  DISPLAY PLEASE PERFORM AUTO MANEUVER
020957,000123: 26,2151           02250                           TC       R61TEST                               
020958,000124: 26,2152           02156                           TC       REDOMANC                              #  PROCEED
020959,000125: 26,2153           02203                           TC       ENDMANU1                              #  ENTER I.E. FINISHED WITH R60
020960,000126: 26,2154           02207                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
020961,000127: 26,2155           05155                           TC       ENDOFJOB                              
020962,000128: 
020963,000129: 26,2156           34746        REDOMANC           CAF      3AXISBIT                              
020964,000130: 26,2157           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
020965,000131: 26,2160           10000                           CCS      A                                     
020966,000132: 26,2161           12167                           TCF      TOBALLC                               #  YES
020967,000133: 26,2162           06042                           TC       INTPRET                               
020968,000134: 26,2163           77624                           CALL                                           
020969,000135: 26,2164           56040                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
020970,000136: 26,2165           00322                           STORE    CPHI                                  #  STORE ANGLES
020971,000137: 26,2166           77776                           EXIT                                           
020972,000138: 
020973,000139: 26,2167           04616        TOBALLC            TC       BANKCALL                              
020974,000140: 26,2170           54274                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
020975,000141: 26,2171           02263                           TC       G+N,AUTO                              #  CHECK AUTO MODE
020976,000142: 26,2172           10000                           CCS      A                                     
020977,000143: 26,2173           12146                           TCF      TOBALLA                               #  NOT AUTO, GO REREQUEST AUTO MANEUVER.
020978,000144: 
020979,000145: 26,2174           32262        AUTOMANV           CAF      V06N18                                #  STATIC DISPLAY DURING AUTO MANEUVER
020980,000146: 26,2175           04616                           TC       BANKCALL                              #                                       -
020981,000147: 26,2176           20452                           CADR     GODSPR                                #                                       -
020982,000148: 26,2177           02207                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
020983,000149: 
020984,000150: 26,2200           04616        STARTMNV           TC       BANKCALL                              #  PERFORM MANEUVER VIA KALCMANU
020985,000151: 26,2201           17754                           CADR     GOMANUR                               
020986,000152: 
020987,000153: 26,2202           12146        ENDMANUV           TCF      TOBALLA                               #  FINISHED MANEUVER.
020988,000154: 26,2203           05527        ENDMANU1           TC       DOWNFLAG                              #  RESET 3-AXIS FLAG
020989,000155: 26,2204           00124                           ADRES    3AXISFLG                              
020990,000156: 26,2205           31163                           CAE      TEMPR60                               #                                       -
020991,000157: 26,2206           04640                           TC       BANKJUMP                              #                                       -
020992,000158: 
020993,000159: 26,2207           40100        CHKLINUS           CS       FLAGWRD4                              
020994,000160: 26,2210           74740                           MASK     PDSPFBIT                              #  IS PRIORITY DISPLAY FLAG SET?
020995,000161: 26,2211           10000                           CCS      A                                     #                                       -
020996,000162: 26,2212           00002                           TC       Q                                     #  NO - EXIT
020997,000163: 26,2213           30002                           CA       Q                                     
020998,000164: 26,2214           54156                           TS       MPAC       +2                         #  SAVE RETURN
020999,000165: 26,2215           46250                           CS       THREE                                 #  OBTAIN LOCATION FOR RESTART
021000,000166: 26,2216           60133                           AD       BUF2                                  #  HOLDS Q OF LAST DISPLAY
021001,000167: 26,2217           55054                           TS       TBASE2                                
021002,000168: 
021003,000169: 26,2220           05364                           TC       PHASCHNG                              
021004,000170: 26,2221           00132                           OCT      00132                                 
021005,000171: 

Page 483

021007,000173: 26,2222           34745                           CAF      BIT7                                  
021008,000174: 26,2223           05475                           TC       LINUS                                 #  GO SET BITS FOR PRIORITY DISPLAY     -
021009,000175: 26,2224           00156                           TC       MPAC       +2                         
021010,000176: 
021011,000177: 26,2225           37717        RELINUS            CAF      PRIO26                                #  RESTORE ORIGINAL PRIORITY
021012,000178: 26,2226           05146                           TC       PRIOCHNG                              
021013,000179: 
021014,000180: 26,2227           34747                           CAF      TRACKBIT                              #  DON'T CONTINUE R60 UNLESS TRACKFLAG ON.
021015,000181: 26,2230           70075                           MASK     FLAGWRD1                              
021016,000182: 26,2231           10000                           CCS      A                                     
021017,000183: 26,2232           12245                           TCF      RER60                                 
021018,000184: 
021019,000185: 26,2233           34745                           CAF      RNDVZBIT                              #  IS IT P20?
021020,000186: 26,2234           70074                           MASK     FLAGWRD0                              
021021,000187: 26,2235           10000                           CCS      A                                     
021022,000188: 26,2236           02242                           TC       +4                                    #  YES
021023,000189: 26,2237           05364                           TC       PHASCHNG                              #  NO, MUST BE P25, SET 2.11 SPOT
021024,000190: 26,2240           40112                           OCT      40112                                 
021025,000191: 
021026,000192: 26,2241           05155                           TC       ENDOFJOB                              
021027,000193: 
021028,000194: 26,2242           05364                           TC       PHASCHNG                              #  SET 2.7 SPOT FOR P20
021029,000195: 26,2243           40072                           OCT      40072                                 
021030,000196: 
021031,000197: 26,2244           05155                           TC       ENDOFJOB                              
021032,000198: 
021033,000199: 26,2245           05515        RER60              TC       UPFLAG                                #  SET PRIO DISPLAY FLAG AFTER RESTART
021034,000200: 26,2246           00077                           ADRES    PDSPFLAG                              
021035,000201: 
021036,000202: 26,2247           01054                           TC       TBASE2                                
021037,000203: 
021038,000204: 26,2250           31010        R61TEST            CA       MODREG                                #  IF WE ARE IN P00 IT MUST BE V49 OR V89
021039,000205: 26,2251           00006                           EXTEND                                         
021040,000206: 26,2252           12203                           BZF      ENDMANU1                              #  THUS WE GO TO ENDEXT VIA USER
021041,000207: 
021042,000208: 26,2253           30100                           CA       FLAGWRD4                              #  ARE WE IN R61  (P20 OR P25)
021043,000209: 26,2254           74740                           MASK     PDSPFBIT                              
021044,000210: 26,2255           00006                           EXTEND                                         
021045,000211: 26,2256           16001                           BZF      GOTOPOOH                              #  NO
021046,000212: 26,2257           06025                           TC       GOTOV56                               #  YES
021047,000213: 
021048,000214: 26,2260           20100        BIT14+7            OCT      20100                                 #                                       -
021049,000215: 26,2261           00203        OCT203             OCT      203                                   
021050,000216: 26,2262           01422        V06N18             VN       0618                                  
021051,000217:                                                                                                  #           SUBROUTINE TO CHECK FOR G+N CONTROL, AUTO STABILIZATION
021052,000218: 
021053,000219:                                                                                                  #           RETURNS WITH C(A) = +  IF NOT SET FOR G+N, AUTO
021054,000220:                                                                                                  #           RETURNS WITH C(A) = +0 IF SWITCHES ARE SET
021055,000221: 
021056,000222: 26,2263           00006        G+N,AUTO           EXTEND                                         

Page 484

021058,000224: 26,2264           00030                           READ     CHAN30                                
021059,000225: 26,2265           74742                           MASK     BIT10                                 
021060,000226: 26,2266           10000                           CCS      A                                     
021061,000227: 26,2267           00002                           TC       Q                                     #  NOT IN G+N  C(A) = +
021062,000228: 26,2270           00006        ISITAUTO           EXTEND                                         #  CHECK FOR AUTO MODE
021063,000229: 26,2271           00031                           READ     CHAN31                                
021064,000230: 26,2272           74736                           MASK     BIT14                                 
021065,000231: 26,2273           00002                           TC       Q                                     #  (+) = NOT IN AUTO, (+0) = AOK
021066,000232: 

Page 485

021068,000234:                                                                                                  #  PROGRAM DESCRIPTION BALLANGS
021069,000235:                                                                                                  #  MOD NO.         LOG SECTION  R60,R62
021070,000236: 
021071,000237:                                                                                                  #  WRITTEN BY RAMA M.AIYAWAR
021072,000238:                                                                                                  #  FUNCTIONAL DESCRIPTION
021073,000239: 
021074,000240:                                                                                                  #  COMPUTES LM FDAI BALL DISPLAY ANGLES
021075,000241:                                                                                                  #  CALLING SEQUENCE
021076,000242: 
021077,000243:                                                                                                  #           TC     BALLANGS
021078,000244:                                                                                                  #  NORMAL EXIT MODE
021079,000245: 
021080,000246:                                                                                                  #           TC     BALLEXIT        (SAVED Q)
021081,000247: 
021082,000248:                                                                                                  #  ALARM OR EXIT MODE  NIL
021083,000249:                                                                                                  #  SUBROUTINES CALLED
021084,000250:                                                                                                  #           CD*TR*G
021085,000251:                                                                                                  #           ARCTAN
021086,000252: 
021087,000253:                                                                                                  #  INPUT
021088,000254: 
021089,000255:                                                                                                  #  CPHI,CTHETA,CPSI  ARE  THE ANGLES CORRESPONDING TO AOG,AIG,AMG. THEY ARE
021090,000256:                                                                                                  #  SP,2S COMPLIMENT SCALED TO HALF REVOLUTION.
021091,000257:                                                                                                  #  OUTPUT
021092,000258: 
021093,000259:                                                                                                  #  FDAIX,FDAIY,FDAIZ ARE THE REQUIRED BALL ANGLES SCALED TO HALF REVOLUTION
021094,000260:                                                                                                  #  SP,2S COMPLIMENT.
021095,000261:                                                                                                  #  THESE ANGLES WILL BE DISPLAYED AS DEGREES AND HUNDREDTHS, IN THE ORDER ROLL, PITCH, YAW, USING NOUNS 18 & 19.
021096,000262: 
021097,000263:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
021098,000264: 
021099,000265:                                                                                                  #  CPHI,CTHETA,CPSI EACH A SP REGISTER
021100,000266:                                                                                                  #  DEBRIS
021101,000267: 
021102,000268:                                                                                                  #  A,L,Q,MPAC,SINCDU,COSCDU,PUSHLIST,BALLEXIT
021103,000269: 
021104,000270: 
021105,000271:                                                                                                  #  NOMENCLATURE:  CPHI, CTHETA, & CPSI REPRESENT THE OUTER, INNER, & MIDDLE GIMBAL ANGLES, RESPECTIVELY; OR
021106,000272:                                                                                                  #  EQUIVALENTLY, CDUX, CDUY, & CDUZ.
021107,000273: 
021108,000274:                                                                                                  #  NOTE:  ARCTAN CHECKS FOR OVERFLOW AND SHOULD BE ABLE TO HANDLE ANY SINGULARITIES.
021109,000275: 
021110,000276: 26,2000                                           SETLOC   BAWLANGS                              
021111,000277: 26,2000                                           BANK                                           
021112,000278: 
021113,000279: 26,2274                                           COUNT*   $$/BALL                               
021114,000280: 26,2274           04645        BALLANGS           TC       MAKECADR                              
021115,000281: 26,2275           55337                           TS       BALLEXIT                              
021116,000282: 26,2276           30321                           CA       CPHI                                  

Page 486

021118,000284: 26,2277           54771                           TS       CDUSPOT    +4                         
021119,000285: 26,2300           30322                           CA       CTHETA                                
021120,000286: 26,2301           54765                           TS       CDUSPOT                               
021121,000287: 26,2302           30323                           CA       CPSI                                  
021122,000288: 26,2303           54767                           TS       CDUSPOT    +2                         
021123,000289: 
021124,000290: 26,2304           06042                           TC       INTPRET                               
021125,000291: 26,2305           45001                           SETPD    CALL                                  
021126,000292: 26,2306           00001                                    0D                                    
021127,000293: 26,2307           47541                                    CD*TR*G                               
021128,000294: 
021129,000295: 26,2310           41345                           DLOAD    DMP                                   
021130,000296: 26,2311           00742                                    SINCDUX                               #  SIN (OGA)
021131,000297: 26,2312           00746                                    COSCDUZ                               #  COS (MGA)
021132,000298: 
021133,000299: 26,2313           57552                           SL1      DCOMP                                 #  SCALE
021134,000300: 26,2314           65336                           ARCSIN   PDDL                                  #  YAW = ARCSIN(-SXCZ) INTO 0 PD
021135,000301: 26,2315           00740                                    SINCDUZ                               
021136,000302: 26,2316           14023                           STODL    SINTH                                 #  (SINTH = 18D IN PD)
021137,000303: 26,2317           00746                                    COSCDUZ                               
021138,000304: 26,2320           72405                           DMP      SL1                                   #  RESCALE
021139,000305: 26,2321           00750                                    COSCDUX                               
021140,000306: 26,2322           34021                           STCALL   COSTH                                 #  (COSTH = 16D IN PD)
021141,000307: 26,2323           26506                                    ARCTAN                                
021142,000308: 26,2324           41325                           PDDL     DMP                                   #  ROLL = ARCTAN(SZ/CZCX) INTO 2 PD
021143,000309: 26,2325           00740                                    SINCDUZ                               
021144,000310: 26,2326           00742                                    SINCDUX                               
021145,000311: 26,2327           41512                           SL2      PUSH                                  #  SXSZ INTO 4 PD
021146,000312: 26,2330           65205                           DMP      PDDL                                  #  SXSZCY INTO 4 PD
021147,000313: 26,2331           00744                                    COSCDUY                               
021148,000314: 26,2332           65205                           DMP      PDDL                                  #  SXSZSY INTO 6 PD
021149,000315: 26,2333           00736                                    SINCDUY                               
021150,000316: 26,2334           00750                                    COSCDUX                               
021151,000317: 26,2335           72405                           DMP      SL1                                   #  CXCY
021152,000318: 26,2336           00744                                    COSCDUY                               
021153,000319: 26,2337           45425                           DSU      STADR                                 #  PULL UP FROM 6 PD
021154,000320: 26,2340           63756                           STODL    COSTH                                 #  COSTH = CXCY - SXSZSY
021155,000321: 26,2341           00736                                    SINCDUY                               
021156,000322: 26,2342           72405                           DMP      SL1                                   
021157,000323: 26,2343           00750                                    COSCDUX                               #  CXSY
021158,000324: 26,2344           45415                           DAD      STADR                                 #  PULL UP FROM 4 PD
021159,000325: 26,2345           43754                           STCALL   SINTH                                 #  SINTH = CXSY + SXSZCY
021160,000326: 26,2346           26506                                    ARCTAN                                #  RETURNS WITH D(MPAC) = PITCH
021161,000327: 26,2347           55525                           PDDL     VDEF                                  #  PITCH INTO 2 PD, ROLL INTO MPAC FROM 2PD
021162,000328: 26,2350           77634                           RTB                                            #  VDEF MAKES V(MPAC) = ROLL, PITCH, YAW
021163,000329: 26,2351           21621                                    V1STO2S                               
021164,000330: 26,2352           02345                           STORE    FDAIX                                 #  MODE IS TP
021165,000331: 26,2353           77776                           EXIT                                           
021166,000332: 
021167,000333: 26,2354           31337        ENDBALL            CA       BALLEXIT                              

Page 487

021169,000335: 26,2355           04640                           TC       BANKJUMP                              
021170,000336: 

Page 488

021172,000338:                                                                                                  #  PROGRAM DESCRIPTION - VECPOINT
021173,000339: 
021174,000340: 
021175,000341:                                                                                                  #           THIS INTERPRETIVE SUBROUTINE MAY BE USED TO POINT A SPACECRAFT AXIS IN A DESIRED DIRECTION.  THE AXIS
021176,000342:                                                                                                  #  TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN SUCCESSIVE LOCATIONS OF ERASABLE MEMORY
021177,000343:                                                                                                  #  BEGINNING WITH THE LOCATION CALLED SCAXIS.  THE COMPONENTS OF THIS VECTOR ARE GIVEN IN SPACECRAFT COORDINATES.
021178,000344:                                                                                                  #  THE DIRECTION IN WHICH THIS AXIS IS TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN
021179,000345:                                                                                                  #  SUCCESSIVE LOCATIONS OF ERASABLE MEMORY BEGINNING WITH THE ADDRESS CALLED POINTVSM.  THE COMPONENTS OF THIS
021180,000346:                                                                                                  #  VECTOR ARE GIVEN IN STABLE MEMBER COORDINATES.  WITH THIS INFORMATION VECPOINT COMPUTES A SET OF THREE GIMBAL
021181,000347:                                                                                                  #  ANGLES (2S COMPLEMENT) CORESPONDING TO THE CROSS-PRODUCT ROTATION BETWE EN SCAXIS AND POINTVSM AND STORES THEM
021182,000348:                                                                                                  #  IN T(MPAC) BEFORE RETURNING TO THE CALLER.
021183,000349:                                                                                                  #           THIS ROTATION, HOWEVER, MAY BRING THE S/C INTO GIMBAL LOCK.  WHEN POINTING A VECTOR IN THE Y-Z PLANE,
021184,000350:                                                                                                  #  THE TRANSPONDER AXIS, OR THE AOT FOR THE LEM, THE PROGRAM WILL CORRECT THIS PROBLEM BY ROTATING THE CROSS-
021185,000351:                                                                                                  #  PRODUCT ATTITUDE ABOUT POINTVSM BY A FIXED AMOUNT SUFFICIENT TO ROTATE THE DESIRED S/C ATTITUDE OUT OF GIMBAL
021186,000352:                                                                                                  #  LOCK.  IF THE AXIS TO BE POINTED IS MORE THAN 40.6 DEGREES BUT LESS THAN 60.5 DEG FROM THE +X (OR-X) AXIS,
021187,000353:                                                                                                  #  THE ADDITIONAL ROTATION TO AVOID GIMAL LOCK IS 35 DEGREES.  IF THE AXIS IS MORE THAN 60.5 DEGEES FROM +X (OR -X)
021188,000354:                                                                                                  #  THE ADDITIONAL ROTATION IS 35 DEGREES.  THE GIMBAL ANGLES CORRESPONDING TO THIS ATTITUDE ARE THEN COMPUTED AND
021189,000355:                                                                                                  #  STORED AS 2S COMPLIMENT ANGLES IN T(MPAC) BEFORE RETURNING TO THE CALLER.
021190,000356:                                                                                                  #           WHEN POINTING THE X-AXIS, OR THE THRUST VECTOR, OR ANY VECTOR WITHIN 40.6 DEG OF THE X-AXIS, VECPOINT
021191,000357:                                                                                                  #  CANNOT CORRECT FOR A CROSS-PRODUCT ROTATION INTO GIMBAL LOCK.  IN THIS CASE A PLATFORM REALIGNMENT WOULD BE
021192,000358:                                                                                                  #  REQUIRED TO POINT THE VECTOR IN THE DESIRED DIRECTION.  AT PRESENT NO INDICATION IS GIVEN FOR THIS SITUATION
021193,000359:                                                                                                  #  EXCEPT THAT THE FINAL MIDDLE GIMBAL ANGLE IN MPAC +2 IS GREATER THAN 59 DEGREES.
021194,000360: 
021195,000361:                                                                                                  #           CALLING SEQUENCE -
021196,000362:                                                                                                  #               1) LOAD SCAXIS, POINTVSM
021197,000363:                                                                                                  #               2) CALL
021198,000364:                                                                                                  #                       VECPOINT
021199,000365: 
021200,000366:                                                                                                  #           RETURNS WITH
021201,000367: 
021202,000368:                                                                                                  #               1) DESIRED OUTER  GIMBAL ANGLE IN MPAC
021203,000369:                                                                                                  #               2) DESIRED INNER  GIMBAL ANGLE IN MPAC +1
021204,000370:                                                                                                  #               3) DESIRED MIDDLE GIMBAL ANGLE IN MPAC +2
021205,000371: 
021206,000372: 
021207,000373:                                                                                                  #           ERASABLES USED -
021208,000374: 
021209,000375:                                                                                                  #               1) SCAXIS           6
021210,000376:                                                                                                  #               2) POINTVSM         6
021211,000377:                                                                                                  #               3) MIS             18
021212,000378:                                                                                                  #               4) DEL             18
021213,000379:                                                                                                  #               5) COF              6
021214,000380:                                                                                                  #               6) VECQTEMP         1
021215,000381:                                                                                                  #               7) ALL OF VAC AREA 43
021216,000382: 
021217,000383:                                                                                                  #                        TOTAL     99
021218,000384: 
021219,000385: 27,2000                                           SETLOC   VECPT                                 
021220,000386: 27,2000                                           BANK                                           

Page 489

021222,000388: 27,2032                                           COUNT*   $$/VECPT                              
021223,000389: 
021224,000390: 27,2032  E6,1675                                  EBANK=   BCDU                                  
021225,000391: 
021226,000392: 27,2032           40020        VECPNT1            STQ      BOV                                   #  THIS ENTRY USES DESIRED CDUS
021227,000393: 27,2033           03324                                    VECQTEMP                              #  NOT PRESENT-ENTER WITH CDUD'S IN MPAC
021228,000394: 27,2034           56035                                    VECPNT2                               
021229,000395: 27,2035           52164        VECPNT2            AXC,2    GOTO                                  
021230,000396: 27,2036           03245                                    MIS                                   
021231,000397: 27,2037           56046                                    STORANG                               
021232,000398: 27,2040           40020        VECPOINT           STQ      BOV                                   #  SAVE RETURN ADDRESS
021233,000399: 27,2041           03324                                    VECQTEMP                              
021234,000400: 27,2042           56043                                    VECLEAR                               #  AND CLEAR OVFIND
021235,000401: 27,2043           47164        VECLEAR            AXC,2    RTB                                   
021236,000402: 27,2044           03245                                    MIS                                   #  READ THE PRESENT CDU ANGLES AND
021237,000403: 27,2045           44403                                    READCDUK                              #  STORE THEM IN PD25, 26, 27
021238,000404: 27,2046           34032        STORANG            STCALL   25D                                   
021239,000405: 27,2047           44410                                    CDUTODCM                              #  S/C AXES TO STABLE MEMBER AXES (MIS)
021240,000406: 27,2050           61375                           VLOAD    VXM                                   
021241,000407: 27,2051           03773                                    POINTVSM                              #  RESOLVE THE POINTING DIRECTION VF INTO
021242,000408: 27,2052           03246                                    MIS                                   #  INITIAL S/C AXES ( VF = POINTVSM)
021243,000409: 27,2053           77656                           UNIT                                           
021244,000410: 27,2054           00035                           STORE    28D                                   
021245,000411:                                                                                                  #  PD 28 29 30 31 32 33
021246,000412: 27,2055           53435                           VXV      UNIT                                  #  TAKE THE CROSS PRODUCT VF X VI
021247,000413: 27,2056           03765                                    SCAXIS                                #  WHERE VI = SCAXIS
021248,000414: 27,2057           57400                           BOV      VCOMP                                 
021249,000415: 27,2060           56170                                    PICKAXIS                              
021250,000416: 27,2061           17270                           STODL    COF                                   #  CHECK MAGNITUDE
021251,000417: 27,2062           00045                                    36D                                   #  OF CROSS PRODUCT
021252,000418: 27,2063           50025                           DSU      BMN                                   #  VECTOR, IF LESS
021253,000419: 27,2064           14417                                    DPB-14                                #  THAN B-14 ASSUME
021254,000420: 27,2065           56170                                    PICKAXIS                              #  UNIT OPERATION
021255,000421: 27,2066           50375                           VLOAD    DOT                                   #           INVALID.
021256,000422: 27,2067           03765                                    SCAXIS                                
021257,000423: 27,2070           00035                                    28D                                   
021258,000424: 27,2071           65552                           SL1      ARCCOS                                
021259,000425: 27,2072           77624        COMPMATX           CALL                                           #  NOW COMPUTE THE TRANSFORMATION FROM
021260,000426: 27,2073           44527                                    DELCOMP                               #  FINAL S/C AXES TO INITIAL S/C AXES  MFI
021261,000427: 27,2074           75160                           AXC,1    AXC,2                                 
021262,000428: 27,2075           03245                                    MIS                                   #  COMPUTE THE TRANSFORMATION FROM FINAL
021263,000429: 27,2076           02230                                    KEL                                   #  S/C AXES TO STABLE MEMBER AXES
021264,000430: 27,2077           77624                           CALL                                           #  MFS = MIS MFI
021265,000431: 27,2100           44312                                    MXM3                                  #  (IN PD LIST)
021266,000432: 
021267,000433: 27,2101           51545                           DLOAD    ABS                                   
021268,000434: 27,2102           00007                                    6                                     #  MFS6 = SIN(CPSI)                    $2
021269,000435: 27,2103           50025                           DSU      BMN                                   
021270,000436: 27,2104           14404                                    SINGIMLC                              #  = SIN(59 DEGS)                      $2
021271,000437: 27,2105           56160                                    FINDGIMB                              #  /CPSI/ LESS THAN 59 DEGS

Page 490

021273,000439:                                                                                                  #  I.E. DESIRED ATTITUDE NOT IN GIMBAL LOCK
021274,000440: 
021275,000441: 27,2106           51545                           DLOAD    ABS                                   #  CHECK TO SEE IF WE ARE POINTING
021276,000442: 27,2107           03765                                    SCAXIS                                #  THE THRUST AXIS
021277,000443: 27,2110           51025                           DSU      BPL                                   
021278,000444: 27,2111           14406                                    SINVEC1                               #  SIN 49.4 DEGS                        $2
021279,000445: 27,2112           56160                                    FINDGIMB                              #  IF SO, WE ARE TRYING TO POINT IT INTO
021280,000446: 27,2113           77775                           VLOAD                                          #  GIMBAL LOCK, ABORT COULD GO HERE
021281,000447: 27,2114           77626                           STADR                                          
021282,000448: 27,2115           50515                           STOVL    MIS        +12D                       
021283,000449: 27,2116           77626                           STADR                                          #  STORE MFS (IN PD LIST) IN MIS
021284,000450: 27,2117           50523                           STOVL    MIS        +6                         
021285,000451: 27,2120           77626                           STADR                                          
021286,000452: 27,2121           50531                           STOVL    MIS                                   
021287,000453: 27,2122           03254                                    MIS        +6                         #  INNER GIMBAL AXIS IN FINAL S/C AXES
021288,000454: 27,2123           57444                           BPL      VCOMP                                 #  LOCATE THE IG AXIS DIRECTION CLOSEST TO
021289,000455: 27,2124           56125                                    IGSAMEX                               #  FINAL X S/C AXIS
021290,000456: 
021291,000457: 27,2125           50035        IGSAMEX            VXV      BMN                                   #  FIND THE SHORTEST WAY OF ROTATING THE
021292,000458: 27,2126           03765                                    SCAXIS                                #  S/C OUT OF GIMBAL LOCK BY A ROTATION
021293,000459: 27,2127           56134                                    U=SCAXIS                              #  ABOUT +- SCAXIS, I.E. IF  (IG (SGN MFS3)
021294,000460:                                                                                                  #  X SCAXIS . XF) LESS THAN 0, U = SCAXIS
021295,000461:                                                                                                  #  OTHERWISE U = -SCAXIS
021296,000462: 
021297,000463: 27,2130           57575                           VLOAD    VCOMP                                 
021298,000464: 27,2131           03765                                    SCAXIS                                
021299,000465: 27,2132           37270                           STCALL   COF                                   #  ROTATE ABOUT -SCAXIS
021300,000466: 27,2133           56137                                    CHEKAXIS                              
021301,000467: 27,2134           77775        U=SCAXIS           VLOAD                                          
021302,000468: 27,2135           03765                                    SCAXIS                                
021303,000469: 27,2136           03270                           STORE    COF                                   #  ROTATE ABOUT + SCAXIS
021304,000470: 27,2137           51545        CHEKAXIS           DLOAD    ABS                                   
021305,000471: 27,2140           03765                                    SCAXIS                                #  SEE IF WE ARE POINTING THE AOT
021306,000472: 27,2141           51025                           DSU      BPL                                   
021307,000473: 27,2142           14410                                    SINVEC2                               #  SIN 29.5 DEGS                        $2
021308,000474: 27,2143           56147                                    PICKANG1                              #  IF SO, ROTATE 50 DEGS ABOUT +- SCAXIS
021309,000475: 27,2144           52145                           DLOAD    GOTO                                  #  IF NOT, MUST BE POINTING THE TRANSPONDER
021310,000476: 27,2145           14414                                    VECANG2                               #  OR SOME VECTOR IN THE Y, OR Z PLANE
021311,000477: 27,2146           56151                                    COMPMFSN                              #  IN THIS CASE ROTATE 35 DEGS TO GET OUT
021312,000478:                                                                                                  #  OF GIMBAL LOCK (VECANG2  $360)
021313,000479: 27,2147           77745        PICKANG1           DLOAD                                          
021314,000480: 27,2150           14412                                    VECANG1                               #  = 50 DEGS                          $ 360
021315,000481: 27,2151           77624        COMPMFSN           CALL                                           
021316,000482: 27,2152           44527                                    DELCOMP                               #  COMPUTE THE ROTATION ABOUT SCAXIS TO
021317,000483: 27,2153           75160                           AXC,1    AXC,2                                 #  BRING MFS OUT OF GIMBAL LOCK
021318,000484: 27,2154           03245                                    MIS                                   
021319,000485: 27,2155           02230                                    KEL                                   
021320,000486: 27,2156           77624                           CALL                                           #  COMPUTE THE NEW TRANSFORMATION FROM
021321,000487: 27,2157           44312                                    MXM3                                  #  DESIRED S/C AXES TO STABLE MEMBER AXES
021322,000488:                                                                                                  #  WHICH WILL ALIGN VI WITH VF AND AVOID

Page 491

021324,000490:                                                                                                  #  GIMBAL LOCK
021325,000491: 27,2160           45160        FINDGIMB           AXC,1    CALL                                  
021326,000492: 27,2161           00000                                    0                                     #  EXTRACT THE COMMANDED CDU ANGLES FROM
021327,000493: 27,2162           44654                                    DCMTOCDU                              #  THIS MATRIX
021328,000494: 27,2163           40234                           RTB      SETPD                                 
021329,000495: 27,2164           21621                                    V1STO2S                               #  CONVERT TO 2:S COMPLEMENT
021330,000496: 27,2165           00001                                    0                                     
021331,000497: 27,2166           77650                           GOTO                                           
021332,000498: 27,2167           03324                                    VECQTEMP                              #  RETURN TO CALLER
021333,000499: 
021334,000500: 27,2170           50375        PICKAXIS           VLOAD    DOT                                   #  IF VF X VI = 0,  FIND VF . VI
021335,000501: 27,2171           00035                                    28D                                   
021336,000502: 27,2172           03765                                    SCAXIS                                
021337,000503: 27,2173           72240                           BMN      TLOAD                                 
021338,000504: 27,2174           54356                                    ROT180                                
021339,000505: 27,2175           00032                                    25D                                   
021340,000506: 27,2176           77650                           GOTO                                           #  IF VF = VI, CDU DESIRED = PRESENT CDU
021341,000507: 27,2177           03324                                    VECQTEMP                              #  PRESENT CDU ANGLES
021342,000508: 
021343,000509: 35,2000                                           BANK     35                                    
021344,000510: 26,2000                                           SETLOC   MANUVER1                              
021345,000511: 26,2000                                           BANK                                           
021346,000512: 26,2356           47375        ROT180             VLOAD    VXV                                   #  IF VF, VI ANTIPARALLEL, 108 DEG ROTATION
021347,000513: 26,2357           03254                                    MIS        +6                         #  IS REQUIRED. Y STABLE MEMBER AXIS IN
021348,000514: 26,2360           06516                                    HIDPHALF                              #  INITIAL S/C AXES.
021349,000515: 26,2361           47256                           UNIT     VXV                                   #  FIND Y(SM) X X(I)
021350,000516: 26,2362           03765                                    SCAXIS                                #  FIND UNIT(VI X UNIT(Y(SM) X X(I)))
021351,000517: 26,2363           40056                           UNIT     BOV                                   #  I.E. PICK A VECTOR IN THE PLANE OF X(I),
021352,000518: 26,2364           54400                                    PICKX                                 #  Y(SM) PERPENDICULAR TO VI
021353,000519: 26,2365           17270                           STODL    COF                                   
021354,000520: 26,2366           00045                                    36D                                   #  CHECK MAGNITUDE
021355,000521: 26,2367           50025                           DSU      BMN                                   #  OF THIS VECTOR.
021356,000522: 26,2370           14417                                    DPB-14                                #  IF LESS THAN B-14,
021357,000523: 26,2371           54400                                    PICKX                                 #  PICK X-AXIS.
021358,000524: 26,2372           77775                           VLOAD                                          
021359,000525: 26,2373           03270                                    COF                                   
021360,000526: 26,2374           17270        XROT               STODL    COF                                   
021361,000527: 26,2375           06516                                    HIDPHALF                              
021362,000528: 26,2376           77650                           GOTO                                           
021363,000529: 26,2377           56072                                    COMPMATX                              
021364,000530: 26,2400           52175        PICKX              VLOAD    GOTO                                  #  PICK THE XAXIS IN THIS CASE
021365,000531: 26,2401           06516                                    HIDPHALF                              
021366,000532: 26,2402           54374                                    XROT                                  
021367,000533: 26,2403           15555 35172  SINGIMLC           2DEC     .4285836003                            #  =SIN(59)                $2
021368,000534: 
021369,000535: 26,2405           14113 36326  SINVEC1            2DEC     .3796356537                            #  =SIN(49.4)              $2
021370,000536: 
021371,000537: 26,2407           07701 35703  SINVEC2            2DEC     .2462117800                            #  =SIN(29.5)              $2
021372,000538: 
021373,000539: 26,2411           04343 21616  VECANG1            2DEC     .1388888889                            #  = 50 DEGREES                       $360
021374,000540: 

Page 492

021376,000542: 26,2413           03070 34344  VECANG2            2DEC     .09722222222                            #  = 35 DEGREES                       $360
021377,000543: 
021378,000544: 26,2415           00000        1BITDP             OCT      0                                     #  KEEP THIS BEFORE DPB(-14)     *********
021379,000545: 26,2416           00001        DPB-14             OCT      00001                                 
021380,000546: 26,2417           00000                           OCT      00000                                 
021381,000547: 

Page 493

021383,000549:                                                                                                  #  ROUTINE FOR INITIATING AUTOMATIC MANEUVER VIA KEYBOARD (V49)
021384,000550: 
021385,000551: 
021386,000552: 34,2000                                           BANK     34                                    
021387,000553: 23,2000                                           SETLOC   R62                                   
021388,000554: 23,2000                                           BANK                                           
021389,000555: 23,2103  E6,1675                                  EBANK=   BCDU                                  
021390,000556: 
021391,000557: 23,2103                                           COUNT*   $$/R62                                
021392,000558: 
021393,000559: 23,2103  23,2103               R62DISP            EQUALS   R62FLASH                              
021394,000560: 
021395,000561: 23,2103           35010        R62FLASH           CAF      V06N22                                #  FLASH V06N22 AND
021396,000562: 23,2104           04616                           TC       BANKCALL                              #  ICDU ANGLES
021397,000563: 23,2105           20477                           CADR     GOFLASH                               
021398,000564: 23,2106           15503                           TCF      ENDEXT                                #  TERMINATE
021399,000565: 23,2107           12111                           TCF      GOMOVE                                #  PROCEED
021400,000566: 23,2110           12103                           TCF      R62FLASH                              #  ENTER
021401,000567: 
021402,000568:                                                                                                  #  ASTRONAUT MAY LOAD NEW ICDUS AT THIS
021403,000569:                                                                                                  #  POINT
021404,000570: 23,2111           05515        GOMOVE             TC       UPFLAG                                #  SET FOR 3-AXIS MANEUVER
021405,000571: 23,2112           00124                           ADRES    3AXISFLG                              
021406,000572: 
021407,000573: 23,2113           04616                           TC       BANKCALL                              
021408,000574: 23,2114           54125                           CADR     R60LEM                                
021409,000575: 23,2115           15503                           TCF      ENDEXT                                #  END R62
021410,000576: 

End of include-file R60,R62.agc.  Parent file is MAIN.agc