Source Code

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

The starting point was the source code of Comanche 44 (itself previously accurately reconstructed). Comanche 44 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 44 and 45. The now-reconstructed Comanche 45 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:
There is also a detailed commentary about the reconstruction process.

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.

041555,000002:                                                                                                  ## Copyright:   Public domain.
041556,000003:                                                                                                  ## Filename:    TVCMASSPROP.agc
041557,000004:                                                                                                  ## Purpose:     A section of Comanche revision 045.
041558,000005:                                                                                                  ##              It is part of the reconstructed source code for the
041559,000006:                                                                                                  ##              second release of the flight software for the Command
041560,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
041561,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
041562,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
041563,000010:                                                                                                  ##              exactly match those specified for Comanche 45 in NASA drawing
041564,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
041565,000012:                                                                                                  ##              reconstruction is correct.
041566,000013:                                                                                                  ## Assembler:   yaYUL
041567,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
041568,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
041569,000016:                                                                                                  ## Mod history: 2020-12-06 MAS  Created from Comanche 44.
041570,000017: 

Page 951

041572,000019:                                                                                                  #  PROGRAM NAME....MASSPROP
041573,000020:                                                                                                  #  LOG SECTION....TVCMASSPROP            PROGRAMMER...MELANSON (ENGEL, SCHLUNDT)
041574,000021: 
041575,000022:                                                                                                  #  FUNCTIONAL DESCRIPTION:
041576,000023: 
041577,000024:                                                                                                  #        MASSPROP OPERATES IN TWO MODES: (1) IF LEM MASS OR CONFIGURATION ARE UPDATED (MASSPROP DOES NOT TEST
041578,000025:                                                                                                  #        FOR THIS) THE ENTIRE PROGRAM MUST BE RUN THROUGH, BREAKPOINT VALUES AND DERIVATIVES OF THE OUTPUTS WITH
041579,000026:                                                                                                  #        RESPECT TO CSM MASS BEING CALCULATED PRIOR TO CALCULATION OF THE OUTPUTS.  (2) OTHERWISE, THE OUTPUTS CAN BE
041580,000027:                                                                                                  #        CALCULATED USING PREVIOUSLY COMPUTED BREAKPOINT VALUES AND DERIVATIVES.
041581,000028: 
041582,000029:                                                                                                  #  CALLING SEQUENCES
041583,000030: 
041584,000031:                                                                                                  #        IF LEM MASS OR CONFIGURATION HAS BEEN UPDATED, TRANSFER TO MASSPROP, OTHERWISE TRANSFER TO FIXCW.
041585,000032:                                                                                                  #                L       TC      BANKCALL OR IBNKCALL
041586,000033:                                                                                                  #                L+1     CADR    MASSPROP
041587,000034:                                                                                                  #                        OR
041588,000035:                                                                                                  #                L+1     CADR    FIXCW
041589,000036:                                                                                                  #                L+2     RETURNS VIA Q
041590,000037: 
041591,000038:                                                                                                  #  CALLED   IN PARTICULAR BY DONOUN47 (JOB) AND TVCEXECUTIVE (TASK)
041592,000039: 
041593,000040:                                                                                                  #  JOBS OR TASKS INITIATED - NONE
041594,000041: 
041595,000042:                                                                                                  #  SUBROUTINES CALLED - NONE
041596,000043: 
041597,000044:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
041598,000045: 
041599,000046:                                                                                                  #        LEMMASS MUST CONTAIN LEM MASS SCALED AT B+16 IN KILOGRAMS
041600,000047:                                                                                                  #        CSMMASS MUST CONTAIN CSM MASS SCALED AT B+16 IN KILOGRAMS
041601,000048:                                                                                                  #        DAPDATR1 MUST BE SET TO INDICATE VEHICLE CONFIGURATION.
041602,000049:                                                                                                  #                BITS (15,14,13)  =  ( 0 , 0 , 1 )       LEM OFF
041603,000050:                                                                                                  #                                    ( 0 , 1 , 0 )       LEM ON (ASCNT,DSCNT)
041604,000051:                                                                                                  #                                    ( 1 , 1 , 0 )       LEM ON (ASCNT ONLY)
041605,000052: 
041606,000053:                                                                                                  #  ALARMS - NONE
041607,000054: 
041608,000055:                                                                                                  #  EXIT -   TC   Q
041609,000056: 
041610,000057:                                                                                                  #  OUTPUTS:
041611,000058: 
041612,000059:                                                                                                  #        (1)     IXX, SINGLE PRECISION SCALED AT B+20 IN KG-M SQ.
041613,000060:                                                                                                  #        (2)     IAVG, SINGLE PRECISION SCALED AT B+20 IN KG-M SQ.
041614,000061:                                                                                                  #        (3)     IAVG/TLX, SINGLE PRECISION, SCALED AT B+2 SEC-SQD
041615,000062:                                                                                                  #        
041616,000063:                                                                                                  #        THEY ARE STORED IN CONSECUTIVE REGISTERS IXX0, IXX1, IXX2
041617,000064:                                                                                                  #        CONVERSION FACTOR:  (SLUG-FTSQ) = 0.737562 (KG-MSQ)

Page 952

041619,000066: 
041620,000067:                                                                                                  #  OUTPUTS ARE CALCULATED AS FOLLOWS:
041621,000068: 
041622,000069:                                                                                                  #        (1)     IF LEM DOCKED, LEMMASS IS FIRST ELIMINATED AS A PARAMETER
041623,000070: 
041624,000071:                                                                                                  #                VARST0 = INTVALUE0 + LEMMASS(SLOPEVAL0)         IXX             BREAKPOINT VALUE
041625,000072:                                                                                                  #                VARST1 = INTVALUE1 + LEMMASS(SLOPEVAL1)         IAVG            BREAKPOINT VALUE
041626,000073:                                                                                                  #                VARST2 = INTVALUE2 + LEMMASS(SLOPEVAL2)         IAVG/TLX        BREAKPOINT VALUE
041627,000074: 
041628,000075:                                                                                                  #                VARST3 = INTVALUE3 + LEMMASS(SLOPEVAL3)         IAVG/TLX        SLOPE FOR CSMMASS > 33956 LBS (SPS > 10000 LBS)
041629,000076:                                                                                                  #                VARST4 = INTVALUE4 + LEMMASS(SLOPEVAL4)         IAVG            SLOPE FOR CSMMASS > 33956 LBS (SPS > 10000 LBS)
041630,000077: 
041631,000078:                                                                                                  #                VARST5 = INTVALUE5 + LEMMASS(SLOPEVAL5)         IXX             SLOPE FOR ALL VALUES OF CSMMASS
041632,000079: 
041633,000080:                                                                                                  #                VARST6 = INTVALUE6 + LEMMASS(SLOPEVAL6)         IAVG            SLOPE FOR CSMMASS < 33956 LBS (SPS < 10000 LBS)
041634,000081:                                                                                                  #                VARST7 = INTVALUE7 + LEMMASS(SLOPEVAL7)         IAVG/TLX        SLOPE FOR CSMMASS < 33956 LBS (SPS < 10000 LBS)
041635,000082: 
041636,000083:                                                                                                  #                VARST8 = INTVALUE8 + LEMMASS(SLOPEVAL8)         IAVG            DECREMENT TO BRKPT VALUE WHEN LEM DSCNT STAGE OFF
041637,000084:                                                                                                  #                VARST9 = INTVALUE9 + LEMMASS(SLOPEVAL9)         IAVG/TLX        DECREMENT TO BRKPT VALUE WHEN LEM DSCNT STAGE OFF
041638,000085: 
041639,000086:                                                                                                  #        (2)     IF LEM NOT DOCKED
041640,000087: 
041641,000088:                                                                                                  #                VARST0 = NOLEMVAL0      WHERE THE MEANING AND SCALING OF VARST0
041642,000089:                                                                                                  #                   .          .         TO VARST9 ARE THE SAME AS GIVEN ABOVE
041643,000090:                                                                                                  #                   .          .
041644,000091:                                                                                                  #                   .          .         NOTE... FOR THIS CASE, VARST8,9 HAVE NO
041645,000092:                                                                                                  #                VARST9 = NOLEMVAL9      MEANING (THEY ARE COMPUTED BUT NOT USED)
041646,000093: 
041647,000094:                                                                                                  #        (3)     THE FINAL OUTPUT CALCULATIONS ARE THEN DONE
041648,000095: 
041649,000096:                                                                                                  #                IXX0 = VARST0 + (CSMMASS + NEGBPW)VARST5                IXX
041650,000097: 
041651,000098:                                                                                                  #                IXX1 = VARST1 + (CSMMASS + NEGBPW)VARST(4 OR 6)         IAVG
041652,000099: 
041653,000100:                                                                                                  #                IXX2 = VARST2 + (CSMMASS + NEGBPW)VARST(3 OR 7)         IAVG/TLX
041654,000101: 
041655,000102:                                                                                                  #        THE DATA USED CAME FROM CSM/LM SPACECRAFT OPERATIONAL DATA BOOK.
041656,000103:                                                                                                  #                VOL. 3, NASA DOCUMENT SNA-8-D-027 (MARCH 1968)
041657,000104: 
041658,000105:                                                                                                  #        PERTINENT MASS DATA:            CSM WEIGHT      (FULL)  64100 LBS
041659,000106:                                                                                                  #                                                        (EMPTY) 23956 LBS
041660,000107:                                                                                                  #                                        LEM WEIGHT      (FULL)  32000 LBS
041661,000108:                                                                                                  #                                                        (EMPTY) 14116 LBS
041662,000109: 
041663,000110:                                                                                                  #        (WEIGHTS ARE FROM AMENDMENT #1 (APRIL 24, 1968) TO ABOVE DATA BOOK)

Page 953

041665,000112: 
041666,000113: 25,3774                                           BANK     25                                    
041667,000114: 05,2000                                           SETLOC   DAPMASS                               
041668,000115: 05,2000                                           BANK                                           
041669,000116: 05,3366  E6,1702                                  EBANK=   BZERO                                 
041670,000117: 05,3366                                           COUNT*   $$/MASP                               
041671,000118: 
041672,000119: 05,3366           34334        MASSPROP           CAF      NINE                                  #  MASSPROP USES TVC/RCS INTERUPT TEMPS
041673,000120: 05,3367           55506                           TS       PHI333                                #  SET UP TEN PASSES
041674,000121: 
041675,000122: 05,3370           31466        LEMTEST            CAE      DAPDATR1                              #  DETERMINE LEM STATUS
041676,000123: 05,3371           75003                           MASK     BIT13                                 
041677,000124: 05,3372           00006                           EXTEND                                         
041678,000125: 05,3373           13377                           BZF      LEMYES                                
041679,000126: 
041680,000127: 05,3374           51506        LEMNO              INDEX    PHI333                                #  LEM NOT ATTACHED
041681,000128: 05,3375           33463                           CAF      NOLEMVAL                              
041682,000129: 05,3376           13407                           TCF      STOINST                               
041683,000130: 
041684,000131: 05,3377           31473        LEMYES             CAE      LEMMASS                               #  LEM IS ATTACHED
041685,000132: 05,3400           60000                           DOUBLE                                         
041686,000133: 05,3401           00006                           EXTEND                                         
041687,000134: 05,3402           51506                           INDEX    PHI333                                
041688,000135: 05,3403           73505                           MP       SLOPEVAL                              
041689,000136: 05,3404           20001                           DDOUBL                                         
041690,000137: 05,3405           51506                           INDEX    PHI333                                
041691,000138: 05,3406           63473                           AD       INTVALUE                              
041692,000139: 
041693,000140: 05,3407           51506        STOINST            INDEX    PHI333                                #  STORAGE INST BEGIN HERE
041694,000141: 05,3410           55511                           TS       VARST0                                
041695,000142: 05,3411           11506                           CCS      PHI333                                #  ARE ALL TEN PASSES COMPLETED
041696,000143: 05,3412           13367                           TCF      MASSPROP   +1                         #  NO - GO DECREMENT PHI333
041697,000144: 
041698,000145: 05,3413           11466        DXTEST             CCS      DAPDATR1                              #  IF NEG, BIT15 IS 1, LEM DSCNT STAGE OFF
041699,000146: 05,3414           13422                           TCF      FIXCW                                 
041700,000147: 05,3415           13422                           TCF      FIXCW                                 
041701,000148: 05,3416           53522                           DXCH     VARST0     +8D                        
041702,000149: 05,3417           21513                           DAS      VARST0     +1                         
041703,000150: 05,3420           33520                           CA       DXITFIX                               
041704,000151: 05,3421           27520                           ADS      VARST0     +7                         
041705,000152: 
041706,000153: 05,3422           35016        FIXCW              CAF      BIT2                                  #  COMPUTATION PHASE BEGINS HERE. SET UP
041707,000154: 05,3423           55506                           TS       PHI333                                #  THREE PASSES
041708,000155: 05,3424           55507                           TS       PSI333                                
041709,000156: 
041710,000157: 05,3425           31474                           CAE      CSMMASS                               #  GET DELTA CSM WEIGHT - SIGN DETERMINES
041711,000158: 05,3426           63517                           AD       NEGBPW                                #  SLOPE LOCATIONS.
041712,000159: 05,3427           60000                           DOUBLE                                         
041713,000160: 05,3430           55510                           TS       TEMP333                               

Page 954

041715,000162: 05,3431           00006                           EXTEND                                         
041716,000163: 05,3432           63435                           BZMF     PEGGY                                 #  DETERMINE CORRECT SLOPE
041717,000164: 05,3433           37715                           CAF      NEG2                                  
041718,000165: 05,3434           55506                           TS       PHI333                                
041719,000166: 
041720,000167: 05,3435           51506        PEGGY              INDEX    PHI333                                #  ALL IS READY - CALCULATE OUTPUTS NOW
041721,000168: 05,3436           31516                           CAE      VARST5                                #  GET SLOPE
041722,000169: 05,3437           00006                           EXTEND                                         
041723,000170: 05,3440           71510                           MP       TEMP333                               #  MULT BY DELTA CSM WEIGHT
041724,000171: 05,3441           60000                           DOUBLE                                         
041725,000172: 05,3442           51507                           INDEX    PSI333                                
041726,000173: 05,3443           61511                           AD       VARST0                                #  ADD BREAKPOINT VALUE
041727,000174: 05,3444           51507                           INDEX    PSI333                                
041728,000175: 05,3445           55470                           TS       IXX                                   #  ****** OUTPUTS (IXX0, IXX1, IXX2) ******
041729,000176: 
041730,000177: 05,3446           11507                           CCS      PSI333                                #  BOOKKEEPING - MASSPROP FINISHED OR NOT
041731,000178: 05,3447           13457                           TCF      BOKKEP2                               #  NO - GO TAKE CARE OF INDEXING REGISTERS
041732,000179: 
041733,000180: 05,3450           31466                           CAE      DAPDATR1                              #  UPDATE WEIGHT/G
041734,000181: 05,3451           75002                           MASK     BIT14                                 
041735,000182: 05,3452           10000                           CCS      A                                     
041736,000183: 05,3453           31473                           CA       LEMMASS                               
041737,000184: 05,3454           61474                           AD       CSMMASS                               
041738,000185: 05,3455           55475                           TS       WEIGHT/G                              #  SCALED AT B+16 IN KILOGRAMS
041739,000186: 05,3456           00002        ENDMASSP           TC       Q                                     
041740,000187: 
041741,000188: 05,3457           55507        BOKKEP2            TS       PSI333                                #  REDUCE PSI BY ONE
041742,000189: 05,3460           00006                           EXTEND                                         
041743,000190: 05,3461           27506                           DIM      PHI333                                
041744,000191: 05,3462           13435                           TCF      PEGGY                                 
041745,000192: 

Page 955

041747,000194: 05,3463           00616        NOLEMVAL           DEC      25445      B-20                       
041748,000195: 05,3464           02526                           DEC      87450      B-20                       
041749,000196: 05,3465           02352                           DEC      .30715     B-2                        
041750,000197: 05,3466           01471                           DEC      1.22877    E-5        B+12            
041751,000198: 05,3467           00634                           DEC      1.6096     B-6                        
041752,000199: 05,3470           00612                           DEC      1.54       B-6                        
041753,000200: 05,3471           03706                           DEC      7.77177    B-6                        
041754,000201: 05,3472           04425                           DEC      3.46458    E-5        B+12            
041755,000202: 
041756,000203: 05,3473           00644        INTVALUE           DEC      26850      B-20                       
041757,000204: 05,3474           03710                           DEC      127518     B-20                       
041758,000205: 05,3475           04246                           DEC      .54059     B-2                        
041759,000206: 05,3476           02011                           DEC      .153964    E-4        B+12            
041760,000207: 05,3477           77501                           DEC      -.742923   B-6                        
041761,000208: 05,3500           00612                           DEC      1.5398     B-6                        
041762,000209: 05,3501           04656                           DEC      9.68       B-6                        
041763,000210: 05,3502           10372                           DEC      .647625    E-4        B+12            
041764,000211: 05,3503           77126                           DEC      -27228     B-20                       
041765,000212: 05,3504           76261                           DEC      -.206476   B-2                        
041766,000213: 
041767,000214: 05,3505           00767        SLOPEVAL           DEC      1.96307    B-6                        
041768,000215: 05,3506           15624                           DEC      27.5774    B-6                        
041769,000216: 05,3507           03054                           DEC      2.3548     E-5        B+12            
041770,000217: 05,3510           04532                           DEC      2.1777     E-9        B+26            
041771,000218: 05,3511           10433                           DEC      1.044      E-3        B+8             
041772,000219: 05,3512           00000                           DEC      0          B-14                       
041773,000220: 05,3513           22070                           DEC      2.21068    E-3        B+8             
041774,000221: 05,3514           03204                           DEC      1.5166     E-9        B+26            
041775,000222: 05,3515           77266                           DEC      -1.284     B-6                        
041776,000223: 05,3516           02476                           DEC      2          E-5        B+12            
041777,000224: 
041778,000225: 05,3517           70364        NEGBPW             DEC      -15402.17  B-16                       
041779,000226: 05,3520           75420        DXITFIX            DEC*     -1.88275   E-5        B+12*           
041780,000227: 

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