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.

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

Page 911

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

Page 912

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

Page 913

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

Page 914

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

Page 915

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

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