Source Code

These source-code files are part of a reconstructed copy of Artemis 071, the first release of the Apollo 15 through 17 Command Module (CM) Apollo Guidance Computer (AGC) software.

The reconstruction began with source code of Artemis 072 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes between the two versions. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021154-. Note that page numbers in the reconstructed code match those on the Artemis 072 printout, although the changed code would likely have changed page numbers for a real Artemis 071 listing.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

041998,000002:                                                                                                  ## Copyright:   Public domain.
041999,000003:                                                                                                  ## Filename:    TVCMASSPROP.agc
042000,000004:                                                                                                  ## Purpose:     A section of Artemis revision 071.
042001,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
042002,000006:                                                                                                  ##              release of the flight software for the Command Module's
042003,000007:                                                                                                  ##              (CM) Apollo Guidance Computer (AGC) for Apollo 15 through
042004,000008:                                                                                                  ##              17. The code has been recreated from a copy of Artemis 072.
042005,000009:                                                                                                  ##              It has been adapted such that the resulting bugger words
042006,000010:                                                                                                  ##              exactly match those specified for Artemis 071 in NASA
042007,000011:                                                                                                  ##              drawing 2021154-, which gives relatively high confidence
042008,000012:                                                                                                  ##              that the reconstruction is correct.
042009,000013:                                                                                                  ## Reference:   954
042010,000014:                                                                                                  ## Assembler:   yaYUL
042011,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
042012,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
042013,000017:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Artemis 072.
042014,000018: 

Page 954

042016,000020: 
042017,000021:                                                                                                  #  PROGRAM NAME....MASSPROP
042018,000022:                                                                                                  #  LOG SECTION....TVCMASSPROP            PROGRAMMER...MELANSON (ENGEL, SCHLUNDT)
042019,000023: 
042020,000024: 
042021,000025:                                                                                                  #  FUNCTIONAL DESCRIPTION:
042022,000026: 
042023,000027:                                                                                                  #        MASSPROP OPERATES IN TWO MODES:(1)IF LEM MASS OR CONFIGURATION ARE UPDATED (MASSPROP DOES NOT TEST
042024,000028:                                                                                                  #  FOR THIS) THE ENTIRE PROGRAM MUST BE RUN THROUGH, BREAKPOINT VALUES AND DERIVATIVES OF THE OUTPUTS WITH
042025,000029:                                                                                                  #  RESPECT TO CSM MASS BEING CALCULATED PRIOR TO CALCULATION OF THE OUTPUTS. (2)OTHERWISE, THE OUTPUTS CAN BE
042026,000030:                                                                                                  #  CALCULATED USING PREVIOUSLY COMPUTED BREAKPOINT VALUES AND DERIVATIVES.
042027,000031: 
042028,000032:                                                                                                  #  CALLING SEQUENCES
042029,000033: 
042030,000034:                                                                                                  #        IF LEM MASS OR CONFIGURATION HAS BEEN UPDATED, TRANSFER TO MASSPROP, OTHERWISE TRANSFER TO FIXCW.
042031,000035:                                                                                                  #                L       TC      BANKCALL OR IBNKCALL
042032,000036:                                                                                                  #                L+1     CADR    MASSPROP
042033,000037:                                                                                                  #                        OR
042034,000038:                                                                                                  #                L+1     CADR    FIXCW
042035,000039: 
042036,000040:                                                                                                  #                L+2     RETURNS VIA Q
042037,000041: 
042038,000042:                                                                                                  #  CALLED   IN PARTICULAR BY DONOUN47 (JOB) AND TVCEXECUTIVE (TASK)
042039,000043: 
042040,000044:                                                                                                  #  JOBS OR TASKS INITIATED - NONE
042041,000045: 
042042,000046:                                                                                                  #  SUBROUTINES CALLED - NONE
042043,000047: 
042044,000048:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
042045,000049: 
042046,000050:                                                                                                  #        LEMMASS MUST CONTAIN LEM MASS SCALED AT B+16 IN KILOGRAMS
042047,000051:                                                                                                  #        CSMMASS MUST CONTAIN CSM MASS SCALED AT B+16 IN KILOGRAMS
042048,000052: 
042049,000053:                                                                                                  #        DAPDATR1 MUST BE SET TO INDICATE VEHICLE CONFIGURATION.
042050,000054:                                                                                                  #                BITS (15,14,13)  =  ( 0 , 0 , 1 )       LEM OFF
042051,000055:                                                                                                  #                                    ( 0 , 1 , 0 )       LEM ON (ASCNT,DSCNT)
042052,000056:                                                                                                  #                                    ( 1 , 1 , 0 )       LEM ON (ASCNT ONLY)
042053,000057: 
042054,000058: 
042055,000059:                                                                                                  #  ALARMS - NONE
042056,000060: 
042057,000061:                                                                                                  #  EXIT -   TC     Q
042058,000062: 
042059,000063:                                                                                                  #  OUTPUTS:
042060,000064: 
042061,000065:                                                                                                  #        (1)IXX, SINGLE PRECISION SCALED AT B+20 IN KG-M SQ.
042062,000066:                                                                                                  #        (2)IAVG, SINGLE PRECISION SCALED AT B+20 IN KG-M SQ.
042063,000067:                                                                                                  #        (3)IAVG/TLX, SINGLE PRECISION, SCALED AT B+2 SEC-SQD
042064,000068:                                                                                                  #        THEY ARE STORED IN CONSECUTIVE REGISTERS IXX0, IXX1, IXX2
042065,000069: 
042066,000070:                                                                                                  #        CONVERSION FACTOR:  (SLUG-FTSQ) = 0.737562 (KG-MSQ)
042067,000071: 

Page 955

042069,000073: 
042070,000074:                                                                                                  #  OUTPUTS ARE CALCULATED AS FOLLOWS :
042071,000075: 
042072,000076:                                                                                                  #   (1) IF LEM DOCKED, LEMMASS IS FIRST ELIMINATED AS A PARAMETER
042073,000077: 
042074,000078:                                                                                                  #        VARST0 = INTVALUE0 + LEMMASS(SLOPEVAL0)         IXX             BREAKPOINT VALUE
042075,000079:                                                                                                  #        VARST1 = INTVALUE1 + LEMMASS(SLOPEVAL1)         IAVG            BREAKPOINT VALUE
042076,000080:                                                                                                  #        VARST2 = INTVALUE2 + LEMMASS(SLOPEVAL2)         IAVG/TLX        BREAKPOINT VALUE
042077,000081: 
042078,000082:                                                                                                  #        VARST3 = INTVALUE3 + LEMMASS(SLOPEVAL3)         IAVG/TLX        SLOPE  FOR CSMMASS > 33956 LBS  ( SPS > 10000 LBS)
042079,000083:                                                                                                  #        VARST4 = INTVALUE4 + LEMMASS(SLOPEVAL4)         IAVG            SLOPE  FOR CSMMASS > 33956 LBS  ( SPS > 10000 LBS)
042080,000084: 
042081,000085:                                                                                                  #        VARST5 = INTVALUE5 + LEMMASS(SLOPEVAL5)         IXX             SLOPE  FOR ALL VALUES OF CSMMASS
042082,000086: 
042083,000087:                                                                                                  #        VARST6 = INTVALUE6 + LEMMASS(SLOPEVAL6)         IAVG            SLOPE  FOR CSMMASS < 33956 LBS  ( SPS < 10000 LBS)
042084,000088:                                                                                                  #        VARST7 = INTVALUE7 + LEMMASS(SLOPEVAL7)         IAVG/TLX        SLOPE  FOR CSMMASS < 33956 LBS  ( SPS < 10000 LBS)
042085,000089: 
042086,000090:                                                                                                  #        VARST8 = INTVALUE8 + LEMMASS(SLOPEVAL8)         IAVG            DECREMENT  TO BRKPT VALUE WHEN LEM DSCNT STAGE OFF
042087,000091:                                                                                                  #        VARST9 = INTVALUE9 + LEMMASS(SLOPEVAL9)         IAVG/TLX        DECREMENT  TO BRKPT VALUE WHEN LEM DSCNT STAGE OFF
042088,000092: 
042089,000093:                                                                                                  #   (2) IF LEM NOT DOCKED
042090,000094: 
042091,000095:                                                                                                  #        VARST0 = NOLEMVAL0      WHERE THE MEANING AND SCALING OF VARST0
042092,000096:                                                                                                  #          .         .           TO VARST9 ARE THE SAME AS GIVEN ABOVE
042093,000097:                                                                                                  #          .         .
042094,000098:                                                                                                  #          .         .           NOTE... FOR THIS CASE, VARST8,9 HAVE NO
042095,000099:                                                                                                  #        VARST9 = NOLEMVAL9      MEANING (THEY ARE COMPUTED BUT NOT USED)
042096,000100: 
042097,000101:                                                                                                  #   (3) THE FINAL OUTPUT CALCULATIONS ARE THEN DONE
042098,000102: 
042099,000103:                                                                                                  #        IXX0 =  VARST0 + (CSMMASS + NEGBPW)VARST5               IXX
042100,000104: 
042101,000105:                                                                                                  #        IXX1 =  VARST1 + (CSMMASS + NEGBPW)VARST(4 OR 6)        IAVG
042102,000106: 
042103,000107:                                                                                                  #        IXX2 =  VARST2 + (CSMMASS + NEGBPW)VARST(3 OR 7)        IAVG/TLX
042104,000108: 
042105,000109:                                                                                                  #  THE DATA USED CAME FROM CSM/LM SPACECRAFT OPERATIONAL DATA BOOK.
042106,000110:                                                                                                  #        VOL. 3, NASA DOCUMENT SNA-8-D-027 (MARCH 1968)
042107,000111: 
042108,000112:                                                                                                  #  PERTINENT MASS DATA :         CSM WEIGHT  (FULL)  64100 LBS
042109,000113:                                                                                                  #                                            (EMPTY) 23956 LBS
042110,000114:                                                                                                  #                                LEM WEIGHT  (FULL)  32000 LBS
042111,000115:                                                                                                  #                                            (EMPTY) 14116 LBS
042112,000116: 
042113,000117:                                                                                                  #  (WEIGHTS ARE FROM AMENDMENT #1 (APRIL 24,1968) TO ABOVE DATA BOOK)
042114,000118: 

Page 956

042116,000120: 05,2000                                           SETLOC   DAPMASS                               
042117,000121: 05,2000                                           BANK                                           
042118,000122: 05,3313  E6,1446                                  EBANK=   CNTR                                  
042119,000123: 05,3313                                           COUNT*   $$/MASP                               
042120,000124: 
042121,000125: 
042122,000126: 05,3313           34322        MASSPROP           CAF      NINE                                  #  MASSPROP USES TVC/RCS INTERUPT TEMPS
042123,000127: 05,3314           55506                 +1        TS       PHI333                                #  SET UP TEN PASSES
042124,000128: 05,3315           31465        LEMTEST            CAE      DAPDATR1                              #  DETERMINE LEM STATUS
042125,000129: 05,3316           74754                           MASK     BIT13                                 
042126,000130: 05,3317           00006                           EXTEND                                         
042127,000131: 05,3320           13324                           BZF      LEMYES                                
042128,000132: 
042129,000133: 05,3321           51506        LEMNO              INDEX    PHI333                                #  LEM NOT ATTACHED
042130,000134: 05,3322           33410                           CAF      NOLEMVAL                              
042131,000135: 05,3323           13334                           TCF      STOINST                               
042132,000136: 
042133,000137: 05,3324           31472        LEMYES             CAE      LEMMASS                               #  LEM IS ATTACHED
042134,000138: 05,3325           60000                           DOUBLE                                         
042135,000139: 05,3326           00006                           EXTEND                                         
042136,000140: 05,3327           51506                           INDEX    PHI333                                
042137,000141: 05,3330           73432                           MP       SLOPEVAL                              
042138,000142: 05,3331           20001                           DDOUBL                                         
042139,000143: 05,3332           51506                           INDEX    PHI333                                
042140,000144: 05,3333           63420                           AD       INTVALUE                              
042141,000145: 
042142,000146: 05,3334           51506        STOINST            INDEX    PHI333                                #  STORAGE INST BEGIN HERE
042143,000147: 05,3335           55511                           TS       VARST0                                
042144,000148: 05,3336           11506                           CCS      PHI333                                #  ARE ALL TEN PASSES COMPLETED
042145,000149: 05,3337           13314                           TCF      MASSPROP   +1                         #  NO - GO DECREMENT PHI333
042146,000150: 
042147,000151: 05,3340           11465        DXTEST             CCS      DAPDATR1                              #  IF NEG, BIT15 IS 1, LEM DSCNT STAGE OFF
042148,000152: 05,3341           13347                           TCF      FIXCW                                 
042149,000153: 05,3342           13347                           TCF      FIXCW                                 
042150,000154: 05,3343           53522                           DXCH     VARST0     +8D                        
042151,000155: 05,3344           21513                           DAS      VARST0     +1                         
042152,000156: 05,3345           33445                           CA       DXITFIX                               
042153,000157: 05,3346           27520                           ADS      VARST0     +7                         
042154,000158: 
042155,000159: 05,3347           34767        FIXCW              CAF      BIT2                                  #  COMPUTATION PHASE BEGINS HERE.  SET UP
042156,000160: 05,3350           55506                           TS       PHI333                                #  THREE PASSES
042157,000161: 05,3351           55507                           TS       PSI333                                
042158,000162: 
042159,000163: 05,3352           31473                           CAE      CSMMASS                               #  GET DELTA CSM WEIGHT - SIGN DETERMINES
042160,000164: 05,3353           63444                           AD       NEGBPW                                #  SLOPE LOCATIONS.
042161,000165: 05,3354           60000                           DOUBLE                                         
042162,000166: 05,3355           55510                           TS       TEMP333                               
042163,000167: 
042164,000168: 05,3356           00006                           EXTEND                                         
042165,000169: 05,3357           63362                           BZMF     PEGGY                                 #  DETERMINE CORRECT SLOPE

Page 957

042167,000171: 05,3360           37701                           CAF      NEG2                                  
042168,000172: 05,3361           55506                           TS       PHI333                                
042169,000173: 
042170,000174: 05,3362           51506        PEGGY              INDEX    PHI333                                #  ALL IS READY - CALCULATE OUTPUTS NOW
042171,000175: 05,3363           31516                           CAE      VARST5                                #  GET SLOPE
042172,000176: 05,3364           00006                           EXTEND                                         
042173,000177: 05,3365           71510                           MP       TEMP333                               #  MULT BY DELTA CSM WEIGHT
042174,000178: 05,3366           60000                           DOUBLE                                         
042175,000179: 05,3367           51507                           INDEX    PSI333                                
042176,000180: 05,3370           61511                           AD       VARST0                                #  ADD BREAKPOINT VALUE
042177,000181: 05,3371           51507                           INDEX    PSI333                                
042178,000182: 05,3372           55467                           TS       IXX                                   #  ****** OUTPUTS (IXX0, IXX1, IXX2) ******
042179,000183: 
042180,000184: 
042181,000185: 05,3373           11507                           CCS      PSI333                                #  BOOKKEEPING  - MASSPROP FINISHED OR NOT
042182,000186: 05,3374           13404                           TCF      BOKKEP2                               #  NO - GO TAKE CARE OF INDEXING REGISTERS
042183,000187: 
042184,000188: 05,3375           31465                           CAE      DAPDATR1                              #  UPDATE WEIGHT/G
042185,000189: 05,3376           74753                           MASK     BIT14                                 
042186,000190: 05,3377           10000                           CCS      A                                     
042187,000191: 05,3400           31472                           CA       LEMMASS                               
042188,000192: 05,3401           61473                           AD       CSMMASS                               
042189,000193: 05,3402           55475                           TS       WEIGHT/G                              #  SCALED AT B+16 IN KILOGRAMS
042190,000194: 05,3403           00002        ENDMASSP           TC       Q                                     
042191,000195: 
042192,000196: 05,3404           55507        BOKKEP2            TS       PSI333                                #  REDUCE PSI BY ONE
042193,000197: 05,3405           00006                           EXTEND                                         
042194,000198: 05,3406           27506                           DIM      PHI333                                
042195,000199: 05,3407           13362                           TCF      PEGGY                                 
042196,000200: 

Page 958

042198,000202: 
042199,000203: 05,3410           00616        NOLEMVAL           DEC      25445.     B-20                       
042200,000204: 05,3411           02526                           DEC      87450.     B-20                       
042201,000205: 05,3412           02352                           DEC      .30715     B-2                        
042202,000206: 05,3413           01471                           DEC      1.22877    E-5        B+12            
042203,000207: 05,3414           00634                           DEC      1.6096     B-6                        
042204,000208: 05,3415           00612                           DEC      1.54       B-6                        
042205,000209: 05,3416           03706                           DEC      7.77177    B-6                        
042206,000210: 05,3417           04425                           DEC      3.46458    E-5        B+12            
042207,000211: 
042208,000212: 05,3420           00644        INTVALUE           DEC      26850      B-20                       
042209,000213: 05,3421           03710                           DEC      127518     B-20                       
042210,000214: 05,3422           04246                           DEC      .54059     B-2                        
042211,000215: 05,3423           02011                           DEC      .153964    E-4        B+12            
042212,000216: 05,3424           77501                           DEC      -.742923   B-6                        
042213,000217: 05,3425           00612                           DEC      1.5398     B-6                        
042214,000218: 05,3426           04656                           DEC      9.68       B-6                        
042215,000219: 05,3427           10372                           DEC      .647625    E-4        B+12            
042216,000220: 05,3430           77126                           DEC      -27228.    B-20                       
042217,000221: 05,3431           76261                           DEC      -.206476   B-2                        
042218,000222: 
042219,000223: 05,3432           00767        SLOPEVAL           DEC      1.96307    B-6                        
042220,000224: 05,3433           15624                           DEC      27.5774    B-6                        
042221,000225: 05,3434           03054                           DEC      2.3548     E-5        B+12            
042222,000226: 05,3435           04532                           DEC      2.1777     E-9        B+26            
042223,000227: 05,3436           10433                           DEC      1.044      E-3        B+8             
042224,000228: 05,3437           00000                           DEC      0          B-14                       
042225,000229: 05,3440           22070                           DEC      2.21068    E-3        B+8             
042226,000230: 05,3441           03204                           DEC      1.5166     E-9        B+26            
042227,000231: 05,3442           77266                           DEC      -1.284     B-6                        
042228,000232: 05,3443           02476                           DEC      2.         E-5        B+12            
042229,000233: 
042230,000234: 05,3444           70364        NEGBPW             DEC      -15402.17  B-16                       
042231,000235: 05,3445           75420        DXITFIX            DEC*     -1.88275   E-5        B+12*           

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