Source Code

These source-code files are part of a reconstructed copy of Luminary 97, the second release of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software. It was created to fix two incorrect ephemeris constants in Luminary 96, as described by anomaly report LNY-59.

The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memos 83 and 85, using asterisks indicating changed lines in the listing as a guide. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152D. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 97 listing.

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.

019946,000002:                                                                                                  ## Copyright:   Public domain.
019947,000003:                                                                                                  ## Filename:    R60,R62.agc
019948,000004:                                                                                                  ## Purpose:     A section of Luminary revision 97.
019949,000005:                                                                                                  ##              It is part of the reconstructed source code for the
019950,000006:                                                                                                  ##              second release of the flight software for the Lunar 
019951,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
019952,000008:                                                                                                  ##              It was created to fix two incorrect ephemeris constants in
019953,000009:                                                                                                  ##              Luminary 96, as described by anomaly report LNY-59.
019954,000010:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
019955,000011:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
019956,000012:                                                                                                  ##              the listing and Luminary Memos #83 and #85, which list 
019957,000013:                                                                                                  ##              changes between Luminary 97 and 98, and 98 and 99. The
019958,000014:                                                                                                  ##              code has been adapted such that the resulting bugger words
019959,000015:                                                                                                  ##              exactly match those specified for Luminary 97 in NASA drawing
019960,000016:                                                                                                  ##              2021152D, which gives relatively high confidence that the
019961,000017:                                                                                                  ##              reconstruction is correct.
019962,000018:                                                                                                  ## Reference:   pp. 472-485
019963,000019:                                                                                                  ## Assembler:   yaYUL
019964,000020:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
019965,000021:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
019966,000022:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
019967,000023: 

Page 472

019969,000025:                                                                                                  #  MOD NO: 0                             DATE: 1 MAY 1968
019970,000026:                                                                                                  #  MOD BY: DIGITAL DEVEL GROUP           LOG SECTION R60,R62
019971,000027: 
019972,000028:                                                                                                  #  FUNCTIONAL DESCRIPTION:
019973,000029: 
019974,000030:                                                                                                  #  CALLED AS A GENERAL SUBROUTINE TO MANEUVER THE LM TO A SPECIFIED
019975,000031:                                                                                                  #  ATTITUDE.
019976,000032: 
019977,000033:                                                                                                  #  1. IF THE 3-AXIS FLAG IS NOT SET THE FINAL CDU ANGLES ARE
019978,000034:                                                                                                  #  CALCULATED (VECPOINT).
019979,000035: 
019980,000036:                                                                                                  #  2. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
019981,000037: 
019982,000038:                                                                                                  #  3. REQUEST FLASHING DISPLAY V50 N18 PLEASE PERFORM AUTO MANEUVER.
019983,000039: 
019984,000040:                                                                                                  #  4. IF PRIORITY DISPLAY FLAG IS SET DO A PHASECHANGE.  THEN AWAIT
019985,000041:                                                                                                  #  ASTRONAUT RESPONSE.
019986,000042: 
019987,000043:                                                                                                  #  5. DISPLAY RESPONSE RETURNS:
019988,000044: 
019989,000045:                                                                                                  #        A.      ENTER - RESET 3-AXIS FLAG AND RETURN TO CLIENT.
019990,000046: 
019991,000047:                                                                                                  #        B.      TERMINATE - IF IN P00 GO TO STEP 5A.  OTHERWISE CHECK IF R61 IS
019992,000048:                                                                                                  #                THE CALLING PROGRAM.  IF IN R61 AN EXIT IS MADE TO GOTOV56.  IF
019993,000049:                                                                                                  #                NOT IN R61 AN EXIT IS DONE VIA GOTOP00H.
019994,000050: 
019995,000051:                                                                                                  #        C.      PROCEED - CONTINUE WITH PROGRAM AT STEP 6.
019996,000052: 
019997,000053:                                                                                                  #  6. IF THE 3-AXISFLAG IS NOT SET, THE FINAL CDU ANGLES ARE CALCULATED
019998,000054:                                                                                                  #  (VECPOINT).
019999,000055: 
020000,000056:                                                                                                  #  7. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
020001,000057: 
020002,000058:                                                                                                  #  8. IF THE G+N SWITCH IS NOT SET GO BACK TO STEP 3.
020003,000059:                                                                                                  #  
020004,000060:                                                                                                  #  9. IF THE AUTO SWITCH IS NOT SET GO BACK TO STEP 3.
020005,000061: 
020006,000062:                                                                                                  #  10. NONFLASHING DISPLAY V06N18 (FDAI ANGLES).
020007,000063: 
020008,000064:                                                                                                  #  11. DO A PHASECHANGE.
020009,000065: 
020010,000066:                                                                                                  #  12. DO A MANEUVER CALCULATION AND ICDU DRIVE ROUTINE TO ACHIEVE FINAL
020011,000067:                                                                                                  #  GIMBAL ANGLES (GOMANUR).
020012,000068: 
020013,000069:                                                                                                  #  13. AT END OF MANEUVER GO TO STEP 3.
020014,000070: 
020015,000071:                                                                                                  #        IF SATISFACTORY MANEUVER STEP 5A EXITS R60.
020016,000072:                                                                                                  #        FOR FURTHER ADJUSTMENT OF THE VEHICLE ATTITUDE ABOUT THE
020017,000073:                                                                                                  #        DESIRED VECTOR, THE ROUTINE MAY BE PERFORMED AGAIN STARTING AT

Page 473

020019,000075:                                                                                                  #        STEP 5C.
020020,000076: 
020021,000077:                                                                                                  #  CALLING SEQUENCE:     TC      BANKCALL
020022,000078:                                                                                                  #                        CADR    R60LEM
020023,000079: 
020024,000080:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:     SCAXIS, POINTVSM (FOR VECPOINT)
020025,000081:                                                                                                  #                                        3AXISFLG.
020026,000082: 
020027,000083:                                                                                                  #  SUBROUTINES CALLED:   VECPOINT, BALLANGS, GOPERF2R, LINUS, GODSPER,
020028,000084:                                                                                                  #                        GOMANUR, DOWNFLAG, PHASCHNG, UPFLAG
020029,000085: 
020030,000086:                                                                                                  #  NORMAL EXIT MODES:    CAE     TEMPR60         (CALLERS RETURN ADDRESS)
020031,000087:                                                                                                  #                        TC      BANKJUMP
020032,000088: 
020033,000089:                                                                                                  #  ALARMS: NONE
020034,000090: 
020035,000091:                                                                                                  #  OUTPUT: NONE
020036,000092: 
020037,000093:                                                                                                  #  DEBRIS: CPHI, CTHETA, CPSI, 3AXISFLG, TBASE2
020038,000094: 
020039,000095: 34,2000                                           BANK     34                                    
020040,000096: 26,2000                                           SETLOC   MANUVER                               
020041,000097: 26,2000                                           BANK                                           
020042,000098: 
020043,000099: 26,2123     1164                                  EBANK=   TEMPR60                               
020044,000100: 
020045,000101: 26,2123                                           COUNT*   $$/R06                                
020046,000102: 26,2123           04645        R60LEM             TC       MAKECADR                              
020047,000103: 26,2124           55164                           TS       TEMPR60                               
020048,000104: 
020049,000105: 26,2125           34746        REDOMANN           CAF      3AXISBIT                              
020050,000106: 26,2126           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
020051,000107: 26,2127           10000                           CCS      A                                     
020052,000108: 26,2130           12136                           TCF      TOBALL                                #  YES
020053,000109: 26,2131           06037                           TC       INTPRET                               
020054,000110: 26,2132           77624                           CALL                                           
020055,000111: 26,2133           56040                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
020056,000112: 26,2134           00322                           STORE    CPHI                                  #  STORE FINAL ANGLES - CPHI, CTHETA, CPSI
020057,000113: 26,2135           77776                           EXIT                                           
020058,000114: 
020059,000115: 26,2136           04616        TOBALL             TC       BANKCALL                              
020060,000116: 26,2137           54266                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
020061,000117: 26,2140           32254        TOBALLA            CAF      V06N18                                
020062,000118: 26,2141           04616                           TC       BANKCALL                              
020063,000119: 26,2142           20710                           CADR     GOPERF2R                              #  DISPLAY PLEASE PERFORM AUTO MANEUVER
020064,000120: 26,2143           02242                           TC       R61TEST                               
020065,000121: 26,2144           02150                           TC       REDOMANC                              #  PROCEED
020066,000122: 26,2145           02175                           TC       ENDMANU1                              #  ENTER I.E. FINISHED WITH R60

Page 474

020068,000124: 26,2146           02201                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
020069,000125: 26,2147           05155                           TC       ENDOFJOB                              
020070,000126: 
020071,000127: 26,2150           34746        REDOMANC           CAF      3AXISBIT                              
020072,000128: 26,2151           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
020073,000129: 26,2152           10000                           CCS      A                                     
020074,000130: 26,2153           12161                           TCF      TOBALLC                               #  YES
020075,000131: 26,2154           06037                           TC       INTPRET                               
020076,000132: 26,2155           77624                           CALL                                           
020077,000133: 26,2156           56040                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
020078,000134: 26,2157           00322                           STORE    CPHI                                  #  STORE ANGLES
020079,000135: 26,2160           77776                           EXIT                                           
020080,000136: 
020081,000137: 26,2161           04616        TOBALLC            TC       BANKCALL                              
020082,000138: 26,2162           54266                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
020083,000139: 26,2163           02255                           TC       G+N,AUTO                              #  CHECK AUTO MODE
020084,000140: 26,2164           10000                           CCS      A                                     
020085,000141: 26,2165           12140                           TCF      TOBALLA                               #  NOT AUTO, GO REREQUEST AUTO MANEUVER.
020086,000142: 
020087,000143: 26,2166           32254        AUTOMANV           CAF      V06N18                                #  STATIC DISPLAY DURING AUTO MANEUVER
020088,000144: 26,2167           04616                           TC       BANKCALL                              #                                        -
020089,000145: 26,2170           20451                           CADR     GODSPR                                #                                        -
020090,000146: 26,2171           02201                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
020091,000147: 
020092,000148: 26,2172           04616        STARTMNV           TC       BANKCALL                              #  PERFORM MANEUVER VIA KALCMANU
020093,000149: 26,2173           17750                           CADR     GOMANUR                               
020094,000150: 
020095,000151: 26,2174           12140        ENDMANUV           TCF      TOBALLA                               #  FINISHED MANEUVER.
020096,000152: 26,2175           05516        ENDMANU1           TC       DOWNFLAG                              #  RESET 3-AXIS FLAG
020097,000153: 26,2176           00124                           ADRES    3AXISFLG                              
020098,000154: 26,2177           31164                           CAE      TEMPR60                               #                                        -
020099,000155: 26,2200           04640                           TC       BANKJUMP                              #                                        -
020100,000156: 
020101,000157: 26,2201           40100        CHKLINUS           CS       FLAGWRD4                              
020102,000158: 26,2202           74740                           MASK     PDSPFBIT                              #  IS PRIORITY DISPLAY FLAG SET?
020103,000159: 26,2203           10000                           CCS      A                                     #                                        -
020104,000160: 26,2204           00002                           TC       Q                                     #  NO - EXIT
020105,000161: 26,2205           30002                           CA       Q                                     
020106,000162: 26,2206           54156                           TS       MPAC       +2                         #  SAVE RETURN
020107,000163: 26,2207           46245                           CS       THREE                                 #  OBTAIN LOCATION FOR RESTART
020108,000164: 26,2210           60133                           AD       BUF2                                  #  HOLDS Q OF LAST DISPLAY
020109,000165: 26,2211           55055                           TS       TBASE2                                
020110,000166: 
020111,000167: 26,2212           05353                           TC       PHASCHNG                              
020112,000168: 26,2213           00132                           OCT      00132                                 
020113,000169: 
020114,000170: 26,2214           34745                           CAF      BIT7                                  
020115,000171: 26,2215           05464                           TC       LINUS                                 #  GO SET BITS FOR PRIORITY DISPLAY      -
020116,000172: 26,2216           00156                           TC       MPAC       +2                         
020117,000173: 

Page 475

020119,000175: 26,2217           37714        RELINUS            CAF      PRIO26                                #  RESTORE ORIGINAL PRIORITY
020120,000176: 26,2220           05146                           TC       PRIOCHNG                              
020121,000177: 
020122,000178: 26,2221           34747                           CAF      TRACKBIT                              #  DON'T CONTINUE R60 UNLESS TRACKFLAG ON.
020123,000179: 26,2222           70075                           MASK     FLAGWRD1                              
020124,000180: 26,2223           10000                           CCS      A                                     
020125,000181: 26,2224           12237                           TCF      RER60                                 
020126,000182: 
020127,000183: 26,2225           34745                           CAF      RNDVZBIT                              #  IS IT P20?
020128,000184: 26,2226           70074                           MASK     FLAGWRD0                              
020129,000185: 26,2227           10000                           CCS      A                                     
020130,000186: 26,2230           02234                           TC       +4                                    #  YES
020131,000187: 26,2231           05353                           TC       PHASCHNG                              #  NO, MUST BE P25, SET 2.11 SPOT
020132,000188: 26,2232           40112                           OCT      40112                                 
020133,000189: 
020134,000190: 26,2233           05155                           TC       ENDOFJOB                              
020135,000191: 
020136,000192: 26,2234           05353                           TC       PHASCHNG                              #  SET 2.7 SPOT FOR P20
020137,000193: 26,2235           40072                           OCT      40072                                 
020138,000194: 
020139,000195: 26,2236           05155                           TC       ENDOFJOB                              
020140,000196: 
020141,000197: 26,2237           05504        RER60              TC       UPFLAG                                #  SET PRIO DISPLAY FLAG AFTER RESTART
020142,000198: 26,2240           00077                           ADRES    PDSPFLAG                              
020143,000199: 
020144,000200: 26,2241           01055                           TC       TBASE2                                
020145,000201: 
020146,000202: 26,2242           31011        R61TEST            CA       MODREG                                #  IF WE ARE IN P00 IT MUST BE V49 OR V89
020147,000203: 26,2243           00006                           EXTEND                                         
020148,000204: 26,2244           12175                           BZF      ENDMANU1                              #  THUS WE GO TO ENDEXT VIA USER
020149,000205: 
020150,000206: 26,2245           30100                           CA       FLAGWRD4                              #  ARE WE IN R61 (P20 OR P25)
020151,000207: 26,2246           74740                           MASK     PDSPFBIT                              
020152,000208: 26,2247           00006                           EXTEND                                         
020153,000209: 26,2250           16001                           BZF      GOTOPOOH                              #  NO
020154,000210: 26,2251           06022                           TC       GOTOV56                               #  YES
020155,000211: 
020156,000212: 26,2252           20100        BIT14+7            OCT      20100                                 #                                        -
020157,000213: 26,2253           00203        OCT203             OCT      203                                   
020158,000214: 26,2254           01422        V06N18             VN       0618                                  
020159,000215: 
020160,000216:                                                                                                  #  SUBROUTINE TO CHECK FOR G+N CONTROL, AUTO STABILIZATION
020161,000217: 
020162,000218:                                                                                                  #  RETURNS WITH C(A) = +         IF NOT SET FOR G+N, AUTO
020163,000219:                                                                                                  #  RETURNS WITH C(A) = +0        IF SWITCHES ARE SET
020164,000220: 
020165,000221: 26,2255           00006        G+N,AUTO           EXTEND                                         
020166,000222: 26,2256           00030                           READ     CHAN30                                
020167,000223: 26,2257           74742                           MASK     BIT10                                 
020168,000224: 26,2260           10000                           CCS      A                                     
020169,000225: 26,2261           00002                           TC       Q                                     #  NOT IN G+N    C(A) = +

Page 476

020171,000227: 26,2262           00006        ISITAUTO           EXTEND                                         #  CHECK FOR AUTO MODE
020172,000228: 26,2263           00031                           READ     CHAN31                                
020173,000229: 26,2264           74736                           MASK     BIT14                                 
020174,000230: 26,2265           00002                           TC       Q                                     #  (+) = NOT IN AUTO, (+0) = AOK
020175,000231: 

Page 477

020177,000233:                                                                                                  #  PROGRAM DESCRIPTION BALLANGS
020178,000234:                                                                                                  #  MOD NO.                               LOG SECTION R60,R62
020179,000235: 
020180,000236:                                                                                                  #  WRITTEN BY RAMA M. AIYAWAR
020181,000237: 
020182,000238:                                                                                                  #  FUNCTIONAL DESCRIPTION
020183,000239: 
020184,000240:                                                                                                  #        COMPUTES LM FDAI BALL DISPLAY ANGLES
020185,000241: 
020186,000242:                                                                                                  #  CALLING SEQUENCE
020187,000243: 
020188,000244:                                                                                                  #        TC      BALLANGS
020189,000245: 
020190,000246:                                                                                                  #  NORMAL EXIT MODE
020191,000247: 
020192,000248:                                                                                                  #        TC      BALLEXIT        (SAVED Q)
020193,000249: 
020194,000250:                                                                                                  #  ALARM OR EXIT MODE    NIL
020195,000251: 
020196,000252:                                                                                                  #  SUBROUTINES CALLED
020197,000253: 
020198,000254:                                                                                                  #        CD*TR*G
020199,000255:                                                                                                  #        ARCTAN
020200,000256: 
020201,000257:                                                                                                  #  INPUT
020202,000258: 
020203,000259:                                                                                                  #        CPHI,CTHETA,CPSI ARE THE ANGLES CORRESPONDING TO AOG, AIG, AMG.  THEY ARE
020204,000260:                                                                                                  #        SP,2S COMPLIMENT SCALED TO HALF REVOLUTION.
020205,000261: 
020206,000262:                                                                                                  #  OUTPUT
020207,000263: 
020208,000264:                                                                                                  #        FDAIX, FDAIY, FDAIZ ARE THE REQUIRED BALL ANGLES SCALED TO HALF REVOLUTION
020209,000265:                                                                                                  #        SP,2S COMPLIMENT.
020210,000266: 
020211,000267:                                                                                                  #        THESE ANGLES WILL BE DISPLAYED AS DEGREES AND HUNDREDTHS, IN THE ORDER ROLL, PITCH, YAW, USING NOUNS 18 & 19.
020212,000268: 
020213,000269:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
020214,000270: 
020215,000271:                                                                                                  #        CPHI, CTHETA, CPSI      EACH A SP REGISTER
020216,000272: 
020217,000273:                                                                                                  #  DEBRIS
020218,000274: 
020219,000275:                                                                                                  #        A,L,Q,MPAC,SINCDU,COSCDU,PUSHLIST,BALLEXIT
020220,000276: 
020221,000277:                                                                                                  #  NOMENCLATURE: CPHI, CTHETA, & CPSI REPRESENT THE OUTER, INNER, & MIDDLE GIMBAL ANGLES, RESPECTIVELY; OR
020222,000278:                                                                                                  #                EQUIVALENTLY, CDUX, CDUY, & CDUZ.
020223,000279: 
020224,000280:                                                                                                  #  NOTE:  ARCTAN CHECKS FOR OVERFLOW AND SHOULD BE ABLE TO HANDLE ANY SINGULARITIES.
020225,000281: 
020226,000282: 26,2000                                           SETLOC   BAWLANGS                              
020227,000283: 26,2000                                           BANK                                           
020228,000284: 
020229,000285: 26,2266                                           COUNT*   $$/BALL                               
020230,000286: 26,2266           04645        BALLANGS           TC       MAKECADR                              
020231,000287: 26,2267           55342                           TS       BALLEXIT                              
020232,000288: 26,2270           30321                           CA       CPHI                                  

Page 478

020234,000290: 26,2271           54772                           TS       CDUSPOT    +4                         
020235,000291: 26,2272           30322                           CA       CTHETA                                
020236,000292: 26,2273           54766                           TS       CDUSPOT                               
020237,000293: 26,2274           30323                           CA       CPSI                                  
020238,000294: 26,2275           54770                           TS       CDUSPOT    +2                         
020239,000295: 
020240,000296: 26,2276           06037                           TC       INTPRET                               
020241,000297: 26,2277           45001                           SETPD    CALL                                  
020242,000298: 26,2300           00001                                    0D                                    
020243,000299: 26,2301           47543                                    CD*TR*G                               
020244,000300: 
020245,000301: 26,2302           41345                           DLOAD    DMP                                   
020246,000302: 26,2303           00743                                    SINCDUX                               #  SIN (OGA)
020247,000303: 26,2304           00747                                    COSCDUZ                               #  COS (MGA)
020248,000304: 
020249,000305: 26,2305           57552                           SL1      DCOMP                                 #  SCALE
020250,000306: 26,2306           65336                           ARCSIN   PDDL                                  #  YAW = ARCSIN(-SXCZ) INTO 0 PD
020251,000307: 26,2307           00741                                    SINCDUZ                               
020252,000308: 26,2310           14023                           STODL    SINTH                                 #  (SINTH = 18D IN PD)
020253,000309: 26,2311           00747                                    COSCDUZ                               
020254,000310: 26,2312           72405                           DMP      SL1                                   #  RESCALE
020255,000311: 26,2313           00751                                    COSCDUX                               
020256,000312: 26,2314           34021                           STCALL   COSTH                                 #  (COSTH = 16D IN PD)
020257,000313: 26,2315           26510                                    ARCTAN                                
020258,000314: 26,2316           41325                           PDDL     DMP                                   #  ROLL = ARCTAN(SZ/CZCX) INTO 2 PD
020259,000315: 26,2317           00741                                    SINCDUZ                               
020260,000316: 26,2320           00743                                    SINCDUX                               
020261,000317: 26,2321           41512                           SL2      PUSH                                  #  SXSZ INTO 4 PD
020262,000318: 26,2322           65205                           DMP      PDDL                                  #  SXSZCY INTO 4 PD
020263,000319: 26,2323           00745                                    COSCDUY                               
020264,000320: 26,2324           65205                           DMP      PDDL                                  #  SXSZSY INTO 6 PD
020265,000321: 26,2325           00737                                    SINCDUY                               
020266,000322: 26,2326           00751                                    COSCDUX                               
020267,000323: 26,2327           72405                           DMP      SL1                                   #  CXCY
020268,000324: 26,2330           00745                                    COSCDUY                               
020269,000325: 26,2331           45425                           DSU      STADR                                 #  PULL UP FROM 6 PD
020270,000326: 26,2332           63756                           STODL    COSTH                                 #  COSTH = CXCY - SXSZSY
020271,000327: 26,2333           00737                                    SINCDUY                               
020272,000328: 26,2334           72405                           DMP      SL1                                   
020273,000329: 26,2335           00751                                    COSCDUX                               #  CXSY
020274,000330: 26,2336           45415                           DAD      STADR                                 #  PULL UP FROM 4 PD
020275,000331: 26,2337           43754                           STCALL   SINTH                                 #  SINTH = CXSY + SXSZCY
020276,000332: 26,2340           26510                                    ARCTAN                                #  RETURNS WITH D(MPAC) = PITCH
020277,000333: 26,2341           55525                           PDDL     VDEF                                  #  PITCH INTO 2 PD, ROLL INTO MPAC FROM 2 PD
020278,000334: 26,2342           77634                           RTB                                            #  VDEF MAKES V(MPAC) = ROLL, PITCH, YAW
020279,000335: 26,2343           21620                                    V1STO2S                               
020280,000336: 26,2344           02345                           STORE    FDAIX                                 #  MODE IS TP
020281,000337: 26,2345           77776                           EXIT                                           
020282,000338: 
020283,000339: 26,2346           31342        ENDBALL            CA       BALLEXIT                              
020284,000340: 

Page 479

020286,000342: 26,2347           04640                           TC       BANKJUMP                              
020287,000343: 

Page 480

020289,000345:                                                                                                  #  PROGRAM DESCRIPTION - VECPOINT
020290,000346: 
020291,000347:                                                                                                  #  THIS INTERPRETIVE SUBROUTINE MAY BE USED TO POINT A SPACECRAFT AXIS IN A DESIRED DIRECTION.  THE AXIS
020292,000348:                                                                                                  #  TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN SUCCESSIVE LOCATIONS OF ERASABLE MEMORY
020293,000349:                                                                                                  #  BEGINNING WITH THE LOCATION CALLED SCAXIS.  THE COMPONENTS OF THIS VECTOR ARE GIVEN IN SPACECRAFT COORDINATES.
020294,000350:                                                                                                  #  THE DIRECTION IN WHICH THIS AXIS IS TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN
020295,000351:                                                                                                  #  SUCCESSIVE LOCATIONS OF ERASABLE MEMORY BEGINNING WITH THE ADDRESS CALLED POINTVSM.  THE COMPONENTS OF THIS
020296,000352:                                                                                                  #  VECTOR ARE GIVEN IN STABLE MEMBER COORDINATES.  WITH THIS INFORMATION VECPOINT COMPUTES A SET OF THREE GIMBAL
020297,000353:                                                                                                  #  ANGLES (2S COMPLEMENT) CORESPONDING TO THE CROSS-PRODUCT ROTATION BETWEEN SCAXIS AND POINTVSM AND STORES THEM
020298,000354:                                                                                                  #  IN T(MPAC) BEFORE RETURNING TO THE CALLER.
020299,000355: 
020300,000356:                                                                                                  #  THIS ROTATION, HOWEVER, MAY BRING THE S/C INTO GIMBAL LOCK.  WHEN POINTING A VECTOR IN THE Y-Z PLANE,
020301,000357:                                                                                                  #  THE TRANSPONDER AXIS, OR THE AOT FOR THE LEM, THE PROGRAM WILL CORRECT THIS PROBLEM BY ROTATING THE CROSS-
020302,000358:                                                                                                  #  PRODUCT ATTITUDE ABOUT POINTVSM BY A FIXED AMOUNT SUFFICIENT TO ROTATE THE DESIRED S/C ATTITUDE OUT OF GIMBAL
020303,000359:                                                                                                  #  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,
020304,000360:                                                                                                  #  THE ADDITIONAL ROTATION TO AVOID GIMAL LOCK IS 35 DEGREES.  IF THE AXIS IS MORE THAN 60.5 DEGEES FROM +X (OR -X)
020305,000361:                                                                                                  #  THE ADDITIONAL ROTATION IS 35 DEGREES.  THE GIMBAL ANGLES CORRESPONDING TO THIS ATTITUDE ARE THEN COMPUTED AND
020306,000362:                                                                                                  #  STORED AS 2S COMPLIMENT ANGLES IN T(MPAC) BEFORE RETURNING TO THE CALLER.
020307,000363: 
020308,000364:                                                                                                  #  WHEN POINTING THE X-AXIS, OR THE THRUST VECTOR, OR ANY VECTOR WITHIN 40.6 DEG OF THE X-AXIS, VECPOINT
020309,000365:                                                                                                  #  CANNOT CORRECT FOR A CROSS-PRODUCT ROTATION INTO GIMBAL LOCK.  IN THIS CASE A PLATFORM REALIGNMENT WOULD BE
020310,000366:                                                                                                  #  REQUIRED TO POINT THE VECTOR IN THE DESIRED DIRECTION.  AT PRESENT NO INDICATION IS GIVEN FOR THIS SITUATION
020311,000367:                                                                                                  #  EXCEPT THAT THE FINAL MIDDLE GIMBAL ANGLE IN MPAC +2 IS GREATER THAN 59 DEGREES.
020312,000368: 
020313,000369:                                                                                                  #  CALLING SEQUENCE -
020314,000370: 
020315,000371:                                                                                                  #        1)      LOAD SCAXIS, POINTVSM
020316,000372:                                                                                                  #        2)      CALL
020317,000373:                                                                                                  #                        VECPOINT
020318,000374: 
020319,000375:                                                                                                  #  RETURNS WITH
020320,000376: 
020321,000377:                                                                                                  #        1)      DESIRED OUTER GIMBAL ANGLE IN MPAC
020322,000378:                                                                                                  #        2)      DESIRED INNER GIMBAL ANGLE IN MPAC +1
020323,000379:                                                                                                  #        3)      DESIRED MIDDLE GIMBAL ANGLE IN MPAC +2
020324,000380: 
020325,000381:                                                                                                  #  ERASABLES USED -
020326,000382: 
020327,000383:                                                                                                  #        1)      SCAXIS          6
020328,000384:                                                                                                  #        2)      POINTVSM        6
020329,000385:                                                                                                  #        3)      MIS             18
020330,000386:                                                                                                  #        4)      DEL             18
020331,000387:                                                                                                  #        5)      COF             6
020332,000388:                                                                                                  #        6)      VECQTEMP        1
020333,000389:                                                                                                  #        7)      ALL OF VAC AREA 43
020334,000390: 
020335,000391:                                                                                                  #                        TOTAL   99
020336,000392: 
020337,000393: 27,2000                                           SETLOC   VECPT                                 
020338,000394: 27,2000                                           BANK                                           

Page 481

020340,000396: 27,2032                                           COUNT*   $$/VECPT                              
020341,000397: 
020342,000398: 27,2032  E6,1676                                  EBANK=   BCDU                                  
020343,000399: 
020344,000400: 27,2032           40020        VECPNT1            STQ      BOV                                   #  THIS ENTRY USES DESIRED CDUS
020345,000401: 27,2033           03325                                    VECQTEMP                              #  NOT PRESENT - ENTER WITH CDUD'S IN MPAC
020346,000402: 27,2034           56035                                    VECPNT2                               
020347,000403: 27,2035           52164        VECPNT2            AXC,2    GOTO                                  
020348,000404: 27,2036           03246                                    MIS                                   
020349,000405: 27,2037           56046                                    STORANG                               
020350,000406: 27,2040           40020        VECPOINT           STQ      BOV                                   #  SAVE RETURN ADDRESS
020351,000407: 27,2041           03325                                    VECQTEMP                              
020352,000408: 27,2042           56043                                    VECLEAR                               #  AND CLEAR OVFIND
020353,000409: 27,2043           47164        VECLEAR            AXC,2    RTB                                   
020354,000410: 27,2044           03246                                    MIS                                   #  READ THE PRESENT CDU ANGLES AND
020355,000411: 27,2045           44403                                    READCDUK                              #  STORE THEM IN PD25, 26, 27
020356,000412: 27,2046           34032        STORANG            STCALL   25D                                   
020357,000413: 27,2047           44410                                    CDUTODCM                              #  S/C AXES TO STABLE MEMBER AXES (MIS)
020358,000414: 27,2050           61375                           VLOAD    VXM                                   
020359,000415: 27,2051           03773                                    POINTVSM                              #  RESOLVE THE POINTING DIRECTION VF INTO
020360,000416: 27,2052           03247                                    MIS                                   #  INITIAL S/C AXES (VF = POINTVSM)
020361,000417: 27,2053           77656                           UNIT                                           
020362,000418: 27,2054           00035                           STORE    28D                                   
020363,000419:                                                                                                  #  PD 28 29 30 31 32 33
020364,000420: 27,2055           53435                           VXV      UNIT                                  #  TAKE THE CROSS PRODUCT VF X VI
020365,000421: 27,2056           03765                                    SCAXIS                                #  WHERE VI = SCAXIS
020366,000422: 27,2057           57400                           BOV      VCOMP                                 
020367,000423: 27,2060           56170                                    PICKAXIS                              
020368,000424: 27,2061           17271                           STODL    COF                                   #  CHECK MAGNITUDE
020369,000425: 27,2062           00045                                    36D                                   #  OF CROSS PRODUCT
020370,000426: 27,2063           50025                           DSU      BMN                                   #  VECTOR, IF LESS
020371,000427: 27,2064           14411                                    DPB-14                                #  THAN B-14 ASSUME
020372,000428: 27,2065           56170                                    PICKAXIS                              #  UNIT OPERATION
020373,000429: 27,2066           50375                           VLOAD    DOT                                   #  INVALID.
020374,000430: 27,2067           03765                                    SCAXIS                                
020375,000431: 27,2070           00035                                    28D                                   
020376,000432: 27,2071           65552                           SL1      ARCCOS                                
020377,000433: 27,2072           77624        COMPMATX           CALL                                           #  NOW COMPUTE THE TRANSFORMATION FROM
020378,000434: 27,2073           44527                                    DELCOMP                               #  FINAL S/C AXES TO INITIAL S/C AXES MFI
020379,000435: 27,2074           75160                           AXC,1    AXC,2                                 
020380,000436: 27,2075           03246                                    MIS                                   #  COMPUTE THE TRANSFORMATION FROM FINAL
020381,000437: 27,2076           02230                                    KEL                                   #  S/C AXES TO STABLE MEMBER AXES
020382,000438: 27,2077           77624                           CALL                                           #  MFS = MIS MFI
020383,000439: 27,2100           44312                                    MXM3                                  #  (IN PD LIST)
020384,000440: 
020385,000441: 27,2101           51545                           DLOAD    ABS                                   
020386,000442: 27,2102           00007                                    6                                     #  MFS6 = SIN(CPSI)                      $2
020387,000443: 27,2103           50025                           DSU      BMN                                   
020388,000444: 27,2104           14376                                    SINGIMLC                              #  = SIN(59 DEGS)                        $2
020389,000445: 27,2105           56160                                    FINDGIMB                              #  /CPSI/ LESS THAN 59 DEGS

Page 482

020391,000447:                                                                                                  #  I.E. DESIRED ATTITUDE NOT IN GIMBAL LOCK
020392,000448: 
020393,000449: 27,2106           51545                           DLOAD    ABS                                   #  CHECK TO SEE IF WE ARE POINTING
020394,000450: 27,2107           03765                                    SCAXIS                                #  THE THRUST AXIS
020395,000451: 27,2110           51025                           DSU      BPL                                   
020396,000452: 27,2111           14400                                    SINVEC1                               #  SIN 49.4 DEGS                         $2
020397,000453: 27,2112           56160                                    FINDGIMB                              #  IF SO, WE ARE TRYING TO POINT IT INTO
020398,000454: 27,2113           77775                           VLOAD                                          #  GIMBAL LOCK, ABORT COULD GO HERE
020399,000455: 27,2114           77626                           STADR                                          
020400,000456: 27,2115           50514                           STOVL    MIS        +12D                       
020401,000457: 27,2116           77626                           STADR                                          #  STORE MFS (IN PD LIST) IN MIS
020402,000458: 27,2117           50522                           STOVL    MIS        +6                         
020403,000459: 27,2120           77626                           STADR                                          
020404,000460: 27,2121           50530                           STOVL    MIS                                   
020405,000461: 27,2122           03255                                    MIS        +6                         #  INNER GIMBAL AXIS IN FINAL S/C AXES
020406,000462: 27,2123           57444                           BPL      VCOMP                                 #  LOCATE THE IG AXIS DIRECTION CLOSEST TO
020407,000463: 27,2124           56125                                    IGSAMEX                               #  FINAL X S/C AXIS
020408,000464: 
020409,000465: 27,2125           50035        IGSAMEX            VXV      BMN                                   #  FIND THE SHORTEST WAY OF ROTATING THE 
020410,000466: 27,2126           03765                                    SCAXIS                                #  S/C OUT OF GIMBAL LOCK BY A ROTATION 
020411,000467: 27,2127           56134                                    U=SCAXIS                              #  ABOUT +- SCAXIS, I.E. IF  (IG (SGN MFS3)
020412,000468:                                                                                                  #  X SCAXIS . XF) LESS THAN 0, U = SCAXIS
020413,000469:                                                                                                  #  OTHERWISE U = -SCAXIS
020414,000470: 
020415,000471: 27,2130           57575                           VLOAD    VCOMP                                 
020416,000472: 27,2131           03765                                    SCAXIS                                
020417,000473: 27,2132           37271                           STCALL   COF                                   #  ROTATE ABOUT -SCAXIS
020418,000474: 27,2133           56137                                    CHEKAXIS                              
020419,000475: 27,2134           77775        U=SCAXIS           VLOAD                                          
020420,000476: 27,2135           03765                                    SCAXIS                                
020421,000477: 27,2136           03271                           STORE    COF                                   #  ROTATE ABOUT + SCAXIS
020422,000478: 27,2137           51545        CHEKAXIS           DLOAD    ABS                                   
020423,000479: 27,2140           03765                                    SCAXIS                                #  SEE IF WE ARE POINTING THE AOT
020424,000480: 27,2141           51025                           DSU      BPL                                   
020425,000481: 27,2142           14402                                    SINVEC2                               #  SIN 29.5 DEGS                         $2
020426,000482: 27,2143           56147                                    PICKANG1                              #  IF SO, ROTATE 50 DEGS ABOUT +- SCAXIS
020427,000483: 27,2144           52145                           DLOAD    GOTO                                  #  IF NOT, MUST BE POINTING THE TRANSPONDER
020428,000484: 27,2145           14406                                    VECANG2                               #  OR SOME VECTOR IN THE Y, OR Z PLANE
020429,000485: 27,2146           56151                                    COMPMFSN                              #  IN THIS CASE ROTATE 35 DEGS TO GET OUT
020430,000486:                                                                                                  #  OF GIMBAL LOCK (VECANG2  $360)
020431,000487: 27,2147           77745        PICKANG1           DLOAD                                          
020432,000488: 27,2150           14404                                    VECANG1                               #  = 50 DEGS                             $360
020433,000489: 27,2151           77624        COMPMFSN           CALL                                           
020434,000490: 27,2152           44527                                    DELCOMP                               #  COMPUTE THE ROTATION ABOUT SCAXIS TO
020435,000491: 27,2153           75160                           AXC,1    AXC,2                                 #  BRING MFS OUT OF GIMBAL LOCK
020436,000492: 27,2154           03246                                    MIS                                   
020437,000493: 27,2155           02230                                    KEL                                   
020438,000494: 27,2156           77624                           CALL                                           #  COMPUTE THE NEW TRANSFORMATION FROM
020439,000495: 27,2157           44312                                    MXM3                                  #  DESIRED S/C AXES TO STABLE MEMBER AXES
020440,000496:                                                                                                  #  WHICH WILL ALIGN VI WITH VF AND AVOID

Page 483

020442,000498:                                                                                                  #  GIMBAL LOCK
020443,000499: 27,2160           45160        FINDGIMB           AXC,1    CALL                                  
020444,000500: 27,2161           00000                                    0                                     #  EXTRACT THE COMMANDED CDU ANGLES FROM
020445,000501: 27,2162           44654                                    DCMTOCDU                              #  THIS MATRIX
020446,000502: 27,2163           40234                           RTB      SETPD                                 
020447,000503: 27,2164           21620                                    V1STO2S                               #  CONVERT TO 2:S COMPLEMENT
020448,000504: 27,2165           00001                                    0                                     
020449,000505: 27,2166           77650                           GOTO                                           
020450,000506: 27,2167           03325                                    VECQTEMP                              #  RETURN TO CALLER
020451,000507: 
020452,000508: 27,2170           50375        PICKAXIS           VLOAD    DOT                                   #  IF VF X VI = 0, FIND VF . VI
020453,000509: 27,2171           00035                                    28D                                   
020454,000510: 27,2172           03765                                    SCAXIS                                
020455,000511: 27,2173           72240                           BMN      TLOAD                                 
020456,000512: 27,2174           54350                                    ROT180                                
020457,000513: 27,2175           00032                                    25D                                   
020458,000514: 27,2176           77650                           GOTO                                           #  IF VF = VI, CDU DESIRED = PRESENT CDU
020459,000515: 27,2177           03325                                    VECQTEMP                              #  PRESENT CDU ANGLES
020460,000516: 
020461,000517: 35,2000                                           BANK     35                                    
020462,000518: 26,2000                                           SETLOC   MANUVER1                              
020463,000519: 26,2000                                           BANK                                           
020464,000520: 26,2350           47375        ROT180             VLOAD    VXV                                   #  IF VF, VI ANTIPARALLEL, 108 DEG ROTATION
020465,000521: 26,2351           03255                                    MIS        +6                         #  IS REQUIRED.  Y STABLE MEMBER AXIS IN
020466,000522: 26,2352           06520                                    HIDPHALF                              #  INITIAL S/C AXES.
020467,000523: 26,2353           47256                           UNIT     VXV                                   #  FIND Y(SM) X X(I)
020468,000524: 26,2354           03765                                    SCAXIS                                #  FIND UNIT(VI X UNIT(Y(SM) X X(I)))
020469,000525: 26,2355           40056                           UNIT     BOV                                   #  I.E. PICK A VECTOR IN THE PLANE OF X(I),
020470,000526: 26,2356           54372                                    PICKX                                 #  Y(SM) PERPENDICULAR TO VI
020471,000527: 26,2357           17271                           STODL    COF                                   
020472,000528: 26,2360           00045                                    36D                                   #  CHECK MAGNITUDE
020473,000529: 26,2361           50025                           DSU      BMN                                   #  OF THIS VECTOR.
020474,000530: 26,2362           14411                                    DPB-14                                #  IF LESS THAN B-14,
020475,000531: 26,2363           54372                                    PICKX                                 #  PICK X-AXIS.
020476,000532: 26,2364           77775                           VLOAD                                          
020477,000533: 26,2365           03271                                    COF                                   
020478,000534: 26,2366           17271        XROT               STODL    COF                                   
020479,000535: 26,2367           06520                                    HIDPHALF                              
020480,000536: 26,2370           77650                           GOTO                                           
020481,000537: 26,2371           56072                                    COMPMATX                              
020482,000538: 26,2372           52175        PICKX              VLOAD    GOTO                                  #  PICK THE XAXIS IN THIS CASE
020483,000539: 26,2373           06520                                    HIDPHALF                              
020484,000540: 26,2374           54366                                    XROT                                  
020485,000541: 26,2375           15555 35172  SINGIMLC           2DEC     .4285836003                            #  = SIN(59)                             $2
020486,000542: 
020487,000543: 26,2377           14113 36326  SINVEC1            2DEC     .3796356537                            #  = SIN(49.4)                           $2
020488,000544: 
020489,000545: 26,2401           07701 35703  SINVEC2            2DEC     .2462117800                            #  = SIN(29.5)                           $2
020490,000546: 
020491,000547: 26,2403           04343 21616  VECANG1            2DEC     .1388888889                            #  = 50 DEGREES                          $360

Page 484

020493,000549: 26,2405           03070 34344  VECANG2            2DEC     .09722222222                            #  = 35 DEGREES                          $360
020494,000550: 
020495,000551: 26,2407           00000        1BITDP             OCT      0                                     #  KEEP THIS BEFORE DPB(-14)        *********
020496,000552: 26,2410           00001        DPB-14             OCT      00001                                 
020497,000553: 26,2411           00000                           OCT      00000                                 
020498,000554: 

Page 485

020500,000556:                                                                                                  #  ROUTINE FOR INITIATING AUTOMATIC MANEUVER VIA KEYBOARD (V49)
020501,000557: 
020502,000558: 34,2000                                           BANK     34                                    
020503,000559: 23,2000                                           SETLOC   R62                                   
020504,000560: 23,2000                                           BANK                                           
020505,000561: 23,2103  E6,1676                                  EBANK=   BCDU                                  
020506,000562: 
020507,000563: 23,2103                                           COUNT*   $$/R62                                
020508,000564: 
020509,000565: 23,2103  23,2103               R62DISP            EQUALS   R62FLASH                              
020510,000566: 
020511,000567: 23,2103           35010        R62FLASH           CAF      V06N22                                #  FLASH V06N22 AND
020512,000568: 23,2104           04616                           TC       BANKCALL                              #  ICDU ANGLES
020513,000569: 23,2105           20476                           CADR     GOFLASH                               
020514,000570: 23,2106           15472                           TCF      ENDEXT                                #  TERMINATE
020515,000571: 23,2107           12111                           TCF      GOMOVE                                #  PROCEED
020516,000572: 23,2110           12103                           TCF      R62FLASH                              #  ENTER
020517,000573: 
020518,000574:                                                                                                  #  ASTRONAUT MAY LOAD NEW ICDUS AT THIS
020519,000575:                                                                                                  #  POINT
020520,000576: 23,2111           05504        GOMOVE             TC       UPFLAG                                #  SET FOR 3-AXIS MANEUVER
020521,000577: 23,2112           00124                           ADRES    3AXISFLG                              
020522,000578: 
020523,000579: 23,2113           04616                           TC       BANKCALL                              
020524,000580: 23,2114           54123                           CADR     R60LEM                                
020525,000581: 23,2115           15472                           TCF      ENDEXT                                #  END R62
020526,000582: 

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