Source Code

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

The reconstruction began with source code of Zerlina 56, Luminary 210, and Luminary 131, previously transcribed from digitized copies of those programs. The code was created by combining the three, using Zerlina 56 as a base, since it was based off of Luminary 183. The differences between the three were carefully merged using the Luminary memos as a guide, with all changes made after Luminary 178 being backed out. 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 178 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.

020887,000002:                                                                                                  ## Copyright:   Public domain.
020888,000003:                                                                                                  ## Filename:    R60,R62.agc
020889,000004:                                                                                                  ## Purpose:     A section of Luminary revision 178.
020890,000005:                                                                                                  ##              It is part of the reconstructed source code for the final
020891,000006:                                                                                                  ##              release of the flight software for the Lunar Module's
020892,000007:                                                                                                  ##              (LM) Apollo Guidance Computer (AGC) for Apollo 14. The
020893,000008:                                                                                                  ##              code has been recreated from copies of Zerlina 56, Luminary
020894,000009:                                                                                                  ##              210, and Luminary 131, as well as many Luminary memos.
020895,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
020896,000011:                                                                                                  ##              exactly match those specified for Luminary 178 in NASA
020897,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
020898,000013:                                                                                                  ##              that the reconstruction is correct.
020899,000014:                                                                                                  ## Reference:   pp. 480-493
020900,000015:                                                                                                  ## Assembler:   yaYUL
020901,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
020902,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
020903,000018:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Zerlina 56.
020904,000019: 

Page 480

020906,000021:                                                                                                  #  MOD NO: 0                        DATE: 1 MAY 1968
020907,000022: 
020908,000023:                                                                                                  #  MOD BY: DIGITAL DEVEL GROUP      LOG SECTION R60,R62
020909,000024: 
020910,000025:                                                                                                  #  FUNCTIONAL DESCRIPTION:
020911,000026: 
020912,000027:                                                                                                  #  CALLED AS A GENERAL SUBROUTINE TO MANEUVER THE LM TO A SPECIFIED
020913,000028:                                                                                                  #  ATTITUDE.
020914,000029: 
020915,000030:                                                                                                  #  1. IF THE 3-AXIS FLAG IS NOT SET THE FINAL CDU ANGLES ARE
020916,000031:                                                                                                  #  CALCULATED (VECPOINT).
020917,000032: 
020918,000033:                                                                                                  #  2. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
020919,000034: 
020920,000035:                                                                                                  #  3. REQUEST FLASHING DISPLAY V50 N18 PLEASE PERFORM AUTO MANEUVER.
020921,000036: 
020922,000037:                                                                                                  #  4. IF PRIORITY DISPLAY FLAG IS SET DO A PHASECHANGE. THEN AWAIT
020923,000038:                                                                                                  #  ASTRONAUT RESPONSE.
020924,000039: 
020925,000040:                                                                                                  #  5. DISPLAY RESPONSE RETURNS:
020926,000041: 
020927,000042:                                                                                                  #      A. ENTER - RESET 3-AXIS FLAG AND RETURN TO CLIENT.
020928,000043: 
020929,000044:                                                                                                  #      B. TERMINATE - IF IN P00 GO TO STEP 5A. OTHERWISE CHECK IF R61 IS
020930,000045:                                                                                                  #         THE CALLING PROGRAM. IF IN R61 AN EXIT IS MADE TO GOTOV56. IF
020931,000046:                                                                                                  #         NOT IN R61 AN EXIT IS DONE VIA GOTOP00H.
020932,000047: 
020933,000048:                                                                                                  #      C. PROCEED - CONTINUE WITH PROGRAM AT STEP 6.
020934,000049: 
020935,000050:                                                                                                  #  6. IF THE 3-AXISFLAG IS NOT SET, THE FINAL CDU ANGLES ARE CALCULATED
020936,000051:                                                                                                  #     (VECPOINT).
020937,000052: 
020938,000053:                                                                                                  #  7. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
020939,000054: 
020940,000055:                                                                                                  #  8. IF THE G+N SWITCH IS NOT SET GO BACK TO STEP 3.
020941,000056: 
020942,000057:                                                                                                  #  9. IF THE AUTO SWITCH IS NOT SET GO BACK TO STEP 3.
020943,000058: 
020944,000059:                                                                                                  #  10. NONFLASHING DISPLAY V06N18 (FDAI ANGLES).
020945,000060: 
020946,000061:                                                                                                  #  11. DO A PHASECHANGE.
020947,000062: 
020948,000063:                                                                                                  #  12. DO A MANEUVER CALCULATION AND ICDU DRIVE ROUTINE TO ACHIEVE FINAL
020949,000064: 
020950,000065:                                                                                                  #      GIMBAL ANGLES (GOMANUR).
020951,000066:                                                                                                  #  13. AT END OF MANEUVER GO TO STEP 3.
020952,000067: 
020953,000068:                                                                                                  #           IF SATISFACTORY MANEUVER STEP 5A EXITS R60.
020954,000069:                                                                                                  #           FOR FURTHER ADJUSTMENT OF THE VEHICLE ATTITUDE ABOUT THE
020955,000070:                                                                                                  #           DESIRED VECTOR, THE ROUTINE MAY BE PERFORMED AGAIN STARTING AT

Page 481

020957,000072:                                                                                                  #           STEP 5C.
020958,000073: 
020959,000074:                                                                                                  #  CALLING SEQUENCE:  TC BANKCALL
020960,000075:                                                                                                  #                     CADR R60LEM
020961,000076: 
020962,000077:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED : SCAXIS, POINTVSM (FOR VECPOINT)
020963,000078:                                                                                                  #                                     3AXISFLG.
020964,000079: 
020965,000080:                                                                                                  #  SUBROUTINES CALLED: VECPOINT, BALLANGS, GOPERF2R, LINUS, GODSPER,
020966,000081:                                                                                                  #                     GOMANUR, DOWNFLAG, PHASCHNG, UPFLAG
020967,000082: 
020968,000083:                                                                                                  #  NORMAL EXIT MODES: CAE TEMPR60   (CALLERS RETURN ADDRESS)
020969,000084:                                                                                                  #                     TC  BANKJUMP
020970,000085: 
020971,000086:                                                                                                  #  ALARMS: NONE
020972,000087: 
020973,000088:                                                                                                  #  OUTPUT: NONE
020974,000089: 
020975,000090:                                                                                                  #  DEBRIS: CPHI, CTHETA, CPSI, 3AXISFLG, TBASE2
020976,000091: 
020977,000092: 
020978,000093: 34,2000                                           BANK     34                                    
020979,000094: 26,2000                                           SETLOC   MANUVER                               
020980,000095: 26,2000                                           BANK                                           
020981,000096: 
020982,000097: 26,2125     1163                                  EBANK=   TEMPR60                               
020983,000098: 
020984,000099: 26,2125                                           COUNT*   $$/R06                                
020985,000100: 26,2125           04645        R60LEM             TC       MAKECADR                              
020986,000101: 26,2126           55163                           TS       TEMPR60                               
020987,000102: 
020988,000103: 26,2127           34746        REDOMANN           CAF      3AXISBIT                              
020989,000104: 26,2130           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
020990,000105: 26,2131           10000                           CCS      A                                     
020991,000106: 26,2132           12140                           TCF      TOBALL                                #  YES
020992,000107: 26,2133           06042                           TC       INTPRET                               
020993,000108: 26,2134           77624                           CALL                                           
020994,000109: 26,2135           56040                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
020995,000110: 26,2136           00322                           STORE    CPHI                                  #  STORE FINAL ANGLES - CPHI,CTHETA,CPSI
020996,000111: 26,2137           77776                           EXIT                                           
020997,000112: 
020998,000113: 26,2140           05515        TOBALL             TC       UPFLAG                                #  INSURE THAT TOTAL ATTITUDE ERRORS ARE
020999,000114: 26,2141           00013                           ADRES    NEEDLFLG                              #  DISPLAYED ON FDAI ERROR NEEDLES
021000,000115: 26,2142           05527                           TC       DOWNFLAG                              
021001,000116: 26,2143           00000                           ADRES    NEED2FLG                              
021002,000117: 26,2144           04616                           TC       BANKCALL                              
021003,000118: 26,2145           54274                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
021004,000119: 26,2146           32262        TOBALLA            CAF      V06N18                                
021005,000120: 26,2147           04616                           TC       BANKCALL                              

Page 482

021007,000122: 26,2150           20711                           CADR     GOPERF2R                              #  DISPLAY PLEASE PERFORM AUTO MANEUVER
021008,000123: 26,2151           02250                           TC       R61TEST                               
021009,000124: 26,2152           02156                           TC       REDOMANC                              #  PROCEED
021010,000125: 26,2153           02203                           TC       ENDMANU1                              #  ENTER I.E. FINISHED WITH R60
021011,000126: 26,2154           02207                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
021012,000127: 26,2155           05155                           TC       ENDOFJOB                              
021013,000128: 
021014,000129: 26,2156           34746        REDOMANC           CAF      3AXISBIT                              
021015,000130: 26,2157           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
021016,000131: 26,2160           10000                           CCS      A                                     
021017,000132: 26,2161           12167                           TCF      TOBALLC                               #  YES
021018,000133: 26,2162           06042                           TC       INTPRET                               
021019,000134: 26,2163           77624                           CALL                                           
021020,000135: 26,2164           56040                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
021021,000136: 26,2165           00322                           STORE    CPHI                                  #  STORE ANGLES
021022,000137: 26,2166           77776                           EXIT                                           
021023,000138: 
021024,000139: 26,2167           04616        TOBALLC            TC       BANKCALL                              
021025,000140: 26,2170           54274                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
021026,000141: 26,2171           02263                           TC       G+N,AUTO                              #  CHECK AUTO MODE
021027,000142: 26,2172           10000                           CCS      A                                     
021028,000143: 26,2173           12146                           TCF      TOBALLA                               #  NOT AUTO, GO REREQUEST AUTO MANEUVER.
021029,000144: 
021030,000145: 26,2174           32262        AUTOMANV           CAF      V06N18                                #  STATIC DISPLAY DURING AUTO MANEUVER
021031,000146: 26,2175           04616                           TC       BANKCALL                              #                                       -
021032,000147: 26,2176           20452                           CADR     GODSPR                                #                                       -
021033,000148: 26,2177           02207                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
021034,000149: 
021035,000150: 26,2200           04616        STARTMNV           TC       BANKCALL                              #  PERFORM MANEUVER VIA KALCMANU
021036,000151: 26,2201           17754                           CADR     GOMANUR                               
021037,000152: 
021038,000153: 26,2202           12146        ENDMANUV           TCF      TOBALLA                               #  FINISHED MANEUVER.
021039,000154: 26,2203           05527        ENDMANU1           TC       DOWNFLAG                              #  RESET 3-AXIS FLAG
021040,000155: 26,2204           00124                           ADRES    3AXISFLG                              
021041,000156: 26,2205           31163                           CAE      TEMPR60                               #                                       -
021042,000157: 26,2206           04640                           TC       BANKJUMP                              #                                       -
021043,000158: 
021044,000159: 26,2207           40100        CHKLINUS           CS       FLAGWRD4                              
021045,000160: 26,2210           74740                           MASK     PDSPFBIT                              #  IS PRIORITY DISPLAY FLAG SET?
021046,000161: 26,2211           10000                           CCS      A                                     #                                       -
021047,000162: 26,2212           00002                           TC       Q                                     #  NO - EXIT
021048,000163: 26,2213           30002                           CA       Q                                     
021049,000164: 26,2214           54156                           TS       MPAC       +2                         #  SAVE RETURN
021050,000165: 26,2215           46250                           CS       THREE                                 #  OBTAIN LOCATION FOR RESTART
021051,000166: 26,2216           60133                           AD       BUF2                                  #  HOLDS Q OF LAST DISPLAY
021052,000167: 26,2217           55054                           TS       TBASE2                                
021053,000168: 
021054,000169: 26,2220           05364                           TC       PHASCHNG                              
021055,000170: 26,2221           00132                           OCT      00132                                 
021056,000171: 

Page 483

021058,000173: 26,2222           34745                           CAF      BIT7                                  
021059,000174: 26,2223           05475                           TC       LINUS                                 #  GO SET BITS FOR PRIORITY DISPLAY     -
021060,000175: 26,2224           00156                           TC       MPAC       +2                         
021061,000176: 
021062,000177: 26,2225           37717        RELINUS            CAF      PRIO26                                #  RESTORE ORIGINAL PRIORITY
021063,000178: 26,2226           05146                           TC       PRIOCHNG                              
021064,000179: 
021065,000180: 26,2227           34747                           CAF      TRACKBIT                              #  DON'T CONTINUE R60 UNLESS TRACKFLAG ON.
021066,000181: 26,2230           70075                           MASK     FLAGWRD1                              
021067,000182: 26,2231           10000                           CCS      A                                     
021068,000183: 26,2232           12245                           TCF      RER60                                 
021069,000184: 
021070,000185: 26,2233           34745                           CAF      RNDVZBIT                              #  IS IT P20?
021071,000186: 26,2234           70074                           MASK     FLAGWRD0                              
021072,000187: 26,2235           10000                           CCS      A                                     
021073,000188: 26,2236           02242                           TC       +4                                    #  YES
021074,000189: 26,2237           05364                           TC       PHASCHNG                              #  NO, MUST BE P25, SET 2.11 SPOT
021075,000190: 26,2240           40112                           OCT      40112                                 
021076,000191: 
021077,000192: 26,2241           05155                           TC       ENDOFJOB                              
021078,000193: 
021079,000194: 26,2242           05364                           TC       PHASCHNG                              #  SET 2.7 SPOT FOR P20
021080,000195: 26,2243           40072                           OCT      40072                                 
021081,000196: 
021082,000197: 26,2244           05155                           TC       ENDOFJOB                              
021083,000198: 
021084,000199: 26,2245           05515        RER60              TC       UPFLAG                                #  SET PRIO DISPLAY FLAG AFTER RESTART
021085,000200: 26,2246           00077                           ADRES    PDSPFLAG                              
021086,000201: 
021087,000202: 26,2247           01054                           TC       TBASE2                                
021088,000203: 
021089,000204: 26,2250           31010        R61TEST            CA       MODREG                                #  IF WE ARE IN P00 IT MUST BE V49 OR V89
021090,000205: 26,2251           00006                           EXTEND                                         
021091,000206: 26,2252           12203                           BZF      ENDMANU1                              #  THUS WE GO TO ENDEXT VIA USER
021092,000207: 
021093,000208: 26,2253           30100                           CA       FLAGWRD4                              #  ARE WE IN R61  (P20 OR P25)
021094,000209: 26,2254           74740                           MASK     PDSPFBIT                              
021095,000210: 26,2255           00006                           EXTEND                                         
021096,000211: 26,2256           16001                           BZF      GOTOPOOH                              #  NO
021097,000212: 26,2257           06025                           TC       GOTOV56                               #  YES
021098,000213: 
021099,000214: 26,2260           20100        BIT14+7            OCT      20100                                 #                                       -
021100,000215: 26,2261           00203        OCT203             OCT      203                                   
021101,000216: 26,2262           01422        V06N18             VN       0618                                  
021102,000217:                                                                                                  #           SUBROUTINE TO CHECK FOR G+N CONTROL, AUTO STABILIZATION
021103,000218: 
021104,000219:                                                                                                  #           RETURNS WITH C(A) = +  IF NOT SET FOR G+N, AUTO
021105,000220:                                                                                                  #           RETURNS WITH C(A) = +0 IF SWITCHES ARE SET
021106,000221: 
021107,000222: 26,2263           00006        G+N,AUTO           EXTEND                                         

Page 484

021109,000224: 26,2264           00030                           READ     CHAN30                                
021110,000225: 26,2265           74742                           MASK     BIT10                                 
021111,000226: 26,2266           10000                           CCS      A                                     
021112,000227: 26,2267           00002                           TC       Q                                     #  NOT IN G+N  C(A) = +
021113,000228: 26,2270           00006        ISITAUTO           EXTEND                                         #  CHECK FOR AUTO MODE
021114,000229: 26,2271           00031                           READ     CHAN31                                
021115,000230: 26,2272           74736                           MASK     BIT14                                 
021116,000231: 26,2273           00002                           TC       Q                                     #  (+) = NOT IN AUTO, (+0) = AOK
021117,000232: 

Page 485

021119,000234:                                                                                                  #  PROGRAM DESCRIPTION BALLANGS
021120,000235:                                                                                                  #  MOD NO.         LOG SECTION  R60,R62
021121,000236: 
021122,000237:                                                                                                  #  WRITTEN BY RAMA M.AIYAWAR
021123,000238:                                                                                                  #  FUNCTIONAL DESCRIPTION
021124,000239: 
021125,000240:                                                                                                  #  COMPUTES LM FDAI BALL DISPLAY ANGLES
021126,000241:                                                                                                  #  CALLING SEQUENCE
021127,000242: 
021128,000243:                                                                                                  #           TC     BALLANGS
021129,000244:                                                                                                  #  NORMAL EXIT MODE
021130,000245: 
021131,000246:                                                                                                  #           TC     BALLEXIT        (SAVED Q)
021132,000247: 
021133,000248:                                                                                                  #  ALARM OR EXIT MODE  NIL
021134,000249:                                                                                                  #  SUBROUTINES CALLED
021135,000250:                                                                                                  #           CD*TR*G
021136,000251:                                                                                                  #           ARCTAN
021137,000252: 
021138,000253:                                                                                                  #  INPUT
021139,000254: 
021140,000255:                                                                                                  #  CPHI,CTHETA,CPSI  ARE  THE ANGLES CORRESPONDING TO AOG,AIG,AMG. THEY ARE
021141,000256:                                                                                                  #  SP,2S COMPLIMENT SCALED TO HALF REVOLUTION.
021142,000257:                                                                                                  #  OUTPUT
021143,000258: 
021144,000259:                                                                                                  #  FDAIX,FDAIY,FDAIZ ARE THE REQUIRED BALL ANGLES SCALED TO HALF REVOLUTION
021145,000260:                                                                                                  #  SP,2S COMPLIMENT.
021146,000261:                                                                                                  #  THESE ANGLES WILL BE DISPLAYED AS DEGREES AND HUNDREDTHS, IN THE ORDER ROLL, PITCH, YAW, USING NOUNS 18 & 19.
021147,000262: 
021148,000263:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
021149,000264: 
021150,000265:                                                                                                  #  CPHI,CTHETA,CPSI EACH A SP REGISTER
021151,000266:                                                                                                  #  DEBRIS
021152,000267: 
021153,000268:                                                                                                  #  A,L,Q,MPAC,SINCDU,COSCDU,PUSHLIST,BALLEXIT
021154,000269: 
021155,000270: 
021156,000271:                                                                                                  #  NOMENCLATURE:  CPHI, CTHETA, & CPSI REPRESENT THE OUTER, INNER, & MIDDLE GIMBAL ANGLES, RESPECTIVELY; OR
021157,000272:                                                                                                  #  EQUIVALENTLY, CDUX, CDUY, & CDUZ.
021158,000273: 
021159,000274:                                                                                                  #  NOTE:  ARCTAN CHECKS FOR OVERFLOW AND SHOULD BE ABLE TO HANDLE ANY SINGULARITIES.
021160,000275: 
021161,000276: 26,2000                                           SETLOC   BAWLANGS                              
021162,000277: 26,2000                                           BANK                                           
021163,000278: 
021164,000279: 26,2274                                           COUNT*   $$/BALL                               
021165,000280: 26,2274           04645        BALLANGS           TC       MAKECADR                              
021166,000281: 26,2275           55337                           TS       BALLEXIT                              
021167,000282: 26,2276           30321                           CA       CPHI                                  

Page 486

021169,000284: 26,2277           54771                           TS       CDUSPOT    +4                         
021170,000285: 26,2300           30322                           CA       CTHETA                                
021171,000286: 26,2301           54765                           TS       CDUSPOT                               
021172,000287: 26,2302           30323                           CA       CPSI                                  
021173,000288: 26,2303           54767                           TS       CDUSPOT    +2                         
021174,000289: 
021175,000290: 26,2304           06042                           TC       INTPRET                               
021176,000291: 26,2305           45001                           SETPD    CALL                                  
021177,000292: 26,2306           00001                                    0D                                    
021178,000293: 26,2307           47511                                    CD*TR*G                               
021179,000294: 
021180,000295: 26,2310           41345                           DLOAD    DMP                                   
021181,000296: 26,2311           00742                                    SINCDUX                               #  SIN (OGA)
021182,000297: 26,2312           00746                                    COSCDUZ                               #  COS (MGA)
021183,000298: 
021184,000299: 26,2313           57552                           SL1      DCOMP                                 #  SCALE
021185,000300: 26,2314           65336                           ARCSIN   PDDL                                  #  YAW = ARCSIN(-SXCZ) INTO 0 PD
021186,000301: 26,2315           00740                                    SINCDUZ                               
021187,000302: 26,2316           14023                           STODL    SINTH                                 #  (SINTH = 18D IN PD)
021188,000303: 26,2317           00746                                    COSCDUZ                               
021189,000304: 26,2320           72405                           DMP      SL1                                   #  RESCALE
021190,000305: 26,2321           00750                                    COSCDUX                               
021191,000306: 26,2322           34021                           STCALL   COSTH                                 #  (COSTH = 16D IN PD)
021192,000307: 26,2323           26506                                    ARCTAN                                
021193,000308: 26,2324           41325                           PDDL     DMP                                   #  ROLL = ARCTAN(SZ/CZCX) INTO 2 PD
021194,000309: 26,2325           00740                                    SINCDUZ                               
021195,000310: 26,2326           00742                                    SINCDUX                               
021196,000311: 26,2327           41512                           SL2      PUSH                                  #  SXSZ INTO 4 PD
021197,000312: 26,2330           65205                           DMP      PDDL                                  #  SXSZCY INTO 4 PD
021198,000313: 26,2331           00744                                    COSCDUY                               
021199,000314: 26,2332           65205                           DMP      PDDL                                  #  SXSZSY INTO 6 PD
021200,000315: 26,2333           00736                                    SINCDUY                               
021201,000316: 26,2334           00750                                    COSCDUX                               
021202,000317: 26,2335           72405                           DMP      SL1                                   #  CXCY
021203,000318: 26,2336           00744                                    COSCDUY                               
021204,000319: 26,2337           45425                           DSU      STADR                                 #  PULL UP FROM 6 PD
021205,000320: 26,2340           63756                           STODL    COSTH                                 #  COSTH = CXCY - SXSZSY
021206,000321: 26,2341           00736                                    SINCDUY                               
021207,000322: 26,2342           72405                           DMP      SL1                                   
021208,000323: 26,2343           00750                                    COSCDUX                               #  CXSY
021209,000324: 26,2344           45415                           DAD      STADR                                 #  PULL UP FROM 4 PD
021210,000325: 26,2345           43754                           STCALL   SINTH                                 #  SINTH = CXSY + SXSZCY
021211,000326: 26,2346           26506                                    ARCTAN                                #  RETURNS WITH D(MPAC) = PITCH
021212,000327: 26,2347           55525                           PDDL     VDEF                                  #  PITCH INTO 2 PD, ROLL INTO MPAC FROM 2PD
021213,000328: 26,2350           77634                           RTB                                            #  VDEF MAKES V(MPAC) = ROLL, PITCH, YAW
021214,000329: 26,2351           21621                                    V1STO2S                               
021215,000330: 26,2352           02345                           STORE    FDAIX                                 #  MODE IS TP
021216,000331: 26,2353           77776                           EXIT                                           
021217,000332: 
021218,000333: 26,2354           31337        ENDBALL            CA       BALLEXIT                              

Page 487

021220,000335: 26,2355           04640                           TC       BANKJUMP                              
021221,000336: 

Page 488

021223,000338:                                                                                                  #  PROGRAM DESCRIPTION - VECPOINT
021224,000339: 
021225,000340: 
021226,000341:                                                                                                  #           THIS INTERPRETIVE SUBROUTINE MAY BE USED TO POINT A SPACECRAFT AXIS IN A DESIRED DIRECTION.  THE AXIS
021227,000342:                                                                                                  #  TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN SUCCESSIVE LOCATIONS OF ERASABLE MEMORY
021228,000343:                                                                                                  #  BEGINNING WITH THE LOCATION CALLED SCAXIS.  THE COMPONENTS OF THIS VECTOR ARE GIVEN IN SPACECRAFT COORDINATES.
021229,000344:                                                                                                  #  THE DIRECTION IN WHICH THIS AXIS IS TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN
021230,000345:                                                                                                  #  SUCCESSIVE LOCATIONS OF ERASABLE MEMORY BEGINNING WITH THE ADDRESS CALLED POINTVSM.  THE COMPONENTS OF THIS
021231,000346:                                                                                                  #  VECTOR ARE GIVEN IN STABLE MEMBER COORDINATES.  WITH THIS INFORMATION VECPOINT COMPUTES A SET OF THREE GIMBAL
021232,000347:                                                                                                  #  ANGLES (2S COMPLEMENT) CORESPONDING TO THE CROSS-PRODUCT ROTATION BETWE EN SCAXIS AND POINTVSM AND STORES THEM
021233,000348:                                                                                                  #  IN T(MPAC) BEFORE RETURNING TO THE CALLER.
021234,000349:                                                                                                  #           THIS ROTATION, HOWEVER, MAY BRING THE S/C INTO GIMBAL LOCK.  WHEN POINTING A VECTOR IN THE Y-Z PLANE,
021235,000350:                                                                                                  #  THE TRANSPONDER AXIS, OR THE AOT FOR THE LEM, THE PROGRAM WILL CORRECT THIS PROBLEM BY ROTATING THE CROSS-
021236,000351:                                                                                                  #  PRODUCT ATTITUDE ABOUT POINTVSM BY A FIXED AMOUNT SUFFICIENT TO ROTATE THE DESIRED S/C ATTITUDE OUT OF GIMBAL
021237,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,
021238,000353:                                                                                                  #  THE ADDITIONAL ROTATION TO AVOID GIMAL LOCK IS 35 DEGREES.  IF THE AXIS IS MORE THAN 60.5 DEGEES FROM +X (OR -X)
021239,000354:                                                                                                  #  THE ADDITIONAL ROTATION IS 35 DEGREES.  THE GIMBAL ANGLES CORRESPONDING TO THIS ATTITUDE ARE THEN COMPUTED AND
021240,000355:                                                                                                  #  STORED AS 2S COMPLIMENT ANGLES IN T(MPAC) BEFORE RETURNING TO THE CALLER.
021241,000356:                                                                                                  #           WHEN POINTING THE X-AXIS, OR THE THRUST VECTOR, OR ANY VECTOR WITHIN 40.6 DEG OF THE X-AXIS, VECPOINT
021242,000357:                                                                                                  #  CANNOT CORRECT FOR A CROSS-PRODUCT ROTATION INTO GIMBAL LOCK.  IN THIS CASE A PLATFORM REALIGNMENT WOULD BE
021243,000358:                                                                                                  #  REQUIRED TO POINT THE VECTOR IN THE DESIRED DIRECTION.  AT PRESENT NO INDICATION IS GIVEN FOR THIS SITUATION
021244,000359:                                                                                                  #  EXCEPT THAT THE FINAL MIDDLE GIMBAL ANGLE IN MPAC +2 IS GREATER THAN 59 DEGREES.
021245,000360: 
021246,000361:                                                                                                  #           CALLING SEQUENCE -
021247,000362:                                                                                                  #               1) LOAD SCAXIS, POINTVSM
021248,000363:                                                                                                  #               2) CALL
021249,000364:                                                                                                  #                       VECPOINT
021250,000365: 
021251,000366:                                                                                                  #           RETURNS WITH
021252,000367: 
021253,000368:                                                                                                  #               1) DESIRED OUTER  GIMBAL ANGLE IN MPAC
021254,000369:                                                                                                  #               2) DESIRED INNER  GIMBAL ANGLE IN MPAC +1
021255,000370:                                                                                                  #               3) DESIRED MIDDLE GIMBAL ANGLE IN MPAC +2
021256,000371: 
021257,000372: 
021258,000373:                                                                                                  #           ERASABLES USED -
021259,000374: 
021260,000375:                                                                                                  #               1) SCAXIS           6
021261,000376:                                                                                                  #               2) POINTVSM         6
021262,000377:                                                                                                  #               3) MIS             18
021263,000378:                                                                                                  #               4) DEL             18
021264,000379:                                                                                                  #               5) COF              6
021265,000380:                                                                                                  #               6) VECQTEMP         1
021266,000381:                                                                                                  #               7) ALL OF VAC AREA 43
021267,000382: 
021268,000383:                                                                                                  #                        TOTAL     99
021269,000384: 
021270,000385: 27,2000                                           SETLOC   VECPT                                 
021271,000386: 27,2000                                           BANK                                           

Page 489

021273,000388: 27,2032                                           COUNT*   $$/VECPT                              
021274,000389: 
021275,000390: 27,2032  E6,1675                                  EBANK=   BCDU                                  
021276,000391: 
021277,000392: 27,2032           40020        VECPNT1            STQ      BOV                                   #  THIS ENTRY USES DESIRED CDUS
021278,000393: 27,2033           03324                                    VECQTEMP                              #  NOT PRESENT-ENTER WITH CDUD'S IN MPAC
021279,000394: 27,2034           56035                                    VECPNT2                               
021280,000395: 27,2035           52164        VECPNT2            AXC,2    GOTO                                  
021281,000396: 27,2036           03245                                    MIS                                   
021282,000397: 27,2037           56046                                    STORANG                               
021283,000398: 27,2040           40020        VECPOINT           STQ      BOV                                   #  SAVE RETURN ADDRESS
021284,000399: 27,2041           03324                                    VECQTEMP                              
021285,000400: 27,2042           56043                                    VECLEAR                               #  AND CLEAR OVFIND
021286,000401: 27,2043           47164        VECLEAR            AXC,2    RTB                                   
021287,000402: 27,2044           03245                                    MIS                                   #  READ THE PRESENT CDU ANGLES AND
021288,000403: 27,2045           44403                                    READCDUK                              #  STORE THEM IN PD25, 26, 27
021289,000404: 27,2046           34032        STORANG            STCALL   25D                                   
021290,000405: 27,2047           44410                                    CDUTODCM                              #  S/C AXES TO STABLE MEMBER AXES (MIS)
021291,000406: 27,2050           61375                           VLOAD    VXM                                   
021292,000407: 27,2051           03773                                    POINTVSM                              #  RESOLVE THE POINTING DIRECTION VF INTO
021293,000408: 27,2052           03246                                    MIS                                   #  INITIAL S/C AXES ( VF = POINTVSM)
021294,000409: 27,2053           77656                           UNIT                                           
021295,000410: 27,2054           00035                           STORE    28D                                   
021296,000411:                                                                                                  #  PD 28 29 30 31 32 33
021297,000412: 27,2055           53435                           VXV      UNIT                                  #  TAKE THE CROSS PRODUCT VF X VI
021298,000413: 27,2056           03765                                    SCAXIS                                #  WHERE VI = SCAXIS
021299,000414: 27,2057           57400                           BOV      VCOMP                                 
021300,000415: 27,2060           56170                                    PICKAXIS                              
021301,000416: 27,2061           17270                           STODL    COF                                   #  CHECK MAGNITUDE
021302,000417: 27,2062           00045                                    36D                                   #  OF CROSS PRODUCT
021303,000418: 27,2063           50025                           DSU      BMN                                   #  VECTOR, IF LESS
021304,000419: 27,2064           14417                                    DPB-14                                #  THAN B-14 ASSUME
021305,000420: 27,2065           56170                                    PICKAXIS                              #  UNIT OPERATION
021306,000421: 27,2066           50375                           VLOAD    DOT                                   #           INVALID.
021307,000422: 27,2067           03765                                    SCAXIS                                
021308,000423: 27,2070           00035                                    28D                                   
021309,000424: 27,2071           65552                           SL1      ARCCOS                                
021310,000425: 27,2072           77624        COMPMATX           CALL                                           #  NOW COMPUTE THE TRANSFORMATION FROM
021311,000426: 27,2073           44527                                    DELCOMP                               #  FINAL S/C AXES TO INITIAL S/C AXES  MFI
021312,000427: 27,2074           75160                           AXC,1    AXC,2                                 
021313,000428: 27,2075           03245                                    MIS                                   #  COMPUTE THE TRANSFORMATION FROM FINAL
021314,000429: 27,2076           02230                                    KEL                                   #  S/C AXES TO STABLE MEMBER AXES
021315,000430: 27,2077           77624                           CALL                                           #  MFS = MIS MFI
021316,000431: 27,2100           44312                                    MXM3                                  #  (IN PD LIST)
021317,000432: 
021318,000433: 27,2101           51545                           DLOAD    ABS                                   
021319,000434: 27,2102           00007                                    6                                     #  MFS6 = SIN(CPSI)                    $2
021320,000435: 27,2103           50025                           DSU      BMN                                   
021321,000436: 27,2104           14404                                    SINGIMLC                              #  = SIN(59 DEGS)                      $2
021322,000437: 27,2105           56160                                    FINDGIMB                              #  /CPSI/ LESS THAN 59 DEGS

Page 490

021324,000439:                                                                                                  #  I.E. DESIRED ATTITUDE NOT IN GIMBAL LOCK
021325,000440: 
021326,000441: 27,2106           51545                           DLOAD    ABS                                   #  CHECK TO SEE IF WE ARE POINTING
021327,000442: 27,2107           03765                                    SCAXIS                                #  THE THRUST AXIS
021328,000443: 27,2110           51025                           DSU      BPL                                   
021329,000444: 27,2111           14406                                    SINVEC1                               #  SIN 49.4 DEGS                        $2
021330,000445: 27,2112           56160                                    FINDGIMB                              #  IF SO, WE ARE TRYING TO POINT IT INTO
021331,000446: 27,2113           77775                           VLOAD                                          #  GIMBAL LOCK, ABORT COULD GO HERE
021332,000447: 27,2114           77626                           STADR                                          
021333,000448: 27,2115           50515                           STOVL    MIS        +12D                       
021334,000449: 27,2116           77626                           STADR                                          #  STORE MFS (IN PD LIST) IN MIS
021335,000450: 27,2117           50523                           STOVL    MIS        +6                         
021336,000451: 27,2120           77626                           STADR                                          
021337,000452: 27,2121           50531                           STOVL    MIS                                   
021338,000453: 27,2122           03254                                    MIS        +6                         #  INNER GIMBAL AXIS IN FINAL S/C AXES
021339,000454: 27,2123           57444                           BPL      VCOMP                                 #  LOCATE THE IG AXIS DIRECTION CLOSEST TO
021340,000455: 27,2124           56125                                    IGSAMEX                               #  FINAL X S/C AXIS
021341,000456: 
021342,000457: 27,2125           50035        IGSAMEX            VXV      BMN                                   #  FIND THE SHORTEST WAY OF ROTATING THE
021343,000458: 27,2126           03765                                    SCAXIS                                #  S/C OUT OF GIMBAL LOCK BY A ROTATION
021344,000459: 27,2127           56134                                    U=SCAXIS                              #  ABOUT +- SCAXIS, I.E. IF  (IG (SGN MFS3)
021345,000460:                                                                                                  #  X SCAXIS . XF) LESS THAN 0, U = SCAXIS
021346,000461:                                                                                                  #  OTHERWISE U = -SCAXIS
021347,000462: 
021348,000463: 27,2130           57575                           VLOAD    VCOMP                                 
021349,000464: 27,2131           03765                                    SCAXIS                                
021350,000465: 27,2132           37270                           STCALL   COF                                   #  ROTATE ABOUT -SCAXIS
021351,000466: 27,2133           56137                                    CHEKAXIS                              
021352,000467: 27,2134           77775        U=SCAXIS           VLOAD                                          
021353,000468: 27,2135           03765                                    SCAXIS                                
021354,000469: 27,2136           03270                           STORE    COF                                   #  ROTATE ABOUT + SCAXIS
021355,000470: 27,2137           51545        CHEKAXIS           DLOAD    ABS                                   
021356,000471: 27,2140           03765                                    SCAXIS                                #  SEE IF WE ARE POINTING THE AOT
021357,000472: 27,2141           51025                           DSU      BPL                                   
021358,000473: 27,2142           14410                                    SINVEC2                               #  SIN 29.5 DEGS                        $2
021359,000474: 27,2143           56147                                    PICKANG1                              #  IF SO, ROTATE 50 DEGS ABOUT +- SCAXIS
021360,000475: 27,2144           52145                           DLOAD    GOTO                                  #  IF NOT, MUST BE POINTING THE TRANSPONDER
021361,000476: 27,2145           14414                                    VECANG2                               #  OR SOME VECTOR IN THE Y, OR Z PLANE
021362,000477: 27,2146           56151                                    COMPMFSN                              #  IN THIS CASE ROTATE 35 DEGS TO GET OUT
021363,000478:                                                                                                  #  OF GIMBAL LOCK (VECANG2  $360)
021364,000479: 27,2147           77745        PICKANG1           DLOAD                                          
021365,000480: 27,2150           14412                                    VECANG1                               #  = 50 DEGS                          $ 360
021366,000481: 27,2151           77624        COMPMFSN           CALL                                           
021367,000482: 27,2152           44527                                    DELCOMP                               #  COMPUTE THE ROTATION ABOUT SCAXIS TO
021368,000483: 27,2153           75160                           AXC,1    AXC,2                                 #  BRING MFS OUT OF GIMBAL LOCK
021369,000484: 27,2154           03245                                    MIS                                   
021370,000485: 27,2155           02230                                    KEL                                   
021371,000486: 27,2156           77624                           CALL                                           #  COMPUTE THE NEW TRANSFORMATION FROM
021372,000487: 27,2157           44312                                    MXM3                                  #  DESIRED S/C AXES TO STABLE MEMBER AXES
021373,000488:                                                                                                  #  WHICH WILL ALIGN VI WITH VF AND AVOID

Page 491

021375,000490:                                                                                                  #  GIMBAL LOCK
021376,000491: 27,2160           45160        FINDGIMB           AXC,1    CALL                                  
021377,000492: 27,2161           00000                                    0                                     #  EXTRACT THE COMMANDED CDU ANGLES FROM
021378,000493: 27,2162           44654                                    DCMTOCDU                              #  THIS MATRIX
021379,000494: 27,2163           40234                           RTB      SETPD                                 
021380,000495: 27,2164           21621                                    V1STO2S                               #  CONVERT TO 2:S COMPLEMENT
021381,000496: 27,2165           00001                                    0                                     
021382,000497: 27,2166           77650                           GOTO                                           
021383,000498: 27,2167           03324                                    VECQTEMP                              #  RETURN TO CALLER
021384,000499: 
021385,000500: 27,2170           50375        PICKAXIS           VLOAD    DOT                                   #  IF VF X VI = 0,  FIND VF . VI
021386,000501: 27,2171           00035                                    28D                                   
021387,000502: 27,2172           03765                                    SCAXIS                                
021388,000503: 27,2173           72240                           BMN      TLOAD                                 
021389,000504: 27,2174           54356                                    ROT180                                
021390,000505: 27,2175           00032                                    25D                                   
021391,000506: 27,2176           77650                           GOTO                                           #  IF VF = VI, CDU DESIRED = PRESENT CDU
021392,000507: 27,2177           03324                                    VECQTEMP                              #  PRESENT CDU ANGLES
021393,000508: 
021394,000509: 35,2000                                           BANK     35                                    
021395,000510: 26,2000                                           SETLOC   MANUVER1                              
021396,000511: 26,2000                                           BANK                                           
021397,000512: 26,2356           47375        ROT180             VLOAD    VXV                                   #  IF VF, VI ANTIPARALLEL, 108 DEG ROTATION
021398,000513: 26,2357           03254                                    MIS        +6                         #  IS REQUIRED. Y STABLE MEMBER AXIS IN
021399,000514: 26,2360           06466                                    HIDPHALF                              #  INITIAL S/C AXES.
021400,000515: 26,2361           47256                           UNIT     VXV                                   #  FIND Y(SM) X X(I)
021401,000516: 26,2362           03765                                    SCAXIS                                #  FIND UNIT(VI X UNIT(Y(SM) X X(I)))
021402,000517: 26,2363           40056                           UNIT     BOV                                   #  I.E. PICK A VECTOR IN THE PLANE OF X(I),
021403,000518: 26,2364           54400                                    PICKX                                 #  Y(SM) PERPENDICULAR TO VI
021404,000519: 26,2365           17270                           STODL    COF                                   
021405,000520: 26,2366           00045                                    36D                                   #  CHECK MAGNITUDE
021406,000521: 26,2367           50025                           DSU      BMN                                   #  OF THIS VECTOR.
021407,000522: 26,2370           14417                                    DPB-14                                #  IF LESS THAN B-14,
021408,000523: 26,2371           54400                                    PICKX                                 #  PICK X-AXIS.
021409,000524: 26,2372           77775                           VLOAD                                          
021410,000525: 26,2373           03270                                    COF                                   
021411,000526: 26,2374           17270        XROT               STODL    COF                                   
021412,000527: 26,2375           06466                                    HIDPHALF                              
021413,000528: 26,2376           77650                           GOTO                                           
021414,000529: 26,2377           56072                                    COMPMATX                              
021415,000530: 26,2400           52175        PICKX              VLOAD    GOTO                                  #  PICK THE XAXIS IN THIS CASE
021416,000531: 26,2401           06466                                    HIDPHALF                              
021417,000532: 26,2402           54374                                    XROT                                  
021418,000533: 26,2403           15555 35172  SINGIMLC           2DEC     .4285836003                            #  =SIN(59)                $2
021419,000534: 
021420,000535: 26,2405           14113 36326  SINVEC1            2DEC     .3796356537                            #  =SIN(49.4)              $2
021421,000536: 
021422,000537: 26,2407           07701 35703  SINVEC2            2DEC     .2462117800                            #  =SIN(29.5)              $2
021423,000538: 
021424,000539: 26,2411           04343 21616  VECANG1            2DEC     .1388888889                            #  = 50 DEGREES                       $360
021425,000540: 

Page 492

021427,000542: 26,2413           03070 34344  VECANG2            2DEC     .09722222222                            #  = 35 DEGREES                       $360
021428,000543: 
021429,000544: 26,2415           00000        1BITDP             OCT      0                                     #  KEEP THIS BEFORE DPB(-14)     *********
021430,000545: 26,2416           00001        DPB-14             OCT      00001                                 
021431,000546: 26,2417           00000                           OCT      00000                                 
021432,000547: 

Page 493

021434,000549:                                                                                                  #  ROUTINE FOR INITIATING AUTOMATIC MANEUVER VIA KEYBOARD (V49)
021435,000550: 
021436,000551: 
021437,000552: 34,2000                                           BANK     34                                    
021438,000553: 23,2000                                           SETLOC   R62                                   
021439,000554: 23,2000                                           BANK                                           
021440,000555: 23,2103  E6,1675                                  EBANK=   BCDU                                  
021441,000556: 
021442,000557: 23,2103                                           COUNT*   $$/R62                                
021443,000558: 
021444,000559: 23,2103  23,2103               R62DISP            EQUALS   R62FLASH                              
021445,000560: 
021446,000561: 23,2103           35010        R62FLASH           CAF      V06N22                                #  FLASH V06N22 AND
021447,000562: 23,2104           04616                           TC       BANKCALL                              #  ICDU ANGLES
021448,000563: 23,2105           20477                           CADR     GOFLASH                               
021449,000564: 23,2106           15503                           TCF      ENDEXT                                #  TERMINATE
021450,000565: 23,2107           12111                           TCF      GOMOVE                                #  PROCEED
021451,000566: 23,2110           12103                           TCF      R62FLASH                              #  ENTER
021452,000567: 
021453,000568:                                                                                                  #  ASTRONAUT MAY LOAD NEW ICDUS AT THIS
021454,000569:                                                                                                  #  POINT
021455,000570: 23,2111           05515        GOMOVE             TC       UPFLAG                                #  SET FOR 3-AXIS MANEUVER
021456,000571: 23,2112           00124                           ADRES    3AXISFLG                              
021457,000572: 
021458,000573: 23,2113           04616                           TC       BANKCALL                              
021459,000574: 23,2114           54125                           CADR     R60LEM                                
021460,000575: 23,2115           15503                           TCF      ENDEXT                                #  END R62
021461,000576: 

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