Source Code

These source-code files are part of a reconstructed copy of Comanche 72, the first release of the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 13.

They have been adapted from sources files created from a listing of Comanche 55. These source files were updated to match binary dumps of a set of Comanche 67 rope modules. They were then further modified by applying known changes between Comanche 67 and Comanche 72. A binary dump of module B2 of Comanche 72, part number 2010802-021, was also used to validate changes made to banks 05-13. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments.

Since no contemporary listings of Comanche 72 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.

040887,000002:                                                                                                  ## Copyright:   Public domain.
040888,000003:                                                                                                  ## Filename:    TVCMASSPROP.agc
040889,000004:                                                                                                  ## Purpose:     A section of Comanche revision 072.
040890,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
040891,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
040892,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
040893,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
040894,000009:                                                                                                  ##              from a printout of Comanche 055, binary dumps of a set of
040895,000010:                                                                                                  ##              Comanche 067 rope modules, and changelogs between Comanche 067
040896,000011:                                                                                                  ##              and 072. It has been adapted such that the resulting bugger words
040897,000012:                                                                                                  ##              exactly match those specified for Comanche 072 in NASA drawing
040898,000013:                                                                                                  ##              2021153G, which gives relatively high confidence that the
040899,000014:                                                                                                  ##              reconstruction is correct.
040900,000015:                                                                                                  ## Assembler:   yaYUL
040901,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
040902,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
040903,000018:                                                                                                  ## Mod history: 2024-05-13 MAS  Created from Comanche 067.
040904,000019: 
040905,000020:                                                                                                  #  PROGRAM NAME....MASSPROP
040906,000021:                                                                                                  #  LOG SECTION....TVCMASSPROP            PROGRAMMER...MELANSON (ENGEL, SCHLUNDT)
040907,000022: 
040908,000023:                                                                                                  #  FUNCTIONAL DESCRIPTION:
040909,000024: 
040910,000025:                                                                                                  #        MASSPROP OPERATES IN TWO MODES: (1) IF LEM MASS OR CONFIGURATION ARE UPDATED (MASSPROP DOES NOT TEST
040911,000026:                                                                                                  #        FOR THIS) THE ENTIRE PROGRAM MUST BE RUN THROUGH, BREAKPOINT VALUES AND DERIVATIVES OF THE OUTPUTS WITH
040912,000027:                                                                                                  #        RESPECT TO CSM MASS BEING CALCULATED PRIOR TO CALCULATION OF THE OUTPUTS.  (2) OTHERWISE, THE OUTPUTS CAN BE
040913,000028:                                                                                                  #        CALCULATED USING PREVIOUSLY COMPUTED BREAKPOINT VALUES AND DERIVATIVES.
040914,000029: 
040915,000030:                                                                                                  #  CALLING SEQUENCES
040916,000031: 
040917,000032:                                                                                                  #        IF LEM MASS OR CONFIGURATION HAS BEEN UPDATED, TRANSFER TO MASSPROP, OTHERWISE TRANSFER TO FIXCW.
040918,000033:                                                                                                  #                L       TC      BANKCALL OR IBNKCALL
040919,000034:                                                                                                  #                L+1     CADR    MASSPROP
040920,000035:                                                                                                  #                        OR
040921,000036:                                                                                                  #                L+1     CADR    FIXCW
040922,000037:                                                                                                  #                L+2     RETURNS VIA Q
040923,000038: 
040924,000039:                                                                                                  #  CALLED   IN PARTICULAR BY DONOUN47 (JOB) AND TVCEXECUTIVE (TASK)
040925,000040: 
040926,000041:                                                                                                  #  JOBS OR TASKS INITIATED - NONE
040927,000042: 
040928,000043:                                                                                                  #  SUBROUTINES CALLED - NONE
040929,000044: 
040930,000045:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
040931,000046: 
040932,000047:                                                                                                  #        LEMMASS MUST CONTAIN LEM MASS SCALED AT B+16 IN KILOGRAMS
040933,000048:                                                                                                  #        CSMMASS MUST CONTAIN CSM MASS SCALED AT B+16 IN KILOGRAMS
040934,000049:                                                                                                  #        DAPDATR1 MUST BE SET TO INDICATE VEHICLE CONFIGURATION.
040935,000050:                                                                                                  #                BITS (15,14,13)  =  ( 0 , 0 , 1 )       LEM OFF
040936,000051:                                                                                                  #                                    ( 0 , 1 , 0 )       LEM ON (ASCNT,DSCNT)
040937,000052:                                                                                                  #                                    ( 1 , 1 , 0 )       LEM ON (ASCNT ONLY)
040938,000053: 
040939,000054:                                                                                                  #  ALARMS - NONE
040940,000055: 
040941,000056:                                                                                                  #  EXIT -   TC   Q
040942,000057: 
040943,000058:                                                                                                  #  OUTPUTS:
040944,000059: 
040945,000060:                                                                                                  #        (1)     IXX, SINGLE PRECISION SCALED AT B+20 IN KG-M SQ.
040946,000061:                                                                                                  #        (2)     IAVG, SINGLE PRECISION SCALED AT B+20 IN KG-M SQ.
040947,000062:                                                                                                  #        (3)     IAVG/TLX, SINGLE PRECISION, SCALED AT B+2 SEC-SQD
040948,000063:                                                                                                  #        
040949,000064:                                                                                                  #        THEY ARE STORED IN CONSECUTIVE REGISTERS IXX0, IXX1, IXX2
040950,000065:                                                                                                  #        CONVERSION FACTOR:  (SLUG-FTSQ) = 0.737562 (KG-MSQ)
040951,000066: 
040952,000067:                                                                                                  #  OUTPUTS ARE CALCULATED AS FOLLOWS:
040953,000068: 
040954,000069:                                                                                                  #        (1)     IF LEM DOCKED, LEMMASS IS FIRST ELIMINATED AS A PARAMETER
040955,000070: 
040956,000071:                                                                                                  #                VARST0 = INTVALUE0 + LEMMASS(SLOPEVAL0)         IXX             BREAKPOINT VALUE
040957,000072:                                                                                                  #                VARST1 = INTVALUE1 + LEMMASS(SLOPEVAL1)         IAVG            BREAKPOINT VALUE
040958,000073:                                                                                                  #                VARST2 = INTVALUE2 + LEMMASS(SLOPEVAL2)         IAVG/TLX        BREAKPOINT VALUE
040959,000074: 
040960,000075:                                                                                                  #                VARST3 = INTVALUE3 + LEMMASS(SLOPEVAL3)         IAVG/TLX        SLOPE FOR CSMMASS > 33956 LBS (SPS > 10000 LBS)
040961,000076:                                                                                                  #                VARST4 = INTVALUE4 + LEMMASS(SLOPEVAL4)         IAVG            SLOPE FOR CSMMASS > 33956 LBS (SPS > 10000 LBS)
040962,000077: 
040963,000078:                                                                                                  #                VARST5 = INTVALUE5 + LEMMASS(SLOPEVAL5)         IXX             SLOPE FOR ALL VALUES OF CSMMASS
040964,000079: 
040965,000080:                                                                                                  #                VARST6 = INTVALUE6 + LEMMASS(SLOPEVAL6)         IAVG            SLOPE FOR CSMMASS < 33956 LBS (SPS < 10000 LBS)
040966,000081:                                                                                                  #                VARST7 = INTVALUE7 + LEMMASS(SLOPEVAL7)         IAVG/TLX        SLOPE FOR CSMMASS < 33956 LBS (SPS < 10000 LBS)
040967,000082: 
040968,000083:                                                                                                  #                VARST8 = INTVALUE8 + LEMMASS(SLOPEVAL8)         IAVG            DECREMENT TO BRKPT VALUE WHEN LEM DSCNT STAGE OFF
040969,000084:                                                                                                  #                VARST9 = INTVALUE9 + LEMMASS(SLOPEVAL9)         IAVG/TLX        DECREMENT TO BRKPT VALUE WHEN LEM DSCNT STAGE OFF
040970,000085: 
040971,000086:                                                                                                  #        (2)     IF LEM NOT DOCKED
040972,000087: 
040973,000088:                                                                                                  #                VARST0 = NOLEMVAL0      WHERE THE MEANING AND SCALING OF VARST0
040974,000089:                                                                                                  #                   .          .         TO VARST9 ARE THE SAME AS GIVEN ABOVE
040975,000090:                                                                                                  #                   .          .
040976,000091:                                                                                                  #                   .          .         NOTE... FOR THIS CASE, VARST8,9 HAVE NO
040977,000092:                                                                                                  #                VARST9 = NOLEMVAL9      MEANING (THEY ARE COMPUTED BUT NOT USED)
040978,000093: 
040979,000094:                                                                                                  #        (3)     THE FINAL OUTPUT CALCULATIONS ARE THEN DONE
040980,000095: 
040981,000096:                                                                                                  #                IXX0 = VARST0 + (CSMMASS + NEGBPW)VARST5                IXX
040982,000097: 
040983,000098:                                                                                                  #                IXX1 = VARST1 + (CSMMASS + NEGBPW)VARST(4 OR 6)         IAVG
040984,000099: 
040985,000100:                                                                                                  #                IXX2 = VARST2 + (CSMMASS + NEGBPW)VARST(3 OR 7)         IAVG/TLX
040986,000101: 
040987,000102:                                                                                                  #        THE DATA USED CAME FROM CSM/LM SPACECRAFT OPERATIONAL DATA BOOK.
040988,000103:                                                                                                  #                VOL. 3, NASA DOCUMENT SNA-8-D-027 (MARCH 1968)
040989,000104: 
040990,000105:                                                                                                  #        PERTINENT MASS DATA:            CSM WEIGHT      (FULL)  64100 LBS
040991,000106:                                                                                                  #                                                        (EMPTY) 23956 LBS
040992,000107:                                                                                                  #                                        LEM WEIGHT      (FULL)  32000 LBS
040993,000108:                                                                                                  #                                                        (EMPTY) 14116 LBS
040994,000109: 
040995,000110:                                                                                                  #        (WEIGHTS ARE FROM AMENDMENT #1 (APRIL 24, 1968) TO ABOVE DATA BOOK)
040996,000111: 
040997,000112: 25,3774                                           BANK     25                                    
040998,000113: 05,2000                                           SETLOC   DAPMASS                               
040999,000114: 05,2000                                           BANK                                           
041000,000115: 05,3370  E6,1704                                  EBANK=   BZERO                                 
041001,000116: 05,3370                                           COUNT*   $$/MASP                               
041002,000117: 
041003,000118: 05,3370           34334        MASSPROP           CAF      NINE                                  #  MASSPROP USES TVC/RCS INTERUPT TEMPS
041004,000119: 05,3371           55506                           TS       PHI333                                #  SET UP TEN PASSES
041005,000120: 
041006,000121: 05,3372           31466        LEMTEST            CAE      DAPDATR1                              #  DETERMINE LEM STATUS
041007,000122: 05,3373           75017                           MASK     BIT13                                 
041008,000123: 05,3374           00006                           EXTEND                                         
041009,000124: 05,3375           13401                           BZF      LEMYES                                
041010,000125: 
041011,000126: 05,3376           51506        LEMNO              INDEX    PHI333                                #  LEM NOT ATTACHED
041012,000127: 05,3377           33465                           CAF      NOLEMVAL                              
041013,000128: 05,3400           13411                           TCF      STOINST                               
041014,000129: 
041015,000130: 05,3401           31473        LEMYES             CAE      LEMMASS                               #  LEM IS ATTACHED
041016,000131: 05,3402           60000                           DOUBLE                                         
041017,000132: 05,3403           00006                           EXTEND                                         
041018,000133: 05,3404           51506                           INDEX    PHI333                                
041019,000134: 05,3405           73507                           MP       SLOPEVAL                              
041020,000135: 05,3406           20001                           DDOUBL                                         
041021,000136: 05,3407           51506                           INDEX    PHI333                                
041022,000137: 05,3410           63475                           AD       INTVALUE                              
041023,000138: 
041024,000139: 05,3411           51506        STOINST            INDEX    PHI333                                #  STORAGE INST BEGIN HERE
041025,000140: 05,3412           55511                           TS       VARST0                                
041026,000141: 05,3413           11506                           CCS      PHI333                                #  ARE ALL TEN PASSES COMPLETED
041027,000142: 05,3414           13371                           TCF      MASSPROP   +1                         #  NO - GO DECREMENT PHI333
041028,000143: 
041029,000144: 05,3415           11466        DXTEST             CCS      DAPDATR1                              #  IF NEG, BIT15 IS 1, LEM DSCNT STAGE OFF
041030,000145: 05,3416           13424                           TCF      FIXCW                                 
041031,000146: 05,3417           13424                           TCF      FIXCW                                 
041032,000147: 05,3420           53522                           DXCH     VARST0     +8D                        
041033,000148: 05,3421           21513                           DAS      VARST0     +1                         
041034,000149: 05,3422           33522                           CA       DXITFIX                               
041035,000150: 05,3423           27520                           ADS      VARST0     +7                         
041036,000151: 
041037,000152: 05,3424           35032        FIXCW              CAF      BIT2                                  #  COMPUTATION PHASE BEGINS HERE. SET UP
041038,000153: 05,3425           55506                           TS       PHI333                                #  THREE PASSES
041039,000154: 05,3426           55507                           TS       PSI333                                
041040,000155: 
041041,000156: 05,3427           31474                           CAE      CSMMASS                               #  GET DELTA CSM WEIGHT - SIGN DETERMINES
041042,000157: 05,3430           63521                           AD       NEGBPW                                #  SLOPE LOCATIONS.
041043,000158: 05,3431           60000                           DOUBLE                                         
041044,000159: 05,3432           55510                           TS       TEMP333                               
041045,000160: 05,3433           00006                           EXTEND                                         
041046,000161: 05,3434           63437                           BZMF     PEGGY                                 #  DETERMINE CORRECT SLOPE
041047,000162: 05,3435           37715                           CAF      NEG2                                  
041048,000163: 05,3436           55506                           TS       PHI333                                
041049,000164: 
041050,000165: 05,3437           51506        PEGGY              INDEX    PHI333                                #  ALL IS READY - CALCULATE OUTPUTS NOW
041051,000166: 05,3440           31516                           CAE      VARST5                                #  GET SLOPE
041052,000167: 05,3441           00006                           EXTEND                                         
041053,000168: 05,3442           71510                           MP       TEMP333                               #  MULT BY DELTA CSM WEIGHT
041054,000169: 05,3443           60000                           DOUBLE                                         
041055,000170: 05,3444           51507                           INDEX    PSI333                                
041056,000171: 05,3445           61511                           AD       VARST0                                #  ADD BREAKPOINT VALUE
041057,000172: 05,3446           51507                           INDEX    PSI333                                
041058,000173: 05,3447           55470                           TS       IXX                                   #  ****** OUTPUTS (IXX0, IXX1, IXX2) ******
041059,000174: 
041060,000175: 05,3450           11507                           CCS      PSI333                                #  BOOKKEEPING - MASSPROP FINISHED OR NOT
041061,000176: 05,3451           13461                           TCF      BOKKEP2                               #  NO - GO TAKE CARE OF INDEXING REGISTERS
041062,000177: 
041063,000178: 05,3452           31466                           CAE      DAPDATR1                              #  UPDATE WEIGHT/G
041064,000179: 05,3453           75016                           MASK     BIT14                                 
041065,000180: 05,3454           10000                           CCS      A                                     
041066,000181: 05,3455           31473                           CA       LEMMASS                               
041067,000182: 05,3456           61474                           AD       CSMMASS                               
041068,000183: 05,3457           55475                           TS       WEIGHT/G                              #  SCALED AT B+16 IN KILOGRAMS
041069,000184: 05,3460           00002        ENDMASSP           TC       Q                                     
041070,000185: 
041071,000186: 05,3461           55507        BOKKEP2            TS       PSI333                                #  REDUCE PSI BY ONE
041072,000187: 05,3462           00006                           EXTEND                                         
041073,000188: 05,3463           27506                           DIM      PHI333                                
041074,000189: 05,3464           13437                           TCF      PEGGY                                 
041075,000190: 
041076,000191: 05,3465           00616        NOLEMVAL           DEC      25445      B-20                       
041077,000192: 05,3466           02526                           DEC      87450      B-20                       
041078,000193: 05,3467           02352                           DEC      .30715     B-2                        
041079,000194: 05,3470           01471                           DEC      1.22877    E-5        B+12            
041080,000195: 05,3471           00634                           DEC      1.6096     B-6                        
041081,000196: 05,3472           00612                           DEC      1.54       B-6                        
041082,000197: 05,3473           03706                           DEC      7.77177    B-6                        
041083,000198: 05,3474           04425                           DEC      3.46458    E-5        B+12            
041084,000199: 
041085,000200: 05,3475           00644        INTVALUE           DEC      26850      B-20                       
041086,000201: 05,3476           03710                           DEC      127518     B-20                       
041087,000202: 05,3477           04246                           DEC      .54059     B-2                        
041088,000203: 05,3500           02011                           DEC      .153964    E-4        B+12            
041089,000204: 05,3501           77501                           DEC      -.742923   B-6                        
041090,000205: 05,3502           00612                           DEC      1.5398     B-6                        
041091,000206: 05,3503           04656                           DEC      9.68       B-6                        
041092,000207: 05,3504           10372                           DEC      .647625    E-4        B+12            
041093,000208: 05,3505           77126                           DEC      -27228     B-20                       
041094,000209: 05,3506           76261                           DEC      -.206476   B-2                        
041095,000210: 
041096,000211: 05,3507           00767        SLOPEVAL           DEC      1.96307    B-6                        
041097,000212: 05,3510           15624                           DEC      27.5774    B-6                        
041098,000213: 05,3511           03054                           DEC      2.3548     E-5        B+12            
041099,000214: 05,3512           04532                           DEC      2.1777     E-9        B+26            
041100,000215: 05,3513           10433                           DEC      1.044      E-3        B+8             
041101,000216: 05,3514           00000                           DEC      0          B-14                       
041102,000217: 05,3515           22070                           DEC      2.21068    E-3        B+8             
041103,000218: 05,3516           03204                           DEC      1.5166     E-9        B+26            
041104,000219: 05,3517           77266                           DEC      -1.284     B-6                        
041105,000220: 05,3520           02476                           DEC      2          E-5        B+12            
041106,000221: 
041107,000222: 05,3521           70364        NEGBPW             DEC      -15402.17  B-16                       
041108,000223: 05,3522           75420        DXITFIX            DEC*     -1.88275   E-5        B+12*           
041109,000224: 

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