Source Code

These source-code files were obtained by digitally photographing a Solarium 55 (Apollo 6) program listing from the American Computer Museum in Bozeman, Montana. Photography was by Ron Burkey, with assistance from museum curator George Keremedjiev and Montana State University curator Kim Scott. The listing originally belonged to Eldon C. Hall, who donated it to the museum. Volunteers then manually typed in the source code or else modified similar pre-existing Colossus 249 (Apollo 9) source files to incorporate changes, although this transcription was principally done by Jim Lawton and corrected by Ron Burkey. Notations on the program listing read, in part:

        YUL SYSTEM FOR AGC4: REVISION 0 OF PROGRAM SOLRUM55
	BY NASA 1021108-021                    DEC. 4, 1966
Note that the date is the date of the printout, not the date of the program revision.

Due to statements by Jay Sampson, the original contractor from AC Electronics who created Solarium 54 (Apollo 4) from the earlier Corona (AS-202 mission) program, it is believed that Solarium 54 and Solarium 55 (Apollo 6) are actually identical programs. The change in numbering, from 54 to 55, is believed to be for some administrative purpose. Thus, it is believed that the source-code represented here is equally appropriate for both Apollo 4 and Apollo 6 missions.

029636,000002:                                                                                                  ## Copyright:   Public domain.
029637,000003:                                                                                                  ## Filename:    AVERAGE_G_INTEGRATOR.agc
029638,000004:                                                                                                  ## Purpose:     Part of the source code for Solarium build 55. This
029639,000005:                                                                                                  ##              is for the Command Module's (CM) Apollo Guidance
029640,000006:                                                                                                  ##              Computer (AGC), for Apollo 6.
029641,000007:                                                                                                  ## Assembler:   yaYUL --block1
029642,000008:                                                                                                  ## Contact:     Jim Lawton <jim DOT lawton AT gmail DOT com>
029643,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
029644,000010:                                                                                                  ## Page Scans:  www.ibiblio.org/apollo/ScansForConversion/Solarium055/
029645,000011:                                                                                                  ## Mod history: 2009-10-01 JL   Created.
029646,000012:                                                                                                  ##              2016-08-19 RSB  Added temporary "BANK 30" workaround.
029647,000013:                                                                                                  ##              2016-08-20 RSB  Typos.
029648,000014:                                                                                                  ##              2016-12-28 RSB  Proofed comment text using octopus/ProoferComments,
029649,000015:                                                                                                  ##                              and fixed errors found.
029650,000016: 

Page 746

029652,000018: 
029653,000019:                                                                                                  #        ROUTINE CALCRVG INTEGRATES THE EQUATIONS OF MOTION BY AVERAGING THE THRUST AND GRAVITATIONAL ACCELERA-
029654,000020:                                                                                                  #  TIONS OVER A TIME INTERVAL, DELTAT
029655,000021:                                                                                                  #        FOR THE EARTH-CENTERED GRAVITATIONAL FIELD THE PERTURBATION DUE TO OBLATENESS IS COMPUTED TO THE FIRST
029656,000022:                                                                                                  #  HARMONIC COEFFICIENT J
029657,000023:                                                                                                  #        ROUTINE NORMLISE MUST BE CALLED PRIOR TO THE FIRST ENTRY INTO CALCRVG. IT REQUIRES RN SCALED TO 2(+29)M
029658,000024:                                                                                                  #  IT LEAVES RN NORMALISED, SO THAT THE SCALED MAGNITUDE OF THE VECTOR CONTAINS ONE LEADING ZERO, BY SHIFTING THE
029659,000025:                                                                                                  #  VECTOR LEFT N BINARY PLACES
029660,000026:                                                                                                  #        ROUTINE CALCRVG REQUIRES
029661,000027:                                                                                                  #                1) THRUST ACCELERATION INCREMENTS IN DELV SCALED SAME AS PIPAX,Y,Z
029662,000028:                                                                                                  #                2) VN SCALED AT 2(+7) M/CS
029663,000029:                                                                                                  #                3) ADDRESS OF CALCGLUN OR CALCGEAR IN CALCG
029664,000030:                                                                                                  #                4) DELTAT SCALED AT 2(+9) CS
029665,000031:                                                                                                  #                5) PUSH-DOWN COUNTER SET TO ZERO
029666,000032:                                                                                                  #  IT LEAVES UPDATED RN, SCALED AT 2(29-N) M, VN, AND GRAVITY SCALED AT 2(-5) M/CS/CS
029667,000033: 
029668,000034: 
029669,000035:                                                                                                  #        CONTINUE ON IN BANK 30.

RSB — The original source code did not have the following BANK pseudo-op, but for some reason I haven't tracked down yet, yaYUL can't resolve the addresses without it. Perhaps a bug in yaYUL.

029673,000039: 30,7524                                           BANK     30                                    
029674,000040: 
029675,000041: 30,7524           71173        NORMLISE           ABVAL    3                                     #  COUNT NUMBER OF LEADING ZEROS IN
029676,000042: 30,7525           57715                           TSLC     INCR,1                                #  ABVAL (RN) AND STORE -N(=2-M) IN NSHIFT
029677,000043: 30,7526           67515                           SXA,1    INCR,1                                #  RN MUST BE SCALED AT 2(+29)M
029678,000044: 30,7527           67425                           SXA,1    ITA                                   
029679,000045: 30,7530           00766                                    RN                                    
029680,000046: 30,7531           00047                                    X1                                    
029681,000047: 30,7532           00003                                    2                                     
029682,000048: 30,7533           01041                                    NSHIFT                                #  SAVE C(X1)=-N
029683,000049: 30,7534           00017                                    14D                                   
029684,000050: 30,7535           01042                                    XSHIFT                                #  SAVE C(X1) =14-N
029685,000051: 30,7536           00052                                    S2                                    
029686,000052: 
029687,000053: 30,7537           75175                           VMOVE    1                                     
029688,000054: 30,7540           44376                           VSLT*                                          
029689,000055: 30,7541           00766                                    RN                                    
029690,000056: 30,7542           00035                                    14D,1                                 
029691,000057: 30,7543           32766                           STORE    RN                                    #  RN SCALED AT 2(29-N)METRES
029692,000058: 
029693,000059: 30,7544           76776                           ITC      0                                     
029694,000060: 30,7545           21645                                    CALCGRV1                              
029695,000061: 
029696,000062: 30,7546           44576                           ITCI     0                                     
029697,000063: 30,7547           00052                                    S2                                    
029698,000064: 

Page 747

029700,000066: 
029701,000067: 30,7550           75776        CALCRVG            VXSC     0                                     
029702,000068: 30,7551           01002                                    DELV                                  
029703,000069: 30,7552           21742                                    KPIP                                  #  DV TO PD SCALED AT 2(+4)M/CS
029704,000070: 
029705,000071: 30,7553           75775                           VXSC     1                                     
029706,000072: 30,7554           73432                           LXA,1    BVSU                                  
029707,000073: 30,7555           01010                                    GRAVITY                               
029708,000074: 30,7556           01030                                    DELTAT                                
029709,000075: 30,7557           01042                                    XSHIFT                                
029710,000076: 30,7560           00001                                    0                                     #  (DV-(OLD GDT))/2 TO PD SCALED 2(+3)M/CS
029711,000077: 
029712,000078: 30,7561           47573                           NOLOD    3                                     
029713,000079: 30,7562           45642                           VSRT     VAD                                   
029714,000080: 30,7563           75620                           VXSC     VSLT*                                 
029715,000081: 30,7564           50625                           VAD      ITA                                   
029716,000082: 30,7565           00005                                    4                                     
029717,000083: 30,7566           00774                                    VN                                    
029718,000084: 30,7567           01030                                    DELTAT                                
029719,000085: 30,7570           00001                                    0,1                                   
029720,000086: 30,7571           00766                                    RN                                    
029721,000087: 30,7572           00052                                    S2                                    
029722,000088: 30,7573           33300                           STORE    RN1                                   #  SCALED AT 2(29-N) METERS
029723,000089: 
029724,000090: 30,7574           76776                           ITC      0                                     
029725,000091: 30,7575           21645                                    CALCGRV1                              
029726,000092: 
029727,000093: 30,7576           47573                           NOLOD    3                                     
029728,000094: 30,7577           75632                           VXSC     BVSU                                  
029729,000095: 30,7600           50626                           VAD      VSRT                                  
029730,000096: 30,7601           50776                           VAD                                            
029731,000097: 30,7602           01030                                    DELTAT                                
029732,000098: 30,7603           77777                                    -                                     #  (DV-(OLD GDT))/2
029733,000099: 30,7604           77777                                    -                                     #  DV/2
029734,000100: 30,7605           00005                                    4                                     
029735,000101: 30,7606           00774                                    VN                                    
029736,000102: 30,7607           33306                           STORE    VN1                                   #  SCALED AT 2(+7) MET/CS
029737,000103: 
029738,000104:                                                                                                  #   IN AVERAGE G, UP THE PHASE BITS BY 2 OF ACTIVE PROG BEFORE COPY CYCLE.
029739,000105: 
029740,000106: 30,7610           77576                           EXIT     0                                     
029741,000107: 
029742,000108: 30,7611           20067                           INDEX    FIXLOC                                
029743,000109: 30,7612           40051                           CS       S2                                    #  SAVE NEG RETURN ADDRESS IN NON-VAC AREA.
029744,000110: 30,7613           51313        CALCRVG2           TS       AVGRETRN                              #  SAVE NEGATIVE OF RETURN ADDRESS.
029745,000111: 
029746,000112: 30,7614           40662                           CS       -PHASE1    +4                         #  PICK UP PHASES.
029747,000113: 30,7615           64516                           AD       ONE                                   #  INCREMENT BY 1.
029748,000114: 30,7616           02312                           TC       NEWPHASE                              #  AND CALL ROUTINE TO CHANGE PHASE.
029749,000115: 30,7617           00005                           OCT      00005                                 

Page 748

029751,000117: 30,7620           20017        REFAZE6            INHINT                                         
029752,000118: 30,7621           37641                           CAF      ELEVEND                               
029753,000119: 30,7622           50115                           TS       MPAC                                  #  USE MPAC FOR LOOP COUNTER.
029754,000120: 30,7623           20115                           INDEX    MPAC                                  
029755,000121: 30,7624           41277                           CS       RN1                                   #  RN1 AND VN1 MUST BE IN ORDER.
029756,000122: 30,7625           40000                           COM                                            #  LEAVE RN1 ALONE  IN CASE OF RESTARTS.
029757,000123: 30,7626           20115                           INDEX    MPAC                                  #  SELECT THE RIGHT TERM.
029758,000124: 30,7627           50765                           TS       RN                                    #  ...AND GO THRU COPY CYCLE.
029759,000125: 
029760,000126: 30,7630           10115                           CCS      MPAC                                  #  ARE WE DONE..
029761,000127: 30,7631           07622                           TC       REFAZE6    +2                         #  NO, NOT YET.
029762,000128: 30,7632           44515                           CS       BIT2                                  #  YES, MPAC = 0.
029763,000129: 30,7633           70675                           MASK     TMMARKER                              
029764,000130: 30,7634           64515                           AD       BIT2                                  #  SET BIT 2 TO ONE IN TMMARKER.
029765,000131: 30,7635           50675                           TS       TMMARKER                              
029766,000132:                                                                                                  #  WHAT ABOUT GRAVITY FOR RESTART..
029767,000133: 30,7636           20016                           RELINT                                         
029768,000134: 30,7637           41313                           CS       AVGRETRN                              #  NEG OF ADDRESS WAS STORED.
029769,000135: 30,7640           05723                           TC       BANKJUMP                              
029770,000136: 
029771,000137: 
029772,000138: 
029773,000139: 30,7641           00013        ELEVEND            DEC      11         B-14                       #  11D  (ELEVEN DECIMAL, OF COURSE.)
029774,000140: 
029775,000141: 
029776,000142: 
029777,000143: 30,7642           73576        CALCGRAV           LXA,1    0                                     
029778,000144: 30,7643           01042                                    XSHIFT                                
029779,000145: 
029780,000146: 30,7644           47575        CALCGRV1           NOLOD    1                                     
029781,000147: 30,7645           73176                           UNIT                                           
029782,000148: 30,7646           33016                           STORE    UNITR                                 
029783,000149: 
029784,000150: 30,7647           45175                           DMOVE    1                                     
029785,000151: 30,7650           63776                           TSLT                                           
029786,000152: 30,7651           00037                                    30D                                   
029787,000153: 30,7652           00002                                    1                                     
029788,000154: 30,7653           33024                           STORE    RMAG                                  #  SCALED AT 2(30-N)M
029789,000155: 
029790,000156: 30,7654           63776                           TSLT     0                                     
029791,000157: 30,7655           00035                                    28D                                   
029792,000158: 30,7656           00003                                    2                                     
029793,000159: 30,7657           33026                           STORE    RMAGSQ                                #  SCALED AT 2(+50)M(+2)
029794,000160: 
029795,000161: 30,7660           45575                           ITA      1                                     
029796,000162: 30,7661           61576                           XAD,1                                          
029797,000163: 30,7662           00034                                    27D                                   
029798,000164: 30,7663           01041                                    NSHIFT                                

Page 749

029800,000166: 
029801,000167: 30,7664           42776        CALCGEAR           DOT      0                                     
029802,000168: 30,7665           01016                                    UNITR                                 
029803,000169: 30,7666           01044                                    UNITW                                 
029804,000170: 30,7667           32032                           STORE    25D                                   
029805,000171: 
029806,000172: 30,7670           47574                           NOLOD    2                                     
029807,000173: 30,7671           51122                           DSQ      DMP                                   
029808,000174: 30,7672           63726                           TSLT     BDSU                                  
029809,000175: 30,7673           21746                                    DP(5/8)                               
029810,000176: 30,7674           00005                                    4                                     
029811,000177: 30,7675           21744                                    DP2(-3)                               
029812,000178: 
029813,000179: 30,7676           62775                           DDV      1                                     
029814,000180: 30,7677           63376                           TSLT*                                          
029815,000181: 30,7700           21754                                    J(RE)SQ                               #  SCALED AT 2(+40) M(+2)
029816,000182: 30,7701           01026                                    RMAGSQ                                
029817,000183: 30,7702           00001                                    0,1                                   
029818,000184: 30,7703           32030                           STORE    23D                                   #  J(RE/RN) SQ SCALED AT 2(-3)
029819,000185: 
029820,000186: 30,7704           47574                           NOLOD    2                                     
029821,000187: 30,7705           64766                           DMP      VXSC                                  
029822,000188: 30,7706           50776                           VAD                                            
029823,000189: 30,7707           77777                                    -                                     
029824,000190: 30,7710           01016                                    UNITR                                 
029825,000191: 30,7711           01016                                    UNITR                                 
029826,000192: 
029827,000193: 30,7712           64775                           DMP      1                                     
029828,000194: 30,7713           75642                           VXSC     VAD                                   
029829,000195: 30,7714           00030                                    23D                                   
029830,000196: 30,7715           00032                                    25D                                   
029831,000197: 30,7716           01044                                    UNITW                                 
029832,000198: 
029833,000199: 30,7717           45175                           DMOVE    1                                     
029834,000200: 30,7720           76776                           ITC                                            
029835,000201: 30,7721           21750                                    MUEARTH                               
029836,000202: 30,7722           21732                                    MU/RSQ                                
029837,000203: 
029838,000204: 30,7723           75176        CALCGLUN           VMOVE    0                                     
029839,000205: 30,7724           01016                                    UNITR                                 
029840,000206: 
029841,000207: 30,7725           45175                           DMOVE    1                                     
029842,000208: 30,7726           63576                           INCR,1                                         
029843,000209: 30,7727           21752                                    MUMOON                                
029844,000210: 30,7730           00007                                    6                                     
029845,000211: 
029846,000212: 30,7731           47574        MU/RSQ             NOLOD    2                                     
029847,000213: 30,7732           62714                           DDV      TSLT*                                 
029848,000214: 30,7733           75776                           VXSC                                           
029849,000215: 30,7734           01026                                    RMAGSQ                                #  C(X1)=14-2N  (EARTH)
029850,000216: 30,7735           00013                                    5,1                                   #       =20-2N  (MOON)

Page 750

029852,000218: 30,7736           33010                           STORE    GRAVITY                               #  SCALED AT 2(-5) M/CS/CS
029853,000219: 
029854,000220: 30,7737           44576                           ITCI     0                                     
029855,000221: 30,7740           00034                                    27D                                   
029856,000222: 
029857,000223: 30,7741           23126 25370  KPIP               2DEC     0.59904                               
029858,000224: 30,7743           04000 00000  DP2(-3)            2DEC     0.125                                 
029859,000225: 30,7745           24000 00000  DP(5/8)            2DEC     0.625                                 
029860,000226: 30,7747           00022 21756  MUEARTH            2DEC     .009063188 B-3                        #  SCALED AT 2(+45)M(+3)/CS(+2)
029861,000227: 30,7751           00164 34414  MUMOON             2DEC     0.007134481                            #  4.90277800 E12        2(+36)M(+3)/CS(+2)
029862,000228: 30,7753           00173 00416  J(RE)SQ            2DEC     .06006663  B-3                        #  SCALED AT 2(+43)M(+2)
029863,000229: 

Page 751

029865,000231: 
029866,000232:                                                                                                  #        ROUTINE FOR FLIGHTS 501 &2 TO INCORPORATE STATE VECTOR UPDATE DURING AVERAGE G. EACH PASS THROUGH
029867,000233:                                                                                                  #  SERVICER COMES HERE TO SEE IF AN UPDATE IS READY.
029868,000234: 
029869,000235: 26,7711                                           BANK     26                                    
029870,000236: 
029871,000237: 26,7711           66774        501UPCHK           DSU      2                                     #  IF PIPTIME IS GREATER THAN OR EQUAL TO
029872,000238: 26,7712           73615                           BMN      TEST                                  #    UPTIME, AND UPTIME IS NOT TOO OLD, AND
029873,000239: 26,7713           66616                           DSU      BPL                                   #    UPDATFLG IS SET, DO THE UPDATE. UPTIME
029874,000240: 26,7714           01465                                    PIPTIME                               #    IS NORMALLY SET TO POSMAX
029875,000241: 26,7715           01672                                    UPTIME                                #  POSMAX.
029876,000242: 26,7716           25302                                    REGSTEP                               
029877,000243: 26,7717           00023                                    UPDATFLG                              
029878,000244: 26,7720           25302                                    REGSTEP                               
029879,000245: 
029880,000246: 26,7721           15770                                    2.5SEC26                              
029881,000247: 26,7722           15755                                    BADUPTIM                              
029882,000248: 26,7723           52775                           MXV      1                                     #  TRANSFORM DATA IN STBUFF TO SM COORDS.
029883,000249: 26,7724           44776                           VSLT                                           
029884,000250: 26,7725           01107                                    STBUFF     +6                         
029885,000251: 26,7726           01052                                    REFSMMAT                              
029886,000252: 26,7727           00002                                    1                                     #  THIS ASSUMES THAT UPDATE SCALED 2(7)M/CS
029887,000253: 26,7730           33306                           STORE    VN1                                   
029888,000254: 
029889,000255: 26,7731           52775                           MXV      1                                     
029890,000256: 26,7732           44776                           VSLT                                           
029891,000257: 26,7733           01101                                    STBUFF                                
029892,000258: 26,7734           01052                                    REFSMMAT                              
029893,000259: 26,7735           00003                                    2                                     #  THIS ASSUMES THAT UPDATE SCALED 2(26)M
029894,000260: 26,7736           33300                           STORE    RN1                                   
029895,000261: 
029896,000262: 26,7737           76776                           ITC      0                                     #  CALCULATE THE ASSOCIATED GRAVITY VECTOR
029897,000263: 26,7740           21643                                    CALCGRAV                              #  FOR THE NEXT TIME STEP.
029898,000264: 
029899,000265: 26,7741           77576                           EXIT     0                                     
029900,000266: 
029901,000267: 26,7742           02276                           TC       PHASCHNG                              #  UPDATE RESTART POINT BEFORE SETTING
029902,000268: 26,7743           03005                           OCT      03005                                 #  UPTIME TO SHOW THATTHE DATA HAS BEEN
029903,000269: 
029904,000270: 26,7744           03430        REDO5.24           TC       FLAG1DWN                              #  INCORPORATED. ALSO, INDICATE THIS TO THE
029905,000271: 26,7745           20000                           OCT      20000                                 #  GROUND BY RESETTING UPDATFLG.
029906,000272: 
029907,000273: 26,7746           34476                           CAF      POSMAX                                
029908,000274: 26,7747           51671                           TS       UPTIME                                
029909,000275: 26,7750           51672                           TS       UPTIME     +1                         
029910,000276: 
029911,000277: 26,7751           47771                           CS       501AVEX                               #  SET UP FOR AVERAGE G TO RETURN TO USUAL
029912,000278: 26,7752           05720                           TC       POSTJUMP                              #  POINT IN SERVICER
029913,000279: 26,7753           61613                           CADR     CALCRVG2                              
029914,000280: 
029915,000281: 26,7754           77576        BADUPTIM           EXIT     0                                     #  COME HERE IF UPTIME REPRESENTS PAST TIME

Page 752

029917,000283: 26,7755           03007                           TC       ALARM                                 
029918,000284: 26,7756           01411                           OCT      01411                                 
029919,000285: 
029920,000286: 26,7757           34476                           CAF      POSMAX                                
029921,000287: 26,7760           51671                           TS       UPTIME                                
029922,000288: 26,7761           51672                           TS       UPTIME     +1                         
029923,000289: 
029924,000290: 26,7762           03430                           TC       FLAG1DWN                              #  RESET UPDAT FLAG
029925,000291: 26,7763           20000                           OCT      20000                                 
029926,000292: 
029927,000293: 26,7764           04000                           TC       INTPRET                               
029928,000294: 
029929,000295: 26,7765           76776                           ITC      0                                     
029930,000296: 26,7766           25302                                    REGSTEP                               
029931,000297: 
029932,000298: 26,7767           00000 00372  2.5SEC26           2DEC     250        B-28                       
029933,000299: 26,7771           65303        501AVEX            CADR     AVGRET                                
029934,000300: 

Page 753

029936,000302: 
029937,000303:                                                                                                  #  SIM FLIGHT SPECIAL
029938,000304: 
029939,000305: 
029940,000306: 
029941,000307: 31,7520                                           BANK     31                                    
029942,000308: 
029943,000309: 31,7520           04000        MALSJOB            TC       INTPRET                               
029944,000310: 
029945,000311: 31,7521           51776                           VXM      0                                     
029946,000312: 31,7522           01101                                    STBUFF                                
029947,000313: 31,7523           01052                                    REFSMMAT                              
029948,000314: 31,7524           33101                           STORE    STBUFF                                
029949,000315: 
029950,000316: 31,7525           51775                           VXM      1                                     
029951,000317: 31,7526           44776                           VSLT                                           
029952,000318: 31,7527           01107                                    STBUFF     +6                         
029953,000319: 31,7530           01052                                    REFSMMAT                              
029954,000320: 31,7531           00002                                    1                                     
029955,000321: 31,7532           33107                           STORE    STBUFF     +6                         
029956,000322: 
029957,000323: 31,7533           77576                           EXIT     0                                     
029958,000324: 
029959,000325: 31,7534           02124                           TC       ENDOFJOB                              
029960,000326: 

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