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