Source Code

These source-code files are part of a reconstructed copy of LM131 revision 1, the final release of the Apollo 13 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The source reconstruction began with source code of Luminary 131 previously transcribed from a digitized copy of that program. A dump of the flight spare core rope memory module B5, part number 2010802-171, serial number RAY 411, was obtained. This module is the only module different between Luminary 131 and LM131 revision 1. The dump was disassembled and all changes were incorporated into these source files. Note that page numbers in the reconstructed code match those on the Luminary 131 printout, although the changed code would likely have changed page numbers for a real LM131 revision 1 listing.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

020030,000002:                                                                                                  ## Copyright:   Public domain.
020031,000003:                                                                                                  ## Filename:    R60,R62.agc
020032,000004:                                                                                                  ## Purpose:     A section of LM131 revision 1.
020033,000005:                                                                                                  ##              It is part of the reconstructed source code for the final
020034,000006:                                                                                                  ##              release of the flight software for the Lunar Module's (LM)
020035,000007:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13. The code has
020036,000008:                                                                                                  ##              been reconstructed from a listing of Luminary 131 and a dump
020037,000009:                                                                                                  ##              of a core rope memory module B5, part number 2010802-171,
020038,000010:                                                                                                  ##              which is the only module different between LM131 revision 1
020039,000011:                                                                                                  ##              and Luminary 131. The executable generated from this source
020040,000012:                                                                                                  ##              has been verified against the module dump, so while the names,
020041,000013:                                                                                                  ##              comments, and ordering may not be exactly correct, the
020042,000014:                                                                                                  ##              resulting binary is.
020043,000015:                                                                                                  ## Reference:   pp. 476-489
020044,000016:                                                                                                  ## Assembler:   yaYUL
020045,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
020046,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
020047,000019:                                                                                                  ## Mod history: 2022-10-28 MAS  Created from Luminary 131.
020048,000020: 

Page 476

020050,000022:                                                                                                  #  MOD NO: 0                             DATE: 1 MAY 1968
020051,000023:                                                                                                  #  MOD BY: DIGITAL DEVEL GROUP           LOG SECTION R60,R62
020052,000024: 
020053,000025:                                                                                                  #  FUNCTIONAL DESCRIPTION:
020054,000026: 
020055,000027:                                                                                                  #  CALLED AS A GENERAL SUBROUTINE TO MANEUVER THE LM TO A SPECIFIED
020056,000028:                                                                                                  #  ATTITUDE.
020057,000029: 
020058,000030:                                                                                                  #  1. IF THE 3-AXIS FLAG IS NOT SET THE FINAL CDU ANGLES ARE
020059,000031:                                                                                                  #  CALCULATED (VECPOINT).
020060,000032: 
020061,000033:                                                                                                  #  2. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
020062,000034: 
020063,000035:                                                                                                  #  3. REQUEST FLASHING DISPLAY V50 N18 PLEASE PERFORM AUTO MANEUVER.
020064,000036: 
020065,000037:                                                                                                  #  4. IF PRIORITY DISPLAY FLAG IS SET DO A PHASECHANGE.  THEN AWAIT
020066,000038:                                                                                                  #  ASTRONAUT RESPONSE.
020067,000039: 
020068,000040:                                                                                                  #  5. DISPLAY RESPONSE RETURNS:
020069,000041: 
020070,000042:                                                                                                  #        A.      ENTER - RESET 3-AXIS FLAG AND RETURN TO CLIENT.
020071,000043: 
020072,000044:                                                                                                  #        B.      TERMINATE - IF IN P00 GO TO STEP 5A.  OTHERWISE CHECK IF R61 IS
020073,000045:                                                                                                  #                THE CALLING PROGRAM.  IF IN R61 AN EXIT IS MADE TO GOTOV56.  IF
020074,000046:                                                                                                  #                NOT IN R61 AN EXIT IS DONE VIA GOTOP00H.
020075,000047: 
020076,000048:                                                                                                  #        C.      PROCEED - CONTINUE WITH PROGRAM AT STEP 6.
020077,000049: 
020078,000050:                                                                                                  #  6. IF THE 3-AXIS FLAG IS NOT SET, THE FINAL CDU ANGLES ARE CALCULATED
020079,000051:                                                                                                  #  (VECPOINT).
020080,000052: 
020081,000053:                                                                                                  #  7. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
020082,000054: 
020083,000055:                                                                                                  #  8. IF THE G+N SWITCH IS NOT SET GO BACK TO STEP 3.
020084,000056:                                                                                                  #  
020085,000057:                                                                                                  #  9. IF THE AUTO SWITCH IS NOT SET GO BACK TO STEP 3.
020086,000058: 
020087,000059:                                                                                                  #  10. NONFLASHING DISPLAY V06N18 (FDAI ANGLES).
020088,000060: 
020089,000061:                                                                                                  #  11. DO A PHASECHANGE.
020090,000062: 
020091,000063:                                                                                                  #  12. DO A MANEUVER CALCULATION AND ICDU DRIVE ROUTINE TO ACHIEVE FINAL
020092,000064:                                                                                                  #  GIMBAL ANGLES (GOMANUR).
020093,000065: 
020094,000066:                                                                                                  #  13. AT END OF MANEUVER GO TO STEP 3.
020095,000067: 
020096,000068:                                                                                                  #        IF SATISFACTORY MANEUVER STEP 5A EXITS R60.
020097,000069:                                                                                                  #        FOR FURTHER ADJUSTMENT OF THE VEHICLE ATTITUDE ABOUT THE
020098,000070:                                                                                                  #        DESIRED VECTOR, THE ROUTINE MAY BE PERFORMED AGAIN STARTING AT

Page 477

020100,000072:                                                                                                  #        STEP 5C.
020101,000073: 
020102,000074:                                                                                                  #  CALLING SEQUENCE:     TC      BANKCALL
020103,000075:                                                                                                  #                        CADR    R60LEM
020104,000076: 
020105,000077:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:     SCAXIS, POINTVSM (FOR VECPOINT)
020106,000078:                                                                                                  #                                        3AXISFLG.
020107,000079: 
020108,000080:                                                                                                  #  SUBROUTINES CALLED:   VECPOINT, BALLANGS, GOPERF2R, LINUS, GODSPER,
020109,000081:                                                                                                  #                        GOMANUR, DOWNFLAG, PHASCHNG, UPFLAG
020110,000082: 
020111,000083:                                                                                                  #  NORMAL EXIT MODES:    CAE     TEMPR60         (CALLERS RETURN ADDRESS)
020112,000084:                                                                                                  #                        TC      BANKJUMP
020113,000085: 
020114,000086:                                                                                                  #  ALARMS: NONE
020115,000087: 
020116,000088:                                                                                                  #  OUTPUT: NONE
020117,000089: 
020118,000090:                                                                                                  #  DEBRIS: CPHI, CTHETA, CPSI, 3AXISFLG, TBASE2
020119,000091: 
020120,000092: 34,2000                                           BANK     34                                    
020121,000093: 26,2000                                           SETLOC   MANUVER                               
020122,000094: 26,2000                                           BANK                                           
020123,000095: 
020124,000096: 26,2123     1163                                  EBANK=   TEMPR60                               
020125,000097: 
020126,000098: 26,2123                                           COUNT*   $$/R06                                
020127,000099: 26,2123           04645        R60LEM             TC       MAKECADR                              
020128,000100: 26,2124           55163                           TS       TEMPR60                               
020129,000101: 
020130,000102: 26,2125           34746        REDOMANN           CAF      3AXISBIT                              
020131,000103: 26,2126           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
020132,000104: 26,2127           10000                           CCS      A                                     
020133,000105: 26,2130           12136                           TCF      TOBALL                                #  YES
020134,000106: 26,2131           06042                           TC       INTPRET                               
020135,000107: 26,2132           77624                           CALL                                           
020136,000108: 26,2133           56040                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
020137,000109: 26,2134           00322                           STORE    CPHI                                  #  STORE FINAL ANGLES - CPHI, CTHETA, CPSI
020138,000110: 26,2135           77776                           EXIT                                           
020139,000111: 
020140,000112: 26,2136           05504        TOBALL             TC       UPFLAG                                #  INSURE THAT TOTAL ATTITUDE ERRORS ARE
020141,000113: 26,2137           00013                           ADRES    NEEDLFLG                              #  DISPLAYED ON FDAI ERROR NEEDLES
020142,000114: 26,2140           05516                           TC       DOWNFLAG                              
020143,000115: 26,2141           00000                           ADRES    NEED2FLG                              
020144,000116: 26,2142           04616                           TC       BANKCALL                              
020145,000117: 26,2143           54272                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
020146,000118: 26,2144           32260        TOBALLA            CAF      V06N18                                
020147,000119: 26,2145           04616                           TC       BANKCALL                              

Page 478

020149,000121: 26,2146           20711                           CADR     GOPERF2R                              #  DISPLAY PLEASE PERFORM AUTO MANEUVER
020150,000122: 26,2147           02246                           TC       R61TEST                               
020151,000123: 26,2150           02154                           TC       REDOMANC                              #  PROCEED
020152,000124: 26,2151           02201                           TC       ENDMANU1                              #  ENTER I.E. FINISHED WITH R60
020153,000125: 26,2152           02205                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
020154,000126: 26,2153           05155                           TC       ENDOFJOB                              
020155,000127: 
020156,000128: 26,2154           34746        REDOMANC           CAF      3AXISBIT                              
020157,000129: 26,2155           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
020158,000130: 26,2156           10000                           CCS      A                                     
020159,000131: 26,2157           12165                           TCF      TOBALLC                               #  YES
020160,000132: 26,2160           06042                           TC       INTPRET                               
020161,000133: 26,2161           77624                           CALL                                           
020162,000134: 26,2162           56040                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
020163,000135: 26,2163           00322                           STORE    CPHI                                  #  STORE ANGLES
020164,000136: 26,2164           77776                           EXIT                                           
020165,000137: 
020166,000138: 26,2165           04616        TOBALLC            TC       BANKCALL                              
020167,000139: 26,2166           54272                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
020168,000140: 26,2167           02261                           TC       G+N,AUTO                              #  CHECK AUTO MODE
020169,000141: 26,2170           10000                           CCS      A                                     
020170,000142: 26,2171           12144                           TCF      TOBALLA                               #  NOT AUTO, GO REREQUEST AUTO MANEUVER.
020171,000143: 
020172,000144: 26,2172           32260        AUTOMANV           CAF      V06N18                                #  STATIC DISPLAY DURING AUTO MANEUVER
020173,000145: 26,2173           04616                           TC       BANKCALL                              #                                        -
020174,000146: 26,2174           20452                           CADR     GODSPR                                #                                        -
020175,000147: 26,2175           02205                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
020176,000148: 
020177,000149: 26,2176           04616        STARTMNV           TC       BANKCALL                              #  PERFORM MANEUVER VIA KALCMANU
020178,000150: 26,2177           17741                           CADR     GOMANUR                               
020179,000151: 
020180,000152: 26,2200           12144        ENDMANUV           TCF      TOBALLA                               #  FINISHED MANEUVER.
020181,000153: 26,2201           05516        ENDMANU1           TC       DOWNFLAG                              #  RESET 3-AXIS FLAG
020182,000154: 26,2202           00124                           ADRES    3AXISFLG                              
020183,000155: 26,2203           31163                           CAE      TEMPR60                               #                                        -
020184,000156: 26,2204           04640                           TC       BANKJUMP                              #                                        -
020185,000157: 
020186,000158: 26,2205           40100        CHKLINUS           CS       FLAGWRD4                              
020187,000159: 26,2206           74740                           MASK     PDSPFBIT                              #  IS PRIORITY DISPLAY FLAG SET?
020188,000160: 26,2207           10000                           CCS      A                                     #                                        -
020189,000161: 26,2210           00002                           TC       Q                                     #  NO - EXIT
020190,000162: 26,2211           30002                           CA       Q                                     
020191,000163: 26,2212           54156                           TS       MPAC       +2                         #  SAVE RETURN
020192,000164: 26,2213           46250                           CS       THREE                                 #  OBTAIN LOCATION FOR RESTART
020193,000165: 26,2214           60133                           AD       BUF2                                  #  HOLDS Q OF LAST DISPLAY
020194,000166: 26,2215           55054                           TS       TBASE2                                
020195,000167: 
020196,000168: 26,2216           05353                           TC       PHASCHNG                              
020197,000169: 26,2217           00132                           OCT      00132                                 

Page 479

020199,000171: 26,2220           34745                           CAF      BIT7                                  
020200,000172: 26,2221           05464                           TC       LINUS                                 #  GO SET BITS FOR PRIORITY DISPLAY      -
020201,000173: 26,2222           00156                           TC       MPAC       +2                         
020202,000174: 
020203,000175: 26,2223           37717        RELINUS            CAF      PRIO26                                #  RESTORE ORIGINAL PRIORITY
020204,000176: 26,2224           05146                           TC       PRIOCHNG                              
020205,000177: 
020206,000178: 26,2225           34747                           CAF      TRACKBIT                              #  DON'T CONTINUE R60 UNLESS TRACKFLAG ON.
020207,000179: 26,2226           70075                           MASK     FLAGWRD1                              
020208,000180: 26,2227           10000                           CCS      A                                     
020209,000181: 26,2230           12243                           TCF      RER60                                 
020210,000182: 
020211,000183: 26,2231           34745                           CAF      RNDVZBIT                              #  IS IT P20?
020212,000184: 26,2232           70074                           MASK     FLAGWRD0                              
020213,000185: 26,2233           10000                           CCS      A                                     
020214,000186: 26,2234           02240                           TC       +4                                    #  YES
020215,000187: 26,2235           05353                           TC       PHASCHNG                              #  NO, MUST BE P25, SET 2.11 SPOT
020216,000188: 26,2236           40112                           OCT      40112                                 
020217,000189: 
020218,000190: 26,2237           05155                           TC       ENDOFJOB                              
020219,000191: 
020220,000192: 26,2240           05353                           TC       PHASCHNG                              #  SET 2.7 SPOT FOR P20
020221,000193: 26,2241           40072                           OCT      40072                                 
020222,000194: 
020223,000195: 26,2242           05155                           TC       ENDOFJOB                              
020224,000196: 
020225,000197: 26,2243           05504        RER60              TC       UPFLAG                                #  SET PRIO DISPLAY FLAG AFTER RESTART
020226,000198: 26,2244           00077                           ADRES    PDSPFLAG                              
020227,000199: 
020228,000200: 26,2245           01054                           TC       TBASE2                                
020229,000201: 
020230,000202: 26,2246           31010        R61TEST            CA       MODREG                                #  IF WE ARE IN P00 IT MUST BE V49 OR V89
020231,000203: 26,2247           00006                           EXTEND                                         
020232,000204: 26,2250           12201                           BZF      ENDMANU1                              #  THUS WE GO TO ENDEXT VIA USER
020233,000205: 
020234,000206: 26,2251           30100                           CA       FLAGWRD4                              #  ARE WE IN R61 (P20 OR P25)
020235,000207: 26,2252           74740                           MASK     PDSPFBIT                              
020236,000208: 26,2253           00006                           EXTEND                                         
020237,000209: 26,2254           16001                           BZF      GOTOPOOH                              #  NO
020238,000210: 26,2255           06025                           TC       GOTOV56                               #  YES
020239,000211: 
020240,000212: 26,2256           20100        BIT14+7            OCT      20100                                 #                                        -
020241,000213: 26,2257           00203        OCT203             OCT      203                                   
020242,000214: 26,2260           01422        V06N18             VN       0618                                  
020243,000215: 
020244,000216:                                                                                                  #  SUBROUTINE TO CHECK FOR G+N CONTROL, AUTO STABILIZATION
020245,000217: 
020246,000218:                                                                                                  #  RETURNS WITH C(A) = +         IF NOT SET FOR G+N, AUTO
020247,000219:                                                                                                  #  RETURNS WITH C(A) = +0        IF SWITCHES ARE SET
020248,000220: 
020249,000221: 26,2261           00006        G+N,AUTO           EXTEND                                         

Page 480

020251,000223: 26,2262           00030                           READ     CHAN30                                
020252,000224: 26,2263           74742                           MASK     BIT10                                 
020253,000225: 26,2264           10000                           CCS      A                                     
020254,000226: 26,2265           00002                           TC       Q                                     #  NOT IN G+N    C(A) = +
020255,000227: 26,2266           00006        ISITAUTO           EXTEND                                         #  CHECK FOR AUTO MODE
020256,000228: 26,2267           00031                           READ     CHAN31                                
020257,000229: 26,2270           74736                           MASK     BIT14                                 
020258,000230: 26,2271           00002                           TC       Q                                     #  (+) = NOT IN AUTO, (+0) = AOK
020259,000231: 

Page 481

020261,000233:                                                                                                  #  PROGRAM DESCRIPTION BALLANGS
020262,000234:                                                                                                  #  MOD NO.                               LOG SECTION R60,R62
020263,000235:                                                                                                  #  WRITTEN BY RAMA M. AIYAWAR
020264,000236: 
020265,000237:                                                                                                  #  FUNCTIONAL DESCRIPTION
020266,000238: 
020267,000239:                                                                                                  #        COMPUTES LM FDAI BALL DISPLAY ANGLES
020268,000240: 
020269,000241:                                                                                                  #  CALLING SEQUENCE
020270,000242: 
020271,000243:                                                                                                  #        TC      BALLANGS
020272,000244: 
020273,000245:                                                                                                  #  NORMAL EXIT MODE
020274,000246: 
020275,000247:                                                                                                  #        TC      BALLEXIT        (SAVED Q)
020276,000248: 
020277,000249:                                                                                                  #  ALARM OR EXIT MODE    NIL
020278,000250: 
020279,000251:                                                                                                  #  SUBROUTINES CALLED
020280,000252: 
020281,000253:                                                                                                  #        CD*TR*G
020282,000254:                                                                                                  #        ARCTAN
020283,000255: 
020284,000256:                                                                                                  #  INPUT
020285,000257: 
020286,000258:                                                                                                  #        CPHI,CTHETA,CPSI ARE THE ANGLES CORRESPONDING TO AOG, AIG, AMG.  THEY ARE
020287,000259:                                                                                                  #        SP,2S COMPLIMENT SCALED TO HALF REVOLUTION.
020288,000260: 
020289,000261:                                                                                                  #  OUTPUT
020290,000262: 
020291,000263:                                                                                                  #        FDAIX, FDAIY, FDAIZ ARE THE REQUIRED BALL ANGLES SCALED TO HALF REVOLUTION
020292,000264:                                                                                                  #        SP,2S COMPLIMENT.
020293,000265: 
020294,000266:                                                                                                  #        THESE ANGLES WILL BE DISPLAYED AS DEGREES AND HUNDREDTHS, IN THE ORDER ROLL, PITCH, YAW, USING NOUNS 18 & 19.
020295,000267: 
020296,000268:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
020297,000269: 
020298,000270:                                                                                                  #        CPHI, CTHETA, CPSI      EACH A SP REGISTER
020299,000271: 
020300,000272:                                                                                                  #  DEBRIS
020301,000273: 
020302,000274:                                                                                                  #        A,L,Q,MPAC,SINCDU,COSCDU,PUSHLIST,BALLEXIT
020303,000275: 
020304,000276:                                                                                                  #  NOMENCLATURE: CPHI, CTHETA, & CPSI REPRESENT THE OUTER, INNER, & MIDDLE GIMBAL ANGLES, RESPECTIVELY; OR
020305,000277:                                                                                                  #                EQUIVALENTLY, CDUX, CDUY, & CDUZ.
020306,000278: 
020307,000279:                                                                                                  #  NOTE:  ARCTAN CHECKS FOR OVERFLOW AND SHOULD BE ABLE TO HANDLE ANY SINGULARITIES.
020308,000280: 
020309,000281: 26,2000                                           SETLOC   BAWLANGS                              
020310,000282: 26,2000                                           BANK                                           
020311,000283: 
020312,000284: 26,2272                                           COUNT*   $$/BALL                               
020313,000285: 26,2272           04645        BALLANGS           TC       MAKECADR                              
020314,000286: 26,2273           55337                           TS       BALLEXIT                              
020315,000287: 26,2274           30321                           CA       CPHI                                  

Page 482

020317,000289: 26,2275           54771                           TS       CDUSPOT    +4                         
020318,000290: 26,2276           30322                           CA       CTHETA                                
020319,000291: 26,2277           54765                           TS       CDUSPOT                               
020320,000292: 26,2300           30323                           CA       CPSI                                  
020321,000293: 26,2301           54767                           TS       CDUSPOT    +2                         
020322,000294: 
020323,000295: 26,2302           06042                           TC       INTPRET                               
020324,000296: 26,2303           45001                           SETPD    CALL                                  
020325,000297: 26,2304           00001                                    0D                                    
020326,000298: 26,2305           47545                                    CD*TR*G                               
020327,000299: 
020328,000300: 26,2306           41345                           DLOAD    DMP                                   
020329,000301: 26,2307           00742                                    SINCDUX                               #  SIN (OGA)
020330,000302: 26,2310           00746                                    COSCDUZ                               #  COS (MGA)
020331,000303: 
020332,000304: 26,2311           57552                           SL1      DCOMP                                 #  SCALE
020333,000305: 26,2312           65336                           ARCSIN   PDDL                                  #  YAW = ARCSIN(-SXCZ) INTO 0 PD
020334,000306: 26,2313           00740                                    SINCDUZ                               
020335,000307: 26,2314           14023                           STODL    SINTH                                 #  (SINTH = 18D IN PD)
020336,000308: 26,2315           00746                                    COSCDUZ                               
020337,000309: 26,2316           72405                           DMP      SL1                                   #  RESCALE
020338,000310: 26,2317           00750                                    COSCDUX                               
020339,000311: 26,2320           34021                           STCALL   COSTH                                 #  (COSTH = 16D IN PD)
020340,000312: 26,2321           26506                                    ARCTAN                                
020341,000313: 26,2322           41325                           PDDL     DMP                                   #  ROLL = ARCTAN(SZ/CZCX) INTO 2 PD
020342,000314: 26,2323           00740                                    SINCDUZ                               
020343,000315: 26,2324           00742                                    SINCDUX                               
020344,000316: 26,2325           41512                           SL2      PUSH                                  #  SXSZ INTO 4 PD
020345,000317: 26,2326           65205                           DMP      PDDL                                  #  SXSZCY INTO 4 PD
020346,000318: 26,2327           00744                                    COSCDUY                               
020347,000319: 26,2330           65205                           DMP      PDDL                                  #  SXSZSY INTO 6 PD
020348,000320: 26,2331           00736                                    SINCDUY                               
020349,000321: 26,2332           00750                                    COSCDUX                               
020350,000322: 26,2333           72405                           DMP      SL1                                   #  CXCY
020351,000323: 26,2334           00744                                    COSCDUY                               
020352,000324: 26,2335           45425                           DSU      STADR                                 #  PULL UP FROM 6 PD
020353,000325: 26,2336           63756                           STODL    COSTH                                 #  COSTH = CXCY - SXSZSY
020354,000326: 26,2337           00736                                    SINCDUY                               
020355,000327: 26,2340           72405                           DMP      SL1                                   
020356,000328: 26,2341           00750                                    COSCDUX                               #  CXSY
020357,000329: 26,2342           45415                           DAD      STADR                                 #  PULL UP FROM 4 PD
020358,000330: 26,2343           43754                           STCALL   SINTH                                 #  SINTH = CXSY + SXSZCY
020359,000331: 26,2344           26506                                    ARCTAN                                #  RETURNS WITH D(MPAC) = PITCH
020360,000332: 26,2345           55525                           PDDL     VDEF                                  #  PITCH INTO 2 PD, ROLL INTO MPAC FROM 2PD
020361,000333: 26,2346           77634                           RTB                                            #  VDEF MAKES V(MPAC) = ROLL, PITCH, YAW
020362,000334: 26,2347           21621                                    V1STO2S                               
020363,000335: 26,2350           02345                           STORE    FDAIX                                 #  MODE IS TP
020364,000336: 26,2351           77776                           EXIT                                           
020365,000337: 
020366,000338: 26,2352           31337        ENDBALL            CA       BALLEXIT                              
020367,000339: 

Page 483

020369,000341: 26,2353           04640                           TC       BANKJUMP                              
020370,000342: 

Page 484

020372,000344:                                                                                                  #  PROGRAM DESCRIPTION - VECPOINT
020373,000345: 
020374,000346:                                                                                                  #  THIS INTERPRETIVE SUBROUTINE MAY BE USED TO POINT A SPACECRAFT AXIS IN A DESIRED DIRECTION.  THE AXIS
020375,000347:                                                                                                  #  TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN SUCCESSIVE LOCATIONS OF ERASABLE MEMORY
020376,000348:                                                                                                  #  BEGINNING WITH THE LOCATION CALLED SCAXIS.  THE COMPONENTS OF THIS VECTOR ARE GIVEN IN SPACECRAFT COORDINATES.
020377,000349:                                                                                                  #  THE DIRECTION IN WHICH THIS AXIS IS TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN
020378,000350:                                                                                                  #  SUCCESSIVE LOCATIONS OF ERASABLE MEMORY BEGINNING WITH THE ADDRESS CALLED POINTVSM.  THE COMPONENTS OF THIS
020379,000351:                                                                                                  #  VECTOR ARE GIVEN IN STABLE MEMBER COORDINATES.  WITH THIS INFORMATION VECPOINT COMPUTES A SET OF THREE GIMBAL
020380,000352:                                                                                                  #  ANGLES (2S COMPLEMENT) CORESPONDING TO THE CROSS-PRODUCT ROTATION BETWEEN SCAXIS AND POINTVSM AND STORES THEM
020381,000353:                                                                                                  #  IN T(MPAC) BEFORE RETURNING TO THE CALLER.
020382,000354: 
020383,000355:                                                                                                  #  THIS ROTATION, HOWEVER, MAY BRING THE S/C INTO GIMBAL LOCK.  WHEN POINTING A VECTOR IN THE Y-Z PLANE,
020384,000356:                                                                                                  #  THE TRANSPONDER AXIS, OR THE AOT FOR THE LEM, THE PROGRAM WILL CORRECT THIS PROBLEM BY ROTATING THE CROSS-
020385,000357:                                                                                                  #  PRODUCT ATTITUDE ABOUT POINTVSM BY A FIXED AMOUNT SUFFICIENT TO ROTATE THE DESIRED S/C ATTITUDE OUT OF GIMBAL
020386,000358:                                                                                                  #  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,
020387,000359:                                                                                                  #  THE ADDITIONAL ROTATION TO AVOID GIMAL LOCK IS 35 DEGREES.  IF THE AXIS IS MORE THAN 60.5 DEGEES FROM +X (OR -X)
020388,000360:                                                                                                  #  THE ADDITIONAL ROTATION IS 35 DEGREES.  THE GIMBAL ANGLES CORRESPONDING TO THIS ATTITUDE ARE THEN COMPUTED AND
020389,000361:                                                                                                  #  STORED AS 2S COMPLIMENT ANGLES IN T(MPAC) BEFORE RETURNING TO THE CALLER.
020390,000362: 
020391,000363:                                                                                                  #  WHEN POINTING THE X-AXIS, OR THE THRUST VECTOR, OR ANY VECTOR WITHIN 40.6 DEG OF THE X-AXIS, VECPOINT
020392,000364:                                                                                                  #  CANNOT CORRECT FOR A CROSS-PRODUCT ROTATION INTO GIMBAL LOCK.  IN THIS CASE A PLATFORM REALIGNMENT WOULD BE
020393,000365:                                                                                                  #  REQUIRED TO POINT THE VECTOR IN THE DESIRED DIRECTION.  AT PRESENT NO INDICATION IS GIVEN FOR THIS SITUATION
020394,000366:                                                                                                  #  EXCEPT THAT THE FINAL MIDDLE GIMBAL ANGLE IN MPAC +2 IS GREATER THAN 59 DEGREES.
020395,000367: 
020396,000368:                                                                                                  #  CALLING SEQUENCE -
020397,000369: 
020398,000370:                                                                                                  #        1)      LOAD SCAXIS, POINTVSM
020399,000371:                                                                                                  #        2)      CALL
020400,000372:                                                                                                  #                        VECPOINT
020401,000373: 
020402,000374:                                                                                                  #  RETURNS WITH
020403,000375: 
020404,000376:                                                                                                  #        1)      DESIRED OUTER GIMBAL ANGLE IN MPAC
020405,000377:                                                                                                  #        2)      DESIRED INNER GIMBAL ANGLE IN MPAC +1
020406,000378:                                                                                                  #        3)      DESIRED MIDDLE GIMBAL ANGLE IN MPAC +2
020407,000379: 
020408,000380:                                                                                                  #  ERASABLES USED -
020409,000381: 
020410,000382:                                                                                                  #        1)      SCAXIS          6
020411,000383:                                                                                                  #        2)      POINTVSM        6
020412,000384:                                                                                                  #        3)      MIS             18
020413,000385:                                                                                                  #        4)      DEL             18
020414,000386:                                                                                                  #        5)      COF             6
020415,000387:                                                                                                  #        6)      VECQTEMP        1
020416,000388:                                                                                                  #        7)      ALL OF VAC AREA 43
020417,000389: 
020418,000390:                                                                                                  #                        TOTAL   99
020419,000391: 
020420,000392: 27,2000                                           SETLOC   VECPT                                 
020421,000393: 27,2000                                           BANK                                           

Page 485

020423,000395: 27,2032                                           COUNT*   $$/VECPT                              
020424,000396: 
020425,000397: 27,2032  E6,1675                                  EBANK=   BCDU                                  
020426,000398: 
020427,000399: 27,2032           40020        VECPNT1            STQ      BOV                                   #  THIS ENTRY USES DESIRED CDUS
020428,000400: 27,2033           03324                                    VECQTEMP                              #  NOT PRESENT - ENTER WITH CDUD'S IN MPAC
020429,000401: 27,2034           56035                                    VECPNT2                               
020430,000402: 27,2035           52164        VECPNT2            AXC,2    GOTO                                  
020431,000403: 27,2036           03245                                    MIS                                   
020432,000404: 27,2037           56046                                    STORANG                               
020433,000405: 27,2040           40020        VECPOINT           STQ      BOV                                   #  SAVE RETURN ADDRESS
020434,000406: 27,2041           03324                                    VECQTEMP                              
020435,000407: 27,2042           56043                                    VECLEAR                               #  AND CLEAR OVFIND
020436,000408: 27,2043           47164        VECLEAR            AXC,2    RTB                                   
020437,000409: 27,2044           03245                                    MIS                                   #  READ THE PRESENT CDU ANGLES AND
020438,000410: 27,2045           44403                                    READCDUK                              #  STORE THEM IN PD25, 26, 27
020439,000411: 27,2046           34032        STORANG            STCALL   25D                                   
020440,000412: 27,2047           44410                                    CDUTODCM                              #  S/C AXES TO STABLE MEMBER AXES (MIS)
020441,000413: 27,2050           61375                           VLOAD    VXM                                   
020442,000414: 27,2051           03773                                    POINTVSM                              #  RESOLVE THE POINTING DIRECTION VF INTO
020443,000415: 27,2052           03246                                    MIS                                   #  INITIAL S/C AXES (VF = POINTVSM)
020444,000416: 27,2053           77656                           UNIT                                           
020445,000417: 27,2054           00035                           STORE    28D                                   
020446,000418:                                                                                                  #  PD 28 29 30 31 32 33
020447,000419: 27,2055           53435                           VXV      UNIT                                  #  TAKE THE CROSS PRODUCT VF X VI
020448,000420: 27,2056           03765                                    SCAXIS                                #  WHERE VI = SCAXIS
020449,000421: 27,2057           57400                           BOV      VCOMP                                 
020450,000422: 27,2060           56170                                    PICKAXIS                              
020451,000423: 27,2061           17270                           STODL    COF                                   #  CHECK MAGNITUDE
020452,000424: 27,2062           00045                                    36D                                   #  OF CROSS PRODUCT
020453,000425: 27,2063           50025                           DSU      BMN                                   #  VECTOR, IF LESS
020454,000426: 27,2064           14415                                    DPB-14                                #  THAN B-14 ASSUME
020455,000427: 27,2065           56170                                    PICKAXIS                              #  UNIT OPERATION
020456,000428: 27,2066           50375                           VLOAD    DOT                                   #  INVALID.
020457,000429: 27,2067           03765                                    SCAXIS                                
020458,000430: 27,2070           00035                                    28D                                   
020459,000431: 27,2071           65552                           SL1      ARCCOS                                
020460,000432: 27,2072           77624        COMPMATX           CALL                                           #  NOW COMPUTE THE TRANSFORMATION FROM
020461,000433: 27,2073           44527                                    DELCOMP                               #  FINAL S/C AXES TO INITIAL S/C AXES MFI
020462,000434: 27,2074           75160                           AXC,1    AXC,2                                 
020463,000435: 27,2075           03245                                    MIS                                   #  COMPUTE THE TRANSFORMATION FROM FINAL
020464,000436: 27,2076           02230                                    KEL                                   #  S/C AXES TO STABLE MEMBER AXES
020465,000437: 27,2077           77624                           CALL                                           #  MFS = MIS MFI
020466,000438: 27,2100           44312                                    MXM3                                  #  (IN PD LIST)
020467,000439: 
020468,000440: 27,2101           51545                           DLOAD    ABS                                   
020469,000441: 27,2102           00007                                    6                                     #  MFS6 = SIN(CPSI)                      $2
020470,000442: 27,2103           50025                           DSU      BMN                                   
020471,000443: 27,2104           14402                                    SINGIMLC                              #  = SIN(59 DEGS)                        $2
020472,000444: 27,2105           56160                                    FINDGIMB                              #  /CPSI/ LESS THAN 59 DEGS

Page 486

020474,000446:                                                                                                  #  I.E. DESIRED ATTITUDE NOT IN GIMBAL LOCK
020475,000447: 
020476,000448: 27,2106           51545                           DLOAD    ABS                                   #  CHECK TO SEE IF WE ARE POINTING
020477,000449: 27,2107           03765                                    SCAXIS                                #  THE THRUST AXIS
020478,000450: 27,2110           51025                           DSU      BPL                                   
020479,000451: 27,2111           14404                                    SINVEC1                               #  SIN 49.4 DEGS                         $2
020480,000452: 27,2112           56160                                    FINDGIMB                              #  IF SO, WE ARE TRYING TO POINT IT INTO
020481,000453: 27,2113           77775                           VLOAD                                          #  GIMBAL LOCK, ABORT COULD GO HERE
020482,000454: 27,2114           77626                           STADR                                          
020483,000455: 27,2115           50515                           STOVL    MIS        +12D                       
020484,000456: 27,2116           77626                           STADR                                          #  STORE MFS (IN PD LIST) IN MIS
020485,000457: 27,2117           50523                           STOVL    MIS        +6                         
020486,000458: 27,2120           77626                           STADR                                          
020487,000459: 27,2121           50531                           STOVL    MIS                                   
020488,000460: 27,2122           03254                                    MIS        +6                         #  INNER GIMBAL AXIS IN FINAL S/C AXES
020489,000461: 27,2123           57444                           BPL      VCOMP                                 #  LOCATE THE IG AXIS DIRECTION CLOSEST TO
020490,000462: 27,2124           56125                                    IGSAMEX                               #  FINAL X S/C AXIS
020491,000463: 
020492,000464: 27,2125           50035        IGSAMEX            VXV      BMN                                   #  FIND THE SHORTEST WAY OF ROTATING THE 
020493,000465: 27,2126           03765                                    SCAXIS                                #  S/C OUT OF GIMBAL LOCK BY A ROTATION 
020494,000466: 27,2127           56134                                    U=SCAXIS                              #  ABOUT +- SCAXIS, I.E. IF  (IG (SGN MFS3)
020495,000467:                                                                                                  #  X SCAXIS . XF) LESS THAN 0, U = SCAXIS
020496,000468:                                                                                                  #  OTHERWISE U = -SCAXIS
020497,000469: 
020498,000470: 27,2130           57575                           VLOAD    VCOMP                                 
020499,000471: 27,2131           03765                                    SCAXIS                                
020500,000472: 27,2132           37270                           STCALL   COF                                   #  ROTATE ABOUT -SCAXIS
020501,000473: 27,2133           56137                                    CHEKAXIS                              
020502,000474: 27,2134           77775        U=SCAXIS           VLOAD                                          
020503,000475: 27,2135           03765                                    SCAXIS                                
020504,000476: 27,2136           03270                           STORE    COF                                   #  ROTATE ABOUT + SCAXIS
020505,000477: 27,2137           51545        CHEKAXIS           DLOAD    ABS                                   
020506,000478: 27,2140           03765                                    SCAXIS                                #  SEE IF WE ARE POINTING THE AOT
020507,000479: 27,2141           51025                           DSU      BPL                                   
020508,000480: 27,2142           14406                                    SINVEC2                               #  SIN 29.5 DEGS                         $2
020509,000481: 27,2143           56147                                    PICKANG1                              #  IF SO, ROTATE 50 DEGS ABOUT +- SCAXIS
020510,000482: 27,2144           52145                           DLOAD    GOTO                                  #  IF NOT, MUST BE POINTING THE TRANSPONDER
020511,000483: 27,2145           14412                                    VECANG2                               #  OR SOME VECTOR IN THE Y, OR Z PLANE
020512,000484: 27,2146           56151                                    COMPMFSN                              #  IN THIS CASE ROTATE 35 DEGS TO GET OUT
020513,000485:                                                                                                  #  OF GIMBAL LOCK (VECANG2 $360)
020514,000486: 27,2147           77745        PICKANG1           DLOAD                                          
020515,000487: 27,2150           14410                                    VECANG1                               #  = 50 DEGS                             $ 360
020516,000488: 27,2151           77624        COMPMFSN           CALL                                           
020517,000489: 27,2152           44527                                    DELCOMP                               #  COMPUTE THE ROTATION ABOUT SCAXIS TO
020518,000490: 27,2153           75160                           AXC,1    AXC,2                                 #  BRING MFS OUT OF GIMBAL LOCK
020519,000491: 27,2154           03245                                    MIS                                   
020520,000492: 27,2155           02230                                    KEL                                   
020521,000493: 27,2156           77624                           CALL                                           #  COMPUTE THE NEW TRANSFORMATION FROM
020522,000494: 27,2157           44312                                    MXM3                                  #  DESIRED S/C AXES TO STABLE MEMBER AXES
020523,000495:                                                                                                  #  WHICH WILL ALIGN VI WITH VF AND AVOID

Page 487

020525,000497:                                                                                                  #  GIMBAL LOCK
020526,000498: 27,2160           45160        FINDGIMB           AXC,1    CALL                                  
020527,000499: 27,2161           00000                                    0                                     #  EXTRACT THE COMMANDED CDU ANGLES FROM
020528,000500: 27,2162           44654                                    DCMTOCDU                              #  THIS MATRIX
020529,000501: 27,2163           40234                           RTB      SETPD                                 
020530,000502: 27,2164           21621                                    V1STO2S                               #  CONVERT TO 2:S COMPLEMENT
020531,000503: 27,2165           00001                                    0                                     
020532,000504: 27,2166           77650                           GOTO                                           
020533,000505: 27,2167           03324                                    VECQTEMP                              #  RETURN TO CALLER
020534,000506: 
020535,000507: 27,2170           50375        PICKAXIS           VLOAD    DOT                                   #  IF VF X VI = 0, FIND VF . VI
020536,000508: 27,2171           00035                                    28D                                   
020537,000509: 27,2172           03765                                    SCAXIS                                
020538,000510: 27,2173           72240                           BMN      TLOAD                                 
020539,000511: 27,2174           54354                                    ROT180                                
020540,000512: 27,2175           00032                                    25D                                   
020541,000513: 27,2176           77650                           GOTO                                           #  IF VF = VI, CDU DESIRED = PRESENT CDU
020542,000514: 27,2177           03324                                    VECQTEMP                              #  PRESENT CDU ANGLES
020543,000515: 
020544,000516: 35,2000                                           BANK     35                                    
020545,000517: 26,2000                                           SETLOC   MANUVER1                              
020546,000518: 26,2000                                           BANK                                           
020547,000519: 26,2354           47375        ROT180             VLOAD    VXV                                   #  IF VF, VI ANTIPARALLEL, 108 DEG ROTATION
020548,000520: 26,2355           03254                                    MIS        +6                         #  IS REQUIRED.  Y STABLE MEMBER AXIS IN
020549,000521: 26,2356           06522                                    HIDPHALF                              #  INITIAL S/C AXES.
020550,000522: 26,2357           47256                           UNIT     VXV                                   #  FIND Y(SM) X X(I)
020551,000523: 26,2360           03765                                    SCAXIS                                #  FIND UNIT(VI X UNIT(Y(SM) X X(I)))
020552,000524: 26,2361           40056                           UNIT     BOV                                   #  I.E. PICK A VECTOR IN THE PLANE OF X(I),
020553,000525: 26,2362           54376                                    PICKX                                 #  Y(SM) PERPENDICULAR TO VI
020554,000526: 26,2363           17270                           STODL    COF                                   
020555,000527: 26,2364           00045                                    36D                                   #  CHECK MAGNITUDE
020556,000528: 26,2365           50025                           DSU      BMN                                   #  OF THIS VECTOR.
020557,000529: 26,2366           14415                                    DPB-14                                #  IF LESS THAN B-14,
020558,000530: 26,2367           54376                                    PICKX                                 #  PICK X-AXIS.
020559,000531: 26,2370           77775                           VLOAD                                          
020560,000532: 26,2371           03270                                    COF                                   
020561,000533: 26,2372           17270        XROT               STODL    COF                                   
020562,000534: 26,2373           06522                                    HIDPHALF                              
020563,000535: 26,2374           77650                           GOTO                                           
020564,000536: 26,2375           56072                                    COMPMATX                              
020565,000537: 26,2376           52175        PICKX              VLOAD    GOTO                                  #  PICK THE XAXIS IN THIS CASE
020566,000538: 26,2377           06522                                    HIDPHALF                              
020567,000539: 26,2400           54372                                    XROT                                  
020568,000540: 26,2401           15555 35172  SINGIMLC           2DEC     .4285836003                            #  = SIN(59)                     $2
020569,000541: 26,2403           14113 36326  SINVEC1            2DEC     .3796356537                            #  = SIN(49.4)                   $2
020570,000542: 26,2405           07701 35703  SINVEC2            2DEC     .2462117800                            #  = SIN(29.5)                   $2
020571,000543: 26,2407           04343 21616  VECANG1            2DEC     .1388888889                            #  = 50 DEGREES                          $360

Page 488

020573,000545: 26,2411           03070 34344  VECANG2            2DEC     .09722222222                            #  = 35 DEGREES                          $360
020574,000546: 
020575,000547: 26,2413           00000        1BITDP             OCT      0                                     #  KEEP THIS BEFORE DPB(-14)     *********
020576,000548: 26,2414           00001        DPB-14             OCT      00001                                 
020577,000549: 26,2415           00000                           OCT      00000                                 
020578,000550: 

Page 489

020580,000552:                                                                                                  #  ROUTINE FOR INITIATING AUTOMATIC MANEUVER VIA KEYBOARD (V49)
020581,000553: 
020582,000554: 34,2000                                           BANK     34                                    
020583,000555: 23,2000                                           SETLOC   R62                                   
020584,000556: 23,2000                                           BANK                                           
020585,000557: 23,2103  E6,1675                                  EBANK=   BCDU                                  
020586,000558: 
020587,000559: 23,2103                                           COUNT*   $$/R62                                
020588,000560: 
020589,000561: 23,2103  23,2103               R62DISP            EQUALS   R62FLASH                              
020590,000562: 
020591,000563: 23,2103           35010        R62FLASH           CAF      V06N22                                #  FLASH V06N22 AND
020592,000564: 23,2104           04616                           TC       BANKCALL                              #  ICDU ANGLES
020593,000565: 23,2105           20477                           CADR     GOFLASH                               
020594,000566: 23,2106           15472                           TCF      ENDEXT                                #  TERMINATE
020595,000567: 23,2107           12111                           TCF      GOMOVE                                #  PROCEED
020596,000568: 23,2110           12103                           TCF      R62FLASH                              #  ENTER
020597,000569: 
020598,000570:                                                                                                  #  ASTRONAUT MAY LOAD NEW ICDUS AT THIS
020599,000571:                                                                                                  #  POINT
020600,000572: 23,2111           05504        GOMOVE             TC       UPFLAG                                #  SET FOR 3-AXIS MANEUVER
020601,000573: 23,2112           00124                           ADRES    3AXISFLG                              
020602,000574: 
020603,000575: 23,2113           04616                           TC       BANKCALL                              
020604,000576: 23,2114           54123                           CADR     R60LEM                                
020605,000577: 23,2115           15472                           TCF      ENDEXT                                #  END R62
020606,000578: 

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