Source Code

This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the second release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 97. A bug (which had been around since at least Apollo 10, Luminary 69) was discovered in Rev 0 shortly before the Apollo 11 flight, resulting in a last minute revision into Rev 1, which is what actually flew rather than the Rev 0 presented here. A hardcopy of Rev 0 is known to exist — it belonged to AGC developer Allan Klumpp for many years — but unfortunately the Virtual AGC Project has not had access to that hardcopy. Thus the code you see here had been reconstructed (we believe accurately) rather than transcribed. The first step of the reconstruction of the Rev 0 source code was the transcription of the Rev 1 source code from a hardcopy in the MIT Museum collection. The process of reverting the active portion of the source code (i.e., other than program comments) from Rev 1 to Rev 0 was very minor, consisting only of moving the position of the STARTSB1 label in FRESH START AND RESTART. Allan had previously given us the checksums of the memory banks of Rev 0, and we have verified the program presented here has checksums identical to all banks of Allan's listing of Rev 0. The notations on Allan's Rev 0 program listing read, in part:

	GAP:  ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-051

A single program comment is known to differ between Rev 0 and Rev 1, but these are harder to reconstruct and verify than changes to the active portion of the code. Thus it is possible that there are additional differences between the program comments in Rev 0 and Rev 1 that are unknown to us, and therefore are not reflected in the code presented here.

054806,000002:                                                                                                  ## Copyright:   Public domain.
054807,000003:                                                                                                  ## Filename:    POWERED_FLIGHT_SUBROUTINES.agc
054808,000004:                                                                                                  ## Purpose:     Part of the reconstructed source code for LMY99 Rev 0,
054809,000005:                                                                                                  ##              otherwise known as Luminary Rev 99, the second release
054810,000006:                                                                                                  ##              of the Apollo Guidance Computer (AGC) software for Apollo 11.
054811,000007:                                                                                                  ##              It differs from LMY99 Rev 1 (the flown version) only in the
054812,000008:                                                                                                  ##              placement of a single label. The corrections shown here have
054813,000009:                                                                                                  ##              been verified to have the same bank checksums as AGC developer
054814,000010:                                                                                                  ##              Allan Klumpp's copy of Luminary Rev 99, and so are believed
054815,000011:                                                                                                  ##              to be accurate. This file is intended to be a faithful 
054816,000012:                                                                                                  ##              recreation, except that the code format has been changed to 
054817,000013:                                                                                                  ##              conform to the requirements of the yaYUL assembler rather than 
054818,000014:                                                                                                  ##              the original YUL assembler.
054819,000015:                                                                                                  ##
054820,000016:                                                                                                  ## Assembler:   yaYUL
054821,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
054822,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo.
054823,000019:                                                                                                  ## Pages:       1259-1267
054824,000020:                                                                                                  ## Mod history: 2009-05-26 RSB  Adapted from the corresponding 
054825,000021:                                                                                                  ##                              Luminary131 file, using page 
054826,000022:                                                                                                  ##                              images from Luminary 1A.
054827,000023:                                                                                                  ##              2011-01-06 JL   Fixed pseudo-label indentation.
054828,000024:                                                                                                  ##              2016-12-17 RSB  Proofed text comments with octopus/ProoferComments
054829,000025:                                                                                                  ##                              and corrected the errors found.
054830,000026:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
054831,000027:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
054832,000028:                                                                                                  ##              2017-03-17 RSB  Comment-text fixes identified in diff'ing
054833,000029:                                                                                                  ##                              Luminary 99 vs Comanche 55.
054834,000030:                                                                                                  ##              2017-08-01 MAS  Created from LMY99 Rev 1.
054835,000031: 
054836,000032:                                                                                                  ## This source code has been transcribed or otherwise adapted from
054837,000033:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
054838,000034:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
054839,000035:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
054840,000036:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
054841,000037:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
054842,000038:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
054843,000039:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
054844,000040:                                                                                                  ## actually created.
054845,000041:                                                                                                  ##
054846,000042:                                                                                                  ## The code has been modified to match LMY99 Revision 0, otherwise
054847,000043:                                                                                                  ## known as Luminary Revision 99, the Apollo 11 software release preceeding
054848,000044:                                                                                                  ## the listing from which it was transcribed. It has been verified to
054849,000045:                                                                                                  ## contain the same bank checksums as AGC developer Allan Klumpp's listing
054850,000046:                                                                                                  ## of Luminary Revision 99 (for which we do not have scans).
054851,000047:                                                                                                  ##
054852,000048:                                                                                                  ## Notations on Allan Klumpp's listing read, in part:
054853,000049:                                                                                                  ##
054854,000050:                                                                                                  ##      ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
054855,000051: 

Page 1259

054857,000053: 14,3774                                           BANK     14                                    #  SAME FBANK AS THE FINDCDUD SUB-PROGRAM
054858,000054: 23,2000                                           SETLOC   POWFLITE                              
054859,000055: 23,2000                                           BANK                                           
054860,000056: 
054861,000057: 23,3537     0142                                  EBANK=   DEXDEX                                
054862,000058: 23,3537                                           COUNT*   $$/POWFL                              
054863,000059: 
054864,000060:                                                                                                  #  CDUTRIG, CDUTRIG1, CDUTRIG2, AND CD*TR*GS ALL COMPUTE THE SINES AND
054865,000061:                                                                                                  #  COSINES OF THREE 2'S COMPLEMENT ANGLES AND PLACE THE RESULT, DOUBLE
054866,000062:                                                                                                  #  PRECISION, IN THE SAME ORDER AS THE INPUTS, AT SINCDU AND COSCDU.  AN
054867,000063:                                                                                                  #  ADDITIONAL OUTPUT IS THE 1'S COMPLEMENT ANGLES AT CDUSPOT.  THESE
054868,000064:                                                                                                  #  ROUTINES GO OUT OF THEIR WAY TO LEAVE THE MPAC AREA AS THEY FIND IT,
054869,000065:                                                                                                  #  EXCEPT FOR THE GENERALLY UNIMPORTANT MPAC +2.  THEY DIFFER ONLY IN
054870,000066:                                                                                                  #  WHERE THEY GET THE ANGLES, AND IN METHOD OF CALLING.
054871,000067: 
054872,000068:                                                                                                  #  CDUTRIG (AND CDUTRIG1, WHICH CAN BE CALLED IN BASIC) COMPUTE THE
054873,000069:                                                                                                  #  SINES AND COSINES FROM THE CURRENT CONTENTS OF THE CDU REGISTERS.
054874,000070:                                                                                                  #  THE CONTENTS OF CDUTEMP, ETC., ARE NOT TOUCHED SO THAT THEY MAY
054875,000071:                                                                                                  #  CONTINUE TO FORM A CONSISTENT SET WITH THE LATEST PIPA READINGS.
054876,000072: 
054877,000073:                                                                                                  #  CDUTRIG1 IS LIKE CDUTRIG EXCEPT THAT IT CAN BE CALLED IN BASIC.
054878,000074: 
054879,000075:                                                                                                  #  CD*TR*GS FINDS CDU VALUES IN CDUSPOT RATHER THAN IN CDUTEMP.  THIS
054880,000076:                                                                                                  #  ALLOWS USERS TO MAKE TRANSFORMATIONS USING ARBITRARY ANGLES, OR REAL
054881,000077:                                                                                                  #  ANGLES IN AN ORDER OTHER THAN X Y Z.  A CALL TO THIS ROUTINE IS
054882,000078:                                                                                                  #  NECESSARY IN PREPARATION FOR A CALL TO AX*SR*T IN EITHER OF ITS TWO
054883,000079:                                                                                                  #  MODES (SMNB OR NBSM).  SINCE AX*SR*T EXPECTS TO FIND THE SINES AND
054884,000080:                                                                                                  #  COSINES IN THE ORDER Y Z X THE ANGLES MUST HAVE BEEN PLACED IN CDUSPOT
054885,000081:                                                                                                  #  IN THIS ORDER.  CD*TR*GS NEED NOT BE REPEATED WHEN AX*SR*T IS CALLED
054886,000082:                                                                                                  #  MORE THAN ONCE, PROVIDED THE ANGLES HAVE NOT CHANGED.  NOTE THAT SINCE
054887,000083:                                                                                                  #  IT CLOBBERS BUF2 (IN THE SINE AND COSINE ROUTINES) CD*TR*GS CANNOT BE
054888,000084:                                                                                                  #  CALLED USING BANKCALL.  SORRY.
054889,000085: 
054890,000086:                                                                                                  #  CD*TR*G IS LIKE CD*TR*GS EXCEPT THAT IT CAN BE CALLED IN
054891,000087:                                                                                                  #  INTERPRETIVE.
054892,000088: 
054893,000089: 23,3537           77776        CDUTRIG            EXIT                                           
054894,000090: 23,3540           03547                           TC       CDUTRIGS                              
054895,000091: 23,3541           06037                           TC       INTPRET                               
054896,000092: 23,3542           77616                           RVQ                                            
054897,000093: 
054898,000094: 23,3543           77776        CD*TR*G            EXIT                                           
054899,000095: 23,3544           03555                           TC       CD*TR*GS                              
054900,000096: 23,3545           06037                           TC       INTPRET                               
054901,000097: 23,3546           77616                           RVQ                                            
054902,000098: 
054903,000099: 23,3547           30032        CDUTRIGS           CA       CDUX                                  
054904,000100: 23,3550           54772                           TS       CDUSPOT    +4                         
054905,000101: 23,3551           30033                           CA       CDUY                                  
054906,000102: 23,3552           54766                           TS       CDUSPOT                               

Page 1260

054908,000104: 23,3553           30034                           CA       CDUZ                                  
054909,000105: 23,3554           54770                           TS       CDUSPOT    +2                         
054910,000106: 
054911,000107: 23,3555           00006        CD*TR*GS           EXTEND                                         
054912,000108: 23,3556           22142                           QXCH     TEM2                                  
054913,000109: 23,3557           34751                           CAF      FOUR                                  
054914,000110: 23,3560           76242        TR*GL**P           MASK     SIX                                   #  MAKE IT EVEN AND SMALLER
054915,000111: 23,3561           54143                           TS       TEM3                                  
054916,000112: 23,3562           50143                           INDEX    TEM3                                  
054917,000113: 23,3563           30766                           CA       CDUSPOT                               
054918,000114: 23,3564           52155                           DXCH     MPAC                                  #  STORING 2'S COMP ANGLE, LOADING MPAC
054919,000115: 23,3565           52127                           DXCH     VBUF       +4                         #  STORING MPAC FOR LATER RESTORATION
054920,000116: 23,3566           04713                           TC       USPRCADR                              
054921,000117: 23,3567           21576                           CADR     CDULOGIC                              
054922,000118: 23,3570           00006                           EXTEND                                         
054923,000119: 23,3571           30155                           DCA      MPAC                                  
054924,000120: 23,3572           50143                           INDEX    TEM3                                  
054925,000121: 23,3573           52767                           DXCH     CDUSPOT                               #  STORING 1'S COMPLEMENT ANGLE
054926,000122: 23,3574           04713                           TC       USPRCADR                              
054927,000123: 23,3575           01517                           CADR     COSINE                                
054928,000124: 23,3576           52155                           DXCH     MPAC                                  
054929,000125: 23,3577           50143                           INDEX    TEM3                                  
054930,000126: 23,3600           52745                           DXCH     COSCDU                                #  STORING COSINE
054931,000127: 23,3601           00006                           EXTEND                                         
054932,000128: 23,3602           50143                           INDEX    TEM3                                  
054933,000129: 23,3603           30767                           DCA      CDUSPOT                               #  LOADING 1'S COMPLEMENT ANGLE
054934,000130: 23,3604           04713                           TC       USPRCADR                              
054935,000131: 23,3605           01531                           CADR     SINE       +1                         #  SINE +1 EXPECTS ARGUMENT IN A AND L
054936,000132: 23,3606           52127                           DXCH     VBUF       +4                         #  BRINGING UP PRIOR MPAC TO BE RESTORED
054937,000133: 23,3607           52155                           DXCH     MPAC                                  
054938,000134: 23,3610           50143                           INDEX    TEM3                                  
054939,000135: 23,3611           52737                           DXCH     SINCDU                                
054940,000136: 23,3612           10143                           CCS      TEM3                                  
054941,000137: 23,3613           13560                           TCF      TR*GL**P                              
054942,000138: 23,3614           00142                           TC       TEM2                                  

Page 1261

054944,000140:                                                                                                  #  ****************************************************************************************************************
054945,000141:                                                                                                  #  QUICTRIG, INTENDED FOR GUIDANCE CYCLE USE WHERE TIME IS CRITICAL, IS A MUCH FASTER VERSION OF CD*TR*GS.
054946,000142:                                                                                                  #  QUICTRIG COMPUTES AND STORES THE SINES AND COSINES OF THE 2'S COMPLEMENT ANGLES AT CDUSPOT, CDUSPOT +2,
054947,000143:                                                                                                  #  AND CDUSPOT +4.  UNLIKE CD*TR*GS, QUICTRIG DOES NOT LEAVE THE 1'S COMPLEMENT VERSIONS OF THE ANGLES IN
054948,000144:                                                                                                  #  CDUSPOT.  QUICTRIG'S EXECUTION TIME IS 4.1 MS;  THIS IS 10 TIMES AS FAST AS CD*TR*GS.  QUICTRIG MAY BE
054949,000145:                                                                                                  #  CALLED FROM INTERPRETIVE AS AN RTB OP-CODE, OR FROM BASIC VIA BANKCALL OR IBNKCALL.
054950,000146: 
054951,000147: 23,3615           00004        QUICTRIG           INHINT                                         #  INHINT SINCE DAP USES THE SAME TEMPS
054952,000148: 23,3616           00006                           EXTEND                                         
054953,000149: 23,3617           22061                           QXCH     ITEMP1                                
054954,000150: 23,3620           34751                           CAF      FOUR                                  
054955,000151: 23,3621           76242                 +4        MASK     SIX                                   
054956,000152: 23,3622           54062                           TS       ITEMP2                                
054957,000153: 23,3623           50062                           INDEX    ITEMP2                                
054958,000154: 23,3624           30766                           CA       CDUSPOT                               
054959,000155: 23,3625           05033                           TC       SPSIN                                 
054960,000156: 23,3626           00006                           EXTEND                                         
054961,000157: 23,3627           74736                           MP       BIT14                                 #  SCALE DOWN TO MATCH INTERPRETER OUTPUTS
054962,000158: 23,3630           50062                           INDEX    ITEMP2                                
054963,000159: 23,3631           52737                           DXCH     SINCDU                                
054964,000160: 23,3632           50062                           INDEX    ITEMP2                                
054965,000161: 23,3633           30766                           CA       CDUSPOT                               
054966,000162: 23,3634           05032                           TC       SPCOS                                 
054967,000163: 23,3635           00006                           EXTEND                                         
054968,000164: 23,3636           74736                           MP       BIT14                                 
054969,000165: 23,3637           50062                           INDEX    ITEMP2                                
054970,000166: 23,3640           52745                           DXCH     COSCDU                                
054971,000167: 23,3641           10062                           CCS      ITEMP2                                
054972,000168: 23,3642           13621                           TCF      QUICTRIG   +4                         
054973,000169: 23,3643           30061                           CA       ITEMP1                                
054974,000170: 23,3644           00003                           RELINT                                         
054975,000171: 23,3645           00000                           TC       A                                     
054976,000172: 

Page 1262

054978,000174:                                                                                                  #  ****************************************************************************************************************
054979,000175:                                                                                                  #  THESE INTERFACE ROUTINES MAKE IT POSSIBLE TO CALL AX*SR*T, ETC., IN
054980,000176:                                                                                                  #  INTERPRETIVE.  LATER, WHERE POSSIBLE, THEY WILL BE ELIMINATED.
054981,000177: 
054982,000178:                                                                                                  #  THESE INTERFACE ROUTINES ARE PERMANENT.  ALL RESTORE USER'S EBANK
054983,000179:                                                                                                  #  SETTING. ALL ARE STRICT INTERPRETIVE SUBROUTINES, CALLED USING "CALL",
054984,000180:                                                                                                  #  RETURNING VIA QPRET.  ALL EXPECT AND RETURN THE VECTOR TO BE TRANSFOR-
054985,000181:                                                                                                  #  MED INTERPRETER-STYLE IN MPAC; COMPONENTS AT MPAC, MPAC +3, AND MPAC +5.
054986,000182: 
054987,000183:                                                                                                  #  TRG*SMNB AND TRG*NBSM BOTH EXPECT TO SEE THE 2'S COMPLEMENT ANGLES
054988,000184:                                                                                                  #  AT CDUSPOT (ORDER Y Z X, AT CDUSPOT, CDUSPOT +2, AND CDUSPOT +4; ODD
054989,000185:                                                                                                  #  LOCATIONS NEED NOT BE ZEROED).  TRG*NBSM DOES THE NB TO SM TRANSFOR-
054990,000186:                                                                                                  #  MATION;  TRG*SMNB, VICE VERSA.
054991,000187: 
054992,000188:                                                                                                  #  CDU*NBSM DOES ITS TRANSFORMATION USING THE PRESENT CONTENTS OF
054993,000189:                                                                                                  #  THE CDU COUNTERS.  OTHERWISE IT IS LIKE TRG*NBSM.
054994,000190: 
054995,000191:                                                                                                  #  CDU*SMNB IS THE COMPLEMENT OF CDU*NBSM.
054996,000192: 
054997,000193: 23,3646           77776        CDU*SMNB           EXIT                                           
054998,000194: 23,3647           03547                           TC       CDUTRIGS                              
054999,000195: 23,3650           13653                           TCF      C*MM*N1                               
055000,000196: 
055001,000197: 23,3651           77776        TRG*SMNB           EXIT                                           
055002,000198: 23,3652           03555                           TC       CD*TR*GS                              
055003,000199: 23,3653           07532        C*MM*N1            TC       MPACVBUF                              #  AX*SR*T EXPECTS VECTOR IN VBUF
055004,000200: 23,3654           46245                           CS       THREE                                 #  SIGNAL FOR SM TO NB TRANSFORMATION
055005,000201: 23,3655           03675        C*MM*N2            TC       AX*SR*T                               
055006,000202: 23,3656           06037                           TC       INTPRET                               
055007,000203: 23,3657           43575                           VLOAD    RVQ                                   
055008,000204: 23,3660           00123                                    VBUF                                  
055009,000205: 
055010,000206: 23,3661           77776        CDU*NBSM           EXIT                                           
055011,000207: 23,3662           03547                           TC       CDUTRIGS                              
055012,000208: 23,3663           13666                           TCF      C*MM*N3                               
055013,000209: 
055014,000210: 23,3664           77776        TRG*NBSM           EXIT                                           
055015,000211: 23,3665           03555                           TC       CD*TR*GS                              
055016,000212: 23,3666           07532        C*MM*N3            TC       MPACVBUF                              #  FOR AX*SR*T
055017,000213: 23,3667           36245                           CA       THREE                                 #  SIGNAL FOR NB TO SM TRANSFORMATION
055018,000214: 23,3670           13655                           TCF      C*MM*N2                               
055019,000215: 
055020,000216:                                                                                                  #  *NBSM* AND *SMNB* EXPECT TO SEE THE SINES AND COSINES (AT SINCDU
055021,000217:                                                                                                  #  AND COSCDU) RATHER THAN THE ANGLES THEMSELVES.  OTHERWISE THEY ARE
055022,000218:                                                                                                  #  LIKE TRG*NBSM AND TRG*SMNB.
055023,000219: 
055024,000220:                                                                                                  #  NOTE THAT JUST AS CD*TR*GS NEED BE CALLED ONLY ONCE FOR EACH SERIES
055025,000221:                                                                                                  #  OF TRANSFORMATIONS USING THE SAME ANGLES, SO TOO ONLY ONE OF TRG*NBSM

Page 1263

055027,000223:                                                                                                  #  AND TRG*SMNB NEED BE CALLED FOR EACH SERIES.  FOR SUBSEQUENT TRANSFOR-
055028,000224:                                                                                                  #  MATIONS USE *NBSM* AND *SMNB*.
055029,000225: 
055030,000226: 23,3671           77776        *SMNB*             EXIT                                           
055031,000227: 23,3672           13653                           TCF      C*MM*N1                               
055032,000228: 
055033,000229: 23,3673           77776        *NBSM*             EXIT                                           
055034,000230: 23,3674           13666                           TCF      C*MM*N3                               
055035,000231: 
055036,000232:                                                                                                  #  AX*SR*T COMBINES THE OLD SMNB AND NBSM.  FOR THE NB TO SM
055037,000233:                                                                                                  #  TRANSFORMATION, ENTER WITH +3 IN A.  FOR SM TO NB, ENTER WITH -3.
055038,000234:                                                                                                  #  THE VECTOR TO BE TRANSFORMED ARRIVES, AND IS RETURNED, IN VBUF.
055039,000235:                                                                                                  #  AX*SR*T EXPECTS TO FIND THE SINES AND COSINES OF THE ANGLES OF ROTATION
055040,000236:                                                                                                  #  AT SINCDU AND COSCDU, IN THE ORDER Y Z X.  A CALL TO CD*TR*GS, WITH
055041,000237:                                                                                                  #  THE 2'S COMPLEMENT ANGLES (ORDER Y Z X) AT CDUSPOT, WILL TAKE CARE OF
055042,000238:                                                                                                  #  THIS.  HERE IS A SAMPLE CALLING SEQUENCE:-
055043,000239:                                                                                                  #                TC      CDUTRIGS
055044,000240:                                                                                                  #                CS      THREE           ("CA THREE" FOR NBSM)
055045,000241:                                                                                                  #                TC      AX*SR*T
055046,000242:                                                                                                  #  THE CALL TO CD*TR*GS NEED NOT BE REPEATED, WHEN AX*SR*T IS CALLED MORE
055047,000243:                                                                                                  #  THAN ONCE, UNLESS THE ANGLES HAVE CHANGED.
055048,000244: 
055049,000245:                                                                                                  #  AX*SR*T IS GUARANTEED SAFE ONLY FOR VECTORS OF MAGNITUDE LESS THAN
055050,000246:                                                                                                  #  UNITY.  A LOOK AT THE CASE IN WHICH A VECTOR OF GREATER MAGNITUDE
055051,000247:                                                                                                  #  HAPPENS TO LIE ALONG AN AXIS OF THE SYSTEM TO WHICH IT IS TO BE TRANS-
055052,000248:                                                                                                  #  FORMED CONVINCES ONE THAT THIS IS A RESTRICTION WHICH MUST BE ACCEPTED.
055053,000249: 
055054,000250: 23,3675           54142        AX*SR*T            TS       DEXDEX                                #  WHERE IT BECOMES THE INDEX OF INDEXES
055055,000251: 23,3676           00006                           EXTEND                                         
055056,000252: 23,3677           22145                           QXCH     RTNSAVER                              
055057,000253: 
055058,000254: 23,3700           10142        R*TL**P            CCS      DEXDEX                                #                +3 --> 0        -3 --> 2
055059,000255: 23,3701           40142                           CS       DEXDEX                                #  THUS:         +2 --> 1        -2 --> 1
055060,000256: 23,3702           66245                           AD       THREE                                 #                +1 --> 2        -1 --> 0
055061,000257: 23,3703           00006                           EXTEND                                         
055062,000258: 23,3704           50000                           INDEX    A                                     
055063,000259: 23,3705           33764                           DCA      INDEXI                                
055064,000260: 23,3706           52144                           DXCH     DEXI                                  
055065,000261: 
055066,000262: 23,3707           34753                           CA       ONE                                   
055067,000263: 23,3710           54130                           TS       BUF                                   
055068,000264: 23,3711           00006                           EXTEND                                         
055069,000265: 23,3712           50143                           INDEX    DEX1                                  
055070,000266: 23,3713           40123                           DCS      VBUF                                  
055071,000267: 23,3714           13716                           TCF      LOOP1                                 #  REALLY BE A SUBTRACT, AND VICE VERSA
055072,000268: 
055073,000269: 23,3715           52131        LOOP2              DXCH     BUF                                   #  LOADING VECTOR COMPONENT, STORING INDEX

Page 1264

055075,000271: 23,3716           52155        LOOP1              DXCH     MPAC                                  
055076,000272: 23,3717           33762                           CA       SINSLOC                               
055077,000273: 23,3720           60143                           AD       DEX1                                  
055078,000274: 23,3721           54116                           TS       ADDRWD                                
055079,000275: 
055080,000276: 23,3722           07107                           TC       DMPSUB                                #  MULTIPLY BY SIN(CDUANGLE)
055081,000277: 23,3723           10142                           CCS      DEXDEX                                
055082,000278: 23,3724           52155                           DXCH     MPAC                                  #  NBSM CASE
055083,000279: 23,3725           13730                           TCF      +3                                    
055084,000280: 23,3726           00006                           EXTEND                                         #  SMNB CASE
055085,000281: 23,3727           40155                           DCS      MPAC                                  
055086,000282: 23,3730           52160                           DXCH     TERM1TMP                              
055087,000283: 
055088,000284: 23,3731           36242                           CA       SIX                                   #  SINCDU AND COSCDU (EACH 6 WORDS) MUST
055089,000285: 23,3732           26116                           ADS      ADDRWD                                #        BE CONSECUTIVE AND IN THAT ORDER
055090,000286: 
055091,000287: 23,3733           00006                           EXTEND                                         
055092,000288: 23,3734           50130                           INDEX    BUF                                   
055093,000289: 23,3735           50143                           INDEX    DEX1                                  
055094,000290: 23,3736           30123                           DCA      VBUF                                  
055095,000291: 23,3737           52155                           DXCH     MPAC                                  
055096,000292: 23,3740           07107                           TC       DMPSUB                                #  MULTIPLY BY COS(CDUANGLE)
055097,000293: 23,3741           52155                           DXCH     MPAC                                  
055098,000294: 23,3742           20160                           DAS      TERM1TMP                              
055099,000295: 23,3743           52160                           DXCH     TERM1TMP                              
055100,000296: 23,3744           20001                           DDOUBL                                         
055101,000297: 23,3745           50130                           INDEX    BUF                                   
055102,000298: 23,3746           50143                           INDEX    DEX1                                  
055103,000299: 23,3747           52123                           DXCH     VBUF                                  
055104,000300: 23,3750           52131                           DXCH     BUF                                   #  LOADING INDEX, STORING VECTOR COMPONENT
055105,000301: 
055106,000302: 23,3751           10000                           CCS      A                                     #  'CAUSE THAT'S WHERE THE INDEX NOW IS
055107,000303: 23,3752           13715                           TCF      LOOP2                                 
055108,000304: 
055109,000305: 23,3753           00006                           EXTEND                                         
055110,000306: 23,3754           26142                           DIM      DEXDEX                                #  DECREMENT MAGNITUDE PRESERVING SIGN
055111,000307: 
055112,000308: 23,3755           10142        TSTPOINT           CCS      DEXDEX                                #  ONLY THE BRANCHING FUNCTION IS USED
055113,000309: 23,3756           13700                           TCF      R*TL**P                               
055114,000310: 23,3757           00145                           TC       RTNSAVER                              
055115,000311: 23,3760           13700                           TCF      R*TL**P                               
055116,000312: 23,3761           00145                           TC       RTNSAVER                              
055117,000313: 
055118,000314: 23,3762           00736        SINSLOC            ADRES    SINCDU                                #  FOR USE IN SETTING ADDRWD
055119,000315: 
055120,000316: 23,3763           00004        INDEXI             DEC      4          B-14                       #  **********   DON'T   **********
055121,000317: 23,3764           00002                           DEC      2          B-14                       #  **********   TOUCH   **********
055122,000318: 23,3765           00000                           DEC      0          B-14                       #  **********   THESE   **********

Page 1265

055124,000320: 23,3766           00004                           DEC      4          B-14                       #  ********** CONSTANTS **********
055125,000321: 
055126,000322:                                                                                                  #  ****************************************************************************************************************
055127,000323: 
055128,000324: 10,2030                                           BANK     10                                    
055129,000325: 10,2000                                           SETLOC   FLESHLOC                              
055130,000326: 10,2000                                           BANK                                           
055131,000327: 10,2030                                           COUNT*   $$/POWFL                              
055132,000328: 
055133,000329:                                                                                                  #  ROUTINE FLESHPOT COMPUTES THE BODY-STABLE MEMBER TRANSFORMATION MATRIX (COMMONLY CALLED XNB) AND STORES
055134,000330:                                                                                                  #  IT IN THE LOCATIONS SPECIFIED BY THE ECADR ENTERING IN A.
055135,000331: 
055136,000332: 10,2030           77776        CALCSMSC           EXIT                                           
055137,000333: 10,2031           04616                           TC       BANKCALL                              
055138,000334: 10,2032           20036                           CADR     FLESHPOT   -1                         
055139,000335: 10,2033           06037                           TC       INTPRET                               
055140,000336: 10,2034           77616                           RVQ                                            
055141,000337: 
055142,000338: 10,2035           02664        XNBECADR           ECADR    XNB                                   
055143,000339: 
055144,000340: 10,2036           32035                 -1        CAF      XNBECADR                              
055145,000341: 
055146,000342: 10,2037           54142        FLESHPOT           TS       TEM2                                  
055147,000343: 10,2040           56003                           XCH      EBANK                                 
055148,000344: 10,2041           56142                           XCH      TEM2                                  
055149,000345: 10,2042           74357                           MASK     LOW8                                  
055150,000346: 10,2043           65007                           AD       OCT1400                               
055151,000347: 10,2044           54141                           TS       TEM1                                  
055152,000348: 
055153,000349: 10,2045           00006                           EXTEND                                         
055154,000350: 10,2046           30745                           DCA      COSCDUY                               
055155,000351: 10,2047           52155                           DXCH     MPAC                                  
055156,000352: 10,2050           07103                           TC       DMP                                   
055157,000353: 10,2051           00746                           ADRES    COSCDUZ                               
055158,000354: 10,2052           52155                           DXCH     MPAC                                  
055159,000355: 10,2053           20001                           DDOUBL                                         
055160,000356: 10,2054           50141                           INDEX    TEM1                                  
055161,000357: 10,2055           52001                           DXCH     0                                     #  = COSY COSZ
055162,000358: 
055163,000359: 10,2056           00006                           EXTEND                                         
055164,000360: 10,2057           30741                           DCA      SINCDUZ                               
055165,000361: 10,2060           50141                           INDEX    TEM1                                  
055166,000362: 10,2061           52003                           DXCH     2                                     #  = SINZ
055167,000363: 
055168,000364: 10,2062           00006                           EXTEND                                         
055169,000365: 10,2063           40737                           DCS      SINCDUY                               
055170,000366: 10,2064           52155                           DXCH     MPAC                                  
055171,000367: 10,2065           07107                           TC       DMPSUB                                #  ADDRWD SET TO COSCDUZ

Page 1266

055173,000369: 10,2066           52155                           DXCH     MPAC                                  
055174,000370: 10,2067           20001                           DDOUBL                                         
055175,000371: 10,2070           50141                           INDEX    TEM1                                  
055176,000372: 10,2071           52005                           DXCH     4                                     #  = - SINY COSZ
055177,000373: 
055178,000374: 10,2072           00006                           EXTEND                                         
055179,000375: 10,2073           40743                           DCS      SINCDUX                               
055180,000376: 10,2074           52155                           DXCH     MPAC                                  
055181,000377: 10,2075           07107                           TC       DMPSUB                                #  ADDRWD SET TO COSCDUZ STILL
055182,000378: 10,2076           52155                           DXCH     MPAC                                  
055183,000379: 10,2077           20001                           DDOUBL                                         
055184,000380: 10,2100           52160                           DXCH     MPAC       +3                         
055185,000381: 
055186,000382: 10,2101           00006                           EXTEND                                         
055187,000383: 10,2102           40743                           DCS      SINCDUX                               
055188,000384: 10,2103           52155                           DXCH     MPAC                                  
055189,000385: 10,2104           07103                           TC       DMP                                   
055190,000386: 10,2105           00740                           ADRES    SINCDUZ                               
055191,000387: 10,2106           00006                           EXTEND                                         
055192,000388: 10,2107           40155                           DCS      MPAC                                  
055193,000389: 10,2110           52162                           DXCH     MPAC       +5                         
055194,000390: 10,2111           07103                           TC       DMP                                   
055195,000391: 10,2112           00736                           ADRES    SINCDUY                               
055196,000392: 10,2113           52155                           DXCH     MPAC                                  
055197,000393: 10,2114           20001                           DDOUBL                                         
055198,000394: 10,2115           20001                           DDOUBL                                         
055199,000395: 10,2116           52162                           DXCH     MPAC       +5                         
055200,000396: 
055201,000397: 10,2117           52155                           DXCH     MPAC                                  
055202,000398: 10,2120           07103                           TC       DMP                                   
055203,000399: 10,2121           00744                           ADRES    COSCDUY                               
055204,000400: 10,2122           52155                           DXCH     MPAC                                  
055205,000401: 10,2123           20001                           DDOUBL                                         
055206,000402: 10,2124           20001                           DDOUBL                                         
055207,000403: 10,2125           52131                           DXCH     BUF                                   
055208,000404: 
055209,000405: 10,2126           00006                           EXTEND                                         
055210,000406: 10,2127           30745                           DCA      COSCDUY                               
055211,000407: 10,2130           52155                           DXCH     MPAC                                  
055212,000408: 10,2131           07103                           TC       DMP                                   
055213,000409: 10,2132           00750                           ADRES    COSCDUX                               
055214,000410: 10,2133           52155                           DXCH     MPAC                                  
055215,000411: 10,2134           20001                           DDOUBL                                         
055216,000412: 10,2135           20162                           DAS      MPAC       +5                         
055217,000413: 
055218,000414: 10,2136           00006                           EXTEND                                         
055219,000415: 10,2137           30737                           DCA      SINCDUY                               
055220,000416: 10,2140           52155                           DXCH     MPAC                                  
055221,000417: 10,2141           07107                           TC       DMPSUB                                #  ADDRWD SET TO COSCDUX
055222,000418: 10,2142           52155                           DXCH     MPAC                                  
055223,000419: 

Page 1267

055225,000421: 10,2143           20001                           DDOUBL                                         
055226,000422: 10,2144           20131                           DAS      BUF                                   
055227,000423: 
055228,000424: 10,2145           52131                           DXCH     BUF                                   
055229,000425: 10,2146           52155                           DXCH     MPAC                                  
055230,000426: 
055231,000427: 10,2147           00006                           EXTEND                                         
055232,000428: 10,2150           30155                           DCA      MPAC                                  
055233,000429: 10,2151           50141                           INDEX    TEM1                                  
055234,000430: 10,2152           52015                           DXCH     14                                    #  = SINY COSX + SINX SINZ COSY
055235,000431: 
055236,000432: 10,2153           00006                           EXTEND                                         
055237,000433: 10,2154           30160                           DCA      MPAC       +3                         
055238,000434: 10,2155           50141                           INDEX    TEM1                                  
055239,000435: 10,2156           52017                           DXCH     16                                    #  = - SINX COSZ
055240,000436: 
055241,000437: 10,2157           00006                           EXTEND                                         
055242,000438: 10,2160           30162                           DCA      MPAC       +5                         
055243,000439: 10,2161           50141                           INDEX    TEM1                                  
055244,000440: 10,2162           52021                           DXCH     20                                    #  = COSX COSY - SINX SINY SINZ
055245,000441: 
055246,000442: 10,2163           30141                           CA       TEM1                                  
055247,000443: 10,2164           54116                           TS       ADDRWD                                
055248,000444: 10,2165           00006                           EXTEND                                         
055249,000445: 10,2166           30006                           DCA      Z                                     
055250,000446: 10,2167           64751                           AD       FOUR                                  
055251,000447: 10,2170           52165                           DXCH     LOC                                   
055252,000448: 10,2171           34744                           CAF      BIT8                                  
055253,000449: 10,2172           54023                           TS       EDOP                                  
055254,000450: 10,2173           17460                           TCF      VXV                                   
055255,000451: 10,2174           52155                           DXCH     MPAC                                  
055256,000452: 10,2175           20001                           DDOUBL                                         
055257,000453: 10,2176           50141                           INDEX    TEM1                                  
055258,000454: 10,2177           52007                           DXCH     6                                     
055259,000455: 
055260,000456: 10,2200           52160                           DXCH     MPAC       +3                         
055261,000457: 10,2201           20001                           DDOUBL                                         
055262,000458: 10,2202           50141                           INDEX    TEM1                                  
055263,000459: 10,2203           52011                           DXCH     10                                    
055264,000460: 
055265,000461: 10,2204           52162                           DXCH     MPAC       +5                         
055266,000462: 10,2205           20001                           DDOUBL                                         
055267,000463: 10,2206           50141                           INDEX    TEM1                                  
055268,000464: 10,2207           52013                           DXCH     12                                    
055269,000465: 
055270,000466: 10,2210           30142                           CA       TEM2                                  
055271,000467: 10,2211           54003                           TS       EBANK                                 
055272,000468: 10,2212           14631                           TCF      SWRETURN                              
055273,000469: 

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