Source Code

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

They have been adapted from sources files for Comanche 55, and updated via disassembly of binary dumps of original core rope memory modules, part numbers 2003972-1081, 2003972-1091, 2003972-1111, 2003972-1121, 2003972-1131, and 2003972-1141.

Since only binary dumps (rather than listings) of Comanche 67 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.

040549,000002:                                                                                                  ## Copyright:   Public domain.
040550,000003:                                                                                                  ## Filename:    TVCMASSPROP.agc
040551,000004:                                                                                                  ## Purpose:     A section of Comanche revision 067.
040552,000005:                                                                                                  ##              It is part of the reconstructed source code for the flight
040553,000006:                                                                                                  ##              software for the Command Module's (CM) Apollo Guidance Computer
040554,000007:                                                                                                  ##              (AGC) for Apollo 12. No original listings of this program are
040555,000008:                                                                                                  ##              available; instead, this file was created via dissassembly of
040556,000009:                                                                                                  ##              dumps of Comanche 067 core rope modules and comparison with
040557,000010:                                                                                                  ##              other AGC programs.
040558,000011:                                                                                                  ## Assembler:   yaYUL
040559,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
040560,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
040561,000014:                                                                                                  ## Mod history: 2023-08-16 MAS  Created from Comanche 055.
040562,000015: 
040563,000016:                                                                                                  #  PROGRAM NAME....MASSPROP
040564,000017:                                                                                                  #  LOG SECTION....TVCMASSPROP            PROGRAMMER...MELANSON (ENGEL, SCHLUNDT)
040565,000018: 
040566,000019:                                                                                                  #  FUNCTIONAL DESCRIPTION:
040567,000020: 
040568,000021:                                                                                                  #        MASSPROP OPERATES IN TWO MODES: (1) IF LEM MASS OR CONFIGURATION ARE UPDATED (MASSPROP DOES NOT TEST
040569,000022:                                                                                                  #        FOR THIS) THE ENTIRE PROGRAM MUST BE RUN THROUGH, BREAKPOINT VALUES AND DERIVATIVES OF THE OUTPUTS WITH
040570,000023:                                                                                                  #        RESPECT TO CSM MASS BEING CALCULATED PRIOR TO CALCULATION OF THE OUTPUTS.  (2) OTHERWISE, THE OUTPUTS CAN BE
040571,000024:                                                                                                  #        CALCULATED USING PREVIOUSLY COMPUTED BREAKPOINT VALUES AND DERIVATIVES.
040572,000025: 
040573,000026:                                                                                                  #  CALLING SEQUENCES
040574,000027: 
040575,000028:                                                                                                  #        IF LEM MASS OR CONFIGURATION HAS BEEN UPDATED, TRANSFER TO MASSPROP, OTHERWISE TRANSFER TO FIXCW.
040576,000029:                                                                                                  #                L       TC      BANKCALL OR IBNKCALL
040577,000030:                                                                                                  #                L+1     CADR    MASSPROP
040578,000031:                                                                                                  #                        OR
040579,000032:                                                                                                  #                L+1     CADR    FIXCW
040580,000033:                                                                                                  #                L+2     RETURNS VIA Q
040581,000034: 
040582,000035:                                                                                                  #  CALLED   IN PARTICULAR BY DONOUN47 (JOB) AND TVCEXECUTIVE (TASK)
040583,000036: 
040584,000037:                                                                                                  #  JOBS OR TASKS INITIATED - NONE
040585,000038: 
040586,000039:                                                                                                  #  SUBROUTINES CALLED - NONE
040587,000040: 
040588,000041:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
040589,000042: 
040590,000043:                                                                                                  #        LEMMASS MUST CONTAIN LEM MASS SCALED AT B+16 IN KILOGRAMS
040591,000044:                                                                                                  #        CSMMASS MUST CONTAIN CSM MASS SCALED AT B+16 IN KILOGRAMS
040592,000045:                                                                                                  #        DAPDATR1 MUST BE SET TO INDICATE VEHICLE CONFIGURATION.
040593,000046:                                                                                                  #                BITS (15,14,13)  =  ( 0 , 0 , 1 )       LEM OFF
040594,000047:                                                                                                  #                                    ( 0 , 1 , 0 )       LEM ON (ASCNT,DSCNT)
040595,000048:                                                                                                  #                                    ( 1 , 1 , 0 )       LEM ON (ASCNT ONLY)
040596,000049: 
040597,000050:                                                                                                  #  ALARMS - NONE
040598,000051: 
040599,000052:                                                                                                  #  EXIT -   TC   Q
040600,000053: 
040601,000054:                                                                                                  #  OUTPUTS:
040602,000055: 
040603,000056:                                                                                                  #        (1)     IXX, SINGLE PRECISION SCALED AT B+20 IN KG-M SQ.
040604,000057:                                                                                                  #        (2)     IAVG, SINGLE PRECISION SCALED AT B+20 IN KG-M SQ.
040605,000058:                                                                                                  #        (3)     IAVG/TLX, SINGLE PRECISION, SCALED AT B+2 SEC-SQD
040606,000059:                                                                                                  #        
040607,000060:                                                                                                  #        THEY ARE STORED IN CONSECUTIVE REGISTERS IXX0, IXX1, IXX2
040608,000061:                                                                                                  #        CONVERSION FACTOR:  (SLUG-FTSQ) = 0.737562 (KG-MSQ)
040609,000062: 
040610,000063:                                                                                                  #  OUTPUTS ARE CALCULATED AS FOLLOWS:
040611,000064: 
040612,000065:                                                                                                  #        (1)     IF LEM DOCKED, LEMMASS IS FIRST ELIMINATED AS A PARAMETER
040613,000066: 
040614,000067:                                                                                                  #                VARST0 = INTVALUE0 + LEMMASS(SLOPEVAL0)         IXX             BREAKPOINT VALUE
040615,000068:                                                                                                  #                VARST1 = INTVALUE1 + LEMMASS(SLOPEVAL1)         IAVG            BREAKPOINT VALUE
040616,000069:                                                                                                  #                VARST2 = INTVALUE2 + LEMMASS(SLOPEVAL2)         IAVG/TLX        BREAKPOINT VALUE
040617,000070: 
040618,000071:                                                                                                  #                VARST3 = INTVALUE3 + LEMMASS(SLOPEVAL3)         IAVG/TLX        SLOPE FOR CSMMASS > 33956 LBS (SPS > 10000 LBS)
040619,000072:                                                                                                  #                VARST4 = INTVALUE4 + LEMMASS(SLOPEVAL4)         IAVG            SLOPE FOR CSMMASS > 33956 LBS (SPS > 10000 LBS)
040620,000073: 
040621,000074:                                                                                                  #                VARST5 = INTVALUE5 + LEMMASS(SLOPEVAL5)         IXX             SLOPE FOR ALL VALUES OF CSMMASS
040622,000075: 
040623,000076:                                                                                                  #                VARST6 = INTVALUE6 + LEMMASS(SLOPEVAL6)         IAVG            SLOPE FOR CSMMASS < 33956 LBS (SPS < 10000 LBS)
040624,000077:                                                                                                  #                VARST7 = INTVALUE7 + LEMMASS(SLOPEVAL7)         IAVG/TLX        SLOPE FOR CSMMASS < 33956 LBS (SPS < 10000 LBS)
040625,000078: 
040626,000079:                                                                                                  #                VARST8 = INTVALUE8 + LEMMASS(SLOPEVAL8)         IAVG            DECREMENT TO BRKPT VALUE WHEN LEM DSCNT STAGE OFF
040627,000080:                                                                                                  #                VARST9 = INTVALUE9 + LEMMASS(SLOPEVAL9)         IAVG/TLX        DECREMENT TO BRKPT VALUE WHEN LEM DSCNT STAGE OFF
040628,000081: 
040629,000082:                                                                                                  #        (2)     IF LEM NOT DOCKED
040630,000083: 
040631,000084:                                                                                                  #                VARST0 = NOLEMVAL0      WHERE THE MEANING AND SCALING OF VARST0
040632,000085:                                                                                                  #                   .          .         TO VARST9 ARE THE SAME AS GIVEN ABOVE
040633,000086:                                                                                                  #                   .          .
040634,000087:                                                                                                  #                   .          .         NOTE... FOR THIS CASE, VARST8,9 HAVE NO
040635,000088:                                                                                                  #                VARST9 = NOLEMVAL9      MEANING (THEY ARE COMPUTED BUT NOT USED)
040636,000089: 
040637,000090:                                                                                                  #        (3)     THE FINAL OUTPUT CALCULATIONS ARE THEN DONE
040638,000091: 
040639,000092:                                                                                                  #                IXX0 = VARST0 + (CSMMASS + NEGBPW)VARST5                IXX
040640,000093: 
040641,000094:                                                                                                  #                IXX1 = VARST1 + (CSMMASS + NEGBPW)VARST(4 OR 6)         IAVG
040642,000095: 
040643,000096:                                                                                                  #                IXX2 = VARST2 + (CSMMASS + NEGBPW)VARST(3 OR 7)         IAVG/TLX
040644,000097: 
040645,000098:                                                                                                  #        THE DATA USED CAME FROM CSM/LM SPACECRAFT OPERATIONAL DATA BOOK.
040646,000099:                                                                                                  #                VOL. 3, NASA DOCUMENT SNA-8-D-027 (MARCH 1968)
040647,000100: 
040648,000101:                                                                                                  #        PERTINENT MASS DATA:            CSM WEIGHT      (FULL)  64100 LBS
040649,000102:                                                                                                  #                                                        (EMPTY) 23956 LBS
040650,000103:                                                                                                  #                                        LEM WEIGHT      (FULL)  32000 LBS
040651,000104:                                                                                                  #                                                        (EMPTY) 14116 LBS
040652,000105: 
040653,000106:                                                                                                  #        (WEIGHTS ARE FROM AMENDMENT #1 (APRIL 24, 1968) TO ABOVE DATA BOOK)
040654,000107: 
040655,000108: 25,3774                                           BANK     25                                    
040656,000109: 05,2000                                           SETLOC   DAPMASS                               
040657,000110: 05,2000                                           BANK                                           
040658,000111: 05,3370  E6,1704                                  EBANK=   BZERO                                 
040659,000112: 05,3370                                           COUNT*   $$/MASP                               
040660,000113: 
040661,000114: 05,3370           34334        MASSPROP           CAF      NINE                                  #  MASSPROP USES TVC/RCS INTERUPT TEMPS
040662,000115: 05,3371           55506                           TS       PHI333                                #  SET UP TEN PASSES
040663,000116: 
040664,000117: 05,3372           31466        LEMTEST            CAE      DAPDATR1                              #  DETERMINE LEM STATUS
040665,000118: 05,3373           75017                           MASK     BIT13                                 
040666,000119: 05,3374           00006                           EXTEND                                         
040667,000120: 05,3375           13401                           BZF      LEMYES                                
040668,000121: 
040669,000122: 05,3376           51506        LEMNO              INDEX    PHI333                                #  LEM NOT ATTACHED
040670,000123: 05,3377           33465                           CAF      NOLEMVAL                              
040671,000124: 05,3400           13411                           TCF      STOINST                               
040672,000125: 
040673,000126: 05,3401           31473        LEMYES             CAE      LEMMASS                               #  LEM IS ATTACHED
040674,000127: 05,3402           60000                           DOUBLE                                         
040675,000128: 05,3403           00006                           EXTEND                                         
040676,000129: 05,3404           51506                           INDEX    PHI333                                
040677,000130: 05,3405           73507                           MP       SLOPEVAL                              
040678,000131: 05,3406           20001                           DDOUBL                                         
040679,000132: 05,3407           51506                           INDEX    PHI333                                
040680,000133: 05,3410           63475                           AD       INTVALUE                              
040681,000134: 
040682,000135: 05,3411           51506        STOINST            INDEX    PHI333                                #  STORAGE INST BEGIN HERE
040683,000136: 05,3412           55511                           TS       VARST0                                
040684,000137: 05,3413           11506                           CCS      PHI333                                #  ARE ALL TEN PASSES COMPLETED
040685,000138: 05,3414           13371                           TCF      MASSPROP   +1                         #  NO - GO DECREMENT PHI333
040686,000139: 
040687,000140: 05,3415           11466        DXTEST             CCS      DAPDATR1                              #  IF NEG, BIT15 IS 1, LEM DSCNT STAGE OFF
040688,000141: 05,3416           13424                           TCF      FIXCW                                 
040689,000142: 05,3417           13424                           TCF      FIXCW                                 
040690,000143: 05,3420           53522                           DXCH     VARST0     +8D                        
040691,000144: 05,3421           21513                           DAS      VARST0     +1                         
040692,000145: 05,3422           33522                           CA       DXITFIX                               
040693,000146: 05,3423           27520                           ADS      VARST0     +7                         
040694,000147: 
040695,000148: 05,3424           35032        FIXCW              CAF      BIT2                                  #  COMPUTATION PHASE BEGINS HERE. SET UP
040696,000149: 05,3425           55506                           TS       PHI333                                #  THREE PASSES
040697,000150: 05,3426           55507                           TS       PSI333                                
040698,000151: 
040699,000152: 05,3427           31474                           CAE      CSMMASS                               #  GET DELTA CSM WEIGHT - SIGN DETERMINES
040700,000153: 05,3430           63521                           AD       NEGBPW                                #  SLOPE LOCATIONS.
040701,000154: 05,3431           60000                           DOUBLE                                         
040702,000155: 05,3432           55510                           TS       TEMP333                               
040703,000156: 05,3433           00006                           EXTEND                                         
040704,000157: 05,3434           63437                           BZMF     PEGGY                                 #  DETERMINE CORRECT SLOPE
040705,000158: 05,3435           37715                           CAF      NEG2                                  
040706,000159: 05,3436           55506                           TS       PHI333                                
040707,000160: 
040708,000161: 05,3437           51506        PEGGY              INDEX    PHI333                                #  ALL IS READY - CALCULATE OUTPUTS NOW
040709,000162: 05,3440           31516                           CAE      VARST5                                #  GET SLOPE
040710,000163: 05,3441           00006                           EXTEND                                         
040711,000164: 05,3442           71510                           MP       TEMP333                               #  MULT BY DELTA CSM WEIGHT
040712,000165: 05,3443           60000                           DOUBLE                                         
040713,000166: 05,3444           51507                           INDEX    PSI333                                
040714,000167: 05,3445           61511                           AD       VARST0                                #  ADD BREAKPOINT VALUE
040715,000168: 05,3446           51507                           INDEX    PSI333                                
040716,000169: 05,3447           55470                           TS       IXX                                   #  ****** OUTPUTS (IXX0, IXX1, IXX2) ******
040717,000170: 
040718,000171: 05,3450           11507                           CCS      PSI333                                #  BOOKKEEPING - MASSPROP FINISHED OR NOT
040719,000172: 05,3451           13461                           TCF      BOKKEP2                               #  NO - GO TAKE CARE OF INDEXING REGISTERS
040720,000173: 
040721,000174: 05,3452           31466                           CAE      DAPDATR1                              #  UPDATE WEIGHT/G
040722,000175: 05,3453           75016                           MASK     BIT14                                 
040723,000176: 05,3454           10000                           CCS      A                                     
040724,000177: 05,3455           31473                           CA       LEMMASS                               
040725,000178: 05,3456           61474                           AD       CSMMASS                               
040726,000179: 05,3457           55475                           TS       WEIGHT/G                              #  SCALED AT B+16 IN KILOGRAMS
040727,000180: 05,3460           00002        ENDMASSP           TC       Q                                     
040728,000181: 
040729,000182: 05,3461           55507        BOKKEP2            TS       PSI333                                #  REDUCE PSI BY ONE
040730,000183: 05,3462           00006                           EXTEND                                         
040731,000184: 05,3463           27506                           DIM      PHI333                                
040732,000185: 05,3464           13437                           TCF      PEGGY                                 
040733,000186: 
040734,000187: 05,3465           00616        NOLEMVAL           DEC      25445      B-20                       
040735,000188: 05,3466           02526                           DEC      87450      B-20                       
040736,000189: 05,3467           02352                           DEC      .30715     B-2                        
040737,000190: 05,3470           01471                           DEC      1.22877    E-5        B+12            
040738,000191: 05,3471           00634                           DEC      1.6096     B-6                        
040739,000192: 05,3472           00612                           DEC      1.54       B-6                        
040740,000193: 05,3473           03706                           DEC      7.77177    B-6                        
040741,000194: 05,3474           04425                           DEC      3.46458    E-5        B+12            
040742,000195: 
040743,000196: 05,3475           00644        INTVALUE           DEC      26850      B-20                       
040744,000197: 05,3476           03710                           DEC      127518     B-20                       
040745,000198: 05,3477           04246                           DEC      .54059     B-2                        
040746,000199: 05,3500           02011                           DEC      .153964    E-4        B+12            
040747,000200: 05,3501           77501                           DEC      -.742923   B-6                        
040748,000201: 05,3502           00612                           DEC      1.5398     B-6                        
040749,000202: 05,3503           04656                           DEC      9.68       B-6                        
040750,000203: 05,3504           10372                           DEC      .647625    E-4        B+12            
040751,000204: 05,3505           77126                           DEC      -27228     B-20                       
040752,000205: 05,3506           76261                           DEC      -.206476   B-2                        
040753,000206: 
040754,000207: 05,3507           00767        SLOPEVAL           DEC      1.96307    B-6                        
040755,000208: 05,3510           15624                           DEC      27.5774    B-6                        
040756,000209: 05,3511           03054                           DEC      2.3548     E-5        B+12            
040757,000210: 05,3512           04532                           DEC      2.1777     E-9        B+26            
040758,000211: 05,3513           10433                           DEC      1.044      E-3        B+8             
040759,000212: 05,3514           00000                           DEC      0          B-14                       
040760,000213: 05,3515           22070                           DEC      2.21068    E-3        B+8             
040761,000214: 05,3516           03204                           DEC      1.5166     E-9        B+26            
040762,000215: 05,3517           77266                           DEC      -1.284     B-6                        
040763,000216: 05,3520           02476                           DEC      2          E-5        B+12            
040764,000217: 
040765,000218: 05,3521           70364        NEGBPW             DEC      -15402.17  B-16                       
040766,000219: 05,3522           75420        DXITFIX            DEC*     -1.88275   E-5        B+12*           
040767,000220: 

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