Source Code

These source-code files are part of a reconstructed copy of Comanche 51, the initial release (though not the final mission release) of the Apollo 11 Command Module (CM) Apollo Guidance Computer (AGC) software. The flown, final release was Comanche 55. The reconstruction is believed to be exactly accurate, but in the absence of an actual Apollo-era listing of Comanche 51, some explanation of the reconstruction process is needed to insure confidence in that accuracy.

The starting point was the source code of Comanche 55, whose original source code is available. Comanche 55 source code was then modified by undoing changes known to have been made between revisions 51 and 55. The most-significant steps involved reverting changes related to the R-2 lunar potential model, the details of which were known from the previous, separate, independent reconstruction of the Apollo 10 Lunar Module software Luminary 69/2. The now-reconstructed Comanche 51 source code was verified by assembling it and checking that the assembled code had the expected known-correct memory-bank checksums. Note that page numbers in the reconstructed code match those on the Comanche 55 or Luminary 69 printouts, although the source code would likely have different page numbers in a contemporary Comanche 51 listing.

Annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change relative to Comanche 55. Here's a guide to some of the Apollo documentation relevant to those annotations:
Among documentation not actually referenced in the annotations, there is a short writeup about the reconstruction process in our software repository that may be helpful in understanding it from a different perspective. There's also a handy table that lists what the number of memory-words should be for each routine in Comanche 51, which could make a nice double-check; however, we've not performed that double-check ourselves.

Comments expected to have been present in 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.

058018,000002:                                                                                                  ## Copyright:   Public domain.
058019,000003:                                                                                                  ## Filename:    POWERED_FLIGHT_SUBROUTINES.agc
058020,000004:                                                                                                  ## Purpose:     A section of Comanche revision 051.
058021,000005:                                                                                                  ##              It is part of the reconstructed source code for the
058022,000006:                                                                                                  ##              original release of the flight software for the Command
058023,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 11.
058024,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
058025,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
058026,000010:                                                                                                  ##              exactly match those specified for Comanche 51 in NASA drawing
058027,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
058028,000012:                                                                                                  ##              reconstruction is correct.
058029,000013:                                                                                                  ## Reference:   pp. 1365-1372
058030,000014:                                                                                                  ## Assembler:   yaYUL
058031,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
058032,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
058033,000017:                                                                                                  ## Mod history: 2019-07-30 MAS  Created from Comanche 55.
058034,000018: 

Page 1365

058036,000020: 14,3422                                           BANK     14                                    #  SAME FBANK AS THE FINDCDUD SUB-PROGRAM
058037,000021: 23,2000                                           SETLOC   POWFLITE                              
058038,000022: 23,2000                                           BANK                                           
058039,000023: 
058040,000024: 23,3477     0142                                  EBANK=   DEXDEX                                
058041,000025: 23,3477                                           COUNT*   $$/POWFL                              
058042,000026: 
058043,000027:                                                                                                  #  CDUTRIG, CDUTRIG1, CDUTRIG2, AND CD*TR*GS ALL COMPUTE THE SINES AND
058044,000028:                                                                                                  #  COSINES OF THREE 2'S COMPLEMENT ANGLES AND PLACE THE RESULT, DOUBLE
058045,000029:                                                                                                  #  PRECISION, IN THE SAME ORDER AS THE INPUTS, AT SINCDU AND COSCDU.  AN
058046,000030:                                                                                                  #  ADDITIONAL OUTPUT IS THE 1'S COMPLEMENT ANGLES AT CDUSPOT.  THESE
058047,000031:                                                                                                  #  ROUTINES GO OUT OF THEIR WAY TO LEAVE THE MPAC AREA AS THEY FIND IT,
058048,000032:                                                                                                  #  EXCEPT FOR THE GENERALLY UNIMPORTANT MPAC +2.  THEY DIFFER ONLY IN
058049,000033:                                                                                                  #  WHERE THEY GET THE ANGLES, AND IN METHOD OF CALLING.
058050,000034: 
058051,000035:                                                                                                  #  CDUTRIG (AND CDUTRIG1, WHICH CAN BE CALLED IN BASIC) COMPUTE THE
058052,000036:                                                                                                  #  SINES AND COSINES FROM THE CURRENT CONTENTS OF THE CDU REGISTERS.
058053,000037:                                                                                                  #  THE CONTENTS OF CDUTEMP, ETC., ARE NOT TOUCHED SO THAT THEY MAY
058054,000038:                                                                                                  #  CONTINUE TO FORM A CONSISTENT SET WITH THE LATEST PIPA READINGS.
058055,000039: 
058056,000040:                                                                                                  #  CDUTRIG1 IS LIKE CDUTRIG EXCEPT THAT IT CAN BE CALLED IN BASIC.
058057,000041: 
058058,000042:                                                                                                  #  CD*TR*GS FINDS CDU VALUES IN CDUSPOT RATHER THAN IN CDUTEMP.  THIS
058059,000043:                                                                                                  #  ALLOWS USERS TO MAKE TRANSFORMATIONS USING ARBITRARY ANGLES, OR REAL
058060,000044:                                                                                                  #  ANGLES IN AN ORDER OTHER THAN X Y Z.  A CALL TO THIS ROUTINE IS
058061,000045:                                                                                                  #  NECESSARY IN PREPARATION FOR A CALL TO AX*SR*T IN EITHER OF ITS TWO
058062,000046:                                                                                                  #  MODES (SMNB OR NBSM).  SINCE AX*SR*T EXPECTS TO FIND THE SINES AND
058063,000047:                                                                                                  #  COSINES IN THE ORDER Y Z X THE ANGLES MUST HAVE BEEN PLACED IN CDUSPOT
058064,000048:                                                                                                  #  IN THIS ORDER.  CD*TR*GS NEED NOT BE REPEATED WHEN AX*SR*T IS CALLED
058065,000049:                                                                                                  #  MORE THAN ONCE, PROVIDED THE ANGLES HAVE NOT CHANGED.  NOTE THAT SINCE
058066,000050:                                                                                                  #  IT CLOBBERS BUF2 (IN THE SINE AND COSINE ROUTINES) CD*TR*GS CANNOT BE
058067,000051:                                                                                                  #  CALLED USING BANKCALL.  SORRY.
058068,000052: 
058069,000053:                                                                                                  #  CD*TR*G IS LIKE CD*TR*GS EXCEPT THAT IT CAN BE CALLED IN
058070,000054:                                                                                                  #  INTERPRETIVE.
058071,000055: 
058072,000056: 23,3477           77776        CDUTRIG            EXIT                                           
058073,000057: 23,3500           03507                           TC       CDUTRIGS                              
058074,000058: 23,3501           06006                           TC       INTPRET                               
058075,000059: 23,3502           77616                           RVQ                                            
058076,000060: 
058077,000061: 23,3503           77776        CD*TR*G            EXIT                                           
058078,000062: 23,3504           03515                           TC       CD*TR*GS                              
058079,000063: 23,3505           06006                           TC       INTPRET                               
058080,000064: 23,3506           77616                           RVQ                                            
058081,000065: 
058082,000066: 23,3507           30032        CDUTRIGS           CA       CDUX                                  
058083,000067: 23,3510           54772                           TS       CDUSPOT    +4                         
058084,000068: 23,3511           30033                           CA       CDUY                                  
058085,000069: 23,3512           54766                           TS       CDUSPOT                               

Page 1366

058087,000071: 23,3513           30034                           CA       CDUZ                                  
058088,000072: 23,3514           54770                           TS       CDUSPOT    +2                         
058089,000073: 
058090,000074: 23,3515           00006        CD*TR*GS           EXTEND                                         
058091,000075: 23,3516           22142                           QXCH     TEM2                                  
058092,000076: 23,3517           35015                           CAF      FOUR                                  
058093,000077: 23,3520           76211        TR*GL**P           MASK     SIX                                   #  MAKE IT EVEN AND SMALLER
058094,000078: 23,3521           54143                           TS       TEM3                                  
058095,000079: 23,3522           50143                           INDEX    TEM3                                  
058096,000080: 23,3523           30766                           CA       CDUSPOT                               
058097,000081: 23,3524           52155                           DXCH     MPAC                                  #  STORING 2'S COMP ANGLE, LOADING MPAC
058098,000082: 23,3525           52127                           DXCH     VBUF       +4                         #  STORING MPAC FOR LATER RESTORATION
058099,000083: 23,3526           04757                           TC       USPRCADR                              
058100,000084: 23,3527           45513                           CADR     CDULOGIC                              
058101,000085: 23,3530           00006                           EXTEND                                         
058102,000086: 23,3531           30155                           DCA      MPAC                                  
058103,000087: 23,3532           50143                           INDEX    TEM3                                  
058104,000088: 23,3533           52767                           DXCH     CDUSPOT                               #  STORING 1'S COMPLEMENT ANGLE
058105,000089: 23,3534           04757                           TC       USPRCADR                              
058106,000090: 23,3535           01516                           CADR     COSINE                                
058107,000091: 23,3536           52155                           DXCH     MPAC                                  
058108,000092: 23,3537           50143                           INDEX    TEM3                                  
058109,000093: 23,3540           52745                           DXCH     COSCDU                                #  STORING COSINE
058110,000094: 23,3541           00006                           EXTEND                                         
058111,000095: 23,3542           50143                           INDEX    TEM3                                  
058112,000096: 23,3543           30767                           DCA      CDUSPOT                               #  LOADING 1'S COMPLEMENT ANGLE
058113,000097: 23,3544           04757                           TC       USPRCADR                              
058114,000098: 23,3545           01530                           CADR     SINE       +1                         #  SINE +1 EXPECTS ARGUMENT IN A AND L
058115,000099: 23,3546           52127                           DXCH     VBUF       +4                         #  BRINGING UP PRIOR MPAC TO BE RESTORED
058116,000100: 23,3547           52155                           DXCH     MPAC                                  
058117,000101: 23,3550           50143                           INDEX    TEM3                                  
058118,000102: 23,3551           52737                           DXCH     SINCDU                                
058119,000103: 23,3552           10143                           CCS      TEM3                                  
058120,000104: 23,3553           13520                           TCF      TR*GL**P                              
058121,000105: 23,3554           00142                           TC       TEM2                                  

Page 1367

058123,000107:                                                                                                  #  ****************************************************************************************************************
058124,000108:                                                                                                  #  QUICTRIG, INTENDED FOR GUIDANCE CYCLE USE WHERE TIME IS CRITICAL, IS A MUCH FASTER VERSION OF CD*TR*GS.
058125,000109:                                                                                                  #  QUICTRIG COMPUTES AND STORES THE SINES AND COSINES OF THE 2'S COMPLEMENT ANGLES AT CDUSPOT, CDUSPOT +2,
058126,000110:                                                                                                  #  AND CDUSPOT +4.  UNLIKE CD*TR*GS, QUICTRIG DOES NOT LEAVE THE 1'S COMPLEMENT VERSIONS OF THE ANGLES IN
058127,000111:                                                                                                  #  CDUSPOT.  QUICTRIG'S EXECUTION TIME IS 4.1 MS;    THIS IS 10 TIMES AS FAST AS CD*TR*GS.    QUICTRIG MAY BE
058128,000112:                                                                                                  #  CALLED FROM INTERPRETIVE AS AN RTB OP-CODE, OR FROM BASIC VIA BANKCALL OR IBNKCALL.
058129,000113: 
058130,000114: 23,3555           00004        QUICTRIG           INHINT                                         #  INHINT SINCE DAP USES THE SAME TEMPS
058131,000115: 23,3556           00006                           EXTEND                                         
058132,000116: 23,3557           22061                           QXCH     ITEMP1                                
058133,000117: 23,3560           35015                           CAF      FOUR                                  
058134,000118: 23,3561           76211                 +4        MASK     SIX                                   
058135,000119: 23,3562           54062                           TS       ITEMP2                                
058136,000120: 23,3563           50062                           INDEX    ITEMP2                                
058137,000121: 23,3564           30766                           CA       CDUSPOT                               
058138,000122: 23,3565           05075                           TC       SPSIN                                 
058139,000123: 23,3566           00006                           EXTEND                                         
058140,000124: 23,3567           75002                           MP       BIT14                                 #  SCALE DOWN TO MATCH INTERPRETER OUTPUTS
058141,000125: 23,3570           50062                           INDEX    ITEMP2                                
058142,000126: 23,3571           52737                           DXCH     SINCDU                                
058143,000127: 23,3572           50062                           INDEX    ITEMP2                                
058144,000128: 23,3573           30766                           CA       CDUSPOT                               
058145,000129: 23,3574           05074                           TC       SPCOS                                 
058146,000130: 23,3575           00006                           EXTEND                                         
058147,000131: 23,3576           75002                           MP       BIT14                                 
058148,000132: 23,3577           50062                           INDEX    ITEMP2                                
058149,000133: 23,3600           52745                           DXCH     COSCDU                                
058150,000134: 23,3601           10062                           CCS      ITEMP2                                
058151,000135: 23,3602           13561                           TCF      QUICTRIG   +4                         
058152,000136: 23,3603           30061                           CA       ITEMP1                                
058153,000137: 23,3604           00003                           RELINT                                         
058154,000138: 23,3605           00000                           TC       A                                     

Page 1368

058156,000140:                                                                                                  # ****************************************************************************************************************
058157,000141:                                                                                                  #  THESE INTERFACE ROUTINES MAKE IT POSSIBLE TO CALL AX*SR*T, ETC., IN
058158,000142:                                                                                                  #  INTERPRETIVE.  LATER, WHERE POSSIBLE, THEY WILL BE ELIMINATED.
058159,000143: 
058160,000144:                                                                                                  #  NBSM WILL BE THE FIRST TO GO.  IT SHOULD NOT BE USED.
058161,000145: 
058162,000146: 23,3606           77620        NBSM               STQ                                            
058163,000147: 23,3607           00047                                    X2                                    
058164,000148: 23,3610           76740                           LXC,1    VLOAD*                                
058165,000149: 23,3611           00050                                    S1                                    #  BASE ADDRESS OF THE CDU ANGLES IS IN S1
058166,000150: 23,3612           00001                                    0,1                                   
058167,000151: 23,3613           24767                           STOVL    CDUSPOT                               
058168,000152: 23,3614           00041                                    32D                                   #  VECTOR TO BE TRANSFORMED IS IN 32D
058169,000153: 23,3615           77624                           CALL                                           
058170,000154: 23,3616           47637                                    TRG*NBSM                              
058171,000155: 23,3617           34041                           STCALL   32D                                   #  SINCE THERE'S NO STGOTO
058172,000156: 23,3620           00047                                    X2                                    
058173,000157: 
058174,000158:                                                                                                  #  THESE INTERFACE ROUTINES ARE PERMANENT.  ALL RESTORE USER'S EBANK
058175,000159:                                                                                                  #  SETTING. ALL ARE STRICT INTERPRETIVE SUBROUTINES, CALLED USING "CALL",
058176,000160:                                                                                                  #  RETURNING VIA QPRET.  ALL EXPECT AND RETURN THE VECTOR TO BE TRANSFOR-
058177,000161:                                                                                                  #  MED INTERPRETER-STYLE IN MPAC; COMPONENTS AT MPAC, MPAC +3, AND MPAC +5.
058178,000162: 
058179,000163:                                                                                                  #  TRG*SMNB AND TRG*NBSM BOTH EXPECT TO SEE THE 2'S COMPLEMENT ANGLES
058180,000164:                                                                                                  #  AT CDUSPOT (ORDER Y Z X, AT CDUSPOT, CDUSPOT +2, AND CDUSPOT +4; ODD
058181,000165:                                                                                                  #  LOCATIONS NEED NOT BE ZEROED).  TRG*NBSM DOES THE NB TO SM TRANSFOR-
058182,000166:                                                                                                  #  MATION; TRG*SMNB, VICE VERSA.
058183,000167: 
058184,000168:                                                                                                  #  CDU*NBSM DOES ITS TRANSFORMATION USING THE PRESENT CONTENTS OF
058185,000169:                                                                                                  #  THE CDU COUNTERS.  OTHERWISE IT IS LIKE TRG*NBSM.
058186,000170: 
058187,000171:                                                                                                  #  CDU*SMNB IS THE COMPLEMENT OF CDU*NBSM.
058188,000172: 
058189,000173: 23,3621           77776        CDU*SMNB           EXIT                                           
058190,000174: 23,3622           03507                           TC       CDUTRIGS                              
058191,000175: 23,3623           13626                           TCF      C*MM*N1                               
058192,000176: 
058193,000177: 23,3624           77776        TRG*SMNB           EXIT                                           
058194,000178: 23,3625           03515                           TC       CD*TR*GS                              
058195,000179: 23,3626           07501        C*MM*N1            TC       MPACVBUF                              #  AX*SR*T EXPECTS VECTOR IN VBUF
058196,000180: 23,3627           46214                           CS       THREE                                 #  SIGNAL FOR SM TO NB TRANSFORMATION
058197,000181: 23,3630           03650        C*MM*N2            TC       AX*SR*T                               
058198,000182: 23,3631           06006                           TC       INTPRET                               
058199,000183: 23,3632           43575                           VLOAD    RVQ                                   
058200,000184: 23,3633           00123                                    VBUF                                  
058201,000185: 
058202,000186: 23,3634           77776        CDU*NBSM           EXIT                                           
058203,000187: 23,3635           03507                           TC       CDUTRIGS                              
058204,000188: 

Page 1369

058206,000190: 
058207,000191: 23,3636           13641                           TCF      C*MM*N3                               
058208,000192: 
058209,000193: 23,3637           77776        TRG*NBSM           EXIT                                           
058210,000194: 23,3640           03515                           TC       CD*TR*GS                              
058211,000195: 23,3641           07501        C*MM*N3            TC       MPACVBUF                              #  FOR AX*SR*T
058212,000196: 23,3642           36214                           CA       THREE                                 #  SIGNAL FOR NB TO SM TRANSFORMATION
058213,000197: 23,3643           13630                           TCF      C*MM*N2                               
058214,000198: 
058215,000199:                                                                                                  #  *NBSM* AND *SMNB* EXPECT TO SEE THE SINES AND COSINES (AT SINCDU
058216,000200:                                                                                                  #  AND COSCDU) RATHER THAN THE ANGLES THEMSELVES.  OTHERWISE THEY ARE
058217,000201:                                                                                                  #  LIKE TRG*NBSM AND TRG*SMNB.
058218,000202: 
058219,000203:                                                                                                  #  NOTE THAT JUST AS CD*TR*GS NEED BE CALLED ONLY ONCE FOR EACH SERIES
058220,000204:                                                                                                  #  OF TRANSFORMATIONS USING THE SAME ANGLES, SO TOO ONLY ONE OF TRG*NBSM
058221,000205:                                                                                                  #  AND TRG*SMNB NEED BE CALLED FOR EACH SERIES.  FOR SUBSEQUENT TRANSFOR-
058222,000206:                                                                                                  #  MATIONS USE *NBSM* AND *SMNB*.
058223,000207: 
058224,000208: 23,3644           77776        *SMNB*             EXIT                                           
058225,000209: 23,3645           13626                           TCF      C*MM*N1                               
058226,000210: 
058227,000211: 23,3646           77776        *NBSM*             EXIT                                           
058228,000212: 23,3647           13641                           TCF      C*MM*N3                               
058229,000213: 
058230,000214:                                                                                                  #  AX*SR*T COMBINES THE OLD SMNB AND NBSM.  FOR THE NB TO SM
058231,000215:                                                                                                  #  TRANSFORMATION, ENTER WITH +3 IN A.  FOR SM TO NB, ENTER WITH -3.
058232,000216:                                                                                                  #  THE VECTOR TO BE TRANSFORMED ARRIVES, AND IS RETURNED, IN VBUF.
058233,000217:                                                                                                  #  AX*SR*T EXPECTS TO FIND THE SINES AND COSINES OF THE ANGLES OF ROTATION
058234,000218:                                                                                                  #  AT SINCDU AND COSCDU, IN THE ORDER Y Z X.  A CALL TO CD*TR*GS, WITH
058235,000219:                                                                                                  #  THE 2'S COMPLEMENT ANGLES (ORDER Y Z X) AT CDUSPOT, WILL TAKE CARE OF
058236,000220:                                                                                                  #  THIS.  HERE IS A SAMPLE CALLING SEQUENCE:-
058237,000221:                                                                                                  #                TC      CDUTRIGS
058238,000222:                                                                                                  #                CS      THREE           ("CA THREE" FOR NBSM)
058239,000223:                                                                                                  #                TC      AX*SR*T
058240,000224:                                                                                                  #  THE CALL TO CD*TR*GS NEED NOT BE REPEATED, WHEN AX*SR*T IS CALLED MORE
058241,000225:                                                                                                  #  THAN ONCE, UNLESS THE ANGLES HAVE CHANGED.
058242,000226: 
058243,000227:                                                                                                  #  AX*SR*T IS GUARANTEED SAFE ONLY FOR VECTORS OF MAGNITUDE LESS THAN
058244,000228:                                                                                                  #  UNITY.  A LOOK AT THE CASE IN WHICH A VECTOR OF GREATER MAGNITUDE
058245,000229:                                                                                                  #  HAPPENS TO LIE ALONG AN AXIS OF THE SYSTEM TO WHICH IT IS TO BE TRANS-
058246,000230:                                                                                                  #  FORMED CONVINCES ONE THAT THIS IS A RESTRICTION WHICH MUST BE ACCEPTED.
058247,000231: 
058248,000232: 23,3650           54142        AX*SR*T            TS       DEXDEX                                #  WHERE IT BECOMES THE INDEX OF INDEXES
058249,000233: 23,3651           00006                           EXTEND                                         
058250,000234: 23,3652           22145                           QXCH     RTNSAVER                              
058251,000235: 
058252,000236: 23,3653           10142        R*TL**P            CCS      DEXDEX                                #                +3 --> 0        -3 --> 2
058253,000237: 23,3654           40142                           CS       DEXDEX                                #  THUS:         +2 --> 1        -2 --> 1
058254,000238: 23,3655           66214                           AD       THREE                                 #                +1 --> 2        -1 --> 0

Page 1370

058256,000240: 23,3656           00006                           EXTEND                                         
058257,000241: 23,3657           50000                           INDEX    A                                     
058258,000242: 23,3660           33737                           DCA      INDEXI                                
058259,000243: 23,3661           52144                           DXCH     DEXI                                  
058260,000244: 
058261,000245: 23,3662           35017                           CA       ONE                                   
058262,000246: 23,3663           54130                           TS       BUF                                   
058263,000247: 23,3664           00006                           EXTEND                                         
058264,000248: 23,3665           50143                           INDEX    DEX1                                  
058265,000249: 23,3666           40123                           DCS      VBUF                                  
058266,000250: 23,3667           13671                           TCF      LOOP1                                 #  REALLY BE A SUBTRACT, AND VICE VERSA
058267,000251: 
058268,000252: 23,3670           52131        LOOP2              DXCH     BUF                                   #  LOADING VECTOR COMPONENT, STORING INDEX
058269,000253: 
058270,000254: 23,3671           52155        LOOP1              DXCH     MPAC                                  
058271,000255: 23,3672           33735                           CA       SINESLOC                              
058272,000256: 23,3673           60143                           AD       DEX1                                  
058273,000257: 23,3674           54116                           TS       ADDRWD                                
058274,000258: 
058275,000259: 23,3675           07056                           TC       DMPSUB                                #  MULTIPLY BY SIN(CDUANGLE)
058276,000260: 23,3676           10142                           CCS      DEXDEX                                
058277,000261: 23,3677           52155                           DXCH     MPAC                                  #  NBSM CASE
058278,000262: 23,3700           13703                           TCF      +3                                    
058279,000263: 23,3701           00006                           EXTEND                                         #  SMNB CASE
058280,000264: 23,3702           40155                           DCS      MPAC                                  
058281,000265: 23,3703           52134                           DXCH     TERM1TMP                              
058282,000266: 
058283,000267: 23,3704           36211                           CA       SIX                                   #  SINCDU AND COSCDU (EACH 6 WORDS) MUST
058284,000268: 23,3705           26116                           ADS      ADDRWD                                #        BE CONSECUTIVE AND IN THAT ORDER
058285,000269: 
058286,000270: 23,3706           00006                           EXTEND                                         
058287,000271: 23,3707           50130                           INDEX    BUF                                   
058288,000272: 23,3710           50143                           INDEX    DEX1                                  
058289,000273: 23,3711           30123                           DCA      VBUF                                  
058290,000274: 23,3712           52155                           DXCH     MPAC                                  
058291,000275: 23,3713           07056                           TC       DMPSUB                                #  MULTIPLY BY COS(CDUANGLE)
058292,000276: 23,3714           52155                           DXCH     MPAC                                  
058293,000277: 23,3715           20134                           DAS      TERM1TMP                              
058294,000278: 23,3716           52134                           DXCH     TERM1TMP                              
058295,000279: 23,3717           20001                           DDOUBL                                         
058296,000280: 23,3720           50130                           INDEX    BUF                                   
058297,000281: 23,3721           50143                           INDEX    DEX1                                  
058298,000282: 23,3722           52123                           DXCH     VBUF                                  
058299,000283: 23,3723           52131                           DXCH     BUF                                   #  LOADING INDEX, STORING VECTOR COMPONENT
058300,000284: 23,3724           10000                           CCS      A                                     #  'CAUSE THAT'S WHERE THE INDEX NOW IS
058301,000285: 23,3725           13670                           TCF      LOOP2                                 
058302,000286: 
058303,000287: 23,3726           00006                           EXTEND                                         
058304,000288: 23,3727           26142                           DIM      DEXDEX                                #  DECREMENT MAGNITUDE PRESERVING SIGN
058305,000289: 

Page 1371

058307,000291: 23,3730           10142        TSTPOINT           CCS      DEXDEX                                #  ONLY THE BRANCHING FUNCTION IS USED
058308,000292: 23,3731           13653                           TCF      R*TL**P                               
058309,000293: 23,3732           00145                           TC       RTNSAVER                              
058310,000294: 23,3733           13653                           TCF      R*TL**P                               
058311,000295: 23,3734           00145                           TC       RTNSAVER                              
058312,000296: 
058313,000297: 23,3735           00736        SINESLOC           ADRES    SINCDU                                #  FOR USE IN SETTING ADDRWD
058314,000298: 
058315,000299: 23,3736           00004        INDEXI             DEC      4          B-14                       #  **********   DON'T   **********
058316,000300: 23,3737           00002                           DEC      2          B-14                       #  **********   TOUCH   **********
058317,000301: 23,3740           00000                           DEC      0          B-14                       #  **********   THESE   **********
058318,000302: 23,3741           00004                           DEC      4          B-14                       #  ********** CONSTANTS **********
058319,000303: 
058320,000304:                                                                                                  #  ****************************************************************************************************************

Page 1372

058322,000306:                                                                                                  #  THIS SUBROUTINE COMPUTES INCREMENTAL CHANGES IN CDU(GIMBAL) ANGLES FROM INCREMENTAL CHANGES ABOUT SM AXES.  IT
058323,000307:                                                                                                  #  REQUIRES SM INCREMENTS AS A DP VECTOR SCALED AT ONE REVOLUTION(DTHETASM,+2,+4).  SIN,COS(CDUY,Z,X) ARE IN
058324,000308:                                                                                                  #  SINCDU,+2,+4 AND COSCDU,+2,+4 RESPECTIVELY, SCALED TO ONE HALF.  CDU INCREENTS ARE PLACED IN DCDU,+2,+4 SCALED TO
058325,000309:                                                                                                  #  ONE REVOLUTION.
058326,000310: 
058327,000311:                                                                                                  #        *  COS(IGA)SEC(MGA)             0               -SIN(IGA)SEC(MGA) *
058328,000312:                                                                                                  #        *                                                                 *
058329,000313:                                                                                                  #        * -COS(IGA)TAN(MGA)             1                SIN(IGA)TAN(MGA) *
058330,000314:                                                                                                  #        *                                                                 *
058331,000315:                                                                                                  #        *      SIN(IGA)                 0                    COS(IGA)     *
058332,000316: 
058333,000317: 14,3422                                           BANK     14                                    
058334,000318: 23,2000                                           SETLOC   POWFLIT1                              
058335,000319: 23,2000                                           BANK                                           
058336,000320: 
058337,000321: 23,3742           41345        SMCDURES           DLOAD    DMP                                   
058338,000322: 23,3743           03212                                    DTHETASM                              
058339,000323: 23,3744           00745                                    COSCDUY                               
058340,000324: 
058341,000325: 23,3745           41325                           PDDL     DMP                                   
058342,000326: 23,3746           03216                                    DTHETASM   +4                         
058343,000327: 23,3747           00737                                    SINCDUY                               
058344,000328: 
058345,000329: 23,3750           77621                           BDSU                                           
058346,000330: 23,3751           77671                           DDV                                            
058347,000331: 23,3752           00747                                    COSCDUZ                               
058348,000332: 23,3753           03204                           STORE    DCDU                                  
058349,000333: 
058350,000334: 23,3754           72405                           DMP      SL1                                   #  SCALE
058351,000335: 23,3755           00741                                    SINCDUZ                               
058352,000336: 23,3756           77621                           BDSU                                           
058353,000337: 
058354,000338: 23,3757           03214                                    DTHETASM   +2                         
058355,000339: 23,3760           17206                           STODL    DCDU       +2                         
058356,000340: 23,3761           03212                                    DTHETASM                              
058357,000341: 
058358,000342: 23,3762           65205                           DMP      PDDL                                  
058359,000343: 23,3763           00737                                    SINCDUY                               
058360,000344: 23,3764           03216                                    DTHETASM   +4                         
058361,000345: 
058362,000346: 23,3765           43205                           DMP      DAD                                   
058363,000347: 23,3766           00745                                    COSCDUY                               
058364,000348: 23,3767           77752                           SL1                                            
058365,000349: 23,3770           03210                           STORE    DCDU       +4                         
058366,000350: 23,3771           77616                           RVQ                                            
058367,000351: 

End of include-file POWERED_FLIGHT_SUBROUTINES.agc.  Parent file is MAIN.agc