Source Code

These source-code files were transcribed from a printout in Don Eyles's personal collection, scanned by archive.org, and financially sponsored by Peter McDermott. A team of volunteers performed the transcription and proof-reading. The scanned page images are available at the Virtual AGC Project website, as well as higher-quality (but much larger) images at the Virtual AGC Project's collection in the Internet Archive. Report any problems by creating "issues" at the Virtual AGC Project's GitHub Repository.

Notations on the program listing read, in part:

	YUL SYSTEM FOR AGC: NEW PROGRAM SHEPATIN BY EYLES
	DEC 13, 1966

	THIS PROGRAM WAS ASSEMBLED AS A VERSION OF REVISION 37 
        OF PROGRAM SUNBURST BY LEM GROUP
Note that the date is the date of the printout, not the date of the program revision.

035297,000002:                                                                                                  ## Copyright:   Public domain.
035298,000003:                                                                                                  ## Filename:    FIND_CDU_DESIRED.agc
035299,000004:                                                                                                  ## Purpose:     A section of Sunburst revision 37, or Shepatin revision 0.
035300,000005:                                                                                                  ##              It is part of an early development version of the software
035301,000006:                                                                                                  ##              for Apollo Guidance Computer (AGC) on the unmanned Lunar
035302,000007:                                                                                                  ##              Module (LM) flight Apollo 5. Sunburst 37 was the program
035303,000008:                                                                                                  ##              upon which Don Eyles's offline development program Shepatin
035304,000009:                                                                                                  ##              was based; the listing herein transcribed was actually for
035305,000010:                                                                                                  ##              the equivalent revision 0 of Shepatin.
035306,000011:                                                                                                  ##              This file is intended to be a faithful transcription, except
035307,000012:                                                                                                  ##              that the code format has been changed to conform to the
035308,000013:                                                                                                  ##              requirements of the yaYUL assembler rather than the
035309,000014:                                                                                                  ##              original YUL assembler.
035310,000015:                                                                                                  ## Reference:   pp. 784-787
035311,000016:                                                                                                  ## Assembler:   yaYUL
035312,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
035313,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
035314,000019:                                                                                                  ## Mod history: 2017-05-24 MAS  Created from Sunburst 120.
035315,000020:                                                                                                  ##              2017-06-14 HG   Transcribed
035316,000021:                                                                                                  ##              2017-06-23 RSB  Proofed comment text with
035317,000022:                                                                                                  ##                              octopus/ProoferComments.
035318,000023: 

Page 784

035320,000025:                                                                                                  #  THIS ROUTINE FINDCDUD COMPUTES DESIRED CDU,S WHICH CAN BE FED TO
035321,000026:                                                                                                  #  DAP LATER ON.
035322,000027: 
035323,000028:                                                                                                  #  DESIRED CDU,S WILL BE IN 2,S COMP
035324,000029: 
035325,000030:                                                                                                  #  INPUT
035326,000031: 
035327,000032:                                                                                                  #  DESIRED THRUST VECTOR AXISD COMING FROM GUIDANCE EQUATIONS
035328,000033:                                                                                                  #  CDUX,CDUY,CDUZ INFORM OF A SP VECTOR CDUTEMP,+2,+4.
035329,000034:                                                                                                  #  DELV HALF UNIT VECTOR. PIPAS READING
035330,000035:                                                                                                  #  AXISD IS A HALF UNIT VECTOR
035331,000036:                                                                                                  #  CDUX,Y,Z  ARE IN 2,S COMP
035332,000037: 
035333,000038: 
035334,000039:                                                                                                  #  THIS ROUTINE CAN BE ENTERED FROM INTERPRETIVE . CALL FINDCDUD
035335,000040: 
035336,000041:                                                                                                  #  CALLING SEQUENCE
035337,000042:                                                                                                  #  L-1  CALL
035338,000043:                                                                                                  #  L        FINDCDUD
035339,000044:                                                                                                  #  L+1              INTERPRETIVE RETURN
035340,000045: 
035341,000046: 
035342,000047: 
035343,000048:                                                                                                  #  USER TO HAVE A UNIT VECTOR  AXIS   (1,0,0)
035344,000049: 
035345,000050: 
035346,000051: 
035347,000052: 30,2637                                           BANK     30                                    
035348,000053: 30,2637  E4,1452                                  EBANK=   DELR                                  
035349,000054: 30,2637           24276 14076  2/PI               2DEC     .6366198                              
035350,000055: 
035351,000056: 30,2641           00002 00545  LIMOMG             2DEC     .0001234                              
035352,000057: 
035353,000058: 
035354,000059: 
035355,000060: 30,2643           77401        FINDCDUD           SETPD    EXIT                                  
035356,000061: 30,2644           00001                                    0                                     
035357,000062: 30,2645           31344                           CA       CDUTEMP    +2                         
035358,000063: 30,2646           55654                           TS       SINCDU                                #  TEMPORARY LOCATION FOR CDUY
035359,000064: 30,2647           31346                           CA       CDUTEMP    +4                         
035360,000065: 30,2650           55656                           TS       SINCDU     +2                         #  TEMPORARY LOCATION FOR CDUZ
035361,000066: 30,2651           31342                           CA       CDUTEMP                               
035362,000067: 30,2652           55660                           TS       SINCDU     +4                         #  TEMPORARY LOCATION FOR CDUX
035363,000068: 
035364,000069: 
035365,000070: 
035366,000071:                                                                                                  #  AXISFILT   COMPUTES AXIS AND CORRECTS IT FOR  QUANTIZATION ERROR AND OTH
035367,000072:                                                                                                  #  ER ERRORS
035368,000073: 
035369,000074: 
035370,000075: 30,2653  E6,1423                                  EBANK=   OMEGA                                 
035371,000076: 30,2653           35650                           CAF      PRIO3                                 #  OCT  03000     SWITCH EBANK
035372,000077: 

Page 785

035374,000079: 30,2654           56003                           XCH      EBANK                                 
035375,000080: 30,2655           54144                           TS       MPAC                                  
035376,000081: 30,2656           37761                           CAF      ZERO                                  
035377,000082: 30,2657           55154                           TS       TEMX                                  #  SQOMEGA
035378,000083: 30,2660           55155                           TS       TEMX       +1                         #  SQOMEGA  +1
035379,000084: 30,2661           00004                           INHINT                                         
035380,000085: 30,2662           31416                           CAE      OMEGAP                                
035381,000086: 30,2663           00006                           EXTEND                                         
035382,000087: 
035383,000088: 30,2664           70000                           SQUARE                                         
035384,000089: 30,2665           21155                           DAS      TEMX                                  #  SQOMEGA
035385,000090: 30,2666           31417                           CAE      OMEGAQ                                
035386,000091: 30,2667           00006                           EXTEND                                         
035387,000092: 30,2670           70000                           SQUARE                                         
035388,000093: 30,2671           21155                           DAS      TEMX                                  #  SQOMEGA
035389,000094: 30,2672           31421                           CAE      OMEGAR                                
035390,000095: 30,2673           00006                           EXTEND                                         
035391,000096: 30,2674           70000                           SQUARE                                         
035392,000097: 30,2675           21155                           DAS      TEMX                                  #  SQOMEGA
035393,000098: 
035394,000099: 30,2676           00003                           RELINT                                         
035395,000100: 30,2677           56144                           XCH      MPAC                                  
035396,000101: 30,2700           54003                           TS       EBANK                                 
035397,000102: 30,2701           06103                           TC       INTPRET                               
035398,000103: 30,2702  E4,1452                                  EBANK=   DELR                                  
035399,000104: 30,2702           77620                           STQ                                            
035400,000105: 30,2703           00047                                    RETSAVE                               
035401,000106: 30,2704           45345        AXISFILT           DLOAD    DSU                                   
035402,000107: 
035403,000108: 
035404,000109: 
035405,000110: 30,2705           01155                                    TEMX                                  #  SQOMEGA
035406,000111: 
035407,000112: 30,2706           20642                                    LIMOMG                                
035408,000113: 30,2707           72044                           BPL      LXA,1                                 
035409,000114: 30,2710           60734                                    ROTANGLE                              
035410,000115: 30,2711           00110                                    FIXLOC                                
035411,000116: 30,2712           64110                           INCR,1   XCHX,1                                
035412,000117: 30,2713           00024                                    20D                                   
035413,000118: 30,2714           00050                                    S1                                    
035414,000119: 30,2715           77775                           VLOAD                                          
035415,000120: 30,2716           02255                                    SINCDU                                #  TEMPORARY LOCATION FOR CDUY,Z,X IN
035416,000121: 30,2717           00025                           STORE    20D                                   #  SP  2,S COMP
035417,000122: 
035418,000123: 30,2720           53575                           VLOAD    UNIT                                  
035419,000124: 30,2721           00404                                    DELV                                  
035420,000125: 30,2722           00041                           STORE    32D                                   
035421,000126: 30,2723           77624                           CALL                                           
035422,000127: 30,2724           32576                                    SMNB                                  #  TRANSFORM DELV FROM SM TO NB
035423,000128: 30,2725           52201                           SETPD    VSU                                   
035424,000129: 30,2726           00001                                    0                                     
035425,000130: 30,2727           02241                                    AXIS                                  
035426,000131: 30,2730           53322                           VSR3     VAD                                   
035427,000132: 30,2731           02241                                    AXIS                                  
035428,000133: 

Page 786

035430,000135: 30,2732           77656                           UNIT                                           
035431,000136: 
035432,000137: 30,2733           02241                           STORE    AXIS                                  
035433,000138: 30,2734           62150        ROTANGLE           LXA,1    INCR,1                                
035434,000139: 30,2735           00110                                    FIXLOC                                
035435,000140: 30,2736           00024                                    20D                                   
035436,000141: 30,2737           77320                           XCHX,1   VLOAD                                 
035437,000142: 30,2740           00050                                    S1                                    
035438,000143: 30,2741           02255                                    SINCDU                                #  TEMPORARY LOCATION FOR CDUY,Z,X IN
035439,000144: 30,2742           00025                           STORE    20D                                   #  SP  2,S COMP
035440,000145: 30,2743           77775                           VLOAD                                          
035441,000146: 30,2744           02241                                    AXIS                                  
035442,000147: 30,2745           00041                           STORE    32D                                   
035443,000148: 30,2746           77624                           CALL                                           #  TRANSFORM  AXIS FROM NB TO SM
035444,000149: 
035445,000150: 30,2747           32622                                    NBSM                                  
035446,000151: 30,2750           47201                           SETPD    VXV                                   
035447,000152: 30,2751           00001                                    0                                     
035448,000153: 30,2752           02233                                    AXISD                                 
035449,000154: 30,2753           77761                           VXSC                                           
035450,000155: 30,2754           20640                                    2/PI                                  
035451,000156: 30,2755           00013                           STORE    10D                                   #  DTHETASM  SCALETO ONE REVOLUTION
035452,000157: 30,2756           77624                           CALL                                           #  COMPUTE SIN AND COS OF CDUS FOR
035453,000158: 30,2757           61024                                    SINCOSCD                              #  LATER USE
035454,000159: 
035455,000160: 
035456,000161: 
035457,000162:                                                                                                  #  SMCDURES     COMPUTES CDU(GIMBAL) ANGLES FROM INCREMENTAL
035458,000163:                                                                                                  #  CHANGES ABOUT SM AXES.    IT REQUIRES  SM  INCREMENTAL CHANGES
035459,000164:                                                                                                  #  AS DP  VECTOR SCALED AT  ONE REVOLUTION(DTHETASM,+2,+4).  SIN,COS(CDUX,Y
035460,000165:                                                                                                  #  ,Z)   ARE IN SINCDU,+2,+4 AND COSCDU,+2,+4  RESPECTIVELY,SCALED TO 2.
035461,000166:                                                                                                  #  CDU INCREMENTS  ARE PLACED IN DCDU,+2,+4   SCALED TO ONE REVOLUTION
035462,000167: 
035463,000168: 
035464,000169: 
035465,000170: 30,2760           41345        SMCDURES           DLOAD    DMP                                   
035466,000171: 30,2761           00013                                    10D                                   #  DTHETASM
035467,000172: 30,2762           02251                                    COSCDU     +2                         
035468,000173: 
035469,000174: 30,2763           41325                           PDDL     DMP                                   
035470,000175: 30,2764           00017                                    14D                                   #  DTHETASM +4
035471,000176: 30,2765           02257                                    SINCDU     +2                         
035472,000177: 30,2766           77621                           BDSU                                           
035473,000178: 30,2767           77671                           DDV                                            
035474,000179: 30,2770           02253                                    COSCDU     +4                         
035475,000180: 30,2771           00025                           STORE    20D                                   #  DCDU
035476,000181: 30,2772           72405                           DMP      SL1                                   #  SCALE
035477,000182: 30,2773           02261                                    SINCDU     +4                         
035478,000183: 30,2774           77621                           BDSU                                           
035479,000184: 
035480,000185: 30,2775           00015                                    12D                                   #  DTHETASM +2
035481,000186: 30,2776           14027                           STODL    22D                                   #  DCDU +2
035482,000187: 30,2777           00013                                    10D                                   #  DTHETASM
035483,000188: 30,3000           65205                           DMP      PDDL                                  
035484,000189: 30,3001           02257                                    SINCDU     +2                         
035485,000190: 

Page 787

035487,000192: 30,3002           00017                                    14D                                   #  DTHETASM +4
035488,000193: 30,3003           43205                           DMP      DAD                                   
035489,000194: 30,3004           02251                                    COSCDU     +2                         
035490,000195: 30,3005           77752                           SL1                                            #  SCALE
035491,000196: 30,3006           14031                           STODL    24D                                   #  DCDU +4
035492,000197: 30,3007           00027                                    22D                                   #  DCDU +2
035493,000198: 
035494,000199: 30,3010           57405                           DMP      DCOMP                                 
035495,000200: 30,3011           02261                                    SINCDU     +4                         #  DCDUX =-DCDUY*SIN(CDUZ)
035496,000201: 30,3012           77752                           SL1                                            #  SCALE
035497,000202: 30,3013           00025                           STORE    20D                                   #  DCDU
035498,000203: 30,3014           53375                           VLOAD    VAD                                   
035499,000204: 30,3015           00025                                    20D                                   #  DCDU
035500,000205: 30,3016           01343                                    CDUTEMP                               
035501,000206: 30,3017           77634                           RTB                                            
035502,000207: 30,3020           33573                                    V1STO2S                               #  SCALE FROM 1,S TO 2,S
035503,000208: 30,3021           00767                           STORE    CDUXD                                 
035504,000209: 30,3022           77650                           GOTO                                           
035505,000210: 30,3023           00047                                    RETSAVE                               
035506,000211: 
035507,000212: 
035508,000213: 
035509,000214:                                                                                                  #  SINCOSCD    COMPUTES SIN AND COS OF CDU  AND STORES AS DP VECTORS
035510,000215:                                                                                                  #  SINCDU ,COSCDU
035511,000216:                                                                                                  #  INPUT IS CDUS AS A VECTOR CDUTEMP
035512,000217:                                                                                                  #  OUTPUT IS SIN AND COS OF CDU,S
035513,000218:                                                                                                  #  CDUS ARE AVAILABLE IN 2,S COMP
035514,000219:                                                                                                  #  SIN AND COS ARE SCALED TO 2
035515,000220:                                                                                                  #  SINCOSCD CAN BE ENTERED FROM INTERPRETIVE
035516,000221: 
035517,000222: 
035518,000223: 
035519,000224: 
035520,000225: 30,3024           76131        SINCOSCD           SSP      AXT,1                                 #  SET X1 TO 6
035521,000226: 30,3025           00051                                    S1                                    #  SET S1 TO 2
035522,000227: 30,3026           00002                           OCT      2                                     
035523,000228: 30,3027           00006                           OCT      6                                     
035524,000229: 30,3030           47133        REPEAT1            SLOAD*   RTB                                   
035525,000230: 30,3031           01351                                    CDUTEMP    +6,1                       
035526,000231: 30,3032           33524                                    CDULOGIC                              #  CONVERT CDU FROM 2,S TO 1,S.  SCALE
035527,000232: 30,3033           05351                           STORE    CDUTEMP    +6,1                       #  TO ONE REVOLUTION
035528,000233: 30,3034           77756                           SIN                                            
035529,000234: 30,3035           06263                           STORE    SINCDU     +6,1                       
035530,000235: 
035531,000236: 30,3036           71543                           DLOAD*   COS                                   
035532,000237: 30,3037           01351                                    CDUTEMP    +6,1                       
035533,000238: 30,3040           06255                           STORE    COSCDU     +6,1                       
035534,000239: 30,3041           43500                           TIX,1    RVQ                                   
035535,000240: 30,3042           61030                                    REPEAT1                               

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