Source Code

This is the source-code for the Apollo 9 Command Module's Guidance Computer. These files were derived originally from the scan from MIT's Dibner Institute's now-discontinued website titled "History of Recent Science and Technology", which in turn was originally created by Gary Neff, though his high-quality scans were unfortunately reduced in legibility when presented online. The markings on the front of the printout imply that it was the original AGC developer Norm Brodeur's copy. A scan by Ron Burkey has superceded it, made from a more-legible copy from the collection of original AGC developer Fred Martin. The source code was transcribed from those images by Ron Burkey. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	ASSEMBLE REVISION 249 OF AGC PROGRAM COLOSSUS BY NASA 2021111-041
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

058246,000002:                                                                                                  ## Copyright:   Public domain.
058247,000003:                                                                                                  ## Filename:    POWERED_FLIGHT_SUBROUTINES.agc
058248,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus, build 249.
058249,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
058250,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 9.
058251,000007:                                                                                                  ## Assembler:   yaYUL
058252,000008:                                                                                                  ## Reference:   Starts on p. 1333
058253,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
058254,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
058255,000011:                                                                                                  ## Mod history: 08/29/04 RSB.   Began adapting from corresponding Luminary131 file.
058256,000012:                                                                                                  ##              2010-10-24 JL   Indentation fixes.
058257,000013:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
058258,000014:                                                                                                  ##                              original harcopy, as opposed to the PDF page
058259,000015:                                                                                                  ##                              numbers in 1701.pdf.
058260,000016:                                                                                                  ##              2017-01-18 RSB  Cross-diff'd comment text (not whitespace)
058261,000017:                                                                                                  ##                              vs the already-proofed corresponding Colossus
058262,000018:                                                                                                  ##                              237 and Comanche 55 source-code files
058263,000019:                                                                                                  ##                              and corrected errors found.
058264,000020:                                                                                                  ##              2017-02-08 RSB  Added a note about a curiously-misprinted line.
058265,000021:                                                                                                  ##
058266,000022:                                                                                                  ## The contents of the "Colossus249" files, in general, are transcribed 
058267,000023:                                                                                                  ## from a scanned copy of the program listing.  Notations on this
058268,000024:                                                                                                  ## document read, in part:
058269,000025:                                                                                                  ##
058270,000026:                                                                                                  ##      Assemble revision 249 of AGC program Colossus by NASA
058271,000027:                                                                                                  ##      2021111-041.  October 28, 1968.  
058272,000028:                                                                                                  ##
058273,000029:                                                                                                  ##      This AGC program shall also be referred to as
058274,000030:                                                                                                  ##                              Colossus 1A
058275,000031:                                                                                                  ##
058276,000032:                                                                                                  ##      Prepared by
058277,000033:                                                                                                  ##                      Massachusetts Institute of Technology
058278,000034:                                                                                                  ##                      75 Cambridge Parkway
058279,000035:                                                                                                  ##                      Cambridge, Massachusetts
058280,000036:                                                                                                  ##      under NASA contract NAS 9-4065.
058281,000037:                                                                                                  ##
058282,000038:                                                                                                  ## Refer directly to the online document mentioned above for further information.
058283,000039:                                                                                                  ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
058284,000040:                                                                                                  ##
058285,000041:                                                                                                  ## In some cases, where the source code for Luminary 131 overlaps that of 
058286,000042:                                                                                                  ## Colossus 249, this code is instead copied from the corresponding Luminary 131
058287,000043:                                                                                                  ## source file, and then is proofed to incorporate any changes.
058288,000044: 

Page 1333

058290,000046: 14,3405                                           BANK     14                                    #  SAME FBANK AS THE FINDCDUD SUB-PROGRAM
058291,000047: 23,2000                                           SETLOC   POWFLITE                              
058292,000048: 23,2000                                           BANK                                           
058293,000049: 
058294,000050: 23,3432     0142                                  EBANK=   DEXDEX                                
058295,000051: 23,3432                                           COUNT*   $$/POWFL                              
058296,000052: 
058297,000053:                                                                                                  #  CDUTRIG, CDUTRIG1, CDUTRIG2, AND CD*TR*GS ALL COMPUTE THE SINES AND
058298,000054:                                                                                                  #  COSINES OF THREE 2'S COMPLEMENT ANGLES AND PLACE THE RESULT, DOUBLE
058299,000055:                                                                                                  #  PRECISION, IN THE SAME ORDER AS THE INPUTS, AT SINCDU AND COSCDU.  AN
058300,000056:                                                                                                  #  ADDITIONAL OUTPUT IS THE 1'S COMPLEMENT ANGLES AT CDUSPOT.  THESE
058301,000057:                                                                                                  #  ROUTINES GO OUT OF THEIR WAY TO LEAVE THE MPAC AREA AS THEY FIND IT,
058302,000058:                                                                                                  #  EXCEPT FOR THE GENERALLY UNIMPORTANT MPAC +2.  THEY DIFFER ONLY IN
058303,000059:                                                                                                  #  WHERE THEY GET THE ANGLES, AND IN METHOD OF CALLING.
058304,000060: 
058305,000061:                                                                                                  #  CDUTRIG (AND CDUTRIG1, WHICH CAN BE CALLED IN BASIC) COMPUTE THE
058306,000062:                                                                                                  #  SINES AND COSINES FROM THE CURRENT CONTENTS OF THE CDU REGISTERS.
058307,000063:                                                                                                  #  THE CONTENTS OF CDUTEMP, ETC., ARE NOT TOUCHED SO THAT THEY MAY
058308,000064:                                                                                                  #  CONTINUE TO FORM A CONSISTENT SET WITH THE LATEST PIPA READINGS.
058309,000065: 
058310,000066:                                                                                                  #  CDUTRIG1 IS LIKE CDUTRIG EXCEPT THAT IT CAN BE CALLED IN BASIC.
058311,000067: 
058312,000068:                                                                                                  #  CD*TR*GS FINDS CDU VALUES IN CDUSPOT RATHER THAN IN CDUTEMP.  THIS
058313,000069:                                                                                                  #  ALLOWS USERS TO MAKE TRANSFORMATIONS USING ARBITRARY ANGLES, OR REAL
058314,000070:                                                                                                  #  ANGLES IN AN ORDER OTHER THAN X Y Z.  A CALL TO THIS ROUTINE IS
058315,000071:                                                                                                  #  NECESSARY IN PREPARATION FOR A CALL TO AX*SR*T IN EITHER OF ITS TWO
058316,000072:                                                                                                  #  MODES (SMNB OR NBSM).  SINCE AX*SR*T EXPECTS TO FIND THE SINES AND
058317,000073:                                                                                                  #  COSINES IN THE ORDER Y Z X THE ANGLES MUST HAVE BEEN PLACED IN CDUSPOT
058318,000074:                                                                                                  #  IN THIS ORDER.  CD*TR*GS NEED NOT BE REPEATED WHEN AX*SR*T IS CALLED
058319,000075:                                                                                                  #  MORE THAN ONCE, PROVIDED THE ANGLES HAVE NOT CHANGED.  NOTE THAT SINCE
058320,000076:                                                                                                  #  IT CLOBBERS BUF2 (IN THE SINE AND COSINE ROUTINES) CD*TR*GS CANNOT BE
058321,000077:                                                                                                  #  CALLED USING BANKCALL.  SORRY.
058322,000078: 
058323,000079:                                                                                                  #  CD*TR*G IS LIKE CD*TR*GS EXCEPT THAT IT CAN BE CALLED IN
058324,000080:                                                                                                  #  INTERPRETIVE.
058325,000081: 
058326,000082: 23,3432           77776        CDUTRIG            EXIT                                           
058327,000083: 23,3433           03442                           TC       CDUTRIGS                              
058328,000084: 23,3434           06006                           TC       INTPRET                               
058329,000085: 23,3435           77616                           RVQ                                            
058330,000086: 
058331,000087: 23,3436           77776        CD*TR*G            EXIT                                           
058332,000088: 23,3437           03450                           TC       CD*TR*GS                              
058333,000089: 23,3440           06006                           TC       INTPRET                               
058334,000090: 23,3441           77616                           RVQ                                            
058335,000091: 
058336,000092: 23,3442           30032        CDUTRIGS           CA       CDUX                                  
058337,000093: 23,3443           54772                           TS       CDUSPOT    +4                         
058338,000094: 23,3444           30033                           CA       CDUY                                  
058339,000095: 23,3445           54766                           TS       CDUSPOT                               

Page 1334

058341,000097: 23,3446           30034                           CA       CDUZ                                  
058342,000098: 23,3447           54770                           TS       CDUSPOT    +2                         
058343,000099: 
058344,000100: 23,3450           00006        CD*TR*GS           EXTEND                                         
058345,000101: 23,3451           22142                           QXCH     TEM2                                  
058346,000102: 23,3452           34710                           CAF      FOUR                                  
058347,000103: 23,3453           76211        TR*GL**P           MASK     SIX                                   #  MAKE IT EVEN AND SMALLER
058348,000104: 23,3454           54143                           TS       TEM3                                  
058349,000105: 23,3455           50143                           INDEX    TEM3                                  
058350,000106: 23,3456           30766                           CA       CDUSPOT                               
058351,000107: 23,3457           52155                           DXCH     MPAC                                  #  STORING 2'S COMP ANGLE, LOADING MPAC
058352,000108: 23,3460           52127                           DXCH     VBUF       +4                         #  STORING MPAC FOR LATER RESTORATION
058353,000109: 23,3461           04652                           TC       USPRCADR                              
058354,000110: 23,3462           45510                           CADR     CDULOGIC                              
058355,000111: 23,3463           00006                           EXTEND                                         
058356,000112: 23,3464           30155                           DCA      MPAC                                  
058357,000113: 23,3465           50143                           INDEX    TEM3                                  
058358,000114: 23,3466           52767                           DXCH     CDUSPOT                               #  STORING 1'S COMPLEMENT ANGLE
058359,000115: 23,3467           04652                           TC       USPRCADR                              
058360,000116: 23,3470           01516                           CADR     COSINE                                
058361,000117: 23,3471           52155                           DXCH     MPAC                                  
058362,000118: 23,3472           50143                           INDEX    TEM3                                  
058363,000119: 23,3473           52745                           DXCH     COSCDU                                #  STORING COSINE
058364,000120: 23,3474           00006                           EXTEND                                         
058365,000121: 23,3475           50143                           INDEX    TEM3                                  
058366,000122: 23,3476           30767                           DCA      CDUSPOT                               #  LOADING 1'S COMPLEMENT ANGLE
058367,000123: 23,3477           04652                           TC       USPRCADR                              
058368,000124: 23,3500           01530                           CADR     SINE       +1                         #  SINE +1 EXPECTS ARGUMENT IN A AND L
058369,000125: 23,3501           52127                           DXCH     VBUF       +4                         #  BRINGING UP PRIOR MPAC TO BE RESTORED
058370,000126: 23,3502           52155                           DXCH     MPAC                                  
058371,000127: 23,3503           50143                           INDEX    TEM3                                  
058372,000128: 23,3504           52737                           DXCH     SINCDU                                
058373,000129: 23,3505           10143                           CCS      TEM3                                  
058374,000130: 23,3506           13453                           TCF      TR*GL**P                              
058375,000131: 23,3507           00142                           TC       TEM2                                  

Page 1335

058377,000133:                                                                                                  #  ****************************************************************************************************************
058378,000134:                                                                                                  #  QUICTRIG, INTENDED FOR GUIDANCE CYCLE USE WHERE TIME IS CRITICAL, IS A MUCH FASTER VERSION OF CD*TR*GS.
058379,000135:                                                                                                  #  QUICTRIG COMPUTES AND STORES THE SINES AND COSINES OF THE 2'S COMPLEMENT ANGLES AT CDUSPOT, CDUSPOT +2,
058380,000136:                                                                                                  #  AND CDUSPOT +4.  UNLIKE CD*TR*GS, QUICTRIG DOES NOT LEAVE THE 1'S COMPLEMENT VERSIONS OF THE ANGLES IN
058381,000137:                                                                                                  #  CDUSPOT.  QUICTRIG'S EXECUTION TIME IS 4.1 MS; THIS IS 10 TIMES AS FAST AS CD*TR*GS. QUICTRIG MAY BE
058382,000138: 
058383,000139:                                                                                                  #  CALLED FROM INTERPRETIVE AS AN RTB OP-CODE, OR FROM BASIC VIA BANKCALL OR IBNKCALL.
058384,000140: 
058385,000141: 23,3510           00004        QUICTRIG           INHINT                                         #  INHINT SINCE DAP USES THE SAME TEMPS
058386,000142: 23,3511           00006                           EXTEND                                         
058387,000143: 23,3512           22061                           QXCH     ITEMP1                                
058388,000144: 23,3513           34710                           CAF      FOUR                                  
058389,000145: 23,3514           76211                 +4        MASK     SIX                                   
058390,000146: 23,3515           54062                           TS       ITEMP2                                
058391,000147: 23,3516           50062                           INDEX    ITEMP2                                
058392,000148: 23,3517           30766                           CA       CDUSPOT                               
058393,000149: 23,3520           04770                           TC       SPSIN                                 
058394,000150: 23,3521           00006                           EXTEND                                         
058395,000151: 23,3522           74675                           MP       BIT14                                 #  SCALE DOWN TO MATCH INTERPRETER OUTPUTS
058396,000152: 23,3523           50062                           INDEX    ITEMP2                                
058397,000153: 23,3524           52737                           DXCH     SINCDU                                
058398,000154: 23,3525           50062                           INDEX    ITEMP2                                
058399,000155: 23,3526           30766                           CA       CDUSPOT                               
058400,000156: 23,3527           04767                           TC       SPCOS                                 
058401,000157: 23,3530           00006                           EXTEND                                         
058402,000158: 23,3531           74675                           MP       BIT14                                 
058403,000159: 23,3532           50062                           INDEX    ITEMP2                                
058404,000160: 23,3533           52745                           DXCH     COSCDU                                
058405,000161: 23,3534           10062                           CCS      ITEMP2                                
058406,000162: 23,3535           13514                           TCF      QUICTRIG   +4                         
058407,000163: 23,3536           30061                           CA       ITEMP1                                
058408,000164: 23,3537           00003                           RELINT                                         
058409,000165: 23,3540           00000                           TC       A                                     
058410,000166: 

Page 1336

058412,000168:                                                                                                  # ****************************************************************************************************************
058413,000169:                                                                                                  #  THESE INTERFACE ROUTINES MAKE IT POSSIBLE TO CALL AX*SR*T, ETC., IN
058414,000170:                                                                                                  #  INTERPRETIVE.  LATER, WHERE POSSIBLE, THEY WILL BE ELIMINATED.
058415,000171: 
058416,000172:                                                                                                  #  NBSM WILL BE THE FIRST TO GO.  IT SHOULD NOT BE USED.
058417,000173: 
058418,000174: 23,3541           77620        NBSM               STQ                                            
058419,000175: 23,3542           00047                                    X2                                    
058420,000176: 23,3543           76740                           LXC,1    VLOAD*                                
058421,000177: 23,3544           00050                                    S1                                    #  BASE ADDRESS OF THE CDU ANGLES IS IN S1
058422,000178: 23,3545           00001                                    0,1                                   
058423,000179: 23,3546           24767                           STOVL    CDUSPOT                               
058424,000180: 23,3547           00041                                    32D                                   #  VECTOR TO BE TRANSFORMED IS IN 32D
058425,000181: 23,3550           77624                           CALL                                           
058426,000182: 23,3551           47572                                    TRG*NBSM                              
058427,000183: 23,3552           34041                           STCALL   32D                                   #  SINCE THERE'S NO STGOTO
058428,000184: 23,3553           00047                                    X2                                    
058429,000185: 
058430,000186:                                                                                                  #  THESE INTERFACE ROUTINES ARE PERMANENT.  ALL RESTORE USER'S EBANK
058431,000187:                                                                                                  #  SETTING. ALL ARE STRICT INTERPRETIVE SUBROUTINES, CALLED USING "CALL",
058432,000188:                                                                                                  #  RETURNING VIA QPRET.  ALL EXPECT AND RETURN THE VECTOR TO BE TRANSFOR-
058433,000189:                                                                                                  #  MED INTERPRETER-STYLE IN MPAC

In every other Colossus (and Luminary) version preceding or following this one, the line corresponding to the line above reads:
   MED INTERPRETER-STYLE IN MPAC; COMPONENTS AT MPAC, MPAC +3, AND MPAC +5.
I assume that the truncated line is thus a printer error. — RSB 2017.

058440,000196: 
058441,000197:                                                                                                  #  TRG*SMNB AND TRG*NBSM BOTH EXPECT TO SEE THE 2'S COMPLEMENT ANGLES
058442,000198:                                                                                                  #  AT CDUSPOT (ORDER Y Z X, AT CDUSPOT, CDUSPOT +2, AND CDUSPOT +4; ODD
058443,000199:                                                                                                  #  LOCATIONS NEED NOT BE ZEROED).  TRG*NBSM DOES THE NB TO SM TRANSFOR-
058444,000200:                                                                                                  #  MATION; TRG*SMNB, VICE VERSA.
058445,000201: 
058446,000202:                                                                                                  #  CDU*NBSM DOES ITS TRANSFORMATION USING THE PRESENT CONTENTS OF
058447,000203:                                                                                                  #  THE CDU COUNTERS.  OTHERWISE IT IS LIKE TRG*NBSM.
058448,000204: 
058449,000205:                                                                                                  #  CDU*SMNB IS THE COMPLEMENT OF CDU*NBSM.
058450,000206: 
058451,000207: 23,3554           77776        CDU*SMNB           EXIT                                           
058452,000208: 23,3555           03442                           TC       CDUTRIGS                              
058453,000209: 23,3556           13561                           TCF      C*MM*N1                               
058454,000210: 
058455,000211: 23,3557           77776        TRG*SMNB           EXIT                                           
058456,000212: 23,3560           03450                           TC       CD*TR*GS                              
058457,000213: 23,3561           07501        C*MM*N1            TC       MPACVBUF                              #  AX*SR*T EXPECTS VECTOR IN VBUF
058458,000214: 23,3562           46214                           CS       THREE                                 #  SIGNAL FOR SM TO NB TRANSFORMATION
058459,000215: 23,3563           03603        C*MM*N2            TC       AX*SR*T                               
058460,000216: 23,3564           06006                           TC       INTPRET                               
058461,000217: 23,3565           43575                           VLOAD    RVQ                                   
058462,000218: 23,3566           00123                                    VBUF                                  
058463,000219: 
058464,000220: 23,3567           77776        CDU*NBSM           EXIT                                           
058465,000221: 23,3570           03442                           TC       CDUTRIGS                              
058466,000222: 

Page 1337

058468,000224: 
058469,000225: 23,3571           13574                           TCF      C*MM*N3                               
058470,000226: 
058471,000227: 23,3572           77776        TRG*NBSM           EXIT                                           
058472,000228: 23,3573           03450                           TC       CD*TR*GS                              
058473,000229: 23,3574           07501        C*MM*N3            TC       MPACVBUF                              #  FOR AX*SR*T
058474,000230: 23,3575           36214                           CA       THREE                                 #  SIGNAL FOR NB TO SM TRANSFORMATION
058475,000231: 23,3576           13563                           TCF      C*MM*N2                               
058476,000232: 
058477,000233:                                                                                                  #  *NBSM* AND *SMNB* EXPECT TO SEE THE SINES AND COSINES (AT SINCDU
058478,000234:                                                                                                  #  AND COSCDU) RATHER THAN THE ANGLES THEMSELVES.  OTHERWISE THEY ARE
058479,000235:                                                                                                  #  LIKE TRG*NBSM AND TRG*SMNB.
058480,000236: 
058481,000237:                                                                                                  #  NOTE THAT JUST AS CD*TR*GS NEED BE CALLED ONLY ONCE FOR EACH SERIES
058482,000238:                                                                                                  #  OF TRANSFORMATIONS USING THE SAME ANGLES, SO TOO ONLY ONE OF TRG*NBSM
058483,000239:                                                                                                  #  AND TRG*SMNB NEED BE CALLED FOR EACH SERIES.  FOR SUBSEQUENT TRANSFOR-
058484,000240:                                                                                                  #  MATIONS USE *NBSM* AND *SMNB*.
058485,000241: 
058486,000242: 23,3577           77776        *SMNB*             EXIT                                           
058487,000243: 23,3600           13561                           TCF      C*MM*N1                               
058488,000244: 
058489,000245: 23,3601           77776        *NBSM*             EXIT                                           
058490,000246: 23,3602           13574                           TCF      C*MM*N3                               
058491,000247: 
058492,000248:                                                                                                  #  AX*SR*T COMBINES THE OLD SMNB AND NBSM.  FOR THE NB TO SM
058493,000249:                                                                                                  #  TRANSFORMATION, ENTER WITH +3 IN A.  FOR SM TO NB, ENTER WITH -3.
058494,000250:                                                                                                  #  THE VECTOR TO BE TRANSFORMED ARRIVES, AND IS RETURNED, IN VBUF.
058495,000251:                                                                                                  #  AX*SR*T EXPECTS TO FIND THE SINES AND COSINES OF THE ANGLES OF ROTATION
058496,000252:                                                                                                  #  AT SINCDU AND COSCDU, IN THE ORDER Y Z X.  A CALL TO CD*TR*GS, WITH
058497,000253:                                                                                                  #  THE 2'S COMPLEMENT ANGLES (ORDER Y Z X) AT CDUSPOT, WILL TAKE CARE OF
058498,000254:                                                                                                  #  THIS.  HERE IS A SAMPLE CALLING SEQUENCE:-
058499,000255:                                                                                                  #                TC      CDUTRIGS
058500,000256:                                                                                                  #                CS      THREE           ("CA THREE" FOR NBSM)
058501,000257:                                                                                                  #                TC      AX*SR*T
058502,000258:                                                                                                  #  THE CALL TO CD*TR*GS NEED NOT BE REPEATED, WHEN AX*SR*T IS CALLED MORE
058503,000259:                                                                                                  #  THAN ONCE, UNLESS THE ANGLES HAVE CHANGED.
058504,000260: 
058505,000261:                                                                                                  #  AX*SR*T IS GUARANTEED SAFE ONLY FOR VECTORS OF MAGNITUDE LESS THAN
058506,000262:                                                                                                  #  UNITY.  A LOOK AT THE CASE IN WHICH A VECTOR OF GREATER MAGNITUDE
058507,000263:                                                                                                  #  HAPPENS TO LIE ALONG AN AXIS OF THE SYSTEM TO WHICH IT IS TO BE TRANS-
058508,000264:                                                                                                  #  FORMED CONVINCES ONE THAT THIS IS A RESTRICTION WHICH MUST BE ACCEPTED.
058509,000265: 
058510,000266: 23,3603           54142        AX*SR*T            TS       DEXDEX                                #  WHERE IT BECOMES THE INDEX OF INDEXES
058511,000267: 23,3604           00006                           EXTEND                                         
058512,000268: 23,3605           22145                           QXCH     RTNSAVER                              
058513,000269: 
058514,000270: 23,3606           10142        R*TL**P            CCS      DEXDEX                                #                +3 --> 0        -3 --> 2
058515,000271: 23,3607           40142                           CS       DEXDEX                                #  THUS:         +2 --> 1        -2 --> 1
058516,000272: 23,3610           66214                           AD       THREE                                 #                +1 --> 2        -1 --> 0

Page 1338

058518,000274: 23,3611           00006                           EXTEND                                         
058519,000275: 23,3612           50000                           INDEX    A                                     
058520,000276: 23,3613           33672                           DCA      INDEXI                                
058521,000277: 23,3614           52144                           DXCH     DEXI                                  
058522,000278: 
058523,000279: 23,3615           34712                           CA       ONE                                   
058524,000280: 23,3616           54130                           TS       BUF                                   
058525,000281: 23,3617           00006                           EXTEND                                         
058526,000282: 23,3620           50143                           INDEX    DEX1                                  
058527,000283: 23,3621           40123                           DCS      VBUF                                  
058528,000284: 23,3622           13624                           TCF      LOOP1                                 #  REALLY BE A SUBTRACT, AND VICE VERSA
058529,000285: 
058530,000286: 23,3623           52131        LOOP2              DXCH     BUF                                   #  LOADING VECTOR COMPONENT, STORING INDEX
058531,000287: 
058532,000288: 23,3624           52155        LOOP1              DXCH     MPAC                                  
058533,000289: 23,3625           33670                           CA       SINSLOC                               
058534,000290: 23,3626           60143                           AD       DEX1                                  
058535,000291: 23,3627           54116                           TS       ADDRWD                                
058536,000292: 
058537,000293: 23,3630           07056                           TC       DMPSUB                                #  MULTIPLY BY SIN(CDUANGLE)
058538,000294: 23,3631           10142                           CCS      DEXDEX                                
058539,000295: 23,3632           52155                           DXCH     MPAC                                  #  NBSM CASE
058540,000296: 23,3633           13636                           TCF      +3                                    
058541,000297: 23,3634           00006                           EXTEND                                         #  SMNB CASE
058542,000298: 23,3635           40155                           DCS      MPAC                                  
058543,000299: 23,3636           52134                           DXCH     TERM1TMP                              
058544,000300: 
058545,000301: 23,3637           36211                           CA       SIX                                   #  SINCDU AND COSCDU (EACH 6 WORDS) MUST
058546,000302: 23,3640           26116                           ADS      ADDRWD                                #        BE CONSECUTIVE AND IN THAT ORDER
058547,000303: 
058548,000304: 23,3641           00006                           EXTEND                                         
058549,000305: 23,3642           50130                           INDEX    BUF                                   
058550,000306: 23,3643           50143                           INDEX    DEX1                                  
058551,000307: 23,3644           30123                           DCA      VBUF                                  
058552,000308: 23,3645           52155                           DXCH     MPAC                                  
058553,000309: 23,3646           07056                           TC       DMPSUB                                #  MULTIPLY BY COS(CDUANGLE)
058554,000310: 23,3647           52155                           DXCH     MPAC                                  
058555,000311: 23,3650           20134                           DAS      TERM1TMP                              
058556,000312: 23,3651           52134                           DXCH     TERM1TMP                              
058557,000313: 23,3652           20001                           DDOUBL                                         
058558,000314: 23,3653           50130                           INDEX    BUF                                   
058559,000315: 23,3654           50143                           INDEX    DEX1                                  
058560,000316: 23,3655           52123                           DXCH     VBUF                                  
058561,000317: 23,3656           52131                           DXCH     BUF                                   #  LOADING INDEX, STORING VECTOR COMPONENT
058562,000318: 23,3657           10000                           CCS      A                                     #  'CAUSE THAT'S WHERE THE INDEX NOW IS
058563,000319: 23,3660           13623                           TCF      LOOP2                                 
058564,000320: 
058565,000321: 23,3661           00006                           EXTEND                                         
058566,000322: 23,3662           26142                           DIM      DEXDEX                                #  DECREMENT MAGNITUDE PRESERVING SIGN
058567,000323: 

Page 1339

058569,000325: 23,3663           10142        TSTPOINT           CCS      DEXDEX                                #  ONLY THE BRANCHING FUNCTION IS USED
058570,000326: 23,3664           13606                           TCF      R*TL**P                               
058571,000327: 23,3665           00145                           TC       RTNSAVER                              
058572,000328: 23,3666           13606                           TCF      R*TL**P                               
058573,000329: 23,3667           00145                           TC       RTNSAVER                              
058574,000330: 
058575,000331: 23,3670           00736        SINSLOC            ADRES    SINCDU                                #  FOR USE IN SETTING ADDRWD
058576,000332: 
058577,000333: 23,3671           00004        INDEXI             DEC      4          B-14                       #  **********   DON'T   **********
058578,000334: 23,3672           00002                           DEC      2          B-14                       #  **********   TOUCH   **********
058579,000335: 23,3673           00000                           DEC      0          B-14                       #  **********   THESE   **********
058580,000336: 23,3674           00004                           DEC      4          B-14                       #  ********** CONSTANTS **********
058581,000337: 
058582,000338:                                                                                                  #  ****************************************************************************************************************

Page 1340

058584,000340:                                                                                                  #  THIS SUBROUTINE COMPUTES INCREMENTAL CHANGES IN CDU(GIMBAL) ANGLES FROM INCREMENTAL CHANGES ABOUT SM AXES.  IT
058585,000341:                                                                                                  #  REQUIRES SM INCREMENTS AS A DP VECTOR SCALED AT ONE REVOLUTION(DTHETASM,+2,+4).  SIN,COS(CDUY,Z,X) ARE IN
058586,000342:                                                                                                  #  SINCDU,+2,+4 AND COSCDU,+2,+4 RESPECTIVELY, SCALED TO ONE HALF.  CDU INCREENTS ARE PLACED IN DCDU,+2,+4 SCALED TO
058587,000343:                                                                                                  #  ONE REVOLUTION.
058588,000344: 
058589,000345:                                                                                                  #        *  COS(IGA)SEC(MGA)             0               -SIN(IGA)SEC(MGA) *
058590,000346:                                                                                                  #        *                                                                 *
058591,000347:                                                                                                  #        * -COS(IGA)TAN(MGA)             1                SIN(IGA)TAN(MGA) *
058592,000348:                                                                                                  #        *                                                                 *
058593,000349:                                                                                                  #        *      SIN(IGA)                 0                    COS(IGA)     *
058594,000350: 
058595,000351: 14,3405                                           BANK     14                                    
058596,000352: 23,2000                                           SETLOC   POWFLIT1                              
058597,000353: 23,2000                                           BANK                                           
058598,000354: 
058599,000355: 23,3675           41345        SMCDURES           DLOAD    DMP                                   
058600,000356: 23,3676           03212                                    DTHETASM                              
058601,000357: 23,3677           00745                                    COSCDUY                               
058602,000358: 
058603,000359: 23,3700           41325                           PDDL     DMP                                   
058604,000360: 23,3701           03216                                    DTHETASM   +4                         
058605,000361: 23,3702           00737                                    SINCDUY                               
058606,000362: 
058607,000363: 23,3703           77621                           BDSU                                           
058608,000364: 23,3704           77671                           DDV                                            
058609,000365: 23,3705           00747                                    COSCDUZ                               
058610,000366: 23,3706           03204                           STORE    DCDU                                  
058611,000367: 
058612,000368: 23,3707           72405                           DMP      SL1                                   #  SCALE
058613,000369: 23,3710           00741                                    SINCDUZ                               
058614,000370: 23,3711           77621                           BDSU                                           
058615,000371: 
058616,000372: 23,3712           03214                                    DTHETASM   +2                         
058617,000373: 23,3713           17206                           STODL    DCDU       +2                         
058618,000374: 23,3714           03212                                    DTHETASM                              
058619,000375: 
058620,000376: 23,3715           65205                           DMP      PDDL                                  
058621,000377: 23,3716           00737                                    SINCDUY                               
058622,000378: 23,3717           03216                                    DTHETASM   +4                         
058623,000379: 
058624,000380: 23,3720           43205                           DMP      DAD                                   
058625,000381: 23,3721           00745                                    COSCDUY                               
058626,000382: 23,3722           77752                           SL1                                            
058627,000383: 23,3723           03210                           STORE    DCDU       +4                         
058628,000384: 23,3724           77616                           RVQ                                            
058629,000385: 

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