Source Code

These source-code files were from the printout at the MIT Museum, with many thanks to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing it to us. The printout was digitally photographed by Paul Fjeld. A team of volunteers transcribed the source code manually from these images or, where appropriate, modified already-transcribed but similar source Luminary 131 (Apollo 13) source code to agree with the images from the printout. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 001 OF AGC PROGRAM LMY99 BY NASA 2021112-061
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

020304,000002:                                                                                                  ## Copyright:   Public domain.
020305,000003:                                                                                                  ## Filename:    R60_R62.agc
020306,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
020307,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
020308,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
020309,000007:                                                                                                  ## Assembler:   yaYUL
020310,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
020311,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
020312,000010:                                                                                                  ## Pages:       472-485
020313,000011:                                                                                                  ## Mod history: 2009-05-17 RSB  Adapted from the corresponding 
020314,000012:                                                                                                  ##                              Luminary131 file, using page 
020315,000013:                                                                                                  ##                              images from Luminary 1A.
020316,000014:                                                                                                  ##              2016-12-13 RSB  GOTOP00H -> GOTOPOOH
020317,000015:                                                                                                  ##              2016-12-14 RSB  Proofed text comments with octopus/ProoferComments
020318,000016:                                                                                                  ##                              and corrected the errors found.
020319,000017:                                                                                                  ##              2017-01-27 RSB  Back-ported a comment-text fix identified in Luminary 69.
020320,000018:                                                                                                  ##              2017-03-09 RSB  Comment text fixes noted in proofing Luminary 116.
020321,000019: 
020322,000020:                                                                                                  ## This source code has been transcribed or otherwise adapted from
020323,000021:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
020324,000022:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
020325,000023:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
020326,000024:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
020327,000025:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
020328,000026:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
020329,000027:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
020330,000028:                                                                                                  ## actually created.
020331,000029:                                                                                                  ##
020332,000030:                                                                                                  ## Notations on the hardcopy document read, in part:
020333,000031:                                                                                                  ##
020334,000032:                                                                                                  ##      Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
020335,000033:                                                                                                  ##      16:27 JULY 14, 1969 
020336,000034: 

Page 472

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

Page 473

020388,000086:                                                                                                  #        STEP 5C.
020389,000087: 
020390,000088:                                                                                                  #  CALLING SEQUENCE:     TC      BANKCALL
020391,000089:                                                                                                  #                        CADR    R60LEM
020392,000090: 
020393,000091:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:     SCAXIS, POINTVSM (FOR VECPOINT)
020394,000092:                                                                                                  #                                        3AXISFLG.
020395,000093: 
020396,000094:                                                                                                  #  SUBROUTINES CALLED:   VECPOINT, BALLANGS, GOPERF2R, LINUS, GODSPER,
020397,000095:                                                                                                  #                        GOMANUR, DOWNFLAG, PHASCHNG, UPFLAG
020398,000096: 
020399,000097:                                                                                                  #  NORMAL EXIT MODES:    CAE     TEMPR60         (CALLERS RETURN ADDRESS)
020400,000098:                                                                                                  #                        TC      BANKJUMP
020401,000099: 
020402,000100:                                                                                                  #  ALARMS: NONE
020403,000101: 
020404,000102:                                                                                                  #  OUTPUT: NONE
020405,000103: 
020406,000104:                                                                                                  #  DEBRIS: CPHI, CTHETA, CPSI, 3AXISFLG, TBASE2
020407,000105: 
020408,000106: 34,2000                                           BANK     34                                    
020409,000107: 26,2000                                           SETLOC   MANUVER                               
020410,000108: 26,2000                                           BANK                                           
020411,000109: 
020412,000110: 26,2123     1164                                  EBANK=   TEMPR60                               
020413,000111: 
020414,000112: 26,2123                                           COUNT*   $$/R06                                
020415,000113: 26,2123           04645        R60LEM             TC       MAKECADR                              
020416,000114: 26,2124           55164                           TS       TEMPR60                               
020417,000115: 
020418,000116: 26,2125           34746        REDOMANN           CAF      3AXISBIT                              
020419,000117: 26,2126           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
020420,000118: 26,2127           10000                           CCS      A                                     
020421,000119: 26,2130           12136                           TCF      TOBALL                                #  YES
020422,000120: 26,2131           06037                           TC       INTPRET                               
020423,000121: 26,2132           77624                           CALL                                           
020424,000122: 26,2133           56040                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
020425,000123: 26,2134           00322                           STORE    CPHI                                  #  STORE FINAL ANGLES - CPHI, CTHETA, CPSI
020426,000124: 26,2135           77776                           EXIT                                           
020427,000125: 
020428,000126: 26,2136           04616        TOBALL             TC       BANKCALL                              
020429,000127: 26,2137           54266                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
020430,000128: 26,2140           32254        TOBALLA            CAF      V06N18                                
020431,000129: 26,2141           04616                           TC       BANKCALL                              
020432,000130: 26,2142           20710                           CADR     GOPERF2R                              #  DISPLAY PLEASE PERFORM AUTO MANEUVER
020433,000131: 26,2143           02242                           TC       R61TEST                               
020434,000132: 26,2144           02150                           TC       REDOMANC                              #  PROCEED
020435,000133: 26,2145           02175                           TC       ENDMANU1                              #  ENTER I.E. FINISHED WITH R60

Page 474

020437,000135: 26,2146           02201                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
020438,000136: 26,2147           05155                           TC       ENDOFJOB                              
020439,000137: 
020440,000138: 26,2150           34746        REDOMANC           CAF      3AXISBIT                              
020441,000139: 26,2151           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
020442,000140: 26,2152           10000                           CCS      A                                     
020443,000141: 26,2153           12161                           TCF      TOBALLC                               #  YES
020444,000142: 26,2154           06037                           TC       INTPRET                               
020445,000143: 26,2155           77624                           CALL                                           
020446,000144: 26,2156           56040                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
020447,000145: 26,2157           00322                           STORE    CPHI                                  #  STORE ANGLES
020448,000146: 26,2160           77776                           EXIT                                           
020449,000147: 
020450,000148: 26,2161           04616        TOBALLC            TC       BANKCALL                              
020451,000149: 26,2162           54266                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
020452,000150: 26,2163           02255                           TC       G+N,AUTO                              #  CHECK AUTO MODE
020453,000151: 26,2164           10000                           CCS      A                                     
020454,000152: 26,2165           12140                           TCF      TOBALLA                               #  NOT AUTO, GO REREQUEST AUTO MANEUVER.
020455,000153: 
020456,000154: 26,2166           32254        AUTOMANV           CAF      V06N18                                #  STATIC DISPLAY DURING AUTO MANEUVER
020457,000155: 26,2167           04616                           TC       BANKCALL                              #                                        -
020458,000156: 26,2170           20451                           CADR     GODSPR                                #                                        -
020459,000157: 26,2171           02201                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
020460,000158: 
020461,000159: 26,2172           04616        STARTMNV           TC       BANKCALL                              #  PERFORM MANEUVER VIA KALCMANU
020462,000160: 26,2173           17750                           CADR     GOMANUR                               
020463,000161: 
020464,000162: 26,2174           12140        ENDMANUV           TCF      TOBALLA                               #  FINISHED MANEUVER.
020465,000163: 26,2175           05516        ENDMANU1           TC       DOWNFLAG                              #  RESET 3-AXIS FLAG
020466,000164: 26,2176           00124                           ADRES    3AXISFLG                              
020467,000165: 26,2177           31164                           CAE      TEMPR60                               #                                        -
020468,000166: 26,2200           04640                           TC       BANKJUMP                              #                                        -
020469,000167: 
020470,000168: 26,2201           40100        CHKLINUS           CS       FLAGWRD4                              
020471,000169: 26,2202           74740                           MASK     PDSPFBIT                              #  IS PRIORITY DISPLAY FLAG SET?
020472,000170: 26,2203           10000                           CCS      A                                     #                                        -
020473,000171: 26,2204           00002                           TC       Q                                     #  NO - EXIT
020474,000172: 26,2205           30002                           CA       Q                                     
020475,000173: 26,2206           54156                           TS       MPAC       +2                         #  SAVE RETURN
020476,000174: 26,2207           46245                           CS       THREE                                 #  OBTAIN LOCATION FOR RESTART
020477,000175: 26,2210           60133                           AD       BUF2                                  #  HOLDS Q OF LAST DISPLAY
020478,000176: 26,2211           55055                           TS       TBASE2                                
020479,000177: 
020480,000178: 26,2212           05353                           TC       PHASCHNG                              
020481,000179: 26,2213           00132                           OCT      00132                                 
020482,000180: 
020483,000181: 26,2214           34745                           CAF      BIT7                                  
020484,000182: 26,2215           05464                           TC       LINUS                                 #  GO SET BITS FOR PRIORITY DISPLAY      -
020485,000183: 26,2216           00156                           TC       MPAC       +2                         
020486,000184: 

Page 475

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

Page 476

020540,000238: 26,2262           00006        ISITAUTO           EXTEND                                         #  CHECK FOR AUTO MODE
020541,000239: 26,2263           00031                           READ     CHAN31                                
020542,000240: 26,2264           74736                           MASK     BIT14                                 
020543,000241: 26,2265           00002                           TC       Q                                     #  (+) = NOT IN AUTO, (+0) = AOK
020544,000242: 

Page 477

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

Page 478

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

Page 479

020655,000353: 26,2347           04640                           TC       BANKJUMP                              
020656,000354: 

Page 480

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

Page 481

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

Page 482

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

Page 483

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

Page 484

020862,000560: 26,2405           03070 34344  VECANG2            2DEC     .09722222222                            #  = 35 DEGREES                          $360
020863,000561: 
020864,000562: 26,2407           00000        1BITDP             OCT      0                                     #  KEEP THIS BEFORE DPB(-14)        *********
020865,000563: 26,2410           00001        DPB-14             OCT      00001                                 
020866,000564: 26,2411           00000                           OCT      00000                                 
020867,000565: 

Page 485

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

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