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.

008056,000002:                                                                                                  ## Copyright:   Public domain.
008057,000003:                                                                                                  ## Filename:    IMU_COMPENSATION_PACKAGE.agc
008058,000004:                                                                                                  ## Purpose:     A section of Corona revision 261.
008059,000005:                                                                                                  ##              It is part of the source code for the Apollo Guidance Computer
008060,000006:                                                                                                  ##              (AGC) for AS-202. No original listings of this software are
008061,000007:                                                                                                  ##              available; instead, this file was created via disassembly of
008062,000008:                                                                                                  ##              the core rope modules actually flown on the mission.
008063,000009:                                                                                                  ## Assembler:   yaYUL
008064,000010:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
008065,000011:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
008066,000012:                                                                                                  ## Mod history: 2023-05-27 MAS  Created from Solarium 55.
008067,000013:                                                                                                  ##              2023-06-17 MAS  Updated for Corona.
008068,000014: 
008069,000015: 
008070,000016:                                                                                                  #        THE FOLLWOING ROUTINE IS DESIGNED TO COMPENSATE FOR PIPA BIAS AND SCALE FACTOR ERROR. ATTHE SAME TIME,
008071,000017:                                                                                                  #  IT ACCUMULATES GYRO TORQUE COMMANDS NECESSARY TO COMPENSATE FOR THE ASSOCIATED BIAS AND ACCELERATION-CAUSED GYRO
008072,000018:                                                                                                  #  DRIFTS. THIS ROUTINE EXPECTS TO FIND PIPA READINGS IN THE MAJOR PARTS OF DELV (DELVX, DELVY, DELVZ), WITH THE
008073,000019:                                                                                                  #  MINOR PARTS IRRELEVANT. OUTPUT FROM 1/PIPA IS DOUBLE PRECISION COMPENSATED DATA, THE MINOR PART OF WHICH USUALLY
008074,000020:                                                                                                  #  CONTAINS ALL THE COMPENSATION. 1/PIPA MUST BE CALLED AT LEAST EVERY 2.56 SECONDS, DUE TO SCALING CONSIDERATIONS.
008075,000021:                                                                                                  #  SPECIFICALLY, THE CORRECTION IS:
008076,000022: 
008077,000023:                                                                                                  #        PIPA  = PIPA (1 + SCALE FACTOR ERROR) - BIAS DELTAT
008078,000024:                                                                                                  #            C       I
008079,000025: 
008080,000026:                                                                                                  #  WHERE PIPA  IS THE COMPENSATED DATA OBTAINED FROM THE SAMPLED PIPA .
008081,000027:                                                                                                  #            C                                                       I
008082,000028: 
008083,000029: 
008084,000030: 
008085,000031: 14,7007                                           BANK     14                                    
008086,000032: 14,7007           35502        1/PIPA             CAF      FOUR                                  #  LOOP TO PROCESS INPUT PIPA DATA.
008087,000033: 14,7010           50101                 +1        TS       BUF        +2                         
008088,000034: 14,7011           20000                           INDEX    A                                     
008089,000035: 14,7012           41001                           CS       DELVX                                 #  SAMPLED PIPA INTO MPAC
008090,000036: 14,7013           50115                           TS       MPAC                                  
008091,000037: 14,7014           20101                           INDEX    BUF        +2                         #  SUBTRACT BIAS TERM (LESS THAN 1 BIT).
008092,000038: 14,7015           40736                           CS       PIPABIAS                              
008093,000039: 14,7016           25777                           EXTEND                                         
008094,000040: 14,7017           40755                           MP       1/PIPADT                              #  SUPPLIED BY USER SCALED AT CS 2(-8),
008095,000041: 14,7020           50116                           TS       MPAC       +1                         
008096,000042: 
008097,000043: 14,7021           40115                           CS       MPAC                                  #  SHIFT THE PIPA READING LEFT THREE PLACES
008098,000044: 14,7022           50115                           TS       MPAC                                  
008099,000045: 14,7023           25777                           EXTEND                                         #  IN PREPARATION FOR SCALE FACTOR
008100,000046: 14,7024           44513                           MP       BIT4                                  #  CORRECTION. IF IT OVERFLOWS, SHIFT THE
008101,000047: 14,7025           10000                           CCS      A                                     #  SCALE FACTOR ERROR RIGHT 11 PLACES
008102,000048: 14,7026           07205                           TC       PIPOVF                                #  TAKING A LOSS IN PRECISION.
008103,000049: 
008104,000050: 14,7027           07031                           TC       +2                                    #  THE ABOVE HAPPENS AT DELTA VS OF OVER
008105,000051: 14,7030           07205                           TC       PIPOVF                                #  12 G-SECS., RESULTING IN A SCALE FACTOR
008106,000052: 14,7031           20101                           INDEX    BUF        +2                         #  CORRECTION GOOD ONLY TO 60 PPM.
008107,000053: 14,7032           40737                           CS       PIPASCF                               
008108,000054: 14,7033           25777                           EXTEND                                         
008109,000055: 14,7034           40003                           MP       LP                                    
008110,000056: 14,7035           60116                           AD       MPAC       +1                         #  ADD TO BIAS CORRECTION.
008111,000057: 14,7036           20101                           INDEX    BUF        +2                         
008112,000058: 14,7037           51002                           TS       DELVX      +1                         #  AND MAYBE SKIP.
008113,000059: 14,7040           35501                           CAF      ZERO                                  
008114,000060: 
008115,000061: 14,7041           60115                           AD       MPAC                                  
008116,000062: 14,7042           20101                           INDEX    BUF        +2                         
008117,000063: 14,7043           51001                           TS       DELVX                                 
008118,000064: 
008119,000065: 14,7044           10101        PIPJUMP            CCS      BUF        +2                         #  LOOP TO PROCESS NEXT COMPONENT.
008120,000066: 14,7045           64335                           AD       NEG1                                  
008121,000067: 14,7046           07010                           TC       1/PIPA     +1                         
008122,000068: 14,7047           00756        LGCOMP             ADRES    GCOMP                                 
008123,000069: 
008124,000070: 
008125,000071:                                                                                                  #        THE FOLLOWING ROUTINE COMPUTES THE GYRO TORQUES NECESSARY TO COMPENSATE FOR THE ACCELERATION-SENSITIVE
008126,000072:                                                                                                  #  DRIFTS DUE TO THE DATA JUST PROCESSED, AND SUMS THEM INTO THE GCOMP REGISTERS.
008127,000073: 
008128,000074: 14,7050           50101                           TS       GCOMPSW                               #  SET GYRO TORQUE INDICATOR TO ZERO.
008129,000075: 14,7051           50077                           TS       BUF                                   #  RELATIVE ADDRESS OF PRESENT COMPONENT.
008130,000076: 
008131,000077: 14,7052           41001                           CS       DELVX                                 #  PROCESS X COMPONENT.
008132,000078: 14,7053           50115                           TS       MPAC                                  
008133,000079: 14,7054           41002                           CS       DELVX      +1                         
008134,000080: 14,7055           50116                           TS       MPAC       +1                         
008135,000081: 14,7056           40747                           CS       ADIAX                                 
008136,000082: 14,7057           07134                           TC       GCOMPSUB   -1                         
008137,000083: 
008138,000084: 14,7060           41003                           CS       DELVY                                 
008139,000085: 14,7061           50115                           TS       MPAC                                  
008140,000086: 14,7062           41004                           CS       DELVY      +1                         
008141,000087: 14,7063           50116                           TS       MPAC       +1                         
008142,000088: 14,7064           40752                           CS       ADSRAX                                
008143,000089: 14,7065           07135                           TC       GCOMPSUB                              
008144,000090: 
008145,000091: 14,7066           40744                           CS       GBIASX                                #  ADD IN BIAS DRIFTS.
008146,000092: 14,7067           07160                           TC       DRIFTSUB                              
008147,000093: 
008148,000094: 14,7070           41003                           CS       DELVY                                 #  COMPUTE Y GYRO COMPENSATION.
008149,000095: 14,7071           50115                           TS       MPAC                                  
008150,000096: 14,7072           41004                           CS       DELVY      +1                         
008151,000097: 14,7073           50116                           TS       MPAC       +1                         
008152,000098: 14,7074           40750                           CS       ADIAY                                 
008153,000099: 14,7075           07134                           TC       GCOMPSUB   -1                         
008154,000100: 
008155,000101: 14,7076           41005                           CS       DELVZ                                 
008156,000102: 14,7077           50115                           TS       MPAC                                  
008157,000103: 14,7100           41006                           CS       DELVZ      +1                         
008158,000104: 14,7101           50116                           TS       MPAC       +1                         
008159,000105: 14,7102           40753                           CS       ADSRAY                                
008160,000106: 14,7103           07135                           TC       GCOMPSUB                              
008161,000107: 
008162,000108: 14,7104           40745                           CS       GBIASY                                
008163,000109: 14,7105           07160                           TC       DRIFTSUB                              
008164,000110: 
008165,000111: 14,7106           41003                           CS       DELVY                                 #  CORRESPONDING PATTERN FOR Z GYRO.
008166,000112: 14,7107           50115                           TS       MPAC                                  
008167,000113: 14,7110           41004                           CS       DELVY      +1                         
008168,000114: 14,7111           50116                           TS       MPAC       +1                         
008169,000115: 14,7112           40754                           CS       ADSRAZ                                
008170,000116: 14,7113           07134                           TC       GCOMPSUB   -1                         
008171,000117: 
008172,000118: 14,7114           41005                           CS       DELVZ                                 
008173,000119: 14,7115           50115                           TS       MPAC                                  
008174,000120: 14,7116           41006                           CS       DELVZ      +1                         
008175,000121: 14,7117           50116                           TS       MPAC       +1                         
008176,000122: 14,7120           40751                           CS       ADIAZ                                 
008177,000123: 14,7121           07134                           TC       GCOMPSUB   -1                         
008178,000124: 
008179,000125: 14,7122           40746                           CS       GBIASZ                                
008180,000126: 14,7123           07160                           TC       DRIFTSUB                              
008181,000127: 
008182,000128: 14,7124           10101                           CCS      GCOMPSW                               #  NON-ZERO IF TIME TO PUT OUT COMPENSATION
008183,000129: 14,7125           07127                           TC       +2                                    
008184,000130: 14,7126           05702                           TC       SWRETURN                              #  TORQUES NOT BIG ENOUGH YET.
008185,000131: 
008186,000132: 14,7127           20017                           INHINT                                         
008187,000133: 14,7130           32170                           CAF      PRIO35                                #  REQUEST COMPENSATION JOB
008188,000134: 14,7131           02052                           TC       NOVAC                                 
008189,000135: 14,7132           31225                           CADR     1/GYRO                                
008190,000136: 
008191,000137: 14,7133           06020                           TC       MODEEXIT                              #  RELINT AND RETURN TO SWRETURN.
008192,000138: 
008193,000139: 
008194,000140:                                                                                                  #        SUBROUTINES USED TO ACCUMULATE GYRO COMPENSATION COMMANDS.
008195,000141: 
008196,000142: 14,7134           40000                 -1        COM                                            #  (ENTERS HERE TO RE-COMPLEMENT INPUT).
008197,000143: 14,7135           30116        GCOMPSUB           XCH      MPAC       +1                         #  DOES DP BY SINGLE MULTIPLY WITH DP ADD
008198,000144: 14,7136           25777                           EXTEND                                         #  TO STORAGE.
008199,000145: 14,7137           40116                           MP       MPAC       +1                         
008200,000146: 14,7140           30116                           XCH      MPAC       +1                         
008201,000147: 14,7141           25777                           EXTEND                                         
008202,000148: 14,7142           40115                           MP       MPAC                                  
008203,000149: 14,7143           50034                           TS       OVCTR                                 
008204,000150: 14,7144           30003                           XCH      LP                                    
008205,000151: 14,7145           60116                           AD       MPAC       +1                         #  (AND MAYBE INCREMENT OVCTR).
008206,000152: 
008207,000153: 14,7146           20077        BIASCOMP           INDEX    BUF                                   #  BIAS COMPENSATION ENTERS HERE.
008208,000154: 14,7147           60757                           AD       GCOMP      +1                         
008209,000155: 14,7150           20077                           INDEX    BUF                                   
008210,000156: 14,7151           30757                           XCH      GCOMP      +1                         
008211,000157: 14,7152           30034                           XCH      OVCTR                                 
008212,000158: 14,7153           20077                           INDEX    BUF                                   
008213,000159: 14,7154           60756                           AD       GCOMP                                 
008214,000160: 14,7155           20077                           INDEX    BUF                                   
008215,000161: 14,7156           50756                           TS       GCOMP                                 
008216,000162: 
008217,000163: 14,7157           00001                           TC       Q                                     
008218,000164: 
008219,000165: 
008220,000166:                                                                                                  #        SUBROUTINE WHICH ADDS IN GYRO BIAS DRIFT, TESTS TORQUE SIZE TO SEE IF COMMANDS SHOULD BE PUT OUT, AND
008221,000167:                                                                                                  #  ADVANCES GCOMP POINTER.
008222,000168: 
008223,000169: 14,7160           30001        DRIFTSUB           XCH      Q                                     
008224,000170: 14,7161           50100                           TS       BUF        +1                         
008225,000171: 14,7162           30001                           XCH      Q                                     
008226,000172: 14,7163           25777                           EXTEND                                         
008227,000173: 14,7164           40755                           MP       1/PIPADT                              
008228,000174: 14,7165           25777                           EXTEND                                         #  RESULT WAS IN GYRO PULSES X 2(+2).
008229,000175: 14,7166           45502                           MP       FOUR                                  #  RE-SCALE TO ADD INTO GCOMP REGISTER.
008230,000176: 14,7167           50034                           TS       OVCTR                                 
008231,000177: 14,7170           30003                           XCH      LP                                    #  GO TO STANDARD INCREMENT ROUTINE.
008232,000178: 14,7171           07146        DRFTSUB2           TC       BIASCOMP                              
008233,000179: 
008234,000180: 14,7172           35503                           CAF      TWO                                   #  INCREMENT POINTER AND
008235,000181: 14,7173           60077                           AD       BUF                                   
008236,000182: 14,7174           30077                           XCH      BUF                                   #  CHECK MAGNITUDE OF TORQUE COMMAND. IF
008237,000183: 14,7175           20000                           INDEX    A                                     #  SUFFICIENTLY LARGE, SET GCOMPSW PNZ TO
008238,000184: 14,7176           10756                           CCS      GCOMP                                 #  CALL FOR COMPENSATION JOB, 1/GYRO.
008239,000185: 14,7177           07201                           TC       +2                                    #  GETS DABS OF COMMAND.
008240,000186: 14,7200           00100                           TC       BUF        +1                         
008241,000187: 
008242,000188: 14,7201           77246                           MASK     COMPCHK                               
008243,000189: 14,7202           10000                           CCS      A                                     
008244,000190: 14,7203           50101                           TS       GCOMPSW                               
008245,000191: 14,7204           00100                           TC       BUF        +1                         #  RETURN.
008246,000192: 
008247,000193: 
008248,000194:                                                                                                  #        (1/PIPA COMES HERE IF PIPA COUNTER SHOWED A DELTA V OF OVER 12 G-SEC.)
008249,000195: 
008250,000196: 14,7205           20101        PIPOVF             INDEX    BUF        +2                         #  SHIFT THE SCALE FACTOR RIGHT 11 ON OVF.
008251,000197: 14,7206           40737                           CS       PIPASCF                               
008252,000198: 14,7207           25777                           EXTEND                                         
008253,000199: 14,7210           44513                           MP       BIT4                                  
008254,000200: 14,7211           25777                           EXTEND                                         #  FORM DP INCREMENT TO DELV IN THIS CASE.
008255,000201: 14,7212           40115                           MP       MPAC                                  
008256,000202: 14,7213           50034                           TS       OVCTR                                 
008257,000203: 
008258,000204: 14,7214           30003                           XCH      LP                                    
008259,000205: 14,7215           60116                           AD       MPAC       +1                         #  MAYBE INCREMENTING OVCTR.
008260,000206: 14,7216           20101                           INDEX    BUF        +2                         
008261,000207: 14,7217           31002                           XCH      DELVX      +1                         #  NO SKIP SINCE OVCTR SET.
008262,000208: 14,7220           30034                           XCH      OVCTR                                 
008263,000209: 14,7221           60115                           AD       MPAC                                  
008264,000210: 14,7222           20101                           INDEX    BUF        +2                         
008265,000211: 14,7223           31001                           XCH      DELVX                                 
008266,000212: 14,7224           07044                           TC       PIPJUMP                               #  JUMP ON LOOP COUNTER.
008267,000213: 
008268,000214: 
008269,000215:                                                                                                  #        THE FOLLOWING JOB IS INITIATED BY 1/PIPA TO PUT OUT COMPENSATING GYRO TORQUE COMMANDS.
008270,000216: 
008271,000217: 14,7225           34504        1/GYRO             CAF      BIT11                                 #  IF MODE SWITCH IN PROGRESS, DONT PUT
008272,000218: 14,7226           70646                           MASK     FLAGWRD1                              #  OUT COMPENSATION THIS TIME.
008273,000219: 14,7227           10000                           CCS      A                                     
008274,000220: 14,7230           02124                           TC       ENDOFJOB                              
008275,000221: 
008276,000222: 14,7231           03424                           TC       FLAG1UP                               #  SHOW IMU ACTIVITY
008277,000223: 14,7232           02000                           OCT      02000                                 #  FLAG TURNED OFF BY GYRO ROUTINES.
008278,000224: 
008279,000225: 14,7233           37047                           CAF      LGCOMP                                #  DISABLE THE T4RUPT CDU DRIVE THEMSELVES.
008280,000226: 14,7234           05654                           TC       BANKCALL                              
008281,000227: 14,7235           31335                           CADR     GYROSPNT                              #  NO TWITCH (2+2-) ON ZERO INPUT.
008282,000228: 
008283,000229: 14,7236           05654                           TC       BANKCALL                              
008284,000230: 14,7237           30331                           CADR     IMUSTALL                              
008285,000231: 14,7240           03074                           TC       CURTAINS                              
008286,000232: 
008287,000233: 14,7241           35501                           CAF      ZERO                                  #  ZERO GCOMP REGSITERS SINCE COMMANDS HAVE
008288,000234: 14,7242           50756                           TS       GCOMP                                 #  BEEN PUT OUT.
008289,000235: 14,7243           50760                           TS       GCOMP      +2                         
008290,000236: 14,7244           50762                           TS       GCOMP      +4                         
008291,000237: 
008292,000238: 14,7245           02124                           TC       ENDOFJOB                              
008293,000239: 
008294,000240: 14,7246           77740        COMPCHK            OCT      -37                                   #  COMMANDS MUST BE AT LEAST 32 PLS.
008295,000241: 
008296,000242: 
008297,000243:                                                                                                  #        THE FOLLOWING ROUTINE SUPPLIES GYRO DRIFT COMPENSATION DURING THOSE PORTIONS OF A MISSION WHICH DO NOT
008298,000244:                                                                                                  #  USE PIPA DATA. THIS JOB IS CALLED EVERY 81.93 SECONDS (WHEN APPROPRIATE) BY THE IDLE TASK.
008299,000245: 
008300,000246: 14,7247           40036        BIASONLY           CS       TIME1                                 #  COMPUTE TIME DIFFERENCE (ALMOST ALWAYS
008301,000247: 14,7250           40000                           COM                                            #  81.93 SECS.).
008302,000248: 14,7251           30755                           XCH      OLDBT1                                
008303,000249: 14,7252           40000                           COM                                            
008304,000250: 14,7253           60755                           AD       OLDBT1                                
008305,000251: 14,7254           10000        BONLY2             CCS      A                                     #  LASTBIAS ENTERS HERE.
008306,000252: 14,7255           64516                           AD       ONE                                   
008307,000253: 14,7256           07263                           TC       BONLY3                                
008308,000254: 14,7257           07261                           TC       +2                                    
008309,000255: 14,7260           02124                           TC       ENDOFJOB                              #  MAY HAVE A COMPUTED DIFF = 0.
008310,000256: 
008311,000257: 14,7261           40000                           COM                                            
008312,000258: 14,7262           64476                           AD       POSMAX                                
008313,000259: 
008314,000260: 14,7263           25777        BONLY3             EXTEND                                         #  FORM DELTA-T AT 2(+8) CS.
008315,000261: 14,7264           44506                           MP       BIT9                                  #  SHIFT RIGHT 6.
008316,000262: 14,7265           50115                           TS       MPAC                                  
008317,000263: 14,7266           50106                           TS       TEM9                                  
008318,000264: 14,7267           30003                           XCH      LP                                    
008319,000265: 14,7270           50116                           TS       MPAC       +1                         
008320,000266: 14,7271           50107                           TS       TEM10                                 
008321,000267: 14,7272           35501                           CAF      ZERO                                  
008322,000268: 14,7273           50101                           TS       GCOMPSW                               
008323,000269: 14,7274           50077                           TS       BUF                                   
008324,000270: 
008325,000271: 14,7275           40744                           CS       GBIASX                                #  DO X, Y, AND THEN Z.
008326,000272: 14,7276           07317                           TC       FBIASSUB                              
008327,000273: 
008328,000274: 14,7277           40106                           CS       TEM9                                  #  RELOAD DT.
008329,000275: 14,7300           50115                           TS       MPAC                                  
008330,000276: 14,7301           40107                           CS       TEM10                                 
008331,000277: 14,7302           50116                           TS       MPAC       +1                         
008332,000278: 14,7303           40745                           CS       GBIASY                                
008333,000279: 14,7304           07316                           TC       FBIASSUB   -1                         
008334,000280: 
008335,000281: 14,7305           40106                           CS       TEM9                                  
008336,000282: 14,7306           50115                           TS       MPAC                                  
008337,000283: 14,7307           40107                           CS       TEM10                                 
008338,000284: 14,7310           50116                           TS       MPAC       +1                         
008339,000285: 14,7311           40746                           CS       GBIASZ                                
008340,000286: 14,7312           07316                           TC       FBIASSUB   -1                         
008341,000287: 14,7313           10101                           CCS      GCOMPSW                               #  PUT OUT COMPENSATION IF CALLED FOR.
008342,000288: 14,7314           07225                           TC       1/GYRO                                
008343,000289: 14,7315           02124                           TC       ENDOFJOB                              
008344,000290: 
008345,000291: 14,7316           40000                 -1        COM                                            
008346,000292: 14,7317           30001        FBIASSUB           XCH      Q                                     
008347,000293: 14,7320           50100                           TS       BUF        +1                         
008348,000294: 14,7321           35501                           CAF      ZERO                                  
008349,000295: 14,7322           50117                           TS       MPAC       +2                         
008350,000296: 14,7323           30001                           XCH      Q                                     
008351,000297: 14,7324           05416                           TC       SHORTMP                               
008352,000298: 14,7325           30115                           XCH      MPAC                                  
008353,000299: 14,7326           50034                           TS       OVCTR                                 
008354,000300: 14,7327           30116                           XCH      MPAC       +1                         
008355,000301: 14,7330           07171                           TC       DRFTSUB2                              #  RETURN TO CALLER VIA BUF +1.
008356,000302: 
008357,000303: 14,7331           30755        LASTBIAS           XCH      OLDBT1                                #  COMES HERE FOR TRANSITION TO PIPA READ-
008358,000304: 14,7332           40000                           COM                                            #  ING MODE. NEW VALUE OF 1/PIPADT ARRIVES
008359,000305: 14,7333           60115                           AD       MPAC                                  #  IN A WITH WITH TIME1 AT PIPA ZEROING IN
008360,000306: 14,7334           07254                           TC       BONLY2                                #  MPAC. EXITS VIA ENDOFJOB.

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