Source Code

This is a reconstructed version of Luminary 130, the initial AGC program released in November 1969 for the Apollo 13 LM. Three more releases followed before the flown revision was finally manufactured in February 1970.

This reconstruction was created from a previous transcription of the original listing of Luminary 131, combined with Luminary memo #129 which describes the small difference between the Luminary 130 and 131. The reconstructed source code was verified by matching memory-bank checksums to those listed for Luminary 130 in drawing 2021152G.

In this source code, program comments from the original (Luminary 131) code are prefixed with '#', while those added later by the Virtual AGC project are prefixed with '##'.

020315,000002:                                                                                                  ## Copyright:   Public domain.
020316,000003:                                                                                                  ## Filename:    R60,R62.agc
020317,000004:                                                                                                  ## Purpose:     A section of the reconstructed source code for Luminary 130.
020318,000005:                                                                                                  ##              This was the original program released for the Apollo 13 LM,
020319,000006:                                                                                                  ##              although several more revisions would follow. It has been
020320,000007:                                                                                                  ##              reconstructed from a listing of Luminary 131, from which it
020321,000008:                                                                                                  ##              differs on only two lines in P70-P71. The difference is
020322,000009:                                                                                                  ##              described in detail in Luminary memo #129, which was used
020323,000010:                                                                                                  ##              to perform the reconstruction. This file is intended to be a
020324,000011:                                                                                                  ##              faithful reconstruction, except that the code format has been
020325,000012:                                                                                                  ##              changed to conform to the requirements of the yaYUL assembler
020326,000013:                                                                                                  ##              rather than the original YUL assembler.
020327,000014:                                                                                                  ## Reference:   pp. 476-489
020328,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
020329,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
020330,000017:                                                                                                  ## Mod history: 05/14/03 RSB.   Began transcribing.
020331,000018:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
020332,000019:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
020333,000020:                                                                                                  ##                              original harcopy, as opposed to the PDF page
020334,000021:                                                                                                  ##                              numbers in 1701.pdf.
020335,000022:                                                                                                  ##              2017-01-27 RSB  Back-ported a comment-text fix identified in Luminary 69.
020336,000023:                                                                                                  ##              2017-02-23 RSB  Proofed comment text using octopus/ProoferComments.
020337,000024:                                                                                                  ##              2017-02-28 RSB  Fixed lingering typos.
020338,000025:                                                                                                  ##              2017-03-09 RSB  Comment text fixes noted in proofing Luminary 116.
020339,000026:                                                                                                  ##              2018-09-04 MAS  Copied from Luminary 131 for Luminary 130.
020340,000027: 

Page 476

020342,000029:                                                                                                  #  MOD NO: 0                             DATE: 1 MAY 1968
020343,000030:                                                                                                  #  MOD BY: DIGITAL DEVEL GROUP           LOG SECTION R60,R62
020344,000031: 
020345,000032:                                                                                                  #  FUNCTIONAL DESCRIPTION:
020346,000033: 
020347,000034:                                                                                                  #  CALLED AS A GENERAL SUBROUTINE TO MANEUVER THE LM TO A SPECIFIED
020348,000035:                                                                                                  #  ATTITUDE.
020349,000036: 
020350,000037:                                                                                                  #  1. IF THE 3-AXIS FLAG IS NOT SET THE FINAL CDU ANGLES ARE
020351,000038:                                                                                                  #  CALCULATED (VECPOINT).
020352,000039: 
020353,000040:                                                                                                  #  2. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
020354,000041: 
020355,000042:                                                                                                  #  3. REQUEST FLASHING DISPLAY V50 N18 PLEASE PERFORM AUTO MANEUVER.
020356,000043: 
020357,000044:                                                                                                  #  4. IF PRIORITY DISPLAY FLAG IS SET DO A PHASECHANGE.  THEN AWAIT
020358,000045:                                                                                                  #  ASTRONAUT RESPONSE.
020359,000046: 
020360,000047:                                                                                                  #  5. DISPLAY RESPONSE RETURNS:
020361,000048: 
020362,000049:                                                                                                  #        A.      ENTER - RESET 3-AXIS FLAG AND RETURN TO CLIENT.
020363,000050: 
020364,000051:                                                                                                  #        B.      TERMINATE - IF IN P00 GO TO STEP 5A.  OTHERWISE CHECK IF R61 IS
020365,000052:                                                                                                  #                THE CALLING PROGRAM.  IF IN R61 AN EXIT IS MADE TO GOTOV56.  IF
020366,000053:                                                                                                  #                NOT IN R61 AN EXIT IS DONE VIA GOTOP00H.
020367,000054: 
020368,000055:                                                                                                  #        C.      PROCEED - CONTINUE WITH PROGRAM AT STEP 6.
020369,000056: 
020370,000057:                                                                                                  #  6. IF THE 3-AXIS FLAG IS NOT SET, THE FINAL CDU ANGLES ARE CALCULATED
020371,000058:                                                                                                  #  (VECPOINT).
020372,000059: 
020373,000060:                                                                                                  #  7. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
020374,000061: 
020375,000062:                                                                                                  #  8. IF THE G+N SWITCH IS NOT SET GO BACK TO STEP 3.
020376,000063:                                                                                                  #  
020377,000064:                                                                                                  #  9. IF THE AUTO SWITCH IS NOT SET GO BACK TO STEP 3.
020378,000065: 
020379,000066:                                                                                                  #  10. NONFLASHING DISPLAY V06N18 (FDAI ANGLES).
020380,000067: 
020381,000068:                                                                                                  #  11. DO A PHASECHANGE.
020382,000069: 
020383,000070:                                                                                                  #  12. DO A MANEUVER CALCULATION AND ICDU DRIVE ROUTINE TO ACHIEVE FINAL
020384,000071:                                                                                                  #  GIMBAL ANGLES (GOMANUR).
020385,000072: 
020386,000073:                                                                                                  #  13. AT END OF MANEUVER GO TO STEP 3.
020387,000074: 
020388,000075:                                                                                                  #        IF SATISFACTORY MANEUVER STEP 5A EXITS R60.
020389,000076:                                                                                                  #        FOR FURTHER ADJUSTMENT OF THE VEHICLE ATTITUDE ABOUT THE
020390,000077:                                                                                                  #        DESIRED VECTOR, THE ROUTINE MAY BE PERFORMED AGAIN STARTING AT

Page 477

020392,000079:                                                                                                  #        STEP 5C.
020393,000080: 
020394,000081:                                                                                                  #  CALLING SEQUENCE:     TC      BANKCALL
020395,000082:                                                                                                  #                        CADR    R60LEM
020396,000083: 
020397,000084:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:     SCAXIS, POINTVSM (FOR VECPOINT)
020398,000085:                                                                                                  #                                        3AXISFLG.
020399,000086: 
020400,000087:                                                                                                  #  SUBROUTINES CALLED:   VECPOINT, BALLANGS, GOPERF2R, LINUS, GODSPER,
020401,000088:                                                                                                  #                        GOMANUR, DOWNFLAG, PHASCHNG, UPFLAG
020402,000089: 
020403,000090:                                                                                                  #  NORMAL EXIT MODES:    CAE     TEMPR60         (CALLERS RETURN ADDRESS)
020404,000091:                                                                                                  #                        TC      BANKJUMP
020405,000092: 
020406,000093:                                                                                                  #  ALARMS: NONE
020407,000094: 
020408,000095:                                                                                                  #  OUTPUT: NONE
020409,000096: 
020410,000097:                                                                                                  #  DEBRIS: CPHI, CTHETA, CPSI, 3AXISFLG, TBASE2
020411,000098: 
020412,000099: 34,2000                                           BANK     34                                    
020413,000100: 26,2000                                           SETLOC   MANUVER                               
020414,000101: 26,2000                                           BANK                                           
020415,000102: 
020416,000103: 26,2123     1163                                  EBANK=   TEMPR60                               
020417,000104: 
020418,000105: 26,2123                                           COUNT*   $$/R06                                
020419,000106: 26,2123           04645        R60LEM             TC       MAKECADR                              
020420,000107: 26,2124           55163                           TS       TEMPR60                               
020421,000108: 
020422,000109: 26,2125           34746        REDOMANN           CAF      3AXISBIT                              
020423,000110: 26,2126           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
020424,000111: 26,2127           10000                           CCS      A                                     
020425,000112: 26,2130           12136                           TCF      TOBALL                                #  YES
020426,000113: 26,2131           06042                           TC       INTPRET                               
020427,000114: 26,2132           77624                           CALL                                           
020428,000115: 26,2133           56040                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
020429,000116: 26,2134           00322                           STORE    CPHI                                  #  STORE FINAL ANGLES - CPHI, CTHETA, CPSI
020430,000117: 26,2135           77776                           EXIT                                           
020431,000118: 
020432,000119: 26,2136           05504        TOBALL             TC       UPFLAG                                #  INSURE THAT TOTAL ATTITUDE ERRORS ARE
020433,000120: 26,2137           00013                           ADRES    NEEDLFLG                              #  DISPLAYED ON FDAI ERROR NEEDLES
020434,000121: 26,2140           05516                           TC       DOWNFLAG                              
020435,000122: 26,2141           00000                           ADRES    NEED2FLG                              
020436,000123: 26,2142           04616                           TC       BANKCALL                              
020437,000124: 26,2143           54272                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
020438,000125: 26,2144           32260        TOBALLA            CAF      V06N18                                
020439,000126: 26,2145           04616                           TC       BANKCALL                              

Page 478

020441,000128: 26,2146           20711                           CADR     GOPERF2R                              #  DISPLAY PLEASE PERFORM AUTO MANEUVER
020442,000129: 26,2147           02246                           TC       R61TEST                               
020443,000130: 26,2150           02154                           TC       REDOMANC                              #  PROCEED
020444,000131: 26,2151           02201                           TC       ENDMANU1                              #  ENTER I.E. FINISHED WITH R60
020445,000132: 26,2152           02205                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
020446,000133: 26,2153           05155                           TC       ENDOFJOB                              
020447,000134: 
020448,000135: 26,2154           34746        REDOMANC           CAF      3AXISBIT                              
020449,000136: 26,2155           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
020450,000137: 26,2156           10000                           CCS      A                                     
020451,000138: 26,2157           12165                           TCF      TOBALLC                               #  YES
020452,000139: 26,2160           06042                           TC       INTPRET                               
020453,000140: 26,2161           77624                           CALL                                           
020454,000141: 26,2162           56040                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
020455,000142: 26,2163           00322                           STORE    CPHI                                  #  STORE ANGLES
020456,000143: 26,2164           77776                           EXIT                                           
020457,000144: 
020458,000145: 26,2165           04616        TOBALLC            TC       BANKCALL                              
020459,000146: 26,2166           54272                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
020460,000147: 26,2167           02261                           TC       G+N,AUTO                              #  CHECK AUTO MODE
020461,000148: 26,2170           10000                           CCS      A                                     
020462,000149: 26,2171           12144                           TCF      TOBALLA                               #  NOT AUTO, GO REREQUEST AUTO MANEUVER.
020463,000150: 
020464,000151: 26,2172           32260        AUTOMANV           CAF      V06N18                                #  STATIC DISPLAY DURING AUTO MANEUVER
020465,000152: 26,2173           04616                           TC       BANKCALL                              #                                        -
020466,000153: 26,2174           20452                           CADR     GODSPR                                #                                        -
020467,000154: 26,2175           02205                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
020468,000155: 
020469,000156: 26,2176           04616        STARTMNV           TC       BANKCALL                              #  PERFORM MANEUVER VIA KALCMANU
020470,000157: 26,2177           17741                           CADR     GOMANUR                               
020471,000158: 
020472,000159: 26,2200           12144        ENDMANUV           TCF      TOBALLA                               #  FINISHED MANEUVER.
020473,000160: 26,2201           05516        ENDMANU1           TC       DOWNFLAG                              #  RESET 3-AXIS FLAG
020474,000161: 26,2202           00124                           ADRES    3AXISFLG                              
020475,000162: 26,2203           31163                           CAE      TEMPR60                               #                                        -
020476,000163: 26,2204           04640                           TC       BANKJUMP                              #                                        -
020477,000164: 
020478,000165: 26,2205           40100        CHKLINUS           CS       FLAGWRD4                              
020479,000166: 26,2206           74740                           MASK     PDSPFBIT                              #  IS PRIORITY DISPLAY FLAG SET?
020480,000167: 26,2207           10000                           CCS      A                                     #                                        -
020481,000168: 26,2210           00002                           TC       Q                                     #  NO - EXIT
020482,000169: 26,2211           30002                           CA       Q                                     
020483,000170: 26,2212           54156                           TS       MPAC       +2                         #  SAVE RETURN
020484,000171: 26,2213           46250                           CS       THREE                                 #  OBTAIN LOCATION FOR RESTART
020485,000172: 26,2214           60133                           AD       BUF2                                  #  HOLDS Q OF LAST DISPLAY
020486,000173: 26,2215           55054                           TS       TBASE2                                
020487,000174: 
020488,000175: 26,2216           05353                           TC       PHASCHNG                              
020489,000176: 26,2217           00132                           OCT      00132                                 

Page 479

020491,000178: 26,2220           34745                           CAF      BIT7                                  
020492,000179: 26,2221           05464                           TC       LINUS                                 #  GO SET BITS FOR PRIORITY DISPLAY      -
020493,000180: 26,2222           00156                           TC       MPAC       +2                         
020494,000181: 
020495,000182: 26,2223           37717        RELINUS            CAF      PRIO26                                #  RESTORE ORIGINAL PRIORITY
020496,000183: 26,2224           05146                           TC       PRIOCHNG                              
020497,000184: 
020498,000185: 26,2225           34747                           CAF      TRACKBIT                              #  DON'T CONTINUE R60 UNLESS TRACKFLAG ON.
020499,000186: 26,2226           70075                           MASK     FLAGWRD1                              
020500,000187: 26,2227           10000                           CCS      A                                     
020501,000188: 26,2230           12243                           TCF      RER60                                 
020502,000189: 
020503,000190: 26,2231           34745                           CAF      RNDVZBIT                              #  IS IT P20?
020504,000191: 26,2232           70074                           MASK     FLAGWRD0                              
020505,000192: 26,2233           10000                           CCS      A                                     
020506,000193: 26,2234           02240                           TC       +4                                    #  YES
020507,000194: 26,2235           05353                           TC       PHASCHNG                              #  NO, MUST BE P25, SET 2.11 SPOT
020508,000195: 26,2236           40112                           OCT      40112                                 
020509,000196: 
020510,000197: 26,2237           05155                           TC       ENDOFJOB                              
020511,000198: 
020512,000199: 26,2240           05353                           TC       PHASCHNG                              #  SET 2.7 SPOT FOR P20
020513,000200: 26,2241           40072                           OCT      40072                                 
020514,000201: 
020515,000202: 26,2242           05155                           TC       ENDOFJOB                              
020516,000203: 
020517,000204: 26,2243           05504        RER60              TC       UPFLAG                                #  SET PRIO DISPLAY FLAG AFTER RESTART
020518,000205: 26,2244           00077                           ADRES    PDSPFLAG                              
020519,000206: 
020520,000207: 26,2245           01054                           TC       TBASE2                                
020521,000208: 
020522,000209: 26,2246           31010        R61TEST            CA       MODREG                                #  IF WE ARE IN P00 IT MUST BE V49 OR V89
020523,000210: 26,2247           00006                           EXTEND                                         
020524,000211: 26,2250           12201                           BZF      ENDMANU1                              #  THUS WE GO TO ENDEXT VIA USER
020525,000212: 
020526,000213: 26,2251           30100                           CA       FLAGWRD4                              #  ARE WE IN R61 (P20 OR P25)
020527,000214: 26,2252           74740                           MASK     PDSPFBIT                              
020528,000215: 26,2253           00006                           EXTEND                                         
020529,000216: 26,2254           16001                           BZF      GOTOPOOH                              #  NO
020530,000217: 26,2255           06025                           TC       GOTOV56                               #  YES
020531,000218: 
020532,000219: 26,2256           20100        BIT14+7            OCT      20100                                 #                                        -
020533,000220: 26,2257           00203        OCT203             OCT      203                                   
020534,000221: 26,2260           01422        V06N18             VN       0618                                  
020535,000222: 
020536,000223:                                                                                                  #  SUBROUTINE TO CHECK FOR G+N CONTROL, AUTO STABILIZATION
020537,000224: 
020538,000225:                                                                                                  #  RETURNS WITH C(A) = +         IF NOT SET FOR G+N, AUTO
020539,000226:                                                                                                  #  RETURNS WITH C(A) = +0        IF SWITCHES ARE SET
020540,000227: 
020541,000228: 26,2261           00006        G+N,AUTO           EXTEND                                         

Page 480

020543,000230: 26,2262           00030                           READ     CHAN30                                
020544,000231: 26,2263           74742                           MASK     BIT10                                 
020545,000232: 26,2264           10000                           CCS      A                                     
020546,000233: 26,2265           00002                           TC       Q                                     #  NOT IN G+N    C(A) = +
020547,000234: 26,2266           00006        ISITAUTO           EXTEND                                         #  CHECK FOR AUTO MODE
020548,000235: 26,2267           00031                           READ     CHAN31                                
020549,000236: 26,2270           74736                           MASK     BIT14                                 
020550,000237: 26,2271           00002                           TC       Q                                     #  (+) = NOT IN AUTO, (+0) = AOK
020551,000238: 

Page 481

020553,000240:                                                                                                  #  PROGRAM DESCRIPTION BALLANGS
020554,000241:                                                                                                  #  MOD NO.                               LOG SECTION R60,R62
020555,000242:                                                                                                  #  WRITTEN BY RAMA M. AIYAWAR
020556,000243: 
020557,000244:                                                                                                  #  FUNCTIONAL DESCRIPTION
020558,000245: 
020559,000246:                                                                                                  #        COMPUTES LM FDAI BALL DISPLAY ANGLES
020560,000247: 
020561,000248:                                                                                                  #  CALLING SEQUENCE
020562,000249: 
020563,000250:                                                                                                  #        TC      BALLANGS
020564,000251: 
020565,000252:                                                                                                  #  NORMAL EXIT MODE
020566,000253: 
020567,000254:                                                                                                  #        TC      BALLEXIT        (SAVED Q)
020568,000255: 
020569,000256:                                                                                                  #  ALARM OR EXIT MODE    NIL
020570,000257: 
020571,000258:                                                                                                  #  SUBROUTINES CALLED
020572,000259: 
020573,000260:                                                                                                  #        CD*TR*G
020574,000261:                                                                                                  #        ARCTAN
020575,000262: 
020576,000263:                                                                                                  #  INPUT
020577,000264: 
020578,000265:                                                                                                  #        CPHI,CTHETA,CPSI ARE THE ANGLES CORRESPONDING TO AOG, AIG, AMG.  THEY ARE
020579,000266:                                                                                                  #        SP,2S COMPLIMENT SCALED TO HALF REVOLUTION.
020580,000267: 
020581,000268:                                                                                                  #  OUTPUT
020582,000269: 
020583,000270:                                                                                                  #        FDAIX, FDAIY, FDAIZ ARE THE REQUIRED BALL ANGLES SCALED TO HALF REVOLUTION
020584,000271:                                                                                                  #        SP,2S COMPLIMENT.
020585,000272: 
020586,000273:                                                                                                  #        THESE ANGLES WILL BE DISPLAYED AS DEGREES AND HUNDREDTHS, IN THE ORDER ROLL, PITCH, YAW, USING NOUNS 18 & 19.
020587,000274: 
020588,000275:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
020589,000276: 
020590,000277:                                                                                                  #        CPHI, CTHETA, CPSI      EACH A SP REGISTER
020591,000278: 
020592,000279:                                                                                                  #  DEBRIS
020593,000280: 
020594,000281:                                                                                                  #        A,L,Q,MPAC,SINCDU,COSCDU,PUSHLIST,BALLEXIT
020595,000282: 
020596,000283:                                                                                                  #  NOMENCLATURE: CPHI, CTHETA, & CPSI REPRESENT THE OUTER, INNER, & MIDDLE GIMBAL ANGLES, RESPECTIVELY; OR
020597,000284:                                                                                                  #                EQUIVALENTLY, CDUX, CDUY, & CDUZ.
020598,000285: 
020599,000286:                                                                                                  #  NOTE:  ARCTAN CHECKS FOR OVERFLOW AND SHOULD BE ABLE TO HANDLE ANY SINGULARITIES.
020600,000287: 
020601,000288: 26,2000                                           SETLOC   BAWLANGS                              
020602,000289: 26,2000                                           BANK                                           
020603,000290: 
020604,000291: 26,2272                                           COUNT*   $$/BALL                               
020605,000292: 26,2272           04645        BALLANGS           TC       MAKECADR                              
020606,000293: 26,2273           55337                           TS       BALLEXIT                              
020607,000294: 26,2274           30321                           CA       CPHI                                  

Page 482

020609,000296: 26,2275           54771                           TS       CDUSPOT    +4                         
020610,000297: 26,2276           30322                           CA       CTHETA                                
020611,000298: 26,2277           54765                           TS       CDUSPOT                               
020612,000299: 26,2300           30323                           CA       CPSI                                  
020613,000300: 26,2301           54767                           TS       CDUSPOT    +2                         
020614,000301: 
020615,000302: 26,2302           06042                           TC       INTPRET                               
020616,000303: 26,2303           45001                           SETPD    CALL                                  
020617,000304: 26,2304           00001                                    0D                                    
020618,000305: 26,2305           47545                                    CD*TR*G                               
020619,000306: 
020620,000307: 26,2306           41345                           DLOAD    DMP                                   
020621,000308: 26,2307           00742                                    SINCDUX                               #  SIN (OGA)
020622,000309: 26,2310           00746                                    COSCDUZ                               #  COS (MGA)
020623,000310: 
020624,000311: 26,2311           57552                           SL1      DCOMP                                 #  SCALE
020625,000312: 26,2312           65336                           ARCSIN   PDDL                                  #  YAW = ARCSIN(-SXCZ) INTO 0 PD
020626,000313: 26,2313           00740                                    SINCDUZ                               
020627,000314: 26,2314           14023                           STODL    SINTH                                 #  (SINTH = 18D IN PD)
020628,000315: 26,2315           00746                                    COSCDUZ                               
020629,000316: 26,2316           72405                           DMP      SL1                                   #  RESCALE
020630,000317: 26,2317           00750                                    COSCDUX                               
020631,000318: 26,2320           34021                           STCALL   COSTH                                 #  (COSTH = 16D IN PD)
020632,000319: 26,2321           26506                                    ARCTAN                                
020633,000320: 26,2322           41325                           PDDL     DMP                                   #  ROLL = ARCTAN(SZ/CZCX) INTO 2 PD
020634,000321: 26,2323           00740                                    SINCDUZ                               
020635,000322: 26,2324           00742                                    SINCDUX                               
020636,000323: 26,2325           41512                           SL2      PUSH                                  #  SXSZ INTO 4 PD
020637,000324: 26,2326           65205                           DMP      PDDL                                  #  SXSZCY INTO 4 PD
020638,000325: 26,2327           00744                                    COSCDUY                               
020639,000326: 26,2330           65205                           DMP      PDDL                                  #  SXSZSY INTO 6 PD
020640,000327: 26,2331           00736                                    SINCDUY                               
020641,000328: 26,2332           00750                                    COSCDUX                               
020642,000329: 26,2333           72405                           DMP      SL1                                   #  CXCY
020643,000330: 26,2334           00744                                    COSCDUY                               
020644,000331: 26,2335           45425                           DSU      STADR                                 #  PULL UP FROM 6 PD
020645,000332: 26,2336           63756                           STODL    COSTH                                 #  COSTH = CXCY - SXSZSY
020646,000333: 26,2337           00736                                    SINCDUY                               
020647,000334: 26,2340           72405                           DMP      SL1                                   
020648,000335: 26,2341           00750                                    COSCDUX                               #  CXSY
020649,000336: 26,2342           45415                           DAD      STADR                                 #  PULL UP FROM 4 PD
020650,000337: 26,2343           43754                           STCALL   SINTH                                 #  SINTH = CXSY + SXSZCY
020651,000338: 26,2344           26506                                    ARCTAN                                #  RETURNS WITH D(MPAC) = PITCH
020652,000339: 26,2345           55525                           PDDL     VDEF                                  #  PITCH INTO 2 PD, ROLL INTO MPAC FROM 2PD
020653,000340: 26,2346           77634                           RTB                                            #  VDEF MAKES V(MPAC) = ROLL, PITCH, YAW
020654,000341: 26,2347           21621                                    V1STO2S                               
020655,000342: 26,2350           02345                           STORE    FDAIX                                 #  MODE IS TP
020656,000343: 26,2351           77776                           EXIT                                           
020657,000344: 
020658,000345: 26,2352           31337        ENDBALL            CA       BALLEXIT                              
020659,000346: 

Page 483

020661,000348: 26,2353           04640                           TC       BANKJUMP                              
020662,000349: 

Page 484

020664,000351:                                                                                                  #  PROGRAM DESCRIPTION - VECPOINT
020665,000352: 
020666,000353:                                                                                                  #  THIS INTERPRETIVE SUBROUTINE MAY BE USED TO POINT A SPACECRAFT AXIS IN A DESIRED DIRECTION.  THE AXIS
020667,000354:                                                                                                  #  TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN SUCCESSIVE LOCATIONS OF ERASABLE MEMORY
020668,000355:                                                                                                  #  BEGINNING WITH THE LOCATION CALLED SCAXIS.  THE COMPONENTS OF THIS VECTOR ARE GIVEN IN SPACECRAFT COORDINATES.
020669,000356:                                                                                                  #  THE DIRECTION IN WHICH THIS AXIS IS TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN
020670,000357:                                                                                                  #  SUCCESSIVE LOCATIONS OF ERASABLE MEMORY BEGINNING WITH THE ADDRESS CALLED POINTVSM.  THE COMPONENTS OF THIS
020671,000358:                                                                                                  #  VECTOR ARE GIVEN IN STABLE MEMBER COORDINATES.  WITH THIS INFORMATION VECPOINT COMPUTES A SET OF THREE GIMBAL
020672,000359:                                                                                                  #  ANGLES (2S COMPLEMENT) CORESPONDING TO THE CROSS-PRODUCT ROTATION BETWEEN SCAXIS AND POINTVSM AND STORES THEM
020673,000360:                                                                                                  #  IN T(MPAC) BEFORE RETURNING TO THE CALLER.
020674,000361: 
020675,000362:                                                                                                  #  THIS ROTATION, HOWEVER, MAY BRING THE S/C INTO GIMBAL LOCK.  WHEN POINTING A VECTOR IN THE Y-Z PLANE,
020676,000363:                                                                                                  #  THE TRANSPONDER AXIS, OR THE AOT FOR THE LEM, THE PROGRAM WILL CORRECT THIS PROBLEM BY ROTATING THE CROSS-
020677,000364:                                                                                                  #  PRODUCT ATTITUDE ABOUT POINTVSM BY A FIXED AMOUNT SUFFICIENT TO ROTATE THE DESIRED S/C ATTITUDE OUT OF GIMBAL
020678,000365:                                                                                                  #  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,
020679,000366:                                                                                                  #  THE ADDITIONAL ROTATION TO AVOID GIMAL LOCK IS 35 DEGREES.  IF THE AXIS IS MORE THAN 60.5 DEGEES FROM +X (OR -X)
020680,000367:                                                                                                  #  THE ADDITIONAL ROTATION IS 35 DEGREES.  THE GIMBAL ANGLES CORRESPONDING TO THIS ATTITUDE ARE THEN COMPUTED AND
020681,000368:                                                                                                  #  STORED AS 2S COMPLIMENT ANGLES IN T(MPAC) BEFORE RETURNING TO THE CALLER.
020682,000369: 
020683,000370:                                                                                                  #  WHEN POINTING THE X-AXIS, OR THE THRUST VECTOR, OR ANY VECTOR WITHIN 40.6 DEG OF THE X-AXIS, VECPOINT
020684,000371:                                                                                                  #  CANNOT CORRECT FOR A CROSS-PRODUCT ROTATION INTO GIMBAL LOCK.  IN THIS CASE A PLATFORM REALIGNMENT WOULD BE
020685,000372:                                                                                                  #  REQUIRED TO POINT THE VECTOR IN THE DESIRED DIRECTION.  AT PRESENT NO INDICATION IS GIVEN FOR THIS SITUATION
020686,000373:                                                                                                  #  EXCEPT THAT THE FINAL MIDDLE GIMBAL ANGLE IN MPAC +2 IS GREATER THAN 59 DEGREES.
020687,000374: 
020688,000375:                                                                                                  #  CALLING SEQUENCE -
020689,000376: 
020690,000377:                                                                                                  #        1)      LOAD SCAXIS, POINTVSM
020691,000378:                                                                                                  #        2)      CALL
020692,000379:                                                                                                  #                        VECPOINT
020693,000380: 
020694,000381:                                                                                                  #  RETURNS WITH
020695,000382: 
020696,000383:                                                                                                  #        1)      DESIRED OUTER GIMBAL ANGLE IN MPAC
020697,000384:                                                                                                  #        2)      DESIRED INNER GIMBAL ANGLE IN MPAC +1
020698,000385:                                                                                                  #        3)      DESIRED MIDDLE GIMBAL ANGLE IN MPAC +2
020699,000386: 
020700,000387:                                                                                                  #  ERASABLES USED -
020701,000388: 
020702,000389:                                                                                                  #        1)      SCAXIS          6
020703,000390:                                                                                                  #        2)      POINTVSM        6
020704,000391:                                                                                                  #        3)      MIS             18
020705,000392:                                                                                                  #        4)      DEL             18
020706,000393:                                                                                                  #        5)      COF             6
020707,000394:                                                                                                  #        6)      VECQTEMP        1
020708,000395:                                                                                                  #        7)      ALL OF VAC AREA 43
020709,000396: 
020710,000397:                                                                                                  #                        TOTAL   99
020711,000398: 
020712,000399: 27,2000                                           SETLOC   VECPT                                 
020713,000400: 27,2000                                           BANK                                           

Page 485

020715,000402: 27,2032                                           COUNT*   $$/VECPT                              
020716,000403: 
020717,000404: 27,2032  E6,1675                                  EBANK=   BCDU                                  
020718,000405: 
020719,000406: 27,2032           40020        VECPNT1            STQ      BOV                                   #  THIS ENTRY USES DESIRED CDUS
020720,000407: 27,2033           03324                                    VECQTEMP                              #  NOT PRESENT - ENTER WITH CDUD'S IN MPAC
020721,000408: 27,2034           56035                                    VECPNT2                               
020722,000409: 27,2035           52164        VECPNT2            AXC,2    GOTO                                  
020723,000410: 27,2036           03245                                    MIS                                   
020724,000411: 27,2037           56046                                    STORANG                               
020725,000412: 27,2040           40020        VECPOINT           STQ      BOV                                   #  SAVE RETURN ADDRESS
020726,000413: 27,2041           03324                                    VECQTEMP                              
020727,000414: 27,2042           56043                                    VECLEAR                               #  AND CLEAR OVFIND
020728,000415: 27,2043           47164        VECLEAR            AXC,2    RTB                                   
020729,000416: 27,2044           03245                                    MIS                                   #  READ THE PRESENT CDU ANGLES AND
020730,000417: 27,2045           44403                                    READCDUK                              #  STORE THEM IN PD25, 26, 27
020731,000418: 27,2046           34032        STORANG            STCALL   25D                                   
020732,000419: 27,2047           44410                                    CDUTODCM                              #  S/C AXES TO STABLE MEMBER AXES (MIS)
020733,000420: 27,2050           61375                           VLOAD    VXM                                   
020734,000421: 27,2051           03773                                    POINTVSM                              #  RESOLVE THE POINTING DIRECTION VF INTO
020735,000422: 27,2052           03246                                    MIS                                   #  INITIAL S/C AXES (VF = POINTVSM)
020736,000423: 27,2053           77656                           UNIT                                           
020737,000424: 27,2054           00035                           STORE    28D                                   
020738,000425:                                                                                                  #  PD 28 29 30 31 32 33
020739,000426: 27,2055           53435                           VXV      UNIT                                  #  TAKE THE CROSS PRODUCT VF X VI
020740,000427: 27,2056           03765                                    SCAXIS                                #  WHERE VI = SCAXIS
020741,000428: 27,2057           57400                           BOV      VCOMP                                 
020742,000429: 27,2060           56170                                    PICKAXIS                              
020743,000430: 27,2061           17270                           STODL    COF                                   #  CHECK MAGNITUDE
020744,000431: 27,2062           00045                                    36D                                   #  OF CROSS PRODUCT
020745,000432: 27,2063           50025                           DSU      BMN                                   #  VECTOR, IF LESS
020746,000433: 27,2064           14415                                    DPB-14                                #  THAN B-14 ASSUME
020747,000434: 27,2065           56170                                    PICKAXIS                              #  UNIT OPERATION
020748,000435: 27,2066           50375                           VLOAD    DOT                                   #  INVALID.
020749,000436: 27,2067           03765                                    SCAXIS                                
020750,000437: 27,2070           00035                                    28D                                   
020751,000438: 27,2071           65552                           SL1      ARCCOS                                
020752,000439: 27,2072           77624        COMPMATX           CALL                                           #  NOW COMPUTE THE TRANSFORMATION FROM
020753,000440: 27,2073           44527                                    DELCOMP                               #  FINAL S/C AXES TO INITIAL S/C AXES MFI
020754,000441: 27,2074           75160                           AXC,1    AXC,2                                 
020755,000442: 27,2075           03245                                    MIS                                   #  COMPUTE THE TRANSFORMATION FROM FINAL
020756,000443: 27,2076           02230                                    KEL                                   #  S/C AXES TO STABLE MEMBER AXES
020757,000444: 27,2077           77624                           CALL                                           #  MFS = MIS MFI
020758,000445: 27,2100           44312                                    MXM3                                  #  (IN PD LIST)
020759,000446: 
020760,000447: 27,2101           51545                           DLOAD    ABS                                   
020761,000448: 27,2102           00007                                    6                                     #  MFS6 = SIN(CPSI)                      $2
020762,000449: 27,2103           50025                           DSU      BMN                                   
020763,000450: 27,2104           14402                                    SINGIMLC                              #  = SIN(59 DEGS)                        $2
020764,000451: 27,2105           56160                                    FINDGIMB                              #  /CPSI/ LESS THAN 59 DEGS

Page 486

020766,000453:                                                                                                  #  I.E. DESIRED ATTITUDE NOT IN GIMBAL LOCK
020767,000454: 
020768,000455: 27,2106           51545                           DLOAD    ABS                                   #  CHECK TO SEE IF WE ARE POINTING
020769,000456: 27,2107           03765                                    SCAXIS                                #  THE THRUST AXIS
020770,000457: 27,2110           51025                           DSU      BPL                                   
020771,000458: 27,2111           14404                                    SINVEC1                               #  SIN 49.4 DEGS                         $2
020772,000459: 27,2112           56160                                    FINDGIMB                              #  IF SO, WE ARE TRYING TO POINT IT INTO
020773,000460: 27,2113           77775                           VLOAD                                          #  GIMBAL LOCK, ABORT COULD GO HERE
020774,000461: 27,2114           77626                           STADR                                          
020775,000462: 27,2115           50515                           STOVL    MIS        +12D                       
020776,000463: 27,2116           77626                           STADR                                          #  STORE MFS (IN PD LIST) IN MIS
020777,000464: 27,2117           50523                           STOVL    MIS        +6                         
020778,000465: 27,2120           77626                           STADR                                          
020779,000466: 27,2121           50531                           STOVL    MIS                                   
020780,000467: 27,2122           03254                                    MIS        +6                         #  INNER GIMBAL AXIS IN FINAL S/C AXES
020781,000468: 27,2123           57444                           BPL      VCOMP                                 #  LOCATE THE IG AXIS DIRECTION CLOSEST TO
020782,000469: 27,2124           56125                                    IGSAMEX                               #  FINAL X S/C AXIS
020783,000470: 
020784,000471: 27,2125           50035        IGSAMEX            VXV      BMN                                   #  FIND THE SHORTEST WAY OF ROTATING THE 
020785,000472: 27,2126           03765                                    SCAXIS                                #  S/C OUT OF GIMBAL LOCK BY A ROTATION 
020786,000473: 27,2127           56134                                    U=SCAXIS                              #  ABOUT +- SCAXIS, I.E. IF  (IG (SGN MFS3)
020787,000474:                                                                                                  #  X SCAXIS . XF) LESS THAN 0, U = SCAXIS
020788,000475:                                                                                                  #  OTHERWISE U = -SCAXIS
020789,000476: 
020790,000477: 27,2130           57575                           VLOAD    VCOMP                                 
020791,000478: 27,2131           03765                                    SCAXIS                                
020792,000479: 27,2132           37270                           STCALL   COF                                   #  ROTATE ABOUT -SCAXIS
020793,000480: 27,2133           56137                                    CHEKAXIS                              
020794,000481: 27,2134           77775        U=SCAXIS           VLOAD                                          
020795,000482: 27,2135           03765                                    SCAXIS                                
020796,000483: 27,2136           03270                           STORE    COF                                   #  ROTATE ABOUT + SCAXIS
020797,000484: 27,2137           51545        CHEKAXIS           DLOAD    ABS                                   
020798,000485: 27,2140           03765                                    SCAXIS                                #  SEE IF WE ARE POINTING THE AOT
020799,000486: 27,2141           51025                           DSU      BPL                                   
020800,000487: 27,2142           14406                                    SINVEC2                               #  SIN 29.5 DEGS                         $2
020801,000488: 27,2143           56147                                    PICKANG1                              #  IF SO, ROTATE 50 DEGS ABOUT +- SCAXIS
020802,000489: 27,2144           52145                           DLOAD    GOTO                                  #  IF NOT, MUST BE POINTING THE TRANSPONDER
020803,000490: 27,2145           14412                                    VECANG2                               #  OR SOME VECTOR IN THE Y, OR Z PLANE
020804,000491: 27,2146           56151                                    COMPMFSN                              #  IN THIS CASE ROTATE 35 DEGS TO GET OUT
020805,000492:                                                                                                  #  OF GIMBAL LOCK (VECANG2 $360)
020806,000493: 27,2147           77745        PICKANG1           DLOAD                                          
020807,000494: 27,2150           14410                                    VECANG1                               #  = 50 DEGS                             $ 360
020808,000495: 27,2151           77624        COMPMFSN           CALL                                           
020809,000496: 27,2152           44527                                    DELCOMP                               #  COMPUTE THE ROTATION ABOUT SCAXIS TO
020810,000497: 27,2153           75160                           AXC,1    AXC,2                                 #  BRING MFS OUT OF GIMBAL LOCK
020811,000498: 27,2154           03245                                    MIS                                   
020812,000499: 27,2155           02230                                    KEL                                   
020813,000500: 27,2156           77624                           CALL                                           #  COMPUTE THE NEW TRANSFORMATION FROM
020814,000501: 27,2157           44312                                    MXM3                                  #  DESIRED S/C AXES TO STABLE MEMBER AXES
020815,000502:                                                                                                  #  WHICH WILL ALIGN VI WITH VF AND AVOID

Page 487

020817,000504:                                                                                                  #  GIMBAL LOCK
020818,000505: 27,2160           45160        FINDGIMB           AXC,1    CALL                                  
020819,000506: 27,2161           00000                                    0                                     #  EXTRACT THE COMMANDED CDU ANGLES FROM
020820,000507: 27,2162           44654                                    DCMTOCDU                              #  THIS MATRIX
020821,000508: 27,2163           40234                           RTB      SETPD                                 
020822,000509: 27,2164           21621                                    V1STO2S                               #  CONVERT TO 2:S COMPLEMENT
020823,000510: 27,2165           00001                                    0                                     
020824,000511: 27,2166           77650                           GOTO                                           
020825,000512: 27,2167           03324                                    VECQTEMP                              #  RETURN TO CALLER
020826,000513: 
020827,000514: 27,2170           50375        PICKAXIS           VLOAD    DOT                                   #  IF VF X VI = 0, FIND VF . VI
020828,000515: 27,2171           00035                                    28D                                   
020829,000516: 27,2172           03765                                    SCAXIS                                
020830,000517: 27,2173           72240                           BMN      TLOAD                                 
020831,000518: 27,2174           54354                                    ROT180                                
020832,000519: 27,2175           00032                                    25D                                   
020833,000520: 27,2176           77650                           GOTO                                           #  IF VF = VI, CDU DESIRED = PRESENT CDU
020834,000521: 27,2177           03324                                    VECQTEMP                              #  PRESENT CDU ANGLES
020835,000522: 
020836,000523: 35,2000                                           BANK     35                                    
020837,000524: 26,2000                                           SETLOC   MANUVER1                              
020838,000525: 26,2000                                           BANK                                           
020839,000526: 26,2354           47375        ROT180             VLOAD    VXV                                   #  IF VF, VI ANTIPARALLEL, 108 DEG ROTATION
020840,000527: 26,2355           03254                                    MIS        +6                         #  IS REQUIRED.  Y STABLE MEMBER AXIS IN
020841,000528: 26,2356           06522                                    HIDPHALF                              #  INITIAL S/C AXES.
020842,000529: 26,2357           47256                           UNIT     VXV                                   #  FIND Y(SM) X X(I)
020843,000530: 26,2360           03765                                    SCAXIS                                #  FIND UNIT(VI X UNIT(Y(SM) X X(I)))
020844,000531: 26,2361           40056                           UNIT     BOV                                   #  I.E. PICK A VECTOR IN THE PLANE OF X(I),
020845,000532: 26,2362           54376                                    PICKX                                 #  Y(SM) PERPENDICULAR TO VI
020846,000533: 26,2363           17270                           STODL    COF                                   
020847,000534: 26,2364           00045                                    36D                                   #  CHECK MAGNITUDE
020848,000535: 26,2365           50025                           DSU      BMN                                   #  OF THIS VECTOR.
020849,000536: 26,2366           14415                                    DPB-14                                #  IF LESS THAN B-14,
020850,000537: 26,2367           54376                                    PICKX                                 #  PICK X-AXIS.
020851,000538: 26,2370           77775                           VLOAD                                          
020852,000539: 26,2371           03270                                    COF                                   
020853,000540: 26,2372           17270        XROT               STODL    COF                                   
020854,000541: 26,2373           06522                                    HIDPHALF                              
020855,000542: 26,2374           77650                           GOTO                                           
020856,000543: 26,2375           56072                                    COMPMATX                              
020857,000544: 26,2376           52175        PICKX              VLOAD    GOTO                                  #  PICK THE XAXIS IN THIS CASE
020858,000545: 26,2377           06522                                    HIDPHALF                              
020859,000546: 26,2400           54372                                    XROT                                  
020860,000547: 26,2401           15555 35172  SINGIMLC           2DEC     .4285836003                            #  = SIN(59)                     $2
020861,000548: 26,2403           14113 36326  SINVEC1            2DEC     .3796356537                            #  = SIN(49.4)                   $2
020862,000549: 26,2405           07701 35703  SINVEC2            2DEC     .2462117800                            #  = SIN(29.5)                   $2
020863,000550: 26,2407           04343 21616  VECANG1            2DEC     .1388888889                            #  = 50 DEGREES                          $360

Page 488

020865,000552: 26,2411           03070 34344  VECANG2            2DEC     .09722222222                            #  = 35 DEGREES                          $360
020866,000553: 
020867,000554: 26,2413           00000        1BITDP             OCT      0                                     #  KEEP THIS BEFORE DPB(-14)     *********
020868,000555: 26,2414           00001        DPB-14             OCT      00001                                 
020869,000556: 26,2415           00000                           OCT      00000                                 
020870,000557: 

Page 489

020872,000559:                                                                                                  #  ROUTINE FOR INITIATING AUTOMATIC MANEUVER VIA KEYBOARD (V49)
020873,000560: 
020874,000561: 34,2000                                           BANK     34                                    
020875,000562: 23,2000                                           SETLOC   R62                                   
020876,000563: 23,2000                                           BANK                                           
020877,000564: 23,2103  E6,1675                                  EBANK=   BCDU                                  
020878,000565: 
020879,000566: 23,2103                                           COUNT*   $$/R62                                
020880,000567: 
020881,000568: 23,2103  23,2103               R62DISP            EQUALS   R62FLASH                              
020882,000569: 
020883,000570: 23,2103           35010        R62FLASH           CAF      V06N22                                #  FLASH V06N22 AND
020884,000571: 23,2104           04616                           TC       BANKCALL                              #  ICDU ANGLES
020885,000572: 23,2105           20477                           CADR     GOFLASH                               
020886,000573: 23,2106           15472                           TCF      ENDEXT                                #  TERMINATE
020887,000574: 23,2107           12111                           TCF      GOMOVE                                #  PROCEED
020888,000575: 23,2110           12103                           TCF      R62FLASH                              #  ENTER
020889,000576: 
020890,000577:                                                                                                  #  ASTRONAUT MAY LOAD NEW ICDUS AT THIS
020891,000578:                                                                                                  #  POINT
020892,000579: 23,2111           05504        GOMOVE             TC       UPFLAG                                #  SET FOR 3-AXIS MANEUVER
020893,000580: 23,2112           00124                           ADRES    3AXISFLG                              
020894,000581: 
020895,000582: 23,2113           04616                           TC       BANKCALL                              
020896,000583: 23,2114           54123                           CADR     R60LEM                                
020897,000584: 23,2115           15472                           TCF      ENDEXT                                #  END R62
020898,000585: 

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