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.

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

Page 784

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

Page 785

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

Page 786

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

Page 787

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

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