Source Code

These source-code files are part of a reconstructed copy of Corona 261, the final, flown release of the Block I Command Module (CM) Apollo Guidance Computer (AGC) software for the AS-202 mission.

They have been created via disassembly of binary dumps of the original core rope memory modules actually flown on the mission, part numbers 1003733-171, 1003733-241, 1003733-191, 1003733-211, 1003733-221, and 1003733-241. The source code for the Apollo 4 and 6 software, Solarium 55, was used as a starting point, since it was directly derived from Corona and (at least in theory) only minimally modified.

Since only binary dumps (rather than listings) of Corona are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

030138,000002:                                                                                                  ## Copyright:   Public domain.
030139,000003:                                                                                                  ## Filename:    AVERAGE_G_INTEGRATOR.agc
030140,000004:                                                                                                  ## Purpose:     A section of Corona revision 261.
030141,000005:                                                                                                  ##              It is part of the source code for the Apollo Guidance Computer
030142,000006:                                                                                                  ##              (AGC) for AS-202. No original listings of this software are
030143,000007:                                                                                                  ##              available; instead, this file was created via disassembly of
030144,000008:                                                                                                  ##              the core rope modules actually flown on the mission.
030145,000009:                                                                                                  ## Assembler:   yaYUL
030146,000010:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
030147,000011:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
030148,000012:                                                                                                  ## Mod history: 2023-05-27 MAS  Created from Solarium 55.
030149,000013:                                                                                                  ##              2023-06-17 MAS  Updated for Corona.
030150,000014: 
030151,000015: 
030152,000016:                                                                                                  #        ROUTINE CALCRVG INTEGRATES THE EQUATIONS OF MOTION BY AVERAGING THE THRUST AND GRAVITATIONAL ACCELERA-
030153,000017:                                                                                                  #  TIONS OVER A TIME INTERVAL, DELTAT
030154,000018:                                                                                                  #        FOR THE EARTH-CENTERED GRAVITATIONAL FIELD THE PERTURBATION DUE TO OBLATENESS IS COMPUTED TO THE FIRST
030155,000019:                                                                                                  #  HARMONIC COEFFICIENT J
030156,000020:                                                                                                  #        ROUTINE NORMLISE MUST BE CALLED PRIOR TO THE FIRST ENTRY INTO CALCRVG. IT REQUIRES RN SCALED TO 2(+29)M
030157,000021:                                                                                                  #  IT LEAVES RN NORMALISED, SO THAT THE SCALED MAGNITUDE OF THE VECTOR CONTAINS ONE LEADING ZERO, BY SHIFTING THE
030158,000022:                                                                                                  #  VECTOR LEFT N BINARY PLACES
030159,000023:                                                                                                  #        ROUTINE CALCRVG REQUIRES
030160,000024:                                                                                                  #                1) THRUST ACCELERATION INCREMENTS IN DELV SCALED SAME AS PIPAX,Y,Z
030161,000025:                                                                                                  #                2) VN SCALED AT 2(+7) M/CS
030162,000026:                                                                                                  #                3) ADDRESS OF CALCGLUN OR CALCGEAR IN CALCG
030163,000027:                                                                                                  #                4) DELTAT SCALED AT 2(+9) CS
030164,000028:                                                                                                  #                5) PUSH-DOWN COUNTER SET TO ZERO
030165,000029:                                                                                                  #  IT LEAVES UPDATED RN, SCALED AT 2(29-N) M, VN, AND GRAVITY SCALED AT 2(-5) M/CS/CS
030166,000030: 
030167,000031: 
030168,000032:                                                                                                  #        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.

030172,000036: 30,7513                                           BANK     30                                    
030173,000037: 
030174,000038: 30,7513           71173        NORMLISE           ABVAL    3                                     #  COUNT NUMBER OF LEADING ZEROS IN
030175,000039: 30,7514           57715                           TSLC     INCR,1                                #  ABVAL (RN) AND STORE -N(=2-M) IN NSHIFT
030176,000040: 30,7515           67515                           SXA,1    INCR,1                                #  RN MUST BE SCALED AT 2(+29)M
030177,000041: 30,7516           67425                           SXA,1    ITA                                   
030178,000042: 30,7517           00766                                    RN                                    
030179,000043: 30,7520           00047                                    X1                                    
030180,000044: 30,7521           00003                                    2                                     
030181,000045: 30,7522           01041                                    NSHIFT                                #  SAVE C(X1)=-N
030182,000046: 30,7523           00017                                    14D                                   
030183,000047: 30,7524           01042                                    XSHIFT                                #  SAVE C(X1) =14-N
030184,000048: 30,7525           00052                                    S2                                    
030185,000049: 
030186,000050: 30,7526           75175                           VMOVE    1                                     
030187,000051: 30,7527           44376                           VSLT*                                          
030188,000052: 30,7530           00766                                    RN                                    
030189,000053: 30,7531           00035                                    14D,1                                 
030190,000054: 30,7532           32766                           STORE    RN                                    #  RN SCALED AT 2(29-N)METRES
030191,000055: 
030192,000056: 30,7533           76776                           ITC      0                                     
030193,000057: 30,7534           21634                                    CALCGRV1                              
030194,000058: 
030195,000059: 30,7535           44576                           ITCI     0                                     
030196,000060: 30,7536           00052                                    S2                                    
030197,000061: 
030198,000062: 
030199,000063: 30,7537           75776        CALCRVG            VXSC     0                                     
030200,000064: 30,7540           01002                                    DELV                                  
030201,000065: 30,7541           21730                                    KPIP                                  #  DV TO PD SCALED AT 2(+4)M/CS
030202,000066: 
030203,000067: 30,7542           75775                           VXSC     1                                     
030204,000068: 30,7543           73432                           LXA,1    BVSU                                  
030205,000069: 30,7544           01010                                    GRAVITY                               
030206,000070: 30,7545           01030                                    DELTAT                                
030207,000071: 30,7546           01042                                    XSHIFT                                
030208,000072: 30,7547           00001                                    0                                     #  (DV-(OLD GDT))/2 TO PD SCALED 2(+3)M/CS
030209,000073: 
030210,000074: 30,7550           47573                           NOLOD    3                                     
030211,000075: 30,7551           45642                           VSRT     VAD                                   
030212,000076: 30,7552           75620                           VXSC     VSLT*                                 
030213,000077: 30,7553           50625                           VAD      ITA                                   
030214,000078: 30,7554           00005                                    4                                     
030215,000079: 30,7555           00774                                    VN                                    
030216,000080: 30,7556           01030                                    DELTAT                                
030217,000081: 30,7557           00003                                    1,1                                   
030218,000082: 30,7560           00766                                    RN                                    
030219,000083: 30,7561           00052                                    S2                                    
030220,000084: 30,7562           33300                           STORE    RN1                                   #  SCALED AT 2(29-N) METERS
030221,000085: 
030222,000086: 30,7563           76776                           ITC      0                                     
030223,000087: 30,7564           21634                                    CALCGRV1                              
030224,000088: 
030225,000089: 30,7565           47573                           NOLOD    3                                     
030226,000090: 30,7566           75632                           VXSC     BVSU                                  
030227,000091: 30,7567           50626                           VAD      VSRT                                  
030228,000092: 30,7570           50776                           VAD                                            
030229,000093: 30,7571           01030                                    DELTAT                                
030230,000094: 30,7572           77777                                    -                                     #  (DV-(OLD GDT))/2
030231,000095: 30,7573           77777                                    -                                     #  DV/2
030232,000096: 30,7574           00005                                    4                                     
030233,000097: 30,7575           00774                                    VN                                    
030234,000098: 30,7576           33306                           STORE    VN1                                   #  SCALED AT 2(+7) MET/CS
030235,000099: 
030236,000100:                                                                                                  #   IN AVERAGE G, UP THE PHASE BITS BY 2 OF ACTIVE PROG BEFORE COPY CYCLE.
030237,000101: 
030238,000102: 30,7577           77576                           EXIT     0                                     
030239,000103: 
030240,000104: 30,7600           20067                           INDEX    FIXLOC                                
030241,000105: 30,7601           40051                           CS       S2                                    #  SAVE NEG RETURN ADDRESS IN NON-VAC AREA.
030242,000106: 30,7602           51313        CALCRVG2           TS       AVGRETRN                              #  SAVE NEGATIVE OF RETURN ADDRESS.
030243,000107: 
030244,000108: 30,7603           40662                           CS       -PHASE1    +4                         #  PICK UP PHASES.
030245,000109: 30,7604           64516                           AD       ONE                                   #  INCREMENT BY 1.
030246,000110: 30,7605           02312                           TC       NEWPHASE                              #  AND CALL ROUTINE TO CHANGE PHASE.
030247,000111: 30,7606           00005                           OCT      00005                                 
030248,000112: 30,7607           20017        REFAZE6            INHINT                                         
030249,000113: 30,7610           37630                           CAF      ELEVEND                               
030250,000114: 30,7611           50115                           TS       MPAC                                  #  USE MPAC FOR LOOP COUNTER.
030251,000115: 30,7612           20115                           INDEX    MPAC                                  
030252,000116: 30,7613           41277                           CS       RN1                                   #  RN1 AND VN1 MUST BE IN ORDER.
030253,000117: 30,7614           40000                           COM                                            #  LEAVE RN1 ALONE  IN CASE OF RESTARTS.
030254,000118: 30,7615           20115                           INDEX    MPAC                                  #  SELECT THE RIGHT TERM.
030255,000119: 30,7616           50765                           TS       RN                                    #  ...AND GO THRU COPY CYCLE.
030256,000120: 
030257,000121: 30,7617           10115                           CCS      MPAC                                  #  ARE WE DONE..
030258,000122: 30,7620           07611                           TC       REFAZE6    +2                         #  NO, NOT YET.
030259,000123: 30,7621           44515                           CS       BIT2                                  #  YES, MPAC = 0.
030260,000124: 30,7622           70675                           MASK     TMMARKER                              
030261,000125: 30,7623           64515                           AD       BIT2                                  #  SET BIT 2 TO ONE IN TMMARKER.
030262,000126: 30,7624           50675                           TS       TMMARKER                              
030263,000127:                                                                                                  #  WHAT ABOUT GRAVITY FOR RESTART..
030264,000128: 30,7625           20016                           RELINT                                         
030265,000129: 30,7626           41313                           CS       AVGRETRN                              #  NEG OF ADDRESS WAS STORED.
030266,000130: 30,7627           05723                           TC       BANKJUMP                              
030267,000131: 
030268,000132: 
030269,000133: 
030270,000134: 30,7630           00013        ELEVEND            DEC      11         B-14                       #  11D  (ELEVEN DECIMAL, OF COURSE.)
030271,000135: 
030272,000136: 
030273,000137: 
030274,000138: 30,7631           73576        CALCGRAV           LXA,1    0                                     
030275,000139: 30,7632           01042                                    XSHIFT                                
030276,000140: 
030277,000141: 30,7633           47575        CALCGRV1           NOLOD    1                                     
030278,000142: 30,7634           73176                           UNIT                                           
030279,000143: 30,7635           33016                           STORE    UNITR                                 
030280,000144: 
030281,000145: 30,7636           45176                           DMOVE    0                                     
030282,000146: 30,7637           00037                                    30D                                   
030283,000147: 30,7640           33024                           STORE    RMAG                                  #  SCALED AT 2(30-N)M
030284,000148: 
030285,000149: 30,7641           63776                           TSLT     0                                     
030286,000150: 30,7642           00035                                    28D                                   
030287,000151: 30,7643           00004                                    3                                     
030288,000152: 30,7644           33026                           STORE    RMAGSQ                                #  SCALED AT 2(+50)M(+2)
030289,000153: 
030290,000154: 30,7645           45575                           ITA      1                                     
030291,000155: 30,7646           61421                           XAD,1    ITCI                                  
030292,000156: 30,7647           00034                                    27D                                   
030293,000157: 30,7650           01041                                    NSHIFT                                
030294,000158: 30,7651           01043                                    CALCG                                 
030295,000159: 
030296,000160: 30,7652           42776        CALCGEAR           DOT      0                                     
030297,000161: 30,7653           01016                                    UNITR                                 
030298,000162: 30,7654           01044                                    UNITW                                 
030299,000163: 30,7655           32032                           STORE    25D                                   
030300,000164: 
030301,000165: 30,7656           47574                           NOLOD    2                                     
030302,000166: 30,7657           51122                           DSQ      DMP                                   
030303,000167: 30,7660           63726                           TSLT     BDSU                                  
030304,000168: 30,7661           21734                                    DP(5/8)                               
030305,000169: 30,7662           00005                                    4                                     
030306,000170: 30,7663           21732                                    DP2(-3)                               
030307,000171: 
030308,000172: 30,7664           62775                           DDV      1                                     
030309,000173: 30,7665           63376                           TSLT*                                          
030310,000174: 30,7666           21742                                    J(RE)SQ                               #  SCALED AT 2(+40) M(+2)
030311,000175: 30,7667           01026                                    RMAGSQ                                
030312,000176: 30,7670           00001                                    0,1                                   
030313,000177: 30,7671           32030                           STORE    23D                                   #  J(RE/RN) SQ SCALED AT 2(-3)
030314,000178: 
030315,000179: 30,7672           47574                           NOLOD    2                                     
030316,000180: 30,7673           64766                           DMP      VXSC                                  
030317,000181: 30,7674           50776                           VAD                                            
030318,000182: 30,7675           77777                                    -                                     
030319,000183: 30,7676           01016                                    UNITR                                 
030320,000184: 30,7677           01016                                    UNITR                                 
030321,000185: 
030322,000186: 30,7700           64775                           DMP      1                                     
030323,000187: 30,7701           75642                           VXSC     VAD                                   
030324,000188: 30,7702           00030                                    23D                                   
030325,000189: 30,7703           00032                                    25D                                   
030326,000190: 30,7704           01044                                    UNITW                                 
030327,000191: 
030328,000192: 30,7705           45175                           DMOVE    1                                     
030329,000193: 30,7706           76776                           ITC                                            
030330,000194: 30,7707           21736                                    MUEARTH                               
030331,000195: 30,7710           21720                                    MU/RSQ                                
030332,000196: 
030333,000197: 30,7711           75176        CALCGLUN           VMOVE    0                                     
030334,000198: 30,7712           01016                                    UNITR                                 
030335,000199: 
030336,000200: 30,7713           45175                           DMOVE    1                                     
030337,000201: 30,7714           63576                           INCR,1                                         
030338,000202: 30,7715           21740                                    MUMOON                                
030339,000203: 30,7716           00007                                    6                                     
030340,000204: 
030341,000205: 30,7717           47574        MU/RSQ             NOLOD    2                                     
030342,000206: 30,7720           62714                           DDV      TSLT*                                 
030343,000207: 30,7721           75776                           VXSC                                           
030344,000208: 30,7722           01026                                    RMAGSQ                                #  C(X1)=14-2N  (EARTH)
030345,000209: 30,7723           00013                                    5,1                                   #       =20-2N  (MOON)
030346,000210: 30,7724           33010                           STORE    GRAVITY                               #  SCALED AT 2(-5) M/CS/CS
030347,000211: 
030348,000212: 30,7725           44576                           ITCI     0                                     
030349,000213: 30,7726           00034                                    27D                                   
030350,000214: 
030351,000215: 30,7727           23126 25370  KPIP               2DEC     0.59904                               
030352,000216: 30,7731           04000 00000  DP2(-3)            2DEC     0.125                                 
030353,000217: 30,7733           24000 00000  DP(5/8)            2DEC     0.625                                 
030354,000218: 30,7735           00224 17561  MUEARTH            2DEC     .009063188                            #  SCALED AT 2(+42)M(+3)/CS(+2)
030355,000219: 30,7737           00164 34414  MUMOON             2DEC     0.007134481                            #  4.90277800 E12        2(+36)M(+3)/CS(+2)
030356,000220: 30,7741           01730 04155  J(RE)SQ            2DEC     .06006663                             #  SCALED AT 2(+40)M(+2)

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