Source Code

These source-code files were transcribed from scans made from Don Eyles's personal copy of BURST120 (SUNBURST 120). They were scanned at archive.org's Boston facility, and the scanning was sponsored by Mike Stewart. The code was transcribed from these scans by a team of volunteers who are referenced in the program comments. Comments from the original source code are in ALL-CAPS, whereas comments added later in transcription are in Mixed-Case. In some cases, where similar code blocks exist in previously-transcribed AGC programs (primarily Luminary 99, from Apollo 11) those code blocks were used as a starting point and then corrected to agree with the BURST120 scans. The full scans are available at the Virtual AGC project's collection at archive.org, while more-convenient reduced-size (but reduced-quality) images are available at the main Virtual AGC website. Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. Notations on the program listing read, in part:

	YUL SYSTEM FOR AGC: REVISION 0 OF PROGRAM BURST120 
	BY NASA 2021106-031 DEC 7, 1967

	THIS LISTING IS A COPY OF A VERSION OF THE PROGRAM INTENDED 
	FOR USE IN THE ON-BOARD PRIMARY GUIDANCE COMPUTER IN THE 
	UNMANNED FLIGHT OF APOLLO LUNAR MODULE 1 --- THE AS206 MISSION.
Note that the date is the date of the printout, not the date of the program revision.

035731,000002:                                                                                                  ## Copyright:    Public domain.
035732,000003:                                                                                                  ## Filename:     FIND_CDU_DESIRED.agc
035733,000004:                                                                                                  ## Purpose:      A module for revision 0 of BURST120 (Sunburst). It 
035734,000005:                                                                                                  ##               is part of the source code for the Lunar Module's
035735,000006:                                                                                                  ##               (LM) Apollo Guidance Computer (AGC) for Apollo 5.
035736,000007:                                                                                                  ## Assembler:    yaYUL
035737,000008:                                                                                                  ## Contact:      Ron Burkey <info@sandroid.org>.
035738,000009:                                                                                                  ## Website:      www.ibiblio.org/apollo/index.html
035739,000010:                                                                                                  ## Mod history:  2016-09-30 RSB  Created draft version.
035740,000011:                                                                                                  ##               2016-10-29 MAS  Transcribed.
035741,000012:                                                                                                  ##               2016-12-06 RSB  Comment-proofing via octopus/ProoferComments;
035742,000013:                                                                                                  ##                               changes were made.
035743,000014: 

Page 838

035745,000016:                                                                                                  #  THIS ROUTINE FINDCDUD COMPUTES DESIRED CDU,S WHICH CAN BE FED TO
035746,000017:                                                                                                  #  DAP LATER ON.
035747,000018:                                                                                                  #  DESIRED CDU,S WILL BE IN 2,S COMP
035748,000019: 
035749,000020:                                                                                                  #  INPUT
035750,000021: 
035751,000022:                                                                                                  #  DESIRED THRUST VECTOR AXISD COMING FROM GUIDANCE EQUATIONS
035752,000023:                                                                                                  #  CDUX,CDUY,CDUZ INFORM OF A SP VECTOR CDUTEMP,+2,+4.
035753,000024:                                                                                                  #  DELV HALF UNIT VECTOR. PIPAS READING
035754,000025:                                                                                                  #  AXISD IS A HALF UNIT VECTOR
035755,000026:                                                                                                  #  CDUX,Y,Z  ARE IN 2,S COMP
035756,000027: 
035757,000028:                                                                                                  #  THIS ROUTINE CAN BE ENTERED FROM INTERPRETIVE . CALL FINDCDUD
035758,000029: 
035759,000030:                                                                                                  #  CALLING SEQUENCE
035760,000031:                                                                                                  #  L-1  CALL
035761,000032:                                                                                                  #  L        FINDCDUD
035762,000033:                                                                                                  #  L+1              INTERPRETIVE RETURN
035763,000034: 
035764,000035: 
035765,000036: 
035766,000037:                                                                                                  #  USER TO HAVE A UNIT VECTOR  AXIS   (1,0,0)
035767,000038: 
035768,000039: 
035769,000040: 
035770,000041: 30,2677                                           BANK     30                                    
035771,000042: 30,2677  E4,1452                                  EBANK=   DELR                                  
035772,000043: 30,2677           24276 14076  2/PI               2DEC     .6366198                              
035773,000044: 
035774,000045: 30,2701           00002 00545  LIMOMG             2DEC     .0001234                              
035775,000046: 
035776,000047: 
035777,000048: 
035778,000049: 30,2703           77401        FINDCDUD           SETPD    EXIT                                  
035779,000050: 30,2704           00001                                    0                                     
035780,000051: 30,2705           31332                           CA       CDUTEMP    +2                         
035781,000052: 30,2706           55654                           TS       SINCDU                                #  TEMPORARY LOCATION FOR CDUY
035782,000053: 30,2707           31334                           CA       CDUTEMP    +4                         
035783,000054: 30,2710           55656                           TS       SINCDU     +2                         #  TEMPORARY LOCATION FOR CDUZ
035784,000055: 30,2711           31330                           CA       CDUTEMP                               
035785,000056: 30,2712           55660                           TS       SINCDU     +4                         #  TEMPORARY LOCATION FOR CDUX
035786,000057: 
035787,000058: 
035788,000059: 
035789,000060:                                                                                                  #  AXISFILT   COMPUTES AXIS AND CORRECTS IT FOR  QUANTIZATION ERROR AND OTH
035790,000061:                                                                                                  #  ER ERRORS
035791,000062: 
035792,000063: 
035793,000064: 30,2713  E6,1422                                  EBANK=   OMEGA                                 
035794,000065: 30,2713           35632                           CAF      PRIO3                                 #  OCT  03000     SWITCH EBANK

Page 839

035796,000067: 30,2714           56003                           XCH      EBANK                                 
035797,000068: 30,2715           54144                           TS       MPAC                                  
035798,000069: 30,2716           37767                           CAF      ZERO                                  
035799,000070: 30,2717           55155                           TS       TEMX                                  #  SQOMEGA
035800,000071: 30,2720           55156                           TS       TEMX       +1                         #  SQOMEGA  +1
035801,000072: 30,2721           00004                           INHINT                                         
035802,000073: 30,2722           31415                           CAE      OMEGAP                                
035803,000074: 30,2723           00006                           EXTEND                                         
035804,000075: 30,2724           70000                           SQUARE                                         
035805,000076: 30,2725           21156                           DAS      TEMX                                  #  SQOMEGA
035806,000077: 30,2726           31416                           CAE      OMEGAQ                                
035807,000078: 30,2727           00006                           EXTEND                                         
035808,000079: 30,2730           70000                           SQUARE                                         
035809,000080: 30,2731           21156                           DAS      TEMX                                  #  SQOMEGA
035810,000081: 30,2732           31420                           CAE      OMEGAR                                
035811,000082: 30,2733           00006                           EXTEND                                         
035812,000083: 30,2734           70000                           SQUARE                                         
035813,000084: 30,2735           21156                           DAS      TEMX                                  #  SQOMEGA
035814,000085: 30,2736           00003                           RELINT                                         
035815,000086: 30,2737           56144                           XCH      MPAC                                  
035816,000087: 30,2740           54003                           TS       EBANK                                 
035817,000088: 30,2741           06112                           TC       INTPRET                               
035818,000089: 30,2742  E4,1452                                  EBANK=   DELR                                  
035819,000090: 30,2742           77620                           STQ                                            
035820,000091: 30,2743           01304                                    RETSAVE                               
035821,000092: 30,2744           45345        AXISFILT           DLOAD    DSU                                   
035822,000093: 
035823,000094: 
035824,000095: 
035825,000096: 30,2745           01156                                    TEMX                                  #  SQOMEGA
035826,000097: 30,2746           20702                                    LIMOMG                                
035827,000098: 30,2747           72044                           BPL      LXA,1                                 
035828,000099: 30,2750           60774                                    ROTANGLE                              
035829,000100: 30,2751           00110                                    FIXLOC                                
035830,000101: 30,2752           64110                           INCR,1   XCHX,1                                
035831,000102: 30,2753           00024                                    20D                                   
035832,000103: 30,2754           00050                                    S1                                    
035833,000104: 30,2755           77775                           VLOAD                                          
035834,000105: 30,2756           02255                                    SINCDU                                #  TEMPORARY LOCATION FOR CDUY,Z,X IN
035835,000106: 30,2757           00025                           STORE    20D                                   #  SP  2,S COMP
035836,000107: 30,2760           53575                           VLOAD    UNIT                                  
035837,000108: 30,2761           00404                                    DELV                                  
035838,000109: 30,2762           00041                           STORE    32D                                   
035839,000110: 30,2763           77624                           CALL                                           
035840,000111: 30,2764           32531                                    SMNB                                  #  TRANSFORM DELV FROM SM TO NB
035841,000112: 30,2765           52201                           SETPD    VSU                                   
035842,000113: 30,2766           00001                                    0                                     
035843,000114: 30,2767           02241                                    AXIS                                  
035844,000115: 30,2770           53322                           VSR3     VAD                                   
035845,000116: 30,2771           02241                                    AXIS                                  
035846,000117: 

Page 840

035848,000119: 30,2772           77656                           UNIT                                           
035849,000120: 30,2773           02241                           STORE    AXIS                                  
035850,000121: 30,2774           62150        ROTANGLE           LXA,1    INCR,1                                
035851,000122: 30,2775           00110                                    FIXLOC                                
035852,000123: 30,2776           00024                                    20D                                   
035853,000124: 30,2777           77320                           XCHX,1   VLOAD                                 
035854,000125: 30,3000           00050                                    S1                                    
035855,000126: 30,3001           02255                                    SINCDU                                #  TEMPORARY LOCATION FOR CDUY,Z,X IN
035856,000127: 30,3002           00025                           STORE    20D                                   #  SP  2,S COMP
035857,000128: 30,3003           77775                           VLOAD                                          
035858,000129: 30,3004           02241                                    AXIS                                  
035859,000130: 30,3005           00041                           STORE    32D                                   
035860,000131: 30,3006           77624                           CALL                                           #  TRANSFORM  AXIS FROM NB TO SM
035861,000132: 30,3007           32555                                    NBSM                                  
035862,000133: 30,3010           47201                           SETPD    VXV                                   
035863,000134: 30,3011           00001                                    0                                     
035864,000135: 30,3012           02233                                    AXISD                                 
035865,000136: 30,3013           77761                           VXSC                                           
035866,000137: 30,3014           20700                                    2/PI                                  
035867,000138: 30,3015           00013                           STORE    10D                                   #  DTHETASM  SCALETO ONE REVOLUTION
035868,000139: 30,3016           77624                           CALL                                           #  COMPUTE SIN AND COS OF CDUS FOR
035869,000140: 30,3017           61064                                    SINCOSCD                              #  LATER USE
035870,000141: 
035871,000142: 
035872,000143:                                                                                                  #  SMCDURES     COMPUTES CDU(GIMBAL) ANGLES FROM INCREMENTAL
035873,000144:                                                                                                  #  CHANGES ABOUT SM AXES.    IT REQUIRES  SM  INCREMENTAL CHANGES
035874,000145:                                                                                                  #  AS DP  VECTOR SCALED AT  ONE REVOLUTION(DTHETASM,+2,+4).  SIN,COS(CDUX,Y
035875,000146:                                                                                                  #  ,Z)   ARE IN SINCDU,+2,+4 AND COSCDU,+2,+4  RESPECTIVELY,SCALED TO 2.
035876,000147:                                                                                                  #  CDU INCREMENTS  ARE PLACED IN DCDU,+2,+4   SCALED TO ONE REVOLUTION
035877,000148: 
035878,000149: 
035879,000150: 
035880,000151: 30,3020           41345        SMCDURES           DLOAD    DMP                                   
035881,000152: 30,3021           00013                                    10D                                   #  DTHETASM
035882,000153: 30,3022           02251                                    COSCDU     +2                         
035883,000154: 30,3023           41325                           PDDL     DMP                                   
035884,000155: 30,3024           00017                                    14D                                   #  DTHETASM +4
035885,000156: 30,3025           02257                                    SINCDU     +2                         
035886,000157: 30,3026           77621                           BDSU                                           
035887,000158: 30,3027           77671                           DDV                                            
035888,000159: 30,3030           02253                                    COSCDU     +4                         
035889,000160: 30,3031           00025                           STORE    20D                                   #  DCDU
035890,000161: 30,3032           72405                           DMP      SL1                                   #  SCALE
035891,000162: 30,3033           02261                                    SINCDU     +4                         
035892,000163: 30,3034           77621                           BDSU                                           
035893,000164: 30,3035           00015                                    12D                                   #  DTHETASM +2
035894,000165: 30,3036           14027                           STODL    22D                                   #  DCDU +2
035895,000166: 30,3037           00013                                    10D                                   
035896,000167: 30,3040           65205                           DMP      PDDL                                  
035897,000168: 30,3041           02257                                    SINCDU     +2                         

Page 841

035899,000170: 30,3042           00017                                    14D                                   #  DTHETASM +4
035900,000171: 30,3043           43205                           DMP      DAD                                   
035901,000172: 30,3044           02251                                    COSCDU     +2                         
035902,000173: 30,3045           77752                           SL1                                            #  SCALE
035903,000174: 30,3046           14031                           STODL    24D                                   #  DCDU +4
035904,000175: 30,3047           00027                                    22D                                   #  DCDU +2
035905,000176: 30,3050           57405                           DMP      DCOMP                                 
035906,000177: 30,3051           02261                                    SINCDU     +4                         #  DCDUX =-DCDUY*SIN(CDUZ)
035907,000178: 30,3052           77752                           SL1                                            #  SCALE
035908,000179: 30,3053           00025                           STORE    20D                                   #  DCDU
035909,000180: 30,3054           53375                           VLOAD    VAD                                   
035910,000181: 30,3055           00025                                    20D                                   #  DCDU
035911,000182: 30,3056           01331                                    CDUTEMP                               
035912,000183: 30,3057           77634                           RTB                                            
035913,000184: 30,3060           33526                                    V1STO2S                               #  SCALE FROM 1,S TO 2,S
035914,000185: 30,3061           00767                           STORE    CDUXD                                 
035915,000186: 30,3062           77650                           GOTO                                           
035916,000187: 30,3063           01304                                    RETSAVE                               
035917,000188: 
035918,000189: 
035919,000190:                                                                                                  #  SINCOSCD    COMPUTES SIN AND COS OF CDU  AND STORES AS DP VECTORS
035920,000191:                                                                                                  #  SINCDU ,COSCDU
035921,000192:                                                                                                  #  INPUT IS CDUS AS A VECTOR CDUTEMP
035922,000193:                                                                                                  #  OUTPUT IS SIN AND COS OF CDU,S
035923,000194:                                                                                                  #  CDUS ARE AVAILABLE IN 2,S COMP
035924,000195:                                                                                                  #  SIN AND COS ARE SCALED TO 2
035925,000196:                                                                                                  #  SINCOSCD CAN BE ENTERED FROM INTERPRETIVE
035926,000197: 
035927,000198: 
035928,000199: 
035929,000200: 30,3064           76131        SINCOSCD           SSP      AXT,1                                 #  SET X1 TO 6
035930,000201: 30,3065           00051                                    S1                                    #  SET S1 TO 2
035931,000202: 30,3066           00002                           OCT      2                                     
035932,000203: 30,3067           00006                           OCT      6                                     
035933,000204: 30,3070           47133        REPEAT1            SLOAD*   RTB                                   
035934,000205: 30,3071           01337                                    CDUTEMP    +6,1                       
035935,000206: 30,3072           33457                                    CDULOGIC                              #  CONVERT CDU FROM 2,S TO 1,S.  SCALE
035936,000207: 30,3073           05337                           STORE    CDUTEMP    +6,1                       #  TO ONE REVOLUTION
035937,000208: 30,3074           77756                           SIN                                            
035938,000209: 30,3075           06263                           STORE    SINCDU     +6,1                       
035939,000210: 30,3076           71543                           DLOAD*   COS                                   
035940,000211: 30,3077           01337                                    CDUTEMP    +6,1                       
035941,000212: 30,3100           06255                           STORE    COSCDU     +6,1                       
035942,000213: 30,3101           43500                           TIX,1    RVQ                                   
035943,000214: 30,3102           61070                                    REPEAT1                               

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