Source Code

This is the source-code for the Apollo 9 Command Module's Guidance Computer. These files were derived originally from the scan from MIT's Dibner Institute's now-discontinued website titled "History of Recent Science and Technology", which in turn was originally created by Gary Neff, though his high-quality scans were unfortunately reduced in legibility when presented online. The markings on the front of the printout imply that it was the original AGC developer Norm Brodeur's copy. A scan by Ron Burkey has superceded it, made from a more-legible copy from the collection of original AGC developer Fred Martin. The source code was transcribed from those images by Ron Burkey. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	ASSEMBLE REVISION 249 OF AGC PROGRAM COLOSSUS BY NASA 2021111-041
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

040658,000002:                                                                                                  ## Copyright:   Public domain.
040659,000003:                                                                                                  ## Filename:    TVCMASSPROP.agc
040660,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus, build 249.
040661,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
040662,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 9.
040663,000007:                                                                                                  ## Assembler:   yaYUL
040664,000008:                                                                                                  ## Reference:   Begins on p. 911
040665,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
040666,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
040667,000011:                                                                                                  ## Mod history: 08/23/04 RSB.   Began transcribing.
040668,000012:                                                                                                  ##              05/14/05 RSB.   Corrected website reference above.
040669,000013:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
040670,000014:                                                                                                  ##                              original harcopy, as opposed to the PDF page
040671,000015:                                                                                                  ##                              numbers in 1701.pdf.
040672,000016:                                                                                                  ##              2017-01-20 RSB  Cross-diff'd comment text (not whitespace)
040673,000017:                                                                                                  ##                              vs the already-proofed corresponding Colossus
040674,000018:                                                                                                  ##                              237 and Comanche 55 source-code files
040675,000019:                                                                                                  ##                              and corrected errors found.
040676,000020:                                                                                                  ##
040677,000021:                                                                                                  ## The contents of the "Colossus249" files, in general, are transcribed 
040678,000022:                                                                                                  ## from a scanned copy of the program listing.  Notations on this
040679,000023:                                                                                                  ## document read, in part:
040680,000024:                                                                                                  ##
040681,000025:                                                                                                  ##      Assemble revision 249 of AGC program Colossus by NASA
040682,000026:                                                                                                  ##      2021111-041.  October 28, 1968.  
040683,000027:                                                                                                  ##
040684,000028:                                                                                                  ##      This AGC program shall also be referred to as
040685,000029:                                                                                                  ##                              Colossus 1A
040686,000030:                                                                                                  ##
040687,000031:                                                                                                  ##      Prepared by
040688,000032:                                                                                                  ##                      Massachusetts Institute of Technology
040689,000033:                                                                                                  ##                      75 Cambridge Parkway
040690,000034:                                                                                                  ##                      Cambridge, Massachusetts
040691,000035:                                                                                                  ##      under NASA contract NAS 9-4065.
040692,000036:                                                                                                  ##
040693,000037:                                                                                                  ## Refer directly to the online document mentioned above for further information.
040694,000038:                                                                                                  ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
040695,000039:                                                                                                  ##
040696,000040:                                                                                                  ## In some cases, where the source code for Luminary 131 overlaps that of 
040697,000041:                                                                                                  ## Colossus 249, this code is instead copied from the corresponding Luminary 131
040698,000042:                                                                                                  ## source file, and then is proofed to incorporate any changes.
040699,000043: 

Page 911

040701,000045:                                                                                                  #  PROGRAM NAME....MASSPROP
040702,000046:                                                                                                  #  LOG SECTION....TVCMASSPROP            PROGRAMMER...MELANSON (ENGEL, SCHLUNDT)
040703,000047: 
040704,000048:                                                                                                  #  FUNCTIONAL DESCRIPTION:
040705,000049: 
040706,000050:                                                                                                  #        MASSPROP OPERATES IN TWO MODES: (1) IF LEM MASS OR CONFIGURATION ARE UPDATED (MASSPROP DOES NOT TEST
040707,000051:                                                                                                  #        FOR THIS) THE ENTIRE PROGRAM MUST BE RUN THROUGH, BREAKPOINT VALUES AND DERIVATIVES OF THE OUTPUTS WITH
040708,000052:                                                                                                  #        RESPECT TO CSM MASS BEING CALCULATED PRIOR TO CALCULATION OF THE OUTPUTS.  (2) OTHERWISE, THE OUTPUTS CAN BE
040709,000053:                                                                                                  #        CALCULATED USING PREVIOUSLY COMPUTED BREAKPOINT VALUES AND DERIVATIVES.
040710,000054: 
040711,000055:                                                                                                  #  CALLING SEQUENCES
040712,000056: 
040713,000057:                                                                                                  #        IF LEM MASS OR CONFIGURATION HAS BEEN UPDATED, TRANSFER TO MASSPROP, OTHERWISE TRANSFER TO FIXCW.
040714,000058:                                                                                                  #                L       TC      BANKCALL OR IBNKCALL
040715,000059:                                                                                                  #                L+1     CADR    MASSPROP
040716,000060:                                                                                                  #                        OR
040717,000061:                                                                                                  #                L+1     CADR    FIXCW
040718,000062:                                                                                                  #                L+2     RETURNS VIA Q
040719,000063: 
040720,000064:                                                                                                  #  CALLED   IN PARTICULAR BY DONOUN47 (JOB) AND TVCEXECUTIVE (TASK)
040721,000065: 
040722,000066:                                                                                                  #  JOBS OR TASKS INITIATED - NONE
040723,000067: 
040724,000068:                                                                                                  #  SUBROUTINES CALLED - NONE
040725,000069: 
040726,000070:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
040727,000071: 
040728,000072:                                                                                                  #        LEMMASS MUST CONTAIN LEM MASS SCALED AT B+16 IN KILOGRAMS
040729,000073:                                                                                                  #        CSMMASS MUST CONTAIN CSM MASS SCALED AT B+16 IN KILOGRAMS
040730,000074:                                                                                                  #        DAPDATR1 MUST BE SET TO INDICATE VEHICLE CONFIGURATION.
040731,000075:                                                                                                  #                BITS (15,14,13)  =  ( 0 , 0 , 1 )       LEM OFF
040732,000076:                                                                                                  #                                    ( 0 , 1 , 0 )       LEM ON (ASCNT,DSCNT)
040733,000077:                                                                                                  #                                    ( 1 , 1 , 0 )       LEM ON (ASCNT ONLY)
040734,000078: 
040735,000079:                                                                                                  #  ALARMS -      NONE
040736,000080: 
040737,000081:                                                                                                  #  EXIT -        TC      Q
040738,000082: 
040739,000083:                                                                                                  #  OUTPUTS:
040740,000084: 
040741,000085:                                                                                                  #        (1)     IXX, SINGLE PRECISION SCALED AT B+20 IN KG-M SQ.
040742,000086:                                                                                                  #        (2)     IAVG, SINGLE PRECISION SCALED AT B+20 IN KG-M SQ.
040743,000087:                                                                                                  #        (3)     IAVG/TLX, SINGLE PRECISION, SCALED AT B+2 SEC-SQD
040744,000088:                                                                                                  #        
040745,000089:                                                                                                  #        THEY ARE STORED IN CONSECUTIVE REGISTERS IXX0, IXX1, IXX2
040746,000090:                                                                                                  #        CONVERSION FACTOR:  (SLUG-FTSQ) = 0.737562 (KG-MSQ)

Page 912

040748,000092: 
040749,000093:                                                                                                  #  OUTPUTS ARE CALCULATED AS FOLLOWS:
040750,000094: 
040751,000095:                                                                                                  #        (1)     IF LEM DOCKED, LEMMASS IS FIRST ELIMINATED AS A PARAMETER
040752,000096: 
040753,000097:                                                                                                  #                VARST0 = INTVALUE0 + LEMMASS(SLOPEVAL0)         IXX             BREAKPOINT VALUE
040754,000098:                                                                                                  #                VARST1 = INTVALUE1 + LEMMASS(SLOPEVAL1)         IAVG            BREAKPOINT VALUE
040755,000099:                                                                                                  #                VARST2 = INTVALUE2 + LEMMASS(SLOPEVAL2)         IAVG/TLX        BREAKPOINT VALUE
040756,000100: 
040757,000101:                                                                                                  #                VARST3 = INTVALUE3 + LEMMASS(SLOPEVAL3)         IAVG/TLX        SLOPE FOR CSMMASS > 33956 LBS (SPS > 10000 LBS)
040758,000102:                                                                                                  #                VARST4 = INTVALUE4 + LEMMASS(SLOPEVAL4)         IAVG            SLOPE FOR CSMMASS > 33956 LBS (SPS > 10000 LBS)
040759,000103: 
040760,000104:                                                                                                  #                VARST5 = INTVALUE5 + LEMMASS(SLOPEVAL5)         IXX             SLOPE FOR ALL VALUES OF CSMMASS
040761,000105: 
040762,000106:                                                                                                  #                VARST6 = INTVALUE6 + LEMMASS(SLOPEVAL6)         IAVG            SLOPE FOR CSMMASS < 33956 LBS (SPS < 10000 LBS)
040763,000107:                                                                                                  #                VARST7 = INTVALUE7 + LEMMASS(SLOPEVAL7)         IAVG/TLX        SLOPE FOR CSMMASS < 33956 LBS (SPS < 10000 LBS)
040764,000108: 
040765,000109:                                                                                                  #                VARST8 = INTVALUE8 + LEMMASS(SLOPEVAL8)         IAVG            DECREMENT TO BRKPT VALUE WHEN LEM DSCNT STAGE OFF
040766,000110:                                                                                                  #                VARST9 = INTVALUE9 + LEMMASS(SLOPEVAL9)         IAVG/TLX        DECREMENT TO BRKPT VALUE WHEN LEM DSCNT STAGE OFF
040767,000111: 
040768,000112:                                                                                                  #        (2)     IF LEM NOT DOCKED
040769,000113: 
040770,000114:                                                                                                  #                VARST0 = NOLEMVAL0      WHERE THE MEANING AND SCALING OF VARST0
040771,000115:                                                                                                  #                   .          .         TO VARST9 ARE THE SAME AS GIVEN ABOVE
040772,000116:                                                                                                  #                   .          .
040773,000117:                                                                                                  #                   .          .         NOTE... FOR THIS CASE, VARST8,9 HAVE NO
040774,000118:                                                                                                  #                VARST9 = NOLEMVAL9      MEANING (THEY ARE COMPUTED BUT NOT USED)
040775,000119: 
040776,000120:                                                                                                  #        (3)     THE FINAL OUTPUT CALCULATIONS ARE THEN DONE
040777,000121: 
040778,000122:                                                                                                  #                IXX0 = VARST0 + (CSMMASS + NEGBPW)VARST5                IXX
040779,000123: 
040780,000124:                                                                                                  #                IXX1 = VARST1 + (CSMMASS + NEGBPW)VARST(4 OR 6)         IAVG
040781,000125: 
040782,000126:                                                                                                  #                IXX2 = VARST2 + (CSMMASS + NEGBPW)VARST(3 OR 7)         IAVG/TLX
040783,000127: 
040784,000128:                                                                                                  #        THE DATA USED CAME FROM CSM/LM SPACECRAFT OPERATIONAL DATA BOOK.
040785,000129:                                                                                                  #                VOL. 3, NASA DOCUMENT SNA-8-D-027 (MARCH 1968)
040786,000130: 
040787,000131:                                                                                                  #        PERTINENT MASS DATA:            CSM WEIGHT      (FULL)  64100 LBS
040788,000132:                                                                                                  #                                                        (EMPTY) 23956 LBS
040789,000133:                                                                                                  #                                        LEM WEIGHT      (FULL)  32000 LBS
040790,000134:                                                                                                  #                                                        (EMPTY) 14116 LBS
040791,000135: 
040792,000136:                                                                                                  #        (WEIGHTS ARE FROM AMENDMENT #1 (APRIL 24, 1968) TO ABOVE DATA BOOK)

Page 913

040794,000138: 
040795,000139: 25,3766                                           BANK     25                                    
040796,000140: 05,2000                                           SETLOC   DAPMASS                               
040797,000141: 05,2000                                           BANK                                           
040798,000142: 05,3207  E6,1742                                  EBANK=   BZERO                                 
040799,000143: 05,3207                                           COUNT*   $$/MASP                               
040800,000144: 
040801,000145: 05,3207           34334        MASSPROP           CAF      NINE                                  #  MASSPROP USES TVC/RCS INTERUPT TEMPS
040802,000146: 05,3210           55506                           TS       PHI333                                #  SET UP TEN PASSES
040803,000147: 
040804,000148: 05,3211           31466        LEMTEST            CAE      DAPDATR1                              #  DETERMINE LEM STATUS
040805,000149: 05,3212           74676                           MASK     BIT13                                 
040806,000150: 05,3213           00006                           EXTEND                                         
040807,000151: 05,3214           13220                           BZF      LEMYES                                
040808,000152: 
040809,000153: 05,3215           51506        LEMNO              INDEX    PHI333                                #  LEM NOT ATTACHED
040810,000154: 05,3216           33304                           CAF      NOLEMVAL                              
040811,000155: 05,3217           13230                           TCF      STOINST                               
040812,000156: 
040813,000157: 05,3220           31473        LEMYES             CAE      LEMMASS                               #  LEM IS ATTACHED
040814,000158: 05,3221           60000                           DOUBLE                                         
040815,000159: 05,3222           00006                           EXTEND                                         
040816,000160: 05,3223           51506                           INDEX    PHI333                                
040817,000161: 05,3224           73326                           MP       SLOPEVAL                              
040818,000162: 05,3225           20001                           DDOUBL                                         
040819,000163: 05,3226           51506                           INDEX    PHI333                                
040820,000164: 05,3227           63314                           AD       INTVALUE                              
040821,000165: 
040822,000166: 05,3230           51506        STOINST            INDEX    PHI333                                #  STORAGE INST BEGIN HERE
040823,000167: 05,3231           55511                           TS       VARST0                                
040824,000168: 05,3232           11506                           CCS      PHI333                                #  ARE ALL TEN PASSES COMPLETED
040825,000169: 05,3233           13210                           TCF      MASSPROP   +1                         #  NO - GO DECREMENT PHI333
040826,000170: 
040827,000171: 05,3234           11466        DXTEST             CCS      DAPDATR1                              #  IF NEG, BIT15 IS 1, LEM DSCNT STAGE OFF
040828,000172: 05,3235           13243                           TCF      FIXCW                                 
040829,000173: 05,3236           13243                           TCF      FIXCW                                 
040830,000174: 05,3237           53522                           DXCH     VARST0     +8D                        
040831,000175: 05,3240           21513                           DAS      VARST0     +1                         
040832,000176: 05,3241           33341                           CA       DXITFIX                               
040833,000177: 05,3242           27520                           ADS      VARST0     +7                         
040834,000178: 
040835,000179: 05,3243           34711        FIXCW              CAF      BIT2                                  #  COMPUTATION PHASE BEGINS HERE. SET UP
040836,000180: 05,3244           55506                           TS       PHI333                                #  THREE PASSES
040837,000181: 05,3245           55507                           TS       PSI333                                
040838,000182: 
040839,000183: 05,3246           31474                           CAE      CSMMASS                               #  GET DELTA CSM WEIGHT - SIGN DETERMINES
040840,000184: 05,3247           63340                           AD       NEGBPW                                #  SLOPE LOCATIONS.
040841,000185: 05,3250           60000                           DOUBLE                                         
040842,000186: 05,3251           55510                           TS       TEMP333                               

Page 914

040844,000188: 05,3252           00006                           EXTEND                                         
040845,000189: 05,3253           63256                           BZMF     PEGGY                                 #  DETERMINE CORRECT SLOPE
040846,000190: 05,3254           37715                           CAF      NEG2                                  
040847,000191: 05,3255           55506                           TS       PHI333                                
040848,000192: 
040849,000193: 05,3256           51506        PEGGY              INDEX    PHI333                                #  ALL IS READY - CALCULATE OUTPUTS NOW
040850,000194: 05,3257           31516                           CAE      VARST5                                #  GET SLOPE
040851,000195: 05,3260           00006                           EXTEND                                         
040852,000196: 05,3261           71510                           MP       TEMP333                               #  MULT BY DELTA CSM WEIGHT
040853,000197: 05,3262           60000                           DOUBLE                                         
040854,000198: 05,3263           51507                           INDEX    PSI333                                
040855,000199: 05,3264           61511                           AD       VARST0                                #  ADD BREAKPOINT VALUE
040856,000200: 05,3265           51507                           INDEX    PSI333                                
040857,000201: 05,3266           55470                           TS       IXX                                   #  ****** OUTPUTS (IXX0, IXX1, IXX2) ******
040858,000202: 05,3267           11507                           CCS      PSI333                                #  BOOKKEEPING - MASSPROP FINISHED OR NOT
040859,000203: 05,3270           13300                           TCF      BOKKEP2                               #  NO - GO TAKE CARE OF INDEXING REGISTERS
040860,000204: 
040861,000205: 05,3271           31466                           CAE      DAPDATR1                              #  UPDATE WEIGHT/G
040862,000206: 05,3272           74675                           MASK     BIT14                                 
040863,000207: 05,3273           10000                           CCS      A                                     
040864,000208: 05,3274           31473                           CA       LEMMASS                               
040865,000209: 05,3275           61474                           AD       CSMMASS                               
040866,000210: 05,3276           55475                           TS       WEIGHT/G                              #  SCALED AT B+16 IN KILOGRAMS
040867,000211: 05,3277           00002        ENDMASSP           TC       Q                                     
040868,000212: 
040869,000213: 05,3300           55507        BOKKEP2            TS       PSI333                                #  REDUCE PSI BY ONE
040870,000214: 05,3301           00006                           EXTEND                                         
040871,000215: 05,3302           27506                           DIM      PHI333                                
040872,000216: 05,3303           13256                           TCF      PEGGY                                 
040873,000217: 

Page 915

040875,000219: 05,3304           00616        NOLEMVAL           DEC      25445      B-20                       
040876,000220: 05,3305           02526                           DEC      87450      B-20                       
040877,000221: 05,3306           02352                           DEC      .30715     B-2                        
040878,000222: 05,3307           01471                           DEC      1.22877    E-5        B+12            
040879,000223: 05,3310           00634                           DEC      1.6096     B-6                        
040880,000224: 05,3311           00612                           DEC      1.54       B-6                        
040881,000225: 05,3312           03706                           DEC      7.77177    B-6                        
040882,000226: 05,3313           04425                           DEC      3.46458    E-5        B+12            
040883,000227: 
040884,000228: 05,3314           00644        INTVALUE           DEC      26850      B-20                       
040885,000229: 05,3315           03710                           DEC      127518     B-20                       
040886,000230: 05,3316           04246                           DEC      .54059     B-2                        
040887,000231: 05,3317           02011                           DEC      .153964    E-4        B+12            
040888,000232: 05,3320           77501                           DEC      -.742923   B-6                        
040889,000233: 05,3321           00612                           DEC      1.5398     B-6                        
040890,000234: 05,3322           04656                           DEC      9.68       B-6                        
040891,000235: 05,3323           10372                           DEC      .647625    E-4        B+12            
040892,000236: 05,3324           77126                           DEC      -27228     B-20                       
040893,000237: 05,3325           76261                           DEC      -.206476   B-2                        
040894,000238: 
040895,000239: 05,3326           00767        SLOPEVAL           DEC      1.96307    B-6                        
040896,000240: 05,3327           15624                           DEC      27.5774    B-6                        
040897,000241: 05,3330           03054                           DEC      2.3548     E-5        B+12            
040898,000242: 05,3331           04532                           DEC      2.1777     E-9        B+26            
040899,000243: 05,3332           10433                           DEC      1.044      E-3        B+8             
040900,000244: 05,3333           00000                           DEC      0          B-14                       
040901,000245: 05,3334           22070                           DEC      2.21068    E-3        B+8             
040902,000246: 05,3335           03204                           DEC      1.5166     E-9        B+26            
040903,000247: 05,3336           77266                           DEC      -1.284     B-6                        
040904,000248: 05,3337           02476                           DEC      2          E-5        B+12            
040905,000249: 
040906,000250: 05,3340           70364        NEGBPW             DEC      -15402.17  B-16                       
040907,000251: 05,3341           75420        DXITFIX            DEC*     -1.88275   E-5        B+12*           
040908,000252: 

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