Source Code

These source-code files are part of a reconstructed copy of Luminary 69/2, the flown, final release of the Apollo 10 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction is based on the source code of Luminary 69 — i.e., the initial, unflown version, "revision 0" — of which a contemporary listing was available. The code was then updated by incorporating the differences between Luminary 69 and Luminary 69/2, known from other contemporary documentation. The only such difference is the implementation in Luminary 69/2 of the "R-2 Lunar Potential Model", the source code for which was taken from program Luminary 99/1 (Apollo 11 LM), of which a contemporary listing was also available. Finally, the now-reconstructed Luminary 69/2 was then validated by assembling it to executable form and verifying that its memory banks had the correct checksums, known from still other contemporary documentation.

Note that page numbers in the reconstructed code match those in the original Luminary 69 program listing, or in the ORBITAL INTEGRATION log section, in Luminary 99/1. Page numbers would certainly differ somewhat in a contemporary Luminary 69/2 listing. Moreover, annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change in Luminary 69/2 relative to Luminary 69. Here's a guide to the Apollo documentation referenced in those annotations:
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.

021328,000002:                                                                                                  ## Copyright:   Public domain.
021329,000003:                                                                                                  ## Filename:    R60,R62.agc
021330,000004:                                                                                                  ## Purpose:     A section of LUM69 revision 2.
021331,000005:                                                                                                  ##              It is part of the reconstructed source code for the flown
021332,000006:                                                                                                  ##              version of the flight software for the Lunar Module's (LM)
021333,000007:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 10. The code has
021334,000008:                                                                                                  ##              been recreated from a copy of Luminary revsion 069, using
021335,000009:                                                                                                  ##              changes present in Luminary 099 which were described in
021336,000010:                                                                                                  ##              Luminary memos 75 and 78. The code has been adapted such
021337,000011:                                                                                                  ##              that the resulting bugger words exactly match those specified
021338,000012:                                                                                                  ##              for LUM69 revision 2 in NASA drawing 2021152B, which gives
021339,000013:                                                                                                  ##              relatively high confidence that the reconstruction is correct.
021340,000014:                                                                                                  ## Reference:   pp. 485-497
021341,000015:                                                                                                  ## Assembler:   yaYUL
021342,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
021343,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
021344,000018:                                                                                                  ## Mod history: 2019-07-27 MAS  Created from Luminary 69.
021345,000019: 

Page 485

021347,000021:                                                                                                  #  MOD NO: 0                             DATE: 1 MAY 1968
021348,000022:                                                                                                  #  MOD BY: DIGITAL DEVEL GROUP           LOG SECTION R60,R62
021349,000023: 
021350,000024:                                                                                                  #  FUNCTIONAL DESCRIPTION:
021351,000025: 
021352,000026:                                                                                                  #  CALLED AS A GENERAL SUBROUTINE TO MANEUVER THE LM TO A SPECIFIED
021353,000027:                                                                                                  #  ATTITUDE.
021354,000028: 
021355,000029:                                                                                                  #  1. IF THE 3-AXIS FLAG IS NOT SET THE FINAL CDU ANGLES ARE
021356,000030:                                                                                                  #  CALCULATED (VECPOINT).
021357,000031: 
021358,000032:                                                                                                  #  2. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
021359,000033: 
021360,000034:                                                                                                  #  3. REQUEST FLASHING DISPLAY V50 N18 PLEASE PERFORM AUTO MANEUVER.
021361,000035: 
021362,000036:                                                                                                  #  4. IF PRIORITY DISPLAY FLAG IS SET DO A PHASECHANGE. THEN AWAIT
021363,000037:                                                                                                  #  ASTRONAUT RESPONSE.
021364,000038: 
021365,000039:                                                                                                  #  5. DISPLAY RESPONSE RETURNS:
021366,000040: 
021367,000041:                                                                                                  #        A.      ENTER - RESET 3-AXIS FLAG AND RETURN TO CLIENT.
021368,000042: 
021369,000043:                                                                                                  #        B.      TERMINATE - IF IN P00 GO TO STEP 5A. OTHERWISE CHECK IF R61 IS
021370,000044:                                                                                                  #                THE CALLING PROGRAM. IF IN R61 AN EXIT IS MADE TO GOTOV56.  IF
021371,000045:                                                                                                  #                NOT IN R61 AN EXIT IS DONE VIA GOTOP00H.
021372,000046: 
021373,000047:                                                                                                  #        C.      PROCEED - CONTINUE WITH PROGRAM AT STEP 6.
021374,000048: 
021375,000049:                                                                                                  #  6. IF THE 3-AXISFLAG IS NOT SET, THE FINAL CDU ANGLES ARE CALCULATED
021376,000050:                                                                                                  #  (VECPOINT).
021377,000051: 
021378,000052:                                                                                                  #  7. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
021379,000053: 
021380,000054:                                                                                                  #  8. IF THE G+N SWITCH IS NOT SET GO BACK TO STEP 3.
021381,000055:                                                                                                  #  
021382,000056:                                                                                                  #  9. IF THE AUTO SWITCH IS NOT SET GO BACK TO STEP 3.
021383,000057: 
021384,000058:                                                                                                  #  10. NONFLASHING DISPLAY V06N18 (FDAI ANGLES).
021385,000059: 
021386,000060:                                                                                                  #  11. DO A PHASECHANGE.
021387,000061: 
021388,000062:                                                                                                  #  12. DO A MANEUVER CALCULATION AND ICDU DRIVE ROUTINE TO ACHIEVE FINAL
021389,000063: 
021390,000064:                                                                                                  #  GIMBAL ANGLES (GOMANUR).
021391,000065:                                                                                                  #  13. AT END OF MANEUVER GO TO STEP 3.
021392,000066: 
021393,000067:                                                                                                  #        IF SATISFACTORY MANEUVER STEP 5A EXITS R60.
021394,000068:                                                                                                  #        FOR FURTHER ADJUSTMENT OF THE VEHICLE ATTITUDE ABOUT THE
021395,000069:                                                                                                  #        DESIRED VECTOR, THE ROUTINE MAY BE PERFORMED AGAIN STARTING AT

Page 486

021397,000071:                                                                                                  #        STEP 5C.
021398,000072: 
021399,000073:                                                                                                  #  CALLING SEQUENCE:     TC      BANKCALL
021400,000074:                                                                                                  #                        CADR    R60LEM
021401,000075: 
021402,000076:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:     SCAXIS, POINTVSM (FOR VECPOINT)
021403,000077:                                                                                                  #                                        3AXISFLG.
021404,000078: 
021405,000079:                                                                                                  #  SUBROUTINES CALLED:   VECPOINT, BALLANGS, GOPERF2R, LINUS, GODSPER,
021406,000080:                                                                                                  #                        GOMANUR, DOWNFLAG, PHASCHNG, UPFLAG
021407,000081: 
021408,000082:                                                                                                  #  NORMAL EXIT MODES:    CAE     TEMPR60         (CALLERS RETURN ADDRESS)
021409,000083:                                                                                                  #                        TC      BANKJUMP
021410,000084: 
021411,000085:                                                                                                  #  ALARMS: NONE
021412,000086: 
021413,000087:                                                                                                  #  OUTPUT: NONE
021414,000088: 
021415,000089:                                                                                                  #  DEBRIS: CPHI, CTHETA, CPSI, 3AXISFLG, TBASE2
021416,000090: 
021417,000091: 34,2000                                           BANK     34                                    
021418,000092: 26,2000                                           SETLOC   MANUVER                               
021419,000093: 26,2000                                           BANK                                           
021420,000094: 
021421,000095: 26,2101     1164                                  EBANK=   TEMPR60                               
021422,000096: 
021423,000097: 26,2101                                           COUNT*   $$/R06                                
021424,000098: 26,2101           04645        R60LEM             TC       MAKECADR                              
021425,000099: 26,2102           55164                           TS       TEMPR60                               
021426,000100: 
021427,000101: 26,2103           34746        REDOMANN           CAF      3AXISBIT                              
021428,000102: 26,2104           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
021429,000103: 26,2105           10000                           CCS      A                                     
021430,000104: 26,2106           12114                           TCF      TOBALL                                #  YES
021431,000105: 26,2107           06036                           TC       INTPRET                               
021432,000106: 26,2110           77624                           CALL                                           
021433,000107: 26,2111           56016                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
021434,000108: 26,2112           00322                           STORE    CPHI                                  #  STORE FINAL ANGLES - CPHI, CTHETA, CPSI
021435,000109: 26,2113           77776                           EXIT                                           
021436,000110: 
021437,000111: 26,2114           04616        TOBALL             TC       BANKCALL                              
021438,000112: 26,2115           54244                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
021439,000113: 26,2116           32232        TOBALLA            CAF      V06N18                                
021440,000114: 26,2117           04616                           TC       BANKCALL                              
021441,000115: 26,2120           20563                           CADR     GOPERF2R                              #  DISPLAY PLEASE PERFORM AUTO MANEUVER
021442,000116: 26,2121           02220                           TC       R61TEST                               
021443,000117: 26,2122           02126                           TC       REDOMANC                              #  PROCEED
021444,000118: 26,2123           02153                           TC       ENDMANU1                              #  ENTER I.E. FINISHED WITH R60

Page 487

021446,000120: 26,2124           02157                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
021447,000121: 26,2125           05155                           TC       ENDOFJOB                              
021448,000122: 
021449,000123: 26,2126           34746        REDOMANC           CAF      3AXISBIT                              
021450,000124: 26,2127           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
021451,000125: 26,2130           10000                           CCS      A                                     
021452,000126: 26,2131           12137                           TCF      TOBALLC                               #  YES
021453,000127: 26,2132           06036                           TC       INTPRET                               
021454,000128: 26,2133           77624                           CALL                                           
021455,000129: 26,2134           56016                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
021456,000130: 26,2135           00322                           STORE    CPHI                                  #  STORE ANGLES
021457,000131: 26,2136           77776                           EXIT                                           
021458,000132: 
021459,000133: 26,2137           04616        TOBALLC            TC       BANKCALL                              
021460,000134: 26,2140           54244                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
021461,000135: 26,2141           02233                           TC       G+N,AUTO                              #  CHECK AUTO MODE
021462,000136: 26,2142           10000                           CCS      A                                     
021463,000137: 26,2143           12116                           TCF      TOBALLA                               #  NOT AUTO, GO REREQUEST AUTO MANEUVER.
021464,000138: 
021465,000139: 26,2144           32232        AUTOMANV           CAF      V06N18                                #  STATIC DISPLAY DURING AUTO MANEUVER
021466,000140: 26,2145           04616                           TC       BANKCALL                              #                                        -
021467,000141: 26,2146           20327                           CADR     GODSPR                                #                                        -
021468,000142: 26,2147           02157                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
021469,000143: 
021470,000144: 26,2150           04616        STARTMNV           TC       BANKCALL                              #  PERFORM MANEUVER VIA KALCMANU
021471,000145: 26,2151           17723                           CADR     GOMANUR                               
021472,000146: 
021473,000147: 26,2152           12116        ENDMANUV           TCF      TOBALLA                               #  FINISHED MANEUVER.
021474,000148: 26,2153           05516        ENDMANU1           TC       DOWNFLAG                              #  RESET 3-AXIS FLAG
021475,000149: 26,2154           00124                           ADRES    3AXISFLG                              
021476,000150: 26,2155           31164                           CAE      TEMPR60                               #                                        -
021477,000151: 26,2156           04640                           TC       BANKJUMP                              #                                        -
021478,000152: 
021479,000153: 26,2157           40100        CHKLINUS           CS       FLAGWRD4                              
021480,000154: 26,2160           74740                           MASK     PDSPFBIT                              #  IS PRIORITY DISPLAY FLAG SET?
021481,000155: 26,2161           10000                           CCS      A                                     #                                        -
021482,000156: 26,2162           00002                           TC       Q                                     #  NO - EXIT
021483,000157: 26,2163           30002                           CA       Q                                     
021484,000158: 26,2164           54156                           TS       MPAC       +2                         #  SAVE RETURN
021485,000159: 26,2165           46244                           CS       THREE                                 #  OBTAIN LOCATION FOR RESTART
021486,000160: 26,2166           60133                           AD       BUF2                                  #  HOLDS Q OF LAST DISPLAY
021487,000161: 26,2167           55055                           TS       TBASE2                                
021488,000162: 
021489,000163: 26,2170           05353                           TC       PHASCHNG                              
021490,000164: 26,2171           00132                           OCT      00132                                 
021491,000165: 
021492,000166: 26,2172           34745                           CAF      BIT7                                  
021493,000167: 26,2173           05464                           TC       LINUS                                 #  GO SET BITS FOR PRIORITY DISPLAY      -
021494,000168: 26,2174           00156                           TC       MPAC       +2                         
021495,000169: 

Page 488

021497,000171: 26,2175           37713        RELINUS            CAF      PRIO26                                #  RESTORE ORIGINAL PRIORITY
021498,000172: 26,2176           05146                           TC       PRIOCHNG                              
021499,000173: 
021500,000174: 26,2177           34747                           CAF      TRACKBIT                              #  DON'T CONTINUE R60 UNLESS TRACKFLAG ON.
021501,000175: 26,2200           70075                           MASK     FLAGWRD1                              
021502,000176: 26,2201           10000                           CCS      A                                     
021503,000177: 26,2202           12215                           TCF      RER60                                 
021504,000178: 
021505,000179: 26,2203           34745                           CAF      RNDVZBIT                              #  IS IT P20?
021506,000180: 26,2204           70074                           MASK     FLAGWRD0                              
021507,000181: 26,2205           10000                           CCS      A                                     
021508,000182: 26,2206           02212                           TC       +4                                    #  YES
021509,000183: 26,2207           05353                           TC       PHASCHNG                              #  NO, MUST BE P25, SET 2.11 SPOT
021510,000184: 26,2210           40112                           OCT      40112                                 
021511,000185: 
021512,000186: 26,2211           05155                           TC       ENDOFJOB                              
021513,000187: 
021514,000188: 26,2212           05353                           TC       PHASCHNG                              #  SET 2.7 SPOT FOR P20
021515,000189: 26,2213           40072                           OCT      40072                                 
021516,000190: 
021517,000191: 26,2214           05155                           TC       ENDOFJOB                              
021518,000192: 
021519,000193: 26,2215           05504        RER60              TC       UPFLAG                                #  SET PRIO DISPLAY FLAG AFTER RESTART
021520,000194: 26,2216           00077                           ADRES    PDSPFLAG                              
021521,000195: 
021522,000196: 26,2217           01055                           TC       TBASE2                                
021523,000197: 
021524,000198: 26,2220           31011        R61TEST            CA       MODREG                                #  IF WE ARE IN P00 IT MUST BE V49 OR V89
021525,000199: 26,2221           00006                           EXTEND                                         
021526,000200: 26,2222           12153                           BZF      ENDMANU1                              #  THUS WE GO TO ENDEXT VIA USER
021527,000201: 
021528,000202: 26,2223           30100                           CA       FLAGWRD4                              #  ARE WE IN R61 (P20 OR P25)
021529,000203: 26,2224           74740                           MASK     PDSPFBIT                              
021530,000204: 26,2225           00006                           EXTEND                                         
021531,000205: 26,2226           16001                           BZF      GOTOPOOH                              #  NO
021532,000206: 26,2227           06022                           TC       GOTOV56                               #  YES
021533,000207: 
021534,000208: 26,2230           20100        BIT14+7            OCT      20100                                 #                                        -
021535,000209: 26,2231           00203        OCT203             OCT      203                                   
021536,000210: 26,2232           01422        V06N18             VN       0618                                  
021537,000211: 
021538,000212:                                                                                                  #  SUBROUTINE TO CHECK FOR G+N CONTROL, AUTO STABILIZATION
021539,000213: 
021540,000214:                                                                                                  #  RETURNS WITH C(A) = +         IF NOT SET FOR G+N, AUTO
021541,000215:                                                                                                  #  RETURNS WITH C(A) = +0        IF SWITCHES ARE SET
021542,000216: 
021543,000217: 26,2233           00006        G+N,AUTO           EXTEND                                         
021544,000218: 26,2234           00030                           READ     CHAN30                                
021545,000219: 26,2235           74742                           MASK     BIT10                                 
021546,000220: 26,2236           10000                           CCS      A                                     
021547,000221: 26,2237           00002                           TC       Q                                     #  NOT IN G+N    C(A) = +

Page 489

021549,000223: 26,2240           00006        ISITAUTO           EXTEND                                         #  CHECK FOR AUTO MODE
021550,000224: 26,2241           00031                           READ     CHAN31                                
021551,000225: 26,2242           74736                           MASK     BIT14                                 
021552,000226: 26,2243           00002                           TC       Q                                     #  (+) = NOT IN AUTO, (+0) = AOK
021553,000227: 

Page 490

021555,000229:                                                                                                  #  PROGRAM DESCRIPTION BALLANGS
021556,000230:                                                                                                  #  MOD NO.         LOG SECTION R60,R62
021557,000231: 
021558,000232:                                                                                                  #  WRITTEN BY RAMA M. AIYAWAR
021559,000233:                                                                                                  #  FUNCTIONAL DESCRIPTION
021560,000234: 
021561,000235:                                                                                                  #  COMPUTES LM FDAI BALL DISPLAY ANGLES
021562,000236:                                                                                                  #  CALLING SEQUENCE
021563,000237: 
021564,000238:                                                                                                  #           TC     BALLANGS
021565,000239:                                                                                                  #  NORMAL EXIT MODE
021566,000240: 
021567,000241:                                                                                                  #           TC     BALLEXIT        (SAVED Q)
021568,000242: 
021569,000243:                                                                                                  #  ALARM OR EXIT MODE  NIL
021570,000244:                                                                                                  #  SUBROUTINES CALLED
021571,000245:                                                                                                  #           CD*TR*G
021572,000246:                                                                                                  #           ARCTAN
021573,000247: 
021574,000248:                                                                                                  #  INPUT
021575,000249: 
021576,000250:                                                                                                  #  CPHI,CTHETA,CPSI  ARE  THE ANGLES CORRESPONDING TO AOG,AIG,AMG. THEY ARE
021577,000251:                                                                                                  #  SP,2S COMPLIMENT SCALED TO HALF REVOLUTION.
021578,000252:                                                                                                  #  OUTPUT
021579,000253: 
021580,000254:                                                                                                  #  FDAIX, FDAIY, FDAIZ ARE THE REQUIRED BALL ANGLES SCALED TO HALF REVOLUTION
021581,000255:                                                                                                  #  SP,2S COMPLIMENT.
021582,000256:                                                                                                  #  THESE ANGLES WILL BE DISPLAYED AS DEGREES AND HUNDREDTHS, IN THE ORDER ROLL, PITCH, YAW, USING NOUNS 18 & 19.
021583,000257: 
021584,000258:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
021585,000259: 
021586,000260:                                                                                                  #  CPHI,CTHETA,CPSI EACH A SP REGISTER
021587,000261:                                                                                                  #  DEBRIS
021588,000262: 
021589,000263:                                                                                                  #  A,L,Q,MPAC,SINCDU,COSCDU,PUSHLIST,BALLEXIT
021590,000264: 
021591,000265:                                                                                                  #  NOMENCLATURE:  CPHI, CTHETA, & CPSI REPRESENT THE OUTER, INNER, & MIDDLE GIMBAL ANGLES, RESPECTIVELY; OR
021592,000266:                                                                                                  #  EQUIVALENTLY, CDUX, CDUY, & CDUZ.
021593,000267: 
021594,000268:                                                                                                  #  NOTE:  ARCTAN CHECKS FOR OVERFLOW AND SHOULD BE ABLE TO HANDLE ANY SINGULARITIES.
021595,000269: 
021596,000270: 26,2000                                           SETLOC   BAWLANGS                              
021597,000271: 26,2000                                           BANK                                           
021598,000272: 
021599,000273: 26,2244                                           COUNT*   $$/BALL                               
021600,000274: 26,2244           04645        BALLANGS           TC       MAKECADR                              
021601,000275: 26,2245           55342                           TS       BALLEXIT                              
021602,000276: 26,2246           30321                           CA       CPHI                                  

Page 491

021604,000278: 26,2247           54772                           TS       CDUSPOT    +4                         
021605,000279: 26,2250           30322                           CA       CTHETA                                
021606,000280: 26,2251           54766                           TS       CDUSPOT                               
021607,000281: 26,2252           30323                           CA       CPSI                                  
021608,000282: 26,2253           54770                           TS       CDUSPOT    +2                         
021609,000283: 
021610,000284: 26,2254           06036                           TC       INTPRET                               
021611,000285: 26,2255           45001                           SETPD    CALL                                  
021612,000286: 26,2256           00001                                    0D                                    
021613,000287: 26,2257           47447                                    CD*TR*G                               
021614,000288: 
021615,000289: 26,2260           41345                           DLOAD    DMP                                   
021616,000290: 26,2261           00743                                    SINCDUX                               #  SIN (OGA)
021617,000291: 26,2262           00747                                    COSCDUZ                               #  COS (MGA)
021618,000292: 
021619,000293: 26,2263           57552                           SL1      DCOMP                                 #  SCALE
021620,000294: 26,2264           65336                           ARCSIN   PDDL                                  #  YAW = ARCSIN(-SXCZ) INTO 0 PD
021621,000295: 26,2265           00741                                    SINCDUZ                               
021622,000296: 26,2266           14023                           STODL    SINTH                                 #  (SINTH = 18D IN PD)
021623,000297: 26,2267           00747                                    COSCDUZ                               
021624,000298: 26,2270           72405                           DMP      SL1                                   #  RESCALE
021625,000299: 26,2271           00751                                    COSCDUX                               
021626,000300: 26,2272           34021                           STCALL   COSTH                                 #  (COSTH= 16D IN PD)
021627,000301: 26,2273           26510                                    ARCTAN                                
021628,000302: 26,2274           41325                           PDDL     DMP                                   #  ROLL = ARCTAN(SZ/CZCX) INTO 2 PD
021629,000303: 26,2275           00741                                    SINCDUZ                               
021630,000304: 26,2276           00743                                    SINCDUX                               
021631,000305: 26,2277           41512                           SL2      PUSH                                  #  SXSZ INTO 4 PD
021632,000306: 26,2300           65205                           DMP      PDDL                                  #  SXSZCY INTO 4 PD
021633,000307: 26,2301           00745                                    COSCDUY                               
021634,000308: 26,2302           65205                           DMP      PDDL                                  #  SXSZSY INTO 6 PD
021635,000309: 26,2303           00737                                    SINCDUY                               
021636,000310: 26,2304           00751                                    COSCDUX                               
021637,000311: 26,2305           72405                           DMP      SL1                                   #  CXCY
021638,000312: 26,2306           00745                                    COSCDUY                               
021639,000313: 26,2307           45425                           DSU      STADR                                 #  PULL UP FROM 6 PD
021640,000314: 26,2310           63756                           STODL    COSTH                                 #  COSTH = CXCY - SXSZSY
021641,000315: 26,2311           00737                                    SINCDUY                               
021642,000316: 26,2312           72405                           DMP      SL1                                   
021643,000317: 26,2313           00751                                    COSCDUX                               #  CXSY
021644,000318: 26,2314           45415                           DAD      STADR                                 #  PULL UP FROM 4 PD
021645,000319: 26,2315           43754                           STCALL   SINTH                                 #  SINTH = CXSY + SXSZCY
021646,000320: 26,2316           26510                                    ARCTAN                                #  RETURNS WITH D(MPAC) = PITCH
021647,000321: 26,2317           55525                           PDDL     VDEF                                  #  PITCH INTO 2 PD, ROLL INTO MPAC FROM 2 PD
021648,000322: 26,2320           77634                           RTB                                            #  VDEF MAKES V(MPAC) = ROLL, PITCH, YAW
021649,000323: 26,2321           21524                                    V1STO2S                               
021650,000324: 26,2322           02351                           STORE    FDAIX                                 #  MODE IS TP
021651,000325: 26,2323           77776                           EXIT                                           
021652,000326: 
021653,000327: 26,2324           31342        ENDBALL            CA       BALLEXIT                              
021654,000328: 

Page 492

021656,000330: 26,2325           04640                           TC       BANKJUMP                              
021657,000331: 

Page 493

021659,000333:                                                                                                  #  PROGRAM DESCRIPTION - VECPOINT
021660,000334: 
021661,000335:                                                                                                  #           THIS INTERPRETIVE SUBROUTINE MAY BE USED TO POINT A SPACECRAFT AXIS IN A DESIRED DIRECTION.  THE AXIS
021662,000336:                                                                                                  #  TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN SUCCESSIVE LOCATIONS OF ERASABLE MEMORY
021663,000337:                                                                                                  #  BEGINNING WITH THE LOCATION CALLED SCAXIS.  THE COMPONENTS OF THIS VECTOR ARE GIVEN IN SPACECRAFT COORDINATES.
021664,000338:                                                                                                  #  THE DIRECTION IN WHICH THIS AXIS IS TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN
021665,000339:                                                                                                  #  SUCCESSIVE LOCATIONS OF ERASABLE MEMORY BEGINNING WITH THE ADDRESS CALLED POINTVSM.  THE COMPONENTS OF THIS
021666,000340:                                                                                                  #  VECTOR ARE GIVEN IN STABLE MEMBER COORDINATES.  WITH THIS INFORMATION VECPOINT COMPUTES A SET OF THREE GIMBAL
021667,000341:                                                                                                  #  ANGLES (2S COMPLEMENT) CORESPONDING TO THE CROSS-PRODUCT ROTATION BETWEEN SCAXIS AND POINTVSM AND STORES THEM
021668,000342:                                                                                                  #  IN T(MPAC) BEFORE RETURNING TO THE CALLER.
021669,000343:                                                                                                  #           THIS ROTATION, HOWEVER, MAY BRING THE S/C INTO GIMBAL LOCK.  WHEN POINTING A VECTOR IN THE Y-Z PLANE,
021670,000344:                                                                                                  #  THE TRANSPONDER AXIS, OR THE AOT FOR THE LEM, THE PROGRAM WILL CORRECT THIS PROBLEM BY ROTATING THE CROSS-
021671,000345:                                                                                                  #  PRODUCT ATTITUDE ABOUT POINTVSM BY A FIXED AMOUNT SUFFICIENT TO ROTATE THE DESIRED S/C ATTITUDE OUT OF GIMBAL
021672,000346:                                                                                                  #  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,
021673,000347:                                                                                                  #  THE ADDITIONAL ROTATION TO AVOID GIMAL LOCK IS 35 DEGREES.  IF THE AXIS IS MORE THAN 60.5 DEGEES FROM +X (OR -X)
021674,000348:                                                                                                  #  THE ADDITIONAL ROTATION IS 35 DEGREES.  THE GIMBAL ANGLES CORRESPONDING TO THIS ATTITUDE ARE THEN COMPUTED AND
021675,000349:                                                                                                  #  STORED AS 2S COMPLIMENT ANGLES IN T(MPAC) BEFORE RETURNING TO THE CALLER.
021676,000350:                                                                                                  #           WHEN POINTING THE X-AXIS, OR THE THRUST VECTOR, OR ANY VECTOR WITHIN 40.6 DEG OF THE X-AXIS, VECPOINT
021677,000351:                                                                                                  #  CANNOT CORRECT FOR A CROSS-PRODUCT ROTATION INTO GIMBAL LOCK.  IN THIS CASE A PLATFORM REALIGNMENT WOULD BE
021678,000352:                                                                                                  #  REQUIRED TO POINT THE VECTOR IN THE DESIRED DIRECTION.  AT PRESENT NO INDICATION IS GIVEN FOR THIS SITUATION
021679,000353:                                                                                                  #  EXCEPT THAT THE FINAL MIDDLE GIMBAL ANGLE IN MPAC +2 IS GREATER THAN 59 DEGREES.
021680,000354: 
021681,000355:                                                                                                  #           CALLING SEQUENCE -
021682,000356:                                                                                                  #               1) LOAD SCAXIS, POINTVSM
021683,000357:                                                                                                  #               2) CALL
021684,000358:                                                                                                  #                       VECPOINT
021685,000359: 
021686,000360:                                                                                                  #           RETURNS WITH
021687,000361: 
021688,000362:                                                                                                  #               1) DESIRED OUTER GIMBAL ANGLE IN MPAC
021689,000363:                                                                                                  #               2) DESIRED INNER GIMBAL ANGLE IN MPAC +1
021690,000364:                                                                                                  #               3) DESIRED MIDDLE GIMBAL ANGLE IN MPAC +2
021691,000365: 
021692,000366:                                                                                                  #  ERASABLES USED -
021693,000367: 
021694,000368:                                                                                                  #      1) SCAXIS           6
021695,000369:                                                                                                  #      2) POINTVSM         6
021696,000370:                                                                                                  #      3) MIS             18
021697,000371:                                                                                                  #      4) DEL             18
021698,000372:                                                                                                  #      5) COF              6
021699,000373:                                                                                                  #      6) VECQTEMP         1
021700,000374:                                                                                                  #      7) ALL OF VAC AREA 43
021701,000375: 
021702,000376:                                                                                                  #               TOTAL     99
021703,000377: 
021704,000378: 27,2000                                           SETLOC   VECPT                                 
021705,000379: 27,2000                                           BANK                                           

Page 494

021707,000381: 27,2016                                           COUNT*   $$/VECPT                              
021708,000382: 
021709,000383: 27,2016  E6,1674                                  EBANK=   BCDU                                  
021710,000384: 
021711,000385: 27,2016           40020        VECPOINT           STQ      BOV                                   #  SAVE RETURN ADDRESS
021712,000386: 27,2017           03323                                    VECQTEMP                              
021713,000387: 27,2020           56021                                    VECLEAR                               #  AND CLEAR OVFIND
021714,000388: 27,2021           47164        VECLEAR            AXC,2    RTB                                   
021715,000389: 27,2022           03244                                    MIS                                   #  READ THE PRESENT CDU ANGLES AND
021716,000390: 27,2023           44403                                    READCDUK                              #  STORE THEM IN PD25, 26, 27
021717,000391: 27,2024           34032                           STCALL   25D                                   
021718,000392: 27,2025           44410                                    CDUTODCM                              #  S/C AXES TO STABLE MEMBER AXES (MIS)
021719,000393: 27,2026           61375                           VLOAD    VXM                                   
021720,000394: 27,2027           03767                                    POINTVSM                              #  RESOLVE THE POINTING DIRECTION VF INTO
021721,000395: 27,2030           03245                                    MIS                                   #  INITIAL S/C AXES (VF = POINTVSM)
021722,000396: 27,2031           77656                           UNIT                                           
021723,000397: 27,2032           00035                           STORE    28D                                   
021724,000398:                                                                                                  #  PD 28 29 30 31 32 33
021725,000399: 27,2033           53435                           VXV      UNIT                                  #  TAKE THE CROSS PRODUCT VF X VI
021726,000400: 27,2034           03761                                    SCAXIS                                #  WHERE VI = SCAXIS
021727,000401: 27,2035           57400                           BOV      VCOMP                                 
021728,000402: 27,2036           56146                                    PICKAXIS                              
021729,000403: 27,2037           17267                           STODL    COF                                   #  CHECK MAGNITUDE
021730,000404: 27,2040           00045                                    36D                                   #  OF CROSS PRODUCT
021731,000405: 27,2041           50025                           DSU      BMN                                   #  VECTOR, IF LESS
021732,000406: 27,2042           14367                                    DPB-14                                #  THAN B-14 ASSUME
021733,000407: 27,2043           56146                                    PICKAXIS                              #  UNIT OPERATION
021734,000408: 27,2044           50375                           VLOAD    DOT                                   #           INVALID.
021735,000409: 27,2045           03761                                    SCAXIS                                
021736,000410: 27,2046           00035                                    28D                                   
021737,000411: 27,2047           65552                           SL1      ARCCOS                                
021738,000412: 27,2050           77624        COMPMATX           CALL                                           #  NOW COMPUTE THE TRANSFORMATION FROM
021739,000413: 27,2051           44527                                    DELCOMP                               #  FINAL S/C AXES TO INITIAL S/C AXES  MFI
021740,000414: 27,2052           75160                           AXC,1    AXC,2                                 
021741,000415: 27,2053           03244                                    MIS                                   #  COMPUTE THE TRANSFORMATION FROM FINAL
021742,000416: 27,2054           02234                                    KEL                                   #  S/C AXES TO STABLE MEMBER AXES
021743,000417: 27,2055           77624                           CALL                                           #  MFS = MIS MFI
021744,000418: 27,2056           44312                                    MXM3                                  #  (IN PD LIST)
021745,000419: 
021746,000420: 27,2057           51545                           DLOAD    ABS                                   
021747,000421: 27,2060           00007                                    6                                     #  MFS6 = SIN(CPSI)                      $2
021748,000422: 27,2061           50025                           DSU      BMN                                   
021749,000423: 27,2062           14354                                    SINGIMLC                              #  = SIN(59 DEGS)                        $2
021750,000424: 27,2063           56136                                    FINDGIMB                              #  /CPSI/ LESS THAN 59 DEGS
021751,000425:                                                                                                  #  I.E. DESIRED ATTITUDE NOT IN GIMBAL LOCK
021752,000426: 
021753,000427: 27,2064           51545                           DLOAD    ABS                                   #  CHECK TO SEE IF WE ARE POINTING
021754,000428: 27,2065           03761                                    SCAXIS                                #  THE THRUST AXIS
021755,000429: 27,2066           51025                           DSU      BPL                                   
021756,000430: 27,2067           14356                                    SINVEC1                               #  SIN 49.4 DEGS                         $2

Page 495

021758,000432: 27,2070           56136                                    FINDGIMB                              #  IF SO, WE ARE TRYING TO POINT IT INTO
021759,000433: 27,2071           77775                           VLOAD                                          #  GIMBAL LOCK, ABORT COULD GO HERE
021760,000434: 27,2072           77626                           STADR                                          
021761,000435: 27,2073           50516                           STOVL    MIS        +12D                       
021762,000436: 27,2074           77626                           STADR                                          #  STORE MFS (IN PD LIST) IN MIS
021763,000437: 27,2075           50524                           STOVL    MIS        +6                         
021764,000438: 27,2076           77626                           STADR                                          
021765,000439: 27,2077           50532                           STOVL    MIS                                   
021766,000440: 27,2100           03253                                    MIS        +6                         #  INNER GIMBAL AXIS IN FINAL S/C AXES
021767,000441: 27,2101           57444                           BPL      VCOMP                                 #  LOCATE THE IG AXIS DIRECTION CLOSEST TO
021768,000442: 27,2102           56103                                    IGSAMEX                               #  FINAL X S/C AXIS
021769,000443: 
021770,000444: 27,2103           50035        IGSAMEX            VXV      BMN                                   #  FIND THE SHORTEST WAY OF ROTATING THE 
021771,000445: 27,2104           03761                                    SCAXIS                                #  S/C OUT OF GIMBAL LOCK BY A ROTATION 
021772,000446: 27,2105           56112                                    U=SCAXIS                              #  ABOUT +- SCAXIS, I.E. IF  (IG (SGN MFS3)
021773,000447:                                                                                                  #  X SCAXIS . XF) LESS THAN 0, U = SCAXIS
021774,000448:                                                                                                  #  OTHERWISE U = -SCAXIS
021775,000449: 
021776,000450: 27,2106           57575                           VLOAD    VCOMP                                 
021777,000451: 27,2107           03761                                    SCAXIS                                
021778,000452: 27,2110           37267                           STCALL   COF                                   #  ROTATE ABOUT -SCAXIS
021779,000453: 27,2111           56115                                    CHEKAXIS                              
021780,000454: 27,2112           77775        U=SCAXIS           VLOAD                                          
021781,000455: 27,2113           03761                                    SCAXIS                                
021782,000456: 27,2114           03267                           STORE    COF                                   #  ROTATE ABOUT + SCAXIS
021783,000457: 27,2115           51545        CHEKAXIS           DLOAD    ABS                                   
021784,000458: 27,2116           03761                                    SCAXIS                                #  SEE IF WE ARE POINTING THE AOT
021785,000459: 27,2117           51025                           DSU      BPL                                   
021786,000460: 27,2120           14360                                    SINVEC2                               #  SIN 29.5 DEGS                         $2
021787,000461: 27,2121           56125                                    PICKANG1                              #  IF SO, ROTATE 50 DEGS ABOUT +- SCAXIS
021788,000462: 27,2122           52145                           DLOAD    GOTO                                  #  IF NOT, MUST BE POINTING THE TRANSPONDER
021789,000463: 27,2123           14364                                    VECANG2                               #  OR SOME VECTOR IN THE Y, OR Z PLANE
021790,000464: 27,2124           56127                                    COMPMFSN                              #  IN THIS CASE ROTATE 35 DEGS TO GET OUT
021791,000465:                                                                                                  #  OF GIMBAL LOCK (VECANG2  $360)
021792,000466: 27,2125           77745        PICKANG1           DLOAD                                          
021793,000467: 27,2126           14362                                    VECANG1                               #  = 50 DEGS                             $360
021794,000468: 27,2127           77624        COMPMFSN           CALL                                           
021795,000469: 27,2130           44527                                    DELCOMP                               #  COMPUTE THE ROTATION ABOUT SCAXIS TO
021796,000470: 27,2131           75160                           AXC,1    AXC,2                                 #  BRING MFS OUT OF GIMBAL LOCK
021797,000471: 27,2132           03244                                    MIS                                   
021798,000472: 27,2133           02234                                    KEL                                   
021799,000473: 27,2134           77624                           CALL                                           #  COMPUTE THE NEW TRANSFORMATION FROM
021800,000474: 27,2135           44312                                    MXM3                                  #  DESIRED S/C AXES TO STABLE MEMBER AXES
021801,000475:                                                                                                  #  WHICH WILL ALIGN VI WITH VF AND AVOID
021802,000476:                                                                                                  #  GIMBAL LOCK
021803,000477: 27,2136           45160        FINDGIMB           AXC,1    CALL                                  
021804,000478: 27,2137           00000                                    0                                     #  EXTRACT THE COMMANDED CDU ANGLES FROM
021805,000479: 27,2140           44654                                    DCMTOCDU                              #  THIS MATRIX
021806,000480: 27,2141           40234                           RTB      SETPD                                 
021807,000481: 27,2142           21524                                    V1STO2S                               #  CONVERT TO 2:S COMPLEMENT

Page 496

021809,000483: 27,2143           00001                                    0                                     
021810,000484: 27,2144           77650                           GOTO                                           
021811,000485: 27,2145           03323                                    VECQTEMP                              #  RETURN TO CALLER
021812,000486: 
021813,000487: 27,2146           50375        PICKAXIS           VLOAD    DOT                                   #  IF VF X VI = 0, FIND VF . VI
021814,000488: 27,2147           00035                                    28D                                   
021815,000489: 27,2150           03761                                    SCAXIS                                
021816,000490: 27,2151           72240                           BMN      TLOAD                                 
021817,000491: 27,2152           54326                                    ROT180                                
021818,000492: 27,2153           00032                                    25D                                   
021819,000493: 27,2154           77650                           GOTO                                           #  IF VF = VI, CDU DESIRED = PRESENT CDU
021820,000494: 27,2155           03323                                    VECQTEMP                              #  PRESENT CDU ANGLES
021821,000495: 
021822,000496: 35,2000                                           BANK     35                                    
021823,000497: 26,2000                                           SETLOC   MANUVER1                              
021824,000498: 26,2000                                           BANK                                           
021825,000499: 26,2326           47375        ROT180             VLOAD    VXV                                   #  IF VF, VI ANTIPARALLEL, 108 DEG ROTATION
021826,000500: 26,2327           03253                                    MIS        +6                         #  IS REQUIRED. Y STABLE MEMBER AXIS IN
021827,000501: 26,2330           06422                                    HIDPHALF                              #  INITIAL S/C AXES.
021828,000502: 26,2331           47256                           UNIT     VXV                                   #  FIND Y(SM) X X(I)
021829,000503: 26,2332           03761                                    SCAXIS                                #  FIND UNIT(VI X UNIT(Y(SM) X X(I)))
021830,000504: 26,2333           40056                           UNIT     BOV                                   #  I.E. PICK A VECTOR IN THE PLANE OF X(I),
021831,000505: 26,2334           54350                                    PICKX                                 #  Y(SM) PERPENDICULAR TO VI
021832,000506: 26,2335           17267                           STODL    COF                                   
021833,000507: 26,2336           00045                                    36D                                   #  CHECK MAGNITUDE
021834,000508: 26,2337           50025                           DSU      BMN                                   #  OF THIS VECTOR.
021835,000509: 26,2340           14367                                    DPB-14                                #  IF LESS THAN B-14,
021836,000510: 26,2341           54350                                    PICKX                                 #  PICK X-AXIS.
021837,000511: 26,2342           77775                           VLOAD                                          
021838,000512: 26,2343           03267                                    COF                                   
021839,000513: 26,2344           17267        XROT               STODL    COF                                   
021840,000514: 26,2345           06422                                    HIDPHALF                              
021841,000515: 26,2346           77650                           GOTO                                           
021842,000516: 26,2347           56050                                    COMPMATX                              
021843,000517: 26,2350           52175        PICKX              VLOAD    GOTO                                  #  PICK THE XAXIS IN THIS CASE
021844,000518: 26,2351           06422                                    HIDPHALF                              
021845,000519: 26,2352           54344                                    XROT                                  
021846,000520: 26,2353           15555 35172  SINGIMLC           2DEC     .4285836003                            #  = SIN(59)                             $2
021847,000521: 
021848,000522: 26,2355           14113 36326  SINVEC1            2DEC     .3796356537                            #  = SIN(49.4)                           $2
021849,000523: 
021850,000524: 26,2357           07701 35703  SINVEC2            2DEC     .2462117800                            #  = SIN(29.5)                           $2
021851,000525: 
021852,000526: 26,2361           04343 21616  VECANG1            2DEC     .1388888889                            #  = 50 DEGREES                          $360
021853,000527: 
021854,000528: 26,2363           03070 34344  VECANG2            2DEC     .09722222222                            #  = 35 DEGREES                          $360
021855,000529: 
021856,000530: 26,2365           00000        1BITDP             OCT      0                                     #  KEEP THIS BEFORE DPB(-14)        *********
021857,000531: 26,2366           00001        DPB-14             OCT      00001                                 
021858,000532: 26,2367           00000                           OCT      00000                                 
021859,000533: 

Page 497

021861,000535:                                                                                                  #  ROUTINE FOR INITIATING AUTOMATIC MANEUVER VIA KEYBOARD (V49)
021862,000536: 
021863,000537: 34,2000                                           BANK     34                                    
021864,000538: 23,2000                                           SETLOC   R62                                   
021865,000539: 23,2000                                           BANK                                           
021866,000540: 23,2065  E6,1674                                  EBANK=   BCDU                                  
021867,000541: 
021868,000542: 23,2065                                           COUNT*   $$/R62                                
021869,000543: 
021870,000544: 23,2065  23,2065               R62DISP            EQUALS   R62FLASH                              
021871,000545: 
021872,000546: 23,2065           35010        R62FLASH           CAF      V06N22                                #  FLASH V06N22 AND
021873,000547: 23,2066           04616                           TC       BANKCALL                              #  ICDU ANGLES
021874,000548: 23,2067           20351                           CADR     GOFLASH                               
021875,000549: 23,2070           15472                           TCF      ENDEXT                                #  TERMINATE
021876,000550: 23,2071           12073                           TCF      GOMOVE                                #  PROCEED
021877,000551: 23,2072           12065                           TCF      R62FLASH                              #  ENTER
021878,000552: 
021879,000553:                                                                                                  #  ASTRONAUT MAY LOAD NEW ICDUS AT THIS
021880,000554:                                                                                                  #  POINT
021881,000555: 23,2073           05504        GOMOVE             TC       UPFLAG                                #  SET FOR 3-AXIS MANEUVER
021882,000556: 23,2074           00124                           ADRES    3AXISFLG                              
021883,000557: 
021884,000558: 23,2075           04616                           TC       BANKCALL                              
021885,000559: 23,2076           54101                           CADR     R60LEM                                
021886,000560: 23,2077           15472                           TCF      ENDEXT                                #  END R62
021887,000561: 

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