Source Code

These source-code files are part of a reconstructed copy of Comanche 45/2 (AKA Manche45 revision 2), the final, flown mission release of the Apollo 10 Command Module (CM) Apollo Guidance Computer (AGC) software. Comanche 45/2 was preceded by Comanche 44 and Comanche 45. The reconstruction is believed to be exactly accurate, but in the absence of an actual Apollo-era listing of Comanche 45/2, some explanation of the reconstruction process is needed to insure confidence in that accuracy.

The starting point was the source code of Comanche 45 (itself previously accurately reconstructed). Comanche 45 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 45 and 45/2. The now-reconstructed Comanche 45/2 source code was verified by assembling it and checking that the assembled code had the expected known-correct memory-bank checksums. Note that page numbers in the reconstructed code tend to match those in the Comanche 55, the most-similar revision of Comanche for which we have access to an actual non-reconstructed hardcopy; the source code would likely have different page numbers in a contemporary Comanche 45 listing.

Annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change relative to Comanche 44. Here's a guide to the Apollo documentation referenced in those annotations:
Comments expected to have been present in 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.

041455,000002:                                                                                                  ## Copyright:   Public domain.
041456,000003:                                                                                                  ## Filename:    TVCMASSPROP.agc
041457,000004:                                                                                                  ## Purpose:     A section of Manche45 revision 2.
041458,000005:                                                                                                  ##              It is part of the reconstructed source code for the
041459,000006:                                                                                                  ##              final, flown release of the flight software for the Command
041460,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
041461,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
041462,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
041463,000010:                                                                                                  ##              exactly match those specified for Manche 45/2 in NASA drawing
041464,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
041465,000012:                                                                                                  ##              reconstruction is correct.
041466,000013:                                                                                                  ## Assembler:   yaYUL
041467,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
041468,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
041469,000016:                                                                                                  ## Mod history: 2020-12-24 MAS  Created from Comanche 45.
041470,000017: 

Page 951

041472,000019:                                                                                                  #  PROGRAM NAME....MASSPROP
041473,000020:                                                                                                  #  LOG SECTION....TVCMASSPROP            PROGRAMMER...MELANSON (ENGEL, SCHLUNDT)
041474,000021: 
041475,000022:                                                                                                  #  FUNCTIONAL DESCRIPTION:
041476,000023: 
041477,000024:                                                                                                  #        MASSPROP OPERATES IN TWO MODES: (1) IF LEM MASS OR CONFIGURATION ARE UPDATED (MASSPROP DOES NOT TEST
041478,000025:                                                                                                  #        FOR THIS) THE ENTIRE PROGRAM MUST BE RUN THROUGH, BREAKPOINT VALUES AND DERIVATIVES OF THE OUTPUTS WITH
041479,000026:                                                                                                  #        RESPECT TO CSM MASS BEING CALCULATED PRIOR TO CALCULATION OF THE OUTPUTS.  (2) OTHERWISE, THE OUTPUTS CAN BE
041480,000027:                                                                                                  #        CALCULATED USING PREVIOUSLY COMPUTED BREAKPOINT VALUES AND DERIVATIVES.
041481,000028: 
041482,000029:                                                                                                  #  CALLING SEQUENCES
041483,000030: 
041484,000031:                                                                                                  #        IF LEM MASS OR CONFIGURATION HAS BEEN UPDATED, TRANSFER TO MASSPROP, OTHERWISE TRANSFER TO FIXCW.
041485,000032:                                                                                                  #                L       TC      BANKCALL OR IBNKCALL
041486,000033:                                                                                                  #                L+1     CADR    MASSPROP
041487,000034:                                                                                                  #                        OR
041488,000035:                                                                                                  #                L+1     CADR    FIXCW
041489,000036:                                                                                                  #                L+2     RETURNS VIA Q
041490,000037: 
041491,000038:                                                                                                  #  CALLED   IN PARTICULAR BY DONOUN47 (JOB) AND TVCEXECUTIVE (TASK)
041492,000039: 
041493,000040:                                                                                                  #  JOBS OR TASKS INITIATED - NONE
041494,000041: 
041495,000042:                                                                                                  #  SUBROUTINES CALLED - NONE
041496,000043: 
041497,000044:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
041498,000045: 
041499,000046:                                                                                                  #        LEMMASS MUST CONTAIN LEM MASS SCALED AT B+16 IN KILOGRAMS
041500,000047:                                                                                                  #        CSMMASS MUST CONTAIN CSM MASS SCALED AT B+16 IN KILOGRAMS
041501,000048:                                                                                                  #        DAPDATR1 MUST BE SET TO INDICATE VEHICLE CONFIGURATION.
041502,000049:                                                                                                  #                BITS (15,14,13)  =  ( 0 , 0 , 1 )       LEM OFF
041503,000050:                                                                                                  #                                    ( 0 , 1 , 0 )       LEM ON (ASCNT,DSCNT)
041504,000051:                                                                                                  #                                    ( 1 , 1 , 0 )       LEM ON (ASCNT ONLY)
041505,000052: 
041506,000053:                                                                                                  #  ALARMS - NONE
041507,000054: 
041508,000055:                                                                                                  #  EXIT -   TC   Q
041509,000056: 
041510,000057:                                                                                                  #  OUTPUTS:
041511,000058: 
041512,000059:                                                                                                  #        (1)     IXX, SINGLE PRECISION SCALED AT B+20 IN KG-M SQ.
041513,000060:                                                                                                  #        (2)     IAVG, SINGLE PRECISION SCALED AT B+20 IN KG-M SQ.
041514,000061:                                                                                                  #        (3)     IAVG/TLX, SINGLE PRECISION, SCALED AT B+2 SEC-SQD
041515,000062:                                                                                                  #        
041516,000063:                                                                                                  #        THEY ARE STORED IN CONSECUTIVE REGISTERS IXX0, IXX1, IXX2
041517,000064:                                                                                                  #        CONVERSION FACTOR:  (SLUG-FTSQ) = 0.737562 (KG-MSQ)

Page 952

041519,000066: 
041520,000067:                                                                                                  #  OUTPUTS ARE CALCULATED AS FOLLOWS:
041521,000068: 
041522,000069:                                                                                                  #        (1)     IF LEM DOCKED, LEMMASS IS FIRST ELIMINATED AS A PARAMETER
041523,000070: 
041524,000071:                                                                                                  #                VARST0 = INTVALUE0 + LEMMASS(SLOPEVAL0)         IXX             BREAKPOINT VALUE
041525,000072:                                                                                                  #                VARST1 = INTVALUE1 + LEMMASS(SLOPEVAL1)         IAVG            BREAKPOINT VALUE
041526,000073:                                                                                                  #                VARST2 = INTVALUE2 + LEMMASS(SLOPEVAL2)         IAVG/TLX        BREAKPOINT VALUE
041527,000074: 
041528,000075:                                                                                                  #                VARST3 = INTVALUE3 + LEMMASS(SLOPEVAL3)         IAVG/TLX        SLOPE FOR CSMMASS > 33956 LBS (SPS > 10000 LBS)
041529,000076:                                                                                                  #                VARST4 = INTVALUE4 + LEMMASS(SLOPEVAL4)         IAVG            SLOPE FOR CSMMASS > 33956 LBS (SPS > 10000 LBS)
041530,000077: 
041531,000078:                                                                                                  #                VARST5 = INTVALUE5 + LEMMASS(SLOPEVAL5)         IXX             SLOPE FOR ALL VALUES OF CSMMASS
041532,000079: 
041533,000080:                                                                                                  #                VARST6 = INTVALUE6 + LEMMASS(SLOPEVAL6)         IAVG            SLOPE FOR CSMMASS < 33956 LBS (SPS < 10000 LBS)
041534,000081:                                                                                                  #                VARST7 = INTVALUE7 + LEMMASS(SLOPEVAL7)         IAVG/TLX        SLOPE FOR CSMMASS < 33956 LBS (SPS < 10000 LBS)
041535,000082: 
041536,000083:                                                                                                  #                VARST8 = INTVALUE8 + LEMMASS(SLOPEVAL8)         IAVG            DECREMENT TO BRKPT VALUE WHEN LEM DSCNT STAGE OFF
041537,000084:                                                                                                  #                VARST9 = INTVALUE9 + LEMMASS(SLOPEVAL9)         IAVG/TLX        DECREMENT TO BRKPT VALUE WHEN LEM DSCNT STAGE OFF
041538,000085: 
041539,000086:                                                                                                  #        (2)     IF LEM NOT DOCKED
041540,000087: 
041541,000088:                                                                                                  #                VARST0 = NOLEMVAL0      WHERE THE MEANING AND SCALING OF VARST0
041542,000089:                                                                                                  #                   .          .         TO VARST9 ARE THE SAME AS GIVEN ABOVE
041543,000090:                                                                                                  #                   .          .
041544,000091:                                                                                                  #                   .          .         NOTE... FOR THIS CASE, VARST8,9 HAVE NO
041545,000092:                                                                                                  #                VARST9 = NOLEMVAL9      MEANING (THEY ARE COMPUTED BUT NOT USED)
041546,000093: 
041547,000094:                                                                                                  #        (3)     THE FINAL OUTPUT CALCULATIONS ARE THEN DONE
041548,000095: 
041549,000096:                                                                                                  #                IXX0 = VARST0 + (CSMMASS + NEGBPW)VARST5                IXX
041550,000097: 
041551,000098:                                                                                                  #                IXX1 = VARST1 + (CSMMASS + NEGBPW)VARST(4 OR 6)         IAVG
041552,000099: 
041553,000100:                                                                                                  #                IXX2 = VARST2 + (CSMMASS + NEGBPW)VARST(3 OR 7)         IAVG/TLX
041554,000101: 
041555,000102:                                                                                                  #        THE DATA USED CAME FROM CSM/LM SPACECRAFT OPERATIONAL DATA BOOK.
041556,000103:                                                                                                  #                VOL. 3, NASA DOCUMENT SNA-8-D-027 (MARCH 1968)
041557,000104: 
041558,000105:                                                                                                  #        PERTINENT MASS DATA:            CSM WEIGHT      (FULL)  64100 LBS
041559,000106:                                                                                                  #                                                        (EMPTY) 23956 LBS
041560,000107:                                                                                                  #                                        LEM WEIGHT      (FULL)  32000 LBS
041561,000108:                                                                                                  #                                                        (EMPTY) 14116 LBS
041562,000109: 
041563,000110:                                                                                                  #        (WEIGHTS ARE FROM AMENDMENT #1 (APRIL 24, 1968) TO ABOVE DATA BOOK)

Page 953

041565,000112: 
041566,000113: 25,3774                                           BANK     25                                    
041567,000114: 05,2000                                           SETLOC   DAPMASS                               
041568,000115: 05,2000                                           BANK                                           
041569,000116: 05,3366  E6,1702                                  EBANK=   BZERO                                 
041570,000117: 05,3366                                           COUNT*   $$/MASP                               
041571,000118: 
041572,000119: 05,3366           34334        MASSPROP           CAF      NINE                                  #  MASSPROP USES TVC/RCS INTERUPT TEMPS
041573,000120: 05,3367           55506                           TS       PHI333                                #  SET UP TEN PASSES
041574,000121: 
041575,000122: 05,3370           31466        LEMTEST            CAE      DAPDATR1                              #  DETERMINE LEM STATUS
041576,000123: 05,3371           75003                           MASK     BIT13                                 
041577,000124: 05,3372           00006                           EXTEND                                         
041578,000125: 05,3373           13377                           BZF      LEMYES                                
041579,000126: 
041580,000127: 05,3374           51506        LEMNO              INDEX    PHI333                                #  LEM NOT ATTACHED
041581,000128: 05,3375           33463                           CAF      NOLEMVAL                              
041582,000129: 05,3376           13407                           TCF      STOINST                               
041583,000130: 
041584,000131: 05,3377           31473        LEMYES             CAE      LEMMASS                               #  LEM IS ATTACHED
041585,000132: 05,3400           60000                           DOUBLE                                         
041586,000133: 05,3401           00006                           EXTEND                                         
041587,000134: 05,3402           51506                           INDEX    PHI333                                
041588,000135: 05,3403           73505                           MP       SLOPEVAL                              
041589,000136: 05,3404           20001                           DDOUBL                                         
041590,000137: 05,3405           51506                           INDEX    PHI333                                
041591,000138: 05,3406           63473                           AD       INTVALUE                              
041592,000139: 
041593,000140: 05,3407           51506        STOINST            INDEX    PHI333                                #  STORAGE INST BEGIN HERE
041594,000141: 05,3410           55511                           TS       VARST0                                
041595,000142: 05,3411           11506                           CCS      PHI333                                #  ARE ALL TEN PASSES COMPLETED
041596,000143: 05,3412           13367                           TCF      MASSPROP   +1                         #  NO - GO DECREMENT PHI333
041597,000144: 
041598,000145: 05,3413           11466        DXTEST             CCS      DAPDATR1                              #  IF NEG, BIT15 IS 1, LEM DSCNT STAGE OFF
041599,000146: 05,3414           13422                           TCF      FIXCW                                 
041600,000147: 05,3415           13422                           TCF      FIXCW                                 
041601,000148: 05,3416           53522                           DXCH     VARST0     +8D                        
041602,000149: 05,3417           21513                           DAS      VARST0     +1                         
041603,000150: 05,3420           33520                           CA       DXITFIX                               
041604,000151: 05,3421           27520                           ADS      VARST0     +7                         
041605,000152: 
041606,000153: 05,3422           35016        FIXCW              CAF      BIT2                                  #  COMPUTATION PHASE BEGINS HERE. SET UP
041607,000154: 05,3423           55506                           TS       PHI333                                #  THREE PASSES
041608,000155: 05,3424           55507                           TS       PSI333                                
041609,000156: 
041610,000157: 05,3425           31474                           CAE      CSMMASS                               #  GET DELTA CSM WEIGHT - SIGN DETERMINES
041611,000158: 05,3426           63517                           AD       NEGBPW                                #  SLOPE LOCATIONS.
041612,000159: 05,3427           60000                           DOUBLE                                         
041613,000160: 05,3430           55510                           TS       TEMP333                               

Page 954

041615,000162: 05,3431           00006                           EXTEND                                         
041616,000163: 05,3432           63435                           BZMF     PEGGY                                 #  DETERMINE CORRECT SLOPE
041617,000164: 05,3433           37715                           CAF      NEG2                                  
041618,000165: 05,3434           55506                           TS       PHI333                                
041619,000166: 
041620,000167: 05,3435           51506        PEGGY              INDEX    PHI333                                #  ALL IS READY - CALCULATE OUTPUTS NOW
041621,000168: 05,3436           31516                           CAE      VARST5                                #  GET SLOPE
041622,000169: 05,3437           00006                           EXTEND                                         
041623,000170: 05,3440           71510                           MP       TEMP333                               #  MULT BY DELTA CSM WEIGHT
041624,000171: 05,3441           60000                           DOUBLE                                         
041625,000172: 05,3442           51507                           INDEX    PSI333                                
041626,000173: 05,3443           61511                           AD       VARST0                                #  ADD BREAKPOINT VALUE
041627,000174: 05,3444           51507                           INDEX    PSI333                                
041628,000175: 05,3445           55470                           TS       IXX                                   #  ****** OUTPUTS (IXX0, IXX1, IXX2) ******
041629,000176: 
041630,000177: 05,3446           11507                           CCS      PSI333                                #  BOOKKEEPING - MASSPROP FINISHED OR NOT
041631,000178: 05,3447           13457                           TCF      BOKKEP2                               #  NO - GO TAKE CARE OF INDEXING REGISTERS
041632,000179: 
041633,000180: 05,3450           31466                           CAE      DAPDATR1                              #  UPDATE WEIGHT/G
041634,000181: 05,3451           75002                           MASK     BIT14                                 
041635,000182: 05,3452           10000                           CCS      A                                     
041636,000183: 05,3453           31473                           CA       LEMMASS                               
041637,000184: 05,3454           61474                           AD       CSMMASS                               
041638,000185: 05,3455           55475                           TS       WEIGHT/G                              #  SCALED AT B+16 IN KILOGRAMS
041639,000186: 05,3456           00002        ENDMASSP           TC       Q                                     
041640,000187: 
041641,000188: 05,3457           55507        BOKKEP2            TS       PSI333                                #  REDUCE PSI BY ONE
041642,000189: 05,3460           00006                           EXTEND                                         
041643,000190: 05,3461           27506                           DIM      PHI333                                
041644,000191: 05,3462           13435                           TCF      PEGGY                                 
041645,000192: 

Page 955

041647,000194: 05,3463           00616        NOLEMVAL           DEC      25445      B-20                       
041648,000195: 05,3464           02526                           DEC      87450      B-20                       
041649,000196: 05,3465           02352                           DEC      .30715     B-2                        
041650,000197: 05,3466           01471                           DEC      1.22877    E-5        B+12            
041651,000198: 05,3467           00634                           DEC      1.6096     B-6                        
041652,000199: 05,3470           00612                           DEC      1.54       B-6                        
041653,000200: 05,3471           03706                           DEC      7.77177    B-6                        
041654,000201: 05,3472           04425                           DEC      3.46458    E-5        B+12            
041655,000202: 
041656,000203: 05,3473           00644        INTVALUE           DEC      26850      B-20                       
041657,000204: 05,3474           03710                           DEC      127518     B-20                       
041658,000205: 05,3475           04246                           DEC      .54059     B-2                        
041659,000206: 05,3476           02011                           DEC      .153964    E-4        B+12            
041660,000207: 05,3477           77501                           DEC      -.742923   B-6                        
041661,000208: 05,3500           00612                           DEC      1.5398     B-6                        
041662,000209: 05,3501           04656                           DEC      9.68       B-6                        
041663,000210: 05,3502           10372                           DEC      .647625    E-4        B+12            
041664,000211: 05,3503           77126                           DEC      -27228     B-20                       
041665,000212: 05,3504           76261                           DEC      -.206476   B-2                        
041666,000213: 
041667,000214: 05,3505           00767        SLOPEVAL           DEC      1.96307    B-6                        
041668,000215: 05,3506           15624                           DEC      27.5774    B-6                        
041669,000216: 05,3507           03054                           DEC      2.3548     E-5        B+12            
041670,000217: 05,3510           04532                           DEC      2.1777     E-9        B+26            
041671,000218: 05,3511           10433                           DEC      1.044      E-3        B+8             
041672,000219: 05,3512           00000                           DEC      0          B-14                       
041673,000220: 05,3513           22070                           DEC      2.21068    E-3        B+8             
041674,000221: 05,3514           03204                           DEC      1.5166     E-9        B+26            
041675,000222: 05,3515           77266                           DEC      -1.284     B-6                        
041676,000223: 05,3516           02476                           DEC      2          E-5        B+12            
041677,000224: 
041678,000225: 05,3517           70364        NEGBPW             DEC      -15402.17  B-16                       
041679,000226: 05,3520           75420        DXITFIX            DEC*     -1.88275   E-5        B+12*           
041680,000227: 

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