Source Code

These source-code files derive from a printout of Luminary 210 (Apollo 15-17 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Jim Lawton, and transcribed to source code by a team of volunteers. This colorized, syntax-highlighted form was created by assembling that transcribed source code. Note that the full page images are available on the Virtual AGC project page at archive.org, while reduced-size images are presented at the VirtualAGC project website. Report or fix any transcription errors at the Virtual AGC project code repository.

Notations on the program listing read, in part:

	GAP: ASSEMBLE REVISION 210 OF AGC PROGRAM LUMINARY 
	BY NASA 2021112-161 17:11 MAR. 19,1971
Note that the date is the date of the printout, not the date of the program revision.

021526,000002:                                                                                                  ## Copyright:   Public domain.
021527,000003:                                                                                                  ## Filename:    R60,R62.agc
021528,000004:                                                                                                  ## Purpose:     A section of Luminary revision 210.
021529,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
021530,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 15-17.
021531,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
021532,000008:                                                                                                  ##              that the code format has been changed to conform to the
021533,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
021534,000010:                                                                                                  ##              original YUL assembler.
021535,000011:                                                                                                  ## Reference:   pp. 487-500
021536,000012:                                                                                                  ## Assembler:   yaYUL
021537,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
021538,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
021539,000015:                                                                                                  ## Mod history: 2016-11-17 JL   Created from Luminary131 version.
021540,000016:                                                                                                  ##              2016-11-27 HG   Transcribed
021541,000017:                                                                                                  ##              2016-12-07 HG   Fix P00 -> POO
021542,000018:                                                                                                  ##                              Change POO -> P00 in some comments
021543,000019:                                                                                                  ##              2016-12-23 RSB  Proofed comment text with octopus/ProoferComments
021544,000020:                                                                                                  ##                              and fixed all errors found.
021545,000021:                                                                                                  ##              2017-03-09 RSB  Comment text fixes noted in proofing Luminary 116.
021546,000022:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
021547,000023:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
021548,000024:                                                                                                  ##              2021-05-30 ABS  STARTMNAD -> STRTMNAD
021549,000025: 

Page 487

021551,000027:                                                                                                  #  MOD NO: 0                             DATE: 1 MAY 1968
021552,000028:                                                                                                  #  MOD BY: DIGITAL DEVEL GROUP           LOG SECTION R60,R62
021553,000029: 
021554,000030:                                                                                                  #  FUNCTIONAL DESCRIPTION:
021555,000031: 
021556,000032:                                                                                                  #  CALLED AS A GENERAL SUBROUTINE TO MANEUVER THE LM TO A SPECIFIED
021557,000033:                                                                                                  #  ATTITUDE.
021558,000034: 
021559,000035:                                                                                                  #  1. IF THE 3-AXIS FLAG IS NOT SET THE FINAL CDU ANGLES ARE
021560,000036:                                                                                                  #  CALCULATED (VECPOINT).
021561,000037: 
021562,000038:                                                                                                  #  2. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
021563,000039: 
021564,000040:                                                                                                  #  3. REQUEST FLASHING DISPLAY V50 N18 PLEASE PERFORM AUTO MANEUVER.
021565,000041: 
021566,000042:                                                                                                  #  4. IF PRIORITY DISPLAY FLAG IS SET DO A PHASECHANGE. THEN AWAIT
021567,000043:                                                                                                  #  ASTRONAUT RESPONSE.
021568,000044: 
021569,000045:                                                                                                  #  5. DISPLAY RESPONSE RETURNS:
021570,000046: 
021571,000047:                                                                                                  #      A. ENTER - RESET 3-AXIS FLAG AND RETURN TO CLIENT.
021572,000048: 
021573,000049:                                                                                                  #      B. TERMINATE - IF IN P00 GO TO STEP 5A. OTHERWISE CHECK IF R61 IS
021574,000050:                                                                                                  #         THE CALLING PROGRAM. IF IN R61 AN EXIT IS MADE TO GOTOV56. IF
021575,000051:                                                                                                  #         NOT IN R61 AN EXIT IS DONE VIA GOTOP00H.
021576,000052: 
021577,000053:                                                                                                  #      C. PROCEED - CONTINUE WITH PROGRAM AT STEP 6.
021578,000054: 
021579,000055:                                                                                                  #  6. IF THE 3-AXISFLAG IS NOT SET, THE FINAL CDU ANGLES ARE CALCULATED
021580,000056:                                                                                                  #     (VECPOINT).
021581,000057: 
021582,000058:                                                                                                  #  7. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
021583,000059: 
021584,000060:                                                                                                  #  8. IF THE G+N SWITCH IS NOT SET GO BACK TO STEP 3.
021585,000061: 
021586,000062:                                                                                                  #  9. IF THE AUTO SWITCH IS NOT SET GO BACK TO STEP 3.
021587,000063: 
021588,000064:                                                                                                  #  10. NONFLASHING DISPLAY V06N18 (FDAI ANGLES).
021589,000065: 
021590,000066:                                                                                                  #  11. DO A PHASECHANGE.
021591,000067: 
021592,000068:                                                                                                  #  12. DO A MANEUVER CALCULATION AND ICDU DRIVE ROUTINE TO ACHIEVE FINAL
021593,000069: 
021594,000070:                                                                                                  #      GIMBAL ANGLES (GOMANUR).
021595,000071:                                                                                                  #  13. AT END OF MANEUVER GO TO STEP 3.
021596,000072: 
021597,000073:                                                                                                  #           IF SATISFACTORY MANEUVER STEP 5A EXITS R60.
021598,000074:                                                                                                  #           FOR FURTHER ADJUSTMENT OF THE VEHICLE ATTITUDE ABOUT THE
021599,000075:                                                                                                  #           DESIRED VECTOR, THE ROUTINE MAY BE PERFORMED AGAIN STARTING AT
021600,000076: 

Page 488

021602,000078:                                                                                                  #           STEP 5C.
021603,000079: 
021604,000080:                                                                                                  #  CALLING SEQUENCE:  TC BANKCALL
021605,000081:                                                                                                  #                     CADR R60LEM
021606,000082: 
021607,000083:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED : SCAXIS, POINTVSM (FOR VECPOINT)
021608,000084:                                                                                                  #                                     3AXISFLG.
021609,000085: 
021610,000086:                                                                                                  #  SUBROUTINES CALLED: VECPOINT, BALLANGS, GOPERF2R, LINUS, GODSPER,
021611,000087:                                                                                                  #                     GOMANUR, DOWNFLAG, PHASCHNG, UPFLAG
021612,000088: 
021613,000089:                                                                                                  #  NORMAL EXIT MODES: CAE TEMPR60   (CALLERS RETURN ADDRESS)
021614,000090:                                                                                                  #                     TC  BANKJUMP
021615,000091: 
021616,000092:                                                                                                  #  ALARMS: NONE
021617,000093: 
021618,000094:                                                                                                  #  OUTPUT: NONE
021619,000095: 
021620,000096:                                                                                                  #  DEBRIS: CPHI, CTHETA, CPSI, 3AXISFLG, TBASE2
021621,000097: 
021622,000098: 
021623,000099: 34,2000                                           BANK     34                                    
021624,000100: 26,2000                                           SETLOC   MANUVER                               
021625,000101: 26,2000                                           BANK                                           
021626,000102: 
021627,000103: 26,2125     1163                                  EBANK=   TEMPR60                               
021628,000104: 
021629,000105: 26,2125                                           COUNT*   $$/R06                                
021630,000106: 26,2125           04636        R60LEM             TC       MAKECADR                              
021631,000107: 26,2126           55163                           TS       TEMPR60                               
021632,000108: 
021633,000109: 26,2127           34737        REDOMANN           CAF      3AXISBIT                              
021634,000110: 26,2130           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
021635,000111: 26,2131           10000                           CCS      A                                     
021636,000112: 26,2132           12140                           TCF      TOBALL                                #  YES
021637,000113: 26,2133           06060                           TC       INTPRET                               
021638,000114: 26,2134           77624                           CALL                                           
021639,000115: 26,2135           56040                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
021640,000116: 26,2136           00322                           STORE    CPHI                                  #  STORE FINAL ANGLES - CPHI,CTHETA,CPSI
021641,000117: 26,2137           77776                           EXIT                                           
021642,000118: 
021643,000119: 26,2140           05506        TOBALL             TC       UPFLAG                                #  INSURE THAT TOTAL ATTITUDE ERRORS ARE
021644,000120: 26,2141           00013                           ADRES    NEEDLFLG                              #  DISPLAYED ON FDAI ERROR NEEDLES
021645,000121: 26,2142           05520                           TC       DOWNFLAG                              
021646,000122: 26,2143           00000                           ADRES    NEED2FLG                              
021647,000123: 26,2144           04607                           TC       BANKCALL                              
021648,000124: 26,2145           54300                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
021649,000125: 26,2146           32266        TOBALLA            CAF      V06N18                                
021650,000126: 26,2147           04607                           TC       BANKCALL                              
021651,000127: 

Page 489

021653,000129: 26,2150           20722                           CADR     GOPERF2R                              #  DISPLAY PLEASE PERFORM AUTO MANEUVER
021654,000130: 26,2151           02254                           TC       R61TEST                               
021655,000131: 26,2152           02162                           TC       REDOMANC                              #  PROCEED
021656,000132: 26,2153           02207                           TC       ENDMANU1                              #  ENTER I.E. FINISHED WITH R60
021657,000133: 26,2154           02214                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
021658,000134: 26,2155           05146                           TC       ENDOFJOB                              
021659,000135: 
021660,000136: 26,2156           46266                           CS       THREE                                 #  SET UP RESTART POINT AT BEGINNING OF
021661,000137: 26,2157           60133                           AD       BUF2                                  #    DISPLAY IF PRIORITY DISP FLAG SET
021662,000138: 26,2160           02221                           TC       CHKLINS1                              
021663,000139: 26,2161           05146                           TC       ENDOFJOB                              
021664,000140: 
021665,000141: 26,2162           34737        REDOMANC           CAF      3AXISBIT                              
021666,000142: 26,2163           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
021667,000143: 26,2164           10000                           CCS      A                                     
021668,000144: 26,2165           12173                           TCF      TOBALLC                               #  YES
021669,000145: 26,2166           06060                           TC       INTPRET                               
021670,000146: 26,2167           77624                           CALL                                           
021671,000147: 26,2170           56040                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
021672,000148: 26,2171           00322                           STORE    CPHI                                  #  STORE ANGLES
021673,000149: 26,2172           77776                           EXIT                                           
021674,000150: 
021675,000151: 26,2173           04607        TOBALLC            TC       BANKCALL                              
021676,000152: 26,2174           54300                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
021677,000153: 26,2175           02267                           TC       G+N,AUTO                              #  CHECK AUTO MODE
021678,000154: 26,2176           10000                           CCS      A                                     
021679,000155: 26,2177           12146                           TCF      TOBALLA                               #  NOT AUTO, GO REREQUEST AUTO MANEUVER.
021680,000156: 
021681,000157: 26,2200           02214        AUTOMANV           TC       CHKLINUS                              
021682,000158: 26,2201           12204                           TCF      STARTMNV                              
021683,000159: 26,2202           32213                           CAF      STRTMNAD                              #  RESTART AT STARTMNV IF PRIORITY
021684,000160: 26,2203           55054                           TS       TBASE2                                #     DISPLAY FLAG SET
021685,000161: 
021686,000162: 26,2204           04607        STARTMNV           TC       BANKCALL                              #  PERFORM MANEUVER VIA KALCMANU
021687,000163: 26,2205           42764                           CADR     GOMANUR                               
021688,000164: 
021689,000165: 26,2206           12146        ENDMANUV           TCF      TOBALLA                               #  FINISHED MANEUVER.
021690,000166: 26,2207           05520        ENDMANU1           TC       DOWNFLAG                              #  RESET 3-AXIS FLAG
021691,000167: 26,2210           00124                           ADRES    3AXISFLG                              
021692,000168: 26,2211           31163                           CAE      TEMPR60                               #                                        -
021693,000169: 26,2212           04631                           TC       BANKJUMP                              #                                        -
021694,000170: 
021695,000171: 26,2213           02204        STRTMNAD           ADRES    STARTMNV                              
021696,000172: 
021697,000173: 26,2214           40101        CHKLINUS           CS       FLAGWRD5                              
021698,000174: 26,2215           74727                           MASK     PDSPFBIT                              #  IS PRIORITY DISPLAY FLAG SET?
021699,000175: 26,2216           10000                           CCS      A                                     #                                        -
021700,000176: 26,2217           00002                           TC       Q                                     #  NO - EXIT
021701,000177: 26,2220           16760                           TCF      Q+1                                   #  GO BACK AND SET UP CORRECT RESTART ADDR.
021702,000178: 

Page 490

021704,000180: 26,2221           55054        CHKLINS1           TS       TBASE2                                
021705,000181: 26,2222           30002                           CA       Q                                     
021706,000182: 26,2223           54156                           TS       MPAC       +2                         
021707,000183: 
021708,000184: 26,2224           05355                           TC       PHASCHNG                              
021709,000185: 26,2225           00132                           OCT      00132                                 
021710,000186: 
021711,000187: 26,2226           34736                           CAF      BIT7                                  
021712,000188: 26,2227           05466                           TC       LINUS                                 #  GO SET BITS FOR PRIORITY DISPLAY    -
021713,000189: 26,2230           00156                           TC       MPAC       +2                         
021714,000190: 
021715,000191: 26,2231           37735        RELINUS            CAF      PRIO26                                #  RESTORE ORIGINAL PRIORITY
021716,000192: 26,2232           05137                           TC       PRIOCHNG                              
021717,000193: 
021718,000194: 26,2233           34740                           CAF      TRACKBIT                              #  DON'T CONTINUE R60 UNLESS TRACKFLAG ON.
021719,000195: 26,2234           70075                           MASK     FLAGWRD1                              
021720,000196: 26,2235           10000                           CCS      A                                     
021721,000197: 26,2236           12251                           TCF      RER60                                 
021722,000198: 
021723,000199: 26,2237           34736                           CAF      RNDVZBIT                              #  IS IT P20?
021724,000200: 26,2240           70074                           MASK     FLAGWRD0                              
021725,000201: 26,2241           10000                           CCS      A                                     
021726,000202: 26,2242           02246                           TC       +4                                    #  YES
021727,000203: 26,2243           05355                           TC       PHASCHNG                              #  NO, MUST BE P25, SET 2.11 SPOT
021728,000204: 26,2244           40112                           OCT      40112                                 
021729,000205: 
021730,000206: 26,2245           05146                           TC       ENDOFJOB                              
021731,000207: 
021732,000208: 26,2246           05355                           TC       PHASCHNG                              #  SET 2.7 SPOT FOR P20
021733,000209: 26,2247           40072                           OCT      40072                                 
021734,000210: 
021735,000211: 26,2250           05146                           TC       ENDOFJOB                              
021736,000212: 
021737,000213: 26,2251           05506        RER60              TC       UPFLAG                                #  SET PRIO DISPLAY FLAG AFTER RESTART
021738,000214: 26,2252           00114                           ADRES    PDSPFLAG                              
021739,000215: 
021740,000216: 26,2253           01054                           TC       TBASE2                                
021741,000217: 
021742,000218: 26,2254           31010        R61TEST            CA       MODREG                                #  IF WE ARE IN P00 IT MUST BE V49 OR V89
021743,000219: 26,2255           00006                           EXTEND                                         
021744,000220: 26,2256           12207                           BZF      ENDMANU1                              #  THUS WE GO TO ENDEXT VIA USER
021745,000221: 
021746,000222: 26,2257           30101                           CA       FLAGWRD5                              
021747,000223: 26,2260           74727                           MASK     PDSPFBIT                              
021748,000224: 26,2261           00006                           EXTEND                                         
021749,000225: 26,2262           16001                           BZF      GOTOPOOH                              #  NO
021750,000226: 26,2263           06043                           TC       GOTOV56                               #  YES
021751,000227: 
021752,000228: 26,2264           20100        BIT14+7            OCT      20100                                 #                                        -
021753,000229: 26,2265           00203        OCT203             OCT      203                                   
021754,000230: 

Page 491

021756,000232: 26,2266           01422        V06N18             VN       0618                                  
021757,000233:                                                                                                  #           SUBROUTINE TO CHECK FOR G+N CONTROL, AUTO STABILIZATION
021758,000234: 
021759,000235:                                                                                                  #           RETURNS WITH C(A) = +  IF NOT SET FOR G+N, AUTO
021760,000236:                                                                                                  #           RETURNS WITH C(A) = +0 IF SWITCHES ARE SET
021761,000237: 
021762,000238: 26,2267           00006        G+N,AUTO           EXTEND                                         
021763,000239: 26,2270           00030                           READ     CHAN30                                
021764,000240: 26,2271           74733                           MASK     BIT10                                 
021765,000241: 26,2272           10000                           CCS      A                                     
021766,000242: 26,2273           00002                           TC       Q                                     #  NOT IN G+N  C(A) = +
021767,000243: 26,2274           00006        ISITAUTO           EXTEND                                         #  CHECK FOR AUTO MODE
021768,000244: 26,2275           00031                           READ     CHAN31                                
021769,000245: 26,2276           74727                           MASK     BIT14                                 
021770,000246: 26,2277           00002                           TC       Q                                     #  (+) = NOT IN AUTO, (+0) = AOK
021771,000247: 

Page 492

021773,000249:                                                                                                  #  PROGRAM DESCRIPTION BALLANGS
021774,000250:                                                                                                  #  MOD NO.         LOG SECTION R60,R62
021775,000251: 
021776,000252:                                                                                                  #  WRITTEN BY RAMA M.AIYAWAR
021777,000253:                                                                                                  #  FUNCTIONAL DESCRIPTION
021778,000254: 
021779,000255:                                                                                                  #  COMPUTES LM FDAI BALL DISPLAY ANGLES
021780,000256:                                                                                                  #  CALLING SEQUENCE
021781,000257: 
021782,000258:                                                                                                  #           TC      BALLANGS
021783,000259:                                                                                                  #  NORMAL EXIT MODE
021784,000260: 
021785,000261:                                                                                                  #           TC      BALLEXIT        (SAVED Q)
021786,000262: 
021787,000263:                                                                                                  #  ALARM OR EXIT MODE   NIL
021788,000264:                                                                                                  #  SUBROUTINES CALLED
021789,000265:                                                                                                  #           CD*TR*G
021790,000266:                                                                                                  #           ARCTAN
021791,000267: 
021792,000268:                                                                                                  #  INPUT
021793,000269: 
021794,000270:                                                                                                  #  CPHI,CTHETA,CPSI  ARE  THE ANGLES CORRESPONDING TO AOG,AIG,AMG.  THEY ARE
021795,000271:                                                                                                  #  SP,2S COMPLIMENT SCALED TO HALF REVOLUTION.
021796,000272:                                                                                                  #  OUTPUT
021797,000273: 
021798,000274:                                                                                                  #  FDAIX,FDAIY,FDAIZ ARE THE REQUIRED BALL ANGLES SCALED TO HALF REVOLUTION
021799,000275:                                                                                                  #  SP,2S COMPLIMENT.
021800,000276:                                                                                                  #  THESE ANGLES WILL BE DISPLAYED AS DEGREES AND HUNDREDTHS, IN THE ORDER ROLL, PITCH, YAW, USING NOUNS 18 & 19.
021801,000277: 
021802,000278:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
021803,000279: 
021804,000280:                                                                                                  #  CPHI,CTHETA,CPSI EACH A SP REGISTER
021805,000281:                                                                                                  #  DEBRIS
021806,000282: 
021807,000283:                                                                                                  #  A,L,Q,MPAC,SINCDU,COSCDU,PUSHLIST,BALLEXIT
021808,000284: 
021809,000285: 
021810,000286:                                                                                                  #  NOMENCLATURE:  CPHI, CTHETA, & CPSI REPRESENT THE OUTER, INNER, & MIDDLE GIMBAL ANGLES, RESPECTIVELY; OR
021811,000287:                                                                                                  #  EQUIVALENTLY, CDUX, CDUY, & CDUZ.
021812,000288: 
021813,000289:                                                                                                  #  NOTE:  ARCTAN CHECKS FOR OVERFLOW AND SHOULD BE ABLE TO HANDLE ANY SINGULARITIES.
021814,000290: 
021815,000291: 26,2000                                           SETLOC   BAWLANGS                              
021816,000292: 26,2000                                           BANK                                           
021817,000293: 
021818,000294: 26,2300                                           COUNT*   $$/BALL                               
021819,000295: 26,2300           04636        BALLANGS           TC       MAKECADR                              
021820,000296: 26,2301           55337                           TS       BALLEXIT                              
021821,000297: 26,2302           30321                           CA       CPHI                                  
021822,000298: 

Page 493

021824,000300: 26,2303           54771                           TS       CDUSPOT    +4                         
021825,000301: 26,2304           30322                           CA       CTHETA                                
021826,000302: 26,2305           54765                           TS       CDUSPOT                               
021827,000303: 26,2306           30323                           CA       CPSI                                  
021828,000304: 26,2307           54767                           TS       CDUSPOT    +2                         
021829,000305: 
021830,000306: 26,2310           06060                           TC       INTPRET                               
021831,000307: 26,2311           45001                           SETPD    CALL                                  
021832,000308: 26,2312           00001                                    0D                                    
021833,000309: 26,2313           47526                                    CD*TR*G                               
021834,000310: 
021835,000311: 26,2314           41345                           DLOAD    DMP                                   
021836,000312: 26,2315           00742                                    SINCDUX                               #  SIN (OGA)
021837,000313: 26,2316           00746                                    COSCDUZ                               #  COS (MGA)
021838,000314: 
021839,000315: 26,2317           57552                           SL1      DCOMP                                 #  SCALE
021840,000316: 26,2320           65336                           ARCSIN   PDDL                                  #  YAW = ARCSIN(-SXCZ) INTO 0 PD
021841,000317: 26,2321           00740                                    SINCDUZ                               
021842,000318: 26,2322           14023                           STODL    SINTH                                 #  (SINTH = 18D IN PD)
021843,000319: 26,2323           00746                                    COSCDUZ                               
021844,000320: 26,2324           72405                           DMP      SL1                                   #  RESCALE
021845,000321: 26,2325           00750                                    COSCDUX                               
021846,000322: 26,2326           34021                           STCALL   COSTH                                 #  (COSTH = 16D IN PD)
021847,000323: 26,2327           26545                                    ARCTAN                                
021848,000324: 26,2330           41325                           PDDL     DMP                                   #  ROLL = ARCTAN(SZ/CZCX) INTO 2 PD
021849,000325: 26,2331           00740                                    SINCDUZ                               
021850,000326: 26,2332           00742                                    SINCDUX                               
021851,000327: 26,2333           41512                           SL2      PUSH                                  #  SXSZ INTO 4 PD
021852,000328: 26,2334           65205                           DMP      PDDL                                  #  SXSZCY INTO 4 PD
021853,000329: 26,2335           00744                                    COSCDUY                               
021854,000330: 26,2336           65205                           DMP      PDDL                                  #  SXSZSY INTO 6 PD
021855,000331: 26,2337           00736                                    SINCDUY                               
021856,000332: 26,2340           00750                                    COSCDUX                               
021857,000333: 26,2341           72405                           DMP      SL1                                   #  CXCY
021858,000334: 26,2342           00744                                    COSCDUY                               
021859,000335: 26,2343           45425                           DSU      STADR                                 #  PULL UP FROM 6 PD
021860,000336: 26,2344           63756                           STODL    COSTH                                 #  COSTH = CXCY - SXSZSY
021861,000337: 26,2345           00736                                    SINCDUY                               
021862,000338: 26,2346           72405                           DMP      SL1                                   
021863,000339: 26,2347           00750                                    COSCDUX                               #  CXSY
021864,000340: 26,2350           45415                           DAD      STADR                                 #  PULL UP FROM 4 PD
021865,000341: 26,2351           43754                           STCALL   SINTH                                 #  SINTH = CXSY + SXSZCY
021866,000342: 26,2352           26545                                    ARCTAN                                #  RETURNS WITH D(MPAC) = PITCH
021867,000343: 26,2353           55525                           PDDL     VDEF                                  #  PITCH INTO 2 PD, ROLL INTO MPAC FROM 2PD
021868,000344: 26,2354           77634                           RTB                                            #  VDEF MAKES V(MPAC) = ROLL, PITCH, YAW
021869,000345: 26,2355           21630                                    V1STO2S                               
021870,000346: 26,2356           02336                           STORE    FDAIX                                 #  MODE IS TP
021871,000347: 26,2357           77776                           EXIT                                           
021872,000348: 
021873,000349: 26,2360           31337        ENDBALL            CA       BALLEXIT                              
021874,000350: 

Page 494

021876,000352: 26,2361           04631                           TC       BANKJUMP                              
021877,000353: 

Page 495

021879,000355:                                                                                                  #  PROGRAM DESCRIPTION - VECPOINT
021880,000356: 
021881,000357: 
021882,000358:                                                                                                  #           THIS INTERPRETIVE SUBROUTINE MAY BE USED TO POINT A SPACECRAFT AXIS IN A DESIRED DIRECTION.  THE AXIS
021883,000359:                                                                                                  #  TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN SUCCESSIVE LOCATIONS OF ERASABLE MEMORY
021884,000360:                                                                                                  #  BEGINNING WITH THE LOCATION CALLED SCAXIS.  THE COMPONENTS OF THIS VECTOR ARE GIVEN IN SPACECRAFT COORDINATES.
021885,000361:                                                                                                  #  THE DIRECTION IN WHICH THIS AXIS IS TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN
021886,000362:                                                                                                  #  SUCCESSIVE LOCATIONS OF ERASABLE MEMORY BEGINNING WITH THE ADDRESS CALLED POINTVSM.  THE COMPONENTS OF THIS
021887,000363:                                                                                                  #  VECTOR ARE GIVEN IN STABLE MEMBER COORDINATES.  WITH THIS INFORMATION VECPOINT COMPUTES A SET OF THREE GIMBAL
021888,000364:                                                                                                  #  ANGLES (2S COMPLEMENT) CORESPONDING TO THE CROSS-PRODUCT ROTATION BETWE EN SCAXIS AND POINTVSM AND STORES THEM
021889,000365:                                                                                                  #  IN T(MPAC) BEFORE RETURNING TO THE CALLER.
021890,000366:                                                                                                  #           THIS ROTATION, HOWEVER, MAY BRING THE S/C INTO GIMBAL LOCK.  WHEN POINTING A VECTOR IN THE Y-Z PLANE,
021891,000367:                                                                                                  #  THE TRANSPONDER AXIS, OR THE AOT FOR THE LEM, THE PROGRAM WILL CORRECT THIS PROBLEM BY ROTATING THE CROSS-
021892,000368:                                                                                                  #  PRODUCT ATTITUDE ABOUT POINTVSM BY A FIXED AMOUNT SUFFICIENT TO ROTATE THE DESIRED S/C ATTITUDE OUT OF GIMBAL
021893,000369:                                                                                                  #  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,
021894,000370:                                                                                                  #  THE ADDITIONAL ROTATION TO AVOID GIMAL LOCK IS 35 DEGREES.  IF THE AXIS IS MORE THAN 60.5 DEGEES FROM +X (OR -X)
021895,000371:                                                                                                  #  THE ADDITIONAL ROTATION IS 35 DEGREES.  THE GIMBAL ANGLES CORRESPONDING TO THIS ATTITUDE ARE THEN COMPUTED AND
021896,000372:                                                                                                  #  STORED AS 2S COMPLIMENT ANGLES IN T(MPAC) BEFORE RETURNING TO THE CALLER.
021897,000373:                                                                                                  #           WHEN POINTING THE X-AXIS, OR THE THRUST VECTOR, OR ANY VECTOR WITHIN 40.6 DEG OF THE X-AXIS, VECPOINT
021898,000374:                                                                                                  #  CANNOT CORRECT FOR A CROSS-PRODUCT ROTATION INTO GIMBAL LOCK.  IN THIS CASE A PLATFORM REALIGNMENT WOULD BE
021899,000375:                                                                                                  #  REQUIRED TO POINT THE VECTOR IN THE DESIRED DIRECTION.  AT PRESENT NO INDICATION IS GIVEN FOR THIS SITUATION
021900,000376:                                                                                                  #  EXCEPT THAT THE FINAL MIDDLE GIMBAL ANGLE IN MPAC +2 IS GREATER THAN 59 DEGREES.
021901,000377: 
021902,000378:                                                                                                  #           CALLING SEQUENCE -
021903,000379:                                                                                                  #               1) LOAD SCAXIS, POINTVSM
021904,000380:                                                                                                  #               2) CALL
021905,000381:                                                                                                  #                        VECPOINT
021906,000382: 
021907,000383:                                                                                                  #           RETURNS WITH
021908,000384: 
021909,000385:                                                                                                  #               1) DESIRED OUTER  GIMBAL ANGLE IN MPAC
021910,000386:                                                                                                  #               2) DESIRED INNER  GIMBAL ANGLE IN MPAC +1
021911,000387:                                                                                                  #               3) DESIRED MIDDLE GIMBAL ANGLE IN MPAC +2
021912,000388: 
021913,000389: 
021914,000390:                                                                                                  #           ERASABLES USED -
021915,000391: 
021916,000392:                                                                                                  #               1) SCAXIS           6
021917,000393:                                                                                                  #               2) POINTVSM         6
021918,000394:                                                                                                  #               3) MIS             18
021919,000395:                                                                                                  #               4) DEL             18
021920,000396:                                                                                                  #               5) COF              6
021921,000397:                                                                                                  #               6) VECQTEMP         1
021922,000398:                                                                                                  #               7) ALL OF VAC AREA 43
021923,000399: 
021924,000400:                                                                                                  #                        TOTAL     99
021925,000401: 
021926,000402: 27,2000                                           SETLOC   VECPT                                 
021927,000403: 27,2000                                           BANK                                           
021928,000404: 

Page 496

021930,000406: 27,2032                                           COUNT*   $$/VECPT                              
021931,000407: 
021932,000408: 27,2032  E6,1675                                  EBANK=   BCDU                                  
021933,000409: 
021934,000410: 27,2032           40020        VECPNT1            STQ      BOV                                   #  THIS ENTRY USES DESIRED CDUS
021935,000411: 27,2033           03324                                    VECQTEMP                              #  NOT PRESENT-ENTER WITH CDUD'S IN MPAC
021936,000412: 27,2034           56035                                    VECPNT2                               
021937,000413: 27,2035           52164        VECPNT2            AXC,2    GOTO                                  
021938,000414: 27,2036           03245                                    MIS                                   
021939,000415: 27,2037           56046                                    STORANG                               
021940,000416: 27,2040           40020        VECPOINT           STQ      BOV                                   #  SAVE RETURN ADDRESS
021941,000417: 27,2041           03324                                    VECQTEMP                              
021942,000418: 27,2042           56043                                    VECLEAR                               #  AND CLEAR OVFIND
021943,000419: 27,2043           47164        VECLEAR            AXC,2    RTB                                   
021944,000420: 27,2044           03245                                    MIS                                   #  READ THE PRESENT CDU ANGLES AND
021945,000421: 27,2045           44403                                    READCDUK                              #  STORE THEM IN PD25, 26, 27
021946,000422: 27,2046           34032        STORANG            STCALL   25D                                   
021947,000423: 27,2047           44410                                    CDUTODCM                              #  S/C AXES TO STABLE MEMBER AXES (MIS)
021948,000424: 27,2050           61375                           VLOAD    VXM                                   
021949,000425: 27,2051           03773                                    POINTVSM                              #  RESOLVE THE POINTING DIRECTION VF INTO
021950,000426: 27,2052           03246                                    MIS                                   #  INITIAL S/C AXES (VF = POINTVSM)
021951,000427: 27,2053           77656                           UNIT                                           
021952,000428: 27,2054           00035                           STORE    28D                                   
021953,000429:                                                                                                  #  PD 28 29 30 31 32 33
021954,000430: 27,2055           53435                           VXV      UNIT                                  #  TAKE THE CROSS PRODUCT VF X VI
021955,000431: 27,2056           03765                                    SCAXIS                                #  WHERE VI = SCAXIS
021956,000432: 27,2057           57400                           BOV      VCOMP                                 
021957,000433: 27,2060           56170                                    PICKAXIS                              
021958,000434: 27,2061           17270                           STODL    COF                                   #  CHECK MAGNITUDE
021959,000435: 27,2062           00045                                    36D                                   #  OF CROSS PRODUCT
021960,000436: 27,2063           50025                           DSU      BMN                                   #  VECTOR, IF LESS
021961,000437: 27,2064           14423                                    DPB-14                                #  THAN B-14 ASSUME
021962,000438: 27,2065           56170                                    PICKAXIS                              #  UNIT OPERATION
021963,000439: 27,2066           50375                           VLOAD    DOT                                   #           INVALID.
021964,000440: 27,2067           03765                                    SCAXIS                                
021965,000441: 27,2070           00035                                    28D                                   
021966,000442: 27,2071           65552                           SL1      ARCCOS                                
021967,000443: 27,2072           77624        COMPMATX           CALL                                           #  NOW COMPUTE THE TRANSFORMATION FROM
021968,000444: 27,2073           44527                                    DELCOMP                               #  FINAL S/C AXES TO INITIAL S/C AXES MFI
021969,000445: 27,2074           75160                           AXC,1    AXC,2                                 
021970,000446: 27,2075           03245                                    MIS                                   #  COMPUTE THE TRANSFORMATION FROM FINAL
021971,000447: 27,2076           02221                                    KEL                                   #  S/C AXES TO STABLE MEMBER AXES
021972,000448: 27,2077           77624                           CALL                                           #  MFS = MIS MFI
021973,000449: 27,2100           44312                                    MXM3                                  #  (IN PD LIST)
021974,000450: 
021975,000451: 27,2101           51545                           DLOAD    ABS                                   
021976,000452: 27,2102           00007                                    6                                     #  MFS6 = SIN(CPSI)                    $2
021977,000453: 27,2103           50025                           DSU      BMN                                   
021978,000454: 27,2104           14410                                    SINGIMLC                              #  = SIN(59 DEGS)                      $2
021979,000455: 27,2105           56160                                    FINDGIMB                              #  /CPSI/ LESS THAN 59 DEGS
021980,000456: 

Page 497

021982,000458:                                                                                                  #  I.E. DESIRED ATTITUDE NOT IN GIMBAL LOCK
021983,000459: 
021984,000460: 27,2106           51545                           DLOAD    ABS                                   #  CHECK TO SEE IF WE ARE POINTING
021985,000461: 27,2107           03765                                    SCAXIS                                #  THE THRUST AXIS
021986,000462: 27,2110           51025                           DSU      BPL                                   
021987,000463: 27,2111           14412                                    SINVEC1                               #  SIN 49.4 DEGS                        $2
021988,000464: 27,2112           56160                                    FINDGIMB                              #  IF SO, WE ARE TRYING TO POINT IT INTO
021989,000465: 27,2113           77775                           VLOAD                                          #  GIMBAL LOCK, ABORT COULD GO HERE
021990,000466: 27,2114           77626                           STADR                                          
021991,000467: 27,2115           50515                           STOVL    MIS        +12D                       
021992,000468: 27,2116           77626                           STADR                                          #  STORE MFS (IN PD LIST) IN MIS
021993,000469: 27,2117           50523                           STOVL    MIS        +6                         
021994,000470: 27,2120           77626                           STADR                                          
021995,000471: 27,2121           50531                           STOVL    MIS                                   
021996,000472: 27,2122           03254                                    MIS        +6                         #  INNER GIMBAL AXIS IN FINAL S/C AXES
021997,000473: 27,2123           57444                           BPL      VCOMP                                 #  LOCATE THE IG AXIS DIRECTION CLOSEST TO
021998,000474: 27,2124           56125                                    IGSAMEX                               #  FINAL X S/C AXIS
021999,000475: 
022000,000476: 27,2125           50035        IGSAMEX            VXV      BMN                                   #  FIND THE SHORTEST WAY OF ROTATING THE
022001,000477: 27,2126           03765                                    SCAXIS                                #  S/C OUT OF GIMBAL LOCK BY A ROTATION
022002,000478: 27,2127           56134                                    U=SCAXIS                              #  ABOUT +- SCAXIS, I.E. IF  (IG (SGN MFS3)
022003,000479:                                                                                                  #  X SCAXIS . XF) LESS THAN 0, U = SCAXIS
022004,000480:                                                                                                  #  OTHERWISE U = -SCAXIS
022005,000481: 
022006,000482: 27,2130           57575                           VLOAD    VCOMP                                 
022007,000483: 27,2131           03765                                    SCAXIS                                
022008,000484: 27,2132           37270                           STCALL   COF                                   #  ROTATE ABOUT -SCAXIS
022009,000485: 27,2133           56137                                    CHEKAXIS                              
022010,000486: 27,2134           77775        U=SCAXIS           VLOAD                                          
022011,000487: 27,2135           03765                                    SCAXIS                                
022012,000488: 27,2136           03270                           STORE    COF                                   #  ROTATE ABOUT + SCAXIS
022013,000489: 27,2137           51545        CHEKAXIS           DLOAD    ABS                                   
022014,000490: 27,2140           03765                                    SCAXIS                                #  SEE IF WE ARE POINTING THE AOT
022015,000491: 27,2141           51025                           DSU      BPL                                   
022016,000492: 27,2142           14414                                    SINVEC2                               #  SIN 29.5 DEGS                        $2
022017,000493: 27,2143           56147                                    PICKANG1                              #  IF SO, ROTATE 50 DEGS ABOUT +- SCAXIS
022018,000494: 27,2144           52145                           DLOAD    GOTO                                  #  IF NOT, MUST BE POINTING THE TRANSPONDER
022019,000495: 27,2145           14420                                    VECANG2                               #  OR SOME VECTOR IN THE Y, OR Z PLANE
022020,000496: 27,2146           56151                                    COMPMFSN                              #  IN THIS CASE ROTATE 35 DEGS TO GET OUT
022021,000497:                                                                                                  #  OF GIMBAL LOCK (VECANG2 $360)
022022,000498: 27,2147           77745        PICKANG1           DLOAD                                          
022023,000499: 27,2150           14416                                    VECANG1                               #  = 50 DEGS                          $ 360
022024,000500: 27,2151           77624        COMPMFSN           CALL                                           
022025,000501: 27,2152           44527                                    DELCOMP                               #  COMPUTE THE ROTATION ABOUT SCAXIS TO
022026,000502: 27,2153           75160                           AXC,1    AXC,2                                 #  BRING MFS OUT OF GIMBAL LOCK
022027,000503: 27,2154           03245                                    MIS                                   
022028,000504: 27,2155           02221                                    KEL                                   
022029,000505: 27,2156           77624                           CALL                                           #  COMPUTE THE NEW TRANSFORMATION FROM
022030,000506: 27,2157           44312                                    MXM3                                  #  DESIRED S/C AXES TO STABLE MEMBER AXES
022031,000507:                                                                                                  #  WHICH WILL ALIGN VI WITH VF AND AVOID
022032,000508: 

Page 498

022034,000510:                                                                                                  #  GIMBAL LOCK
022035,000511: 27,2160           45160        FINDGIMB           AXC,1    CALL                                  
022036,000512: 27,2161           00000                                    0                                     #  EXTRACT THE COMMANDED CDU ANGLES FROM
022037,000513: 27,2162           44654                                    DCMTOCDU                              #  THIS MATRIX
022038,000514: 27,2163           40234                           RTB      SETPD                                 
022039,000515: 27,2164           21630                                    V1STO2S                               #  CONVERT TO 2:S COMPLEMENT
022040,000516: 27,2165           00001                                    0                                     
022041,000517: 27,2166           77650                           GOTO                                           
022042,000518: 27,2167           03324                                    VECQTEMP                              #  RETURN TO CALLER
022043,000519: 
022044,000520: 27,2170           50375        PICKAXIS           VLOAD    DOT                                   #  IF VF X VI = 0, FIND VF . VI
022045,000521: 27,2171           00035                                    28D                                   
022046,000522: 27,2172           03765                                    SCAXIS                                
022047,000523: 27,2173           72240                           BMN      TLOAD                                 
022048,000524: 27,2174           54362                                    ROT180                                
022049,000525: 27,2175           00032                                    25D                                   
022050,000526: 27,2176           77650                           GOTO                                           #  IF VF = VI, CDU DESIRED = PRESENT CDU
022051,000527: 27,2177           03324                                    VECQTEMP                              #  PRESENT CDU ANGLES
022052,000528: 
022053,000529: 35,2000                                           BANK     35                                    
022054,000530: 26,2000                                           SETLOC   MANUVER1                              
022055,000531: 26,2000                                           BANK                                           
022056,000532: 26,2362           47375        ROT180             VLOAD    VXV                                   #  IF VF, VI ANTIPARALLEL, 108 DEG ROTATION
022057,000533: 26,2363           03254                                    MIS        +6                         #  IS REQUIRED. Y STABLE MEMBER AXIS IN
022058,000534: 26,2364           06503                                    HIDPHALF                              #  INITIAL S/C AXES.
022059,000535: 26,2365           47256                           UNIT     VXV                                   #  FIND Y(SM) X X(I)
022060,000536: 26,2366           03765                                    SCAXIS                                #  FIND UNIT(VI X UNIT(Y(SM) X X(I)))
022061,000537: 26,2367           40056                           UNIT     BOV                                   #  I.E. PICK A VECTOR IN THE PLANE OF X(I),
022062,000538: 26,2370           54404                                    PICKX                                 #  Y(SM) PERPENDICULAR TO VI
022063,000539: 26,2371           17270                           STODL    COF                                   
022064,000540: 26,2372           00045                                    36D                                   #  CHECK MAGNITUDE
022065,000541: 26,2373           50025                           DSU      BMN                                   #  OF THIS VECTOR.
022066,000542: 26,2374           14423                                    DPB-14                                #  IF LESS THAN B-14,
022067,000543: 26,2375           54404                                    PICKX                                 #  PICK X-AXIS.
022068,000544: 26,2376           77775                           VLOAD                                          
022069,000545: 26,2377           03270                                    COF                                   
022070,000546: 26,2400           17270        XROT               STODL    COF                                   
022071,000547: 26,2401           06503                                    HIDPHALF                              
022072,000548: 26,2402           77650                           GOTO                                           
022073,000549: 26,2403           56072                                    COMPMATX                              
022074,000550: 26,2404           52175        PICKX              VLOAD    GOTO                                  #  PICK THE XAXIS IN THIS CASE
022075,000551: 26,2405           06503                                    HIDPHALF                              
022076,000552: 26,2406           54400                                    XROT                                  
022077,000553: 26,2407           15555 35172  SINGIMLC           2DEC     .4285836003                            #  =SIN(59)                $2
022078,000554: 26,2411           14113 36326  SINVEC1            2DEC     .3796356537                            #  =SIN(49.4)              $2
022079,000555: 26,2413           07701 35703  SINVEC2            2DEC     .2462117800                            #  =SIN(29.5)              $2
022080,000556: 26,2415           04343 21616  VECANG1            2DEC     .1388888889                            #  = 50 DEGREES                       $360
022081,000557: 

Page 499

022083,000559: 26,2417           03070 34344  VECANG2            2DEC     .09722222222                            #  = 35 DEGREES                       $360
022084,000560: 26,2421           00000        1BITDP             OCT      0                                     #  KEEP THIS BEFORE DPB(-14)     *********
022085,000561: 26,2422           00001        DPB-14             OCT      00001                                 
022086,000562: 26,2423           00000                           OCT      00000                                 
022087,000563: 

Page 500

022089,000565:                                                                                                  #  ROUTINE FOR INITIATING AUTOMATIC MANEUVER VIA KEYBOARD (V49)
022090,000566: 
022091,000567: 
022092,000568: 34,2000                                           BANK     34                                    
022093,000569: 23,2000                                           SETLOC   R62                                   
022094,000570: 23,2000                                           BANK                                           
022095,000571: 23,2103  E6,1675                                  EBANK=   BCDU                                  
022096,000572: 
022097,000573: 23,2103                                           COUNT*   $$/R62                                
022098,000574: 
022099,000575: 23,2103  23,2103               R62DISP            EQUALS   R62FLASH                              
022100,000576: 
022101,000577: 23,2103           35001        R62FLASH           CAF      V06N22                                #  FLASH V06N22 AND
022102,000578: 23,2104           04607                           TC       BANKCALL                              #  ICDU ANGLES
022103,000579: 23,2105           20471                           CADR     GOFLASH                               
022104,000580: 23,2106           15474                           TCF      ENDEXT                                #  TERMINATE
022105,000581: 23,2107           12111                           TCF      GOMOVE                                #  PROCEED
022106,000582: 23,2110           12103                           TCF      R62FLASH                              #  ENTER
022107,000583: 
022108,000584:                                                                                                  #  ASTRONAUT MAY LOAD NEW ICDUS AT THIS
022109,000585:                                                                                                  #  POINT
022110,000586: 23,2111           05506        GOMOVE             TC       UPFLAG                                #  SET FOR 3-AXIS MANEUVER
022111,000587: 23,2112           00124                           ADRES    3AXISFLG                              
022112,000588: 
022113,000589: 23,2113           04607                           TC       BANKCALL                              
022114,000590: 23,2114           54125                           CADR     R60LEM                                
022115,000591: 23,2115           15474                           TCF      ENDEXT                                #  END R62
022116,000592: 

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