Source Code

These source-code files are part of a reconstructed copy of Skylark 048, the Block II Command Module (CM) Apollo Guidance Computer (AGC) software for the Skylab-2, Skylab-3, Skylab-4, and Apollo-Soyuz Test Project missions.

They have been created via disassembly of binary dumps of the original core rope memory modules actually flown on Skylab-2, part numbers 2010802-541, 2010802-551, 2010802-561, 2010802-571, 2010802-581, and 2010802-591. Access to these modules was provided by the New Mexico Museum of Space History, who we are much indebted to.

The source code for the Apollo 15, 16, and 17 software, Artemis 072, was used as a starting point. Heavy use was made of TRW 4900.5-244, Programmed Guidance Equations for Skylark Command Module Earth Orbital Program, dated 14 February 1972. This document contains pseudocode of essentially all of Skylark, using original program labels which have been copied for this source reconstruction.

Since only binary dumps (rather than listings) of Skylark are available as source material, all comments and labels are approximate. They have been taken from the Programmed Guidance Equations or other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

038134,000002:                                                                                                  ## Copyright:   Public domain.
038135,000003:                                                                                                  ## Filename:    TVCMASSPROP.agc
038136,000004:                                                                                                  ## Purpose:     A section of Skylark revision 048.
038137,000005:                                                                                                  ##              It is part of the source code for the Apollo Guidance Computer (AGC)
038138,000006:                                                                                                  ##              for Skylab-2, Skylab-3, Skylab-4, and ASTP. No original listings of
038139,000007:                                                                                                  ##              this software are available; instead, this file was created via
038140,000008:                                                                                                  ##              disassembly of dumps of the core rope modules actually flown on
038141,000009:                                                                                                  ##              Skylab-2. Access to these modules was provided by the New Mexico
038142,000010:                                                                                                  ##              Museum of Space History.
038143,000011:                                                                                                  ## Assembler:   yaYUL
038144,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
038145,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
038146,000014:                                                                                                  ## Mod history: 2023-09-04 MAS  Created from Artemis 072.
038147,000015: 
038148,000016: 
038149,000017:                                                                                                  #  PROGRAM NAME....MASSPROP
038150,000018:                                                                                                  #  LOG SECTION....TVCMASSPROP            PROGRAMMER...MELANSON (ENGEL, SCHLUNDT)
038151,000019: 
038152,000020: 
038153,000021:                                                                                                  #  FUNCTIONAL DESCRIPTION:
038154,000022: 
038155,000023:                                                                                                  #        MASSPROP OPERATES IN TWO MODES:(1)IF LEM MASS OR CONFIGURATION ARE UPDATED (MASSPROP DOES NOT TEST
038156,000024:                                                                                                  #  FOR THIS) THE ENTIRE PROGRAM MUST BE RUN THROUGH, BREAKPOINT VALUES AND DERIVATIVES OF THE OUTPUTS WITH
038157,000025:                                                                                                  #  RESPECT TO CSM MASS BEING CALCULATED PRIOR TO CALCULATION OF THE OUTPUTS. (2)OTHERWISE, THE OUTPUTS CAN BE
038158,000026:                                                                                                  #  CALCULATED USING PREVIOUSLY COMPUTED BREAKPOINT VALUES AND DERIVATIVES.
038159,000027: 
038160,000028:                                                                                                  #  CALLING SEQUENCES
038161,000029: 
038162,000030:                                                                                                  #        IF LEM MASS OR CONFIGURATION HAS BEEN UPDATED, TRANSFER TO MASSPROP, OTHERWISE TRANSFER TO FIXCW.
038163,000031:                                                                                                  #                L       TC      BANKCALL OR IBNKCALL
038164,000032:                                                                                                  #                L+1     CADR    MASSPROP
038165,000033:                                                                                                  #                        OR
038166,000034:                                                                                                  #                L+1     CADR    FIXCW
038167,000035: 
038168,000036:                                                                                                  #                L+2     RETURNS VIA Q
038169,000037: 
038170,000038:                                                                                                  #  CALLED   IN PARTICULAR BY DONOUN47 (JOB) AND TVCEXECUTIVE (TASK)
038171,000039: 
038172,000040:                                                                                                  #  JOBS OR TASKS INITIATED - NONE
038173,000041: 
038174,000042:                                                                                                  #  SUBROUTINES CALLED - NONE
038175,000043: 
038176,000044:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
038177,000045: 
038178,000046:                                                                                                  #        LEMMASS MUST CONTAIN LEM MASS SCALED AT B+16 IN KILOGRAMS
038179,000047:                                                                                                  #        CSMMASS MUST CONTAIN CSM MASS SCALED AT B+16 IN KILOGRAMS
038180,000048: 
038181,000049:                                                                                                  #        DAPDATR1 MUST BE SET TO INDICATE VEHICLE CONFIGURATION.
038182,000050:                                                                                                  #                BITS (15,14,13)  =  ( 0 , 0 , 1 )       LEM OFF
038183,000051:                                                                                                  #                                    ( 0 , 1 , 0 )       LEM ON (ASCNT,DSCNT)
038184,000052:                                                                                                  #                                    ( 1 , 1 , 0 )       LEM ON (ASCNT ONLY)
038185,000053: 
038186,000054: 
038187,000055:                                                                                                  #  ALARMS - NONE
038188,000056: 
038189,000057:                                                                                                  #  EXIT -   TC     Q
038190,000058: 
038191,000059:                                                                                                  #  OUTPUTS:
038192,000060: 
038193,000061:                                                                                                  #        (1)IXX, SINGLE PRECISION SCALED AT B+20 IN KG-M SQ.
038194,000062:                                                                                                  #        (2)IAVG, SINGLE PRECISION SCALED AT B+20 IN KG-M SQ.
038195,000063:                                                                                                  #        (3)IAVG/TLX, SINGLE PRECISION, SCALED AT B+2 SEC-SQD
038196,000064:                                                                                                  #        THEY ARE STORED IN CONSECUTIVE REGISTERS IXX0, IXX1, IXX2
038197,000065: 
038198,000066:                                                                                                  #        CONVERSION FACTOR:  (SLUG-FTSQ) = 0.737562 (KG-MSQ)
038199,000067: 
038200,000068: 
038201,000069:                                                                                                  #  OUTPUTS ARE CALCULATED AS FOLLOWS :
038202,000070: 
038203,000071:                                                                                                  #   (1) IF LEM DOCKED, LEMMASS IS FIRST ELIMINATED AS A PARAMETER
038204,000072: 
038205,000073:                                                                                                  #        VARST0 = INTVALUE0 + LEMMASS(SLOPEVAL0)         IXX             BREAKPOINT VALUE
038206,000074:                                                                                                  #        VARST1 = INTVALUE1 + LEMMASS(SLOPEVAL1)         IAVG            BREAKPOINT VALUE
038207,000075:                                                                                                  #        VARST2 = INTVALUE2 + LEMMASS(SLOPEVAL2)         IAVG/TLX        BREAKPOINT VALUE
038208,000076: 
038209,000077:                                                                                                  #        VARST3 = INTVALUE3 + LEMMASS(SLOPEVAL3)         IAVG/TLX        SLOPE  FOR CSMMASS > 33956 LBS  ( SPS > 10000 LBS)
038210,000078:                                                                                                  #        VARST4 = INTVALUE4 + LEMMASS(SLOPEVAL4)         IAVG            SLOPE  FOR CSMMASS > 33956 LBS  ( SPS > 10000 LBS)
038211,000079: 
038212,000080:                                                                                                  #        VARST5 = INTVALUE5 + LEMMASS(SLOPEVAL5)         IXX             SLOPE  FOR ALL VALUES OF CSMMASS
038213,000081: 
038214,000082:                                                                                                  #        VARST6 = INTVALUE6 + LEMMASS(SLOPEVAL6)         IAVG            SLOPE  FOR CSMMASS < 33956 LBS  ( SPS < 10000 LBS)
038215,000083:                                                                                                  #        VARST7 = INTVALUE7 + LEMMASS(SLOPEVAL7)         IAVG/TLX        SLOPE  FOR CSMMASS < 33956 LBS  ( SPS < 10000 LBS)
038216,000084: 
038217,000085:                                                                                                  #        VARST8 = INTVALUE8 + LEMMASS(SLOPEVAL8)         IAVG            DECREMENT  TO BRKPT VALUE WHEN LEM DSCNT STAGE OFF
038218,000086:                                                                                                  #        VARST9 = INTVALUE9 + LEMMASS(SLOPEVAL9)         IAVG/TLX        DECREMENT  TO BRKPT VALUE WHEN LEM DSCNT STAGE OFF
038219,000087: 
038220,000088:                                                                                                  #   (2) IF LEM NOT DOCKED
038221,000089: 
038222,000090:                                                                                                  #        VARST0 = NOLEMVAL0      WHERE THE MEANING AND SCALING OF VARST0
038223,000091:                                                                                                  #          .         .           TO VARST9 ARE THE SAME AS GIVEN ABOVE
038224,000092:                                                                                                  #          .         .
038225,000093:                                                                                                  #          .         .           NOTE... FOR THIS CASE, VARST8,9 HAVE NO
038226,000094:                                                                                                  #        VARST9 = NOLEMVAL9      MEANING (THEY ARE COMPUTED BUT NOT USED)
038227,000095: 
038228,000096:                                                                                                  #   (3) THE FINAL OUTPUT CALCULATIONS ARE THEN DONE
038229,000097: 
038230,000098:                                                                                                  #        IXX0 =  VARST0 + (CSMMASS + NEGBPW)VARST5               IXX
038231,000099: 
038232,000100:                                                                                                  #        IXX1 =  VARST1 + (CSMMASS + NEGBPW)VARST(4 OR 6)        IAVG
038233,000101: 
038234,000102:                                                                                                  #        IXX2 =  VARST2 + (CSMMASS + NEGBPW)VARST(3 OR 7)        IAVG/TLX
038235,000103: 
038236,000104:                                                                                                  #  THE DATA USED CAME FROM CSM/LM SPACECRAFT OPERATIONAL DATA BOOK.
038237,000105:                                                                                                  #        VOL. 3, NASA DOCUMENT SNA-8-D-027 (MARCH 1968)
038238,000106: 
038239,000107:                                                                                                  #  PERTINENT MASS DATA :         CSM WEIGHT  (FULL)  64100 LBS
038240,000108:                                                                                                  #                                            (EMPTY) 23956 LBS
038241,000109:                                                                                                  #                                LEM WEIGHT  (FULL)  32000 LBS
038242,000110:                                                                                                  #                                            (EMPTY) 14116 LBS
038243,000111: 
038244,000112:                                                                                                  #  (WEIGHTS ARE FROM AMENDMENT #1 (APRIL 24,1968) TO ABOVE DATA BOOK)
038245,000113: 
038246,000114: 05,2000                                           SETLOC   DAPMASS                               
038247,000115: 05,2000                                           BANK                                           
038248,000116: 05,3311  E6,1453                                  EBANK=   CNTR                                  
038249,000117: 05,3311                                           COUNT*   $$/MASP                               
038250,000118: 
038251,000119: 
038252,000120: 05,3311           34322        MASSPROP           CAF      NINE                                  #  MASSPROP USES TVC/RCS INTERUPT TEMPS
038253,000121: 05,3312           55535                 +1        TS       PHI333                                #  SET UP TEN PASSES
038254,000122: 05,3313           31514        LEMTEST            CAE      DAPDATR1                              #  DETERMINE LEM STATUS
038255,000123: 05,3314           74765                           MASK     BIT13                                 
038256,000124: 05,3315           00006                           EXTEND                                         
038257,000125: 05,3316           13322                           BZF      LEMYES                                
038258,000126: 
038259,000127: 05,3317           51535        LEMNO              INDEX    PHI333                                #  LEM NOT ATTACHED
038260,000128: 05,3320           33406                           CAF      NOLEMVAL                              
038261,000129: 05,3321           13332                           TCF      STOINST                               
038262,000130: 
038263,000131: 05,3322           31521        LEMYES             CAE      LEMMASS                               #  LEM IS ATTACHED
038264,000132: 05,3323           60000                           DOUBLE                                         
038265,000133: 05,3324           00006                           EXTEND                                         
038266,000134: 05,3325           51535                           INDEX    PHI333                                
038267,000135: 05,3326           73430                           MP       SLOPEVAL                              
038268,000136: 05,3327           20001                           DDOUBL                                         
038269,000137: 05,3330           51535                           INDEX    PHI333                                
038270,000138: 05,3331           63416                           AD       INTVALUE                              
038271,000139: 
038272,000140: 05,3332           51535        STOINST            INDEX    PHI333                                #  STORAGE INST BEGIN HERE
038273,000141: 05,3333           55540                           TS       VARST0                                
038274,000142: 05,3334           11535                           CCS      PHI333                                #  ARE ALL TEN PASSES COMPLETED
038275,000143: 05,3335           13312                           TCF      MASSPROP   +1                         #  NO - GO DECREMENT PHI333
038276,000144: 
038277,000145: 05,3336           11514        DXTEST             CCS      DAPDATR1                              #  IF NEG, BIT15 IS 1, LEM DSCNT STAGE OFF
038278,000146: 05,3337           13345                           TCF      FIXCW                                 
038279,000147: 05,3340           13345                           TCF      FIXCW                                 
038280,000148: 05,3341           53551                           DXCH     VARST0     +8D                        
038281,000149: 05,3342           21542                           DAS      VARST0     +1                         
038282,000150: 05,3343           33443                           CA       DXITFIX                               
038283,000151: 05,3344           27547                           ADS      VARST0     +7                         
038284,000152: 
038285,000153: 05,3345           35000        FIXCW              CAF      BIT2                                  #  COMPUTATION PHASE BEGINS HERE.  SET UP
038286,000154: 05,3346           55535                           TS       PHI333                                #  THREE PASSES
038287,000155: 05,3347           55536                           TS       PSI333                                
038288,000156: 
038289,000157: 05,3350           31522                           CAE      CSMMASS                               #  GET DELTA CSM WEIGHT - SIGN DETERMINES
038290,000158: 05,3351           63442                           AD       NEGBPW                                #  SLOPE LOCATIONS.
038291,000159: 05,3352           60000                           DOUBLE                                         
038292,000160: 05,3353           55537                           TS       TEMP333                               
038293,000161: 
038294,000162: 05,3354           00006                           EXTEND                                         
038295,000163: 05,3355           63360                           BZMF     PEGGY                                 #  DETERMINE CORRECT SLOPE
038296,000164: 05,3356           37701                           CAF      NEG2                                  
038297,000165: 05,3357           55535                           TS       PHI333                                
038298,000166: 
038299,000167: 05,3360           51535        PEGGY              INDEX    PHI333                                #  ALL IS READY - CALCULATE OUTPUTS NOW
038300,000168: 05,3361           31545                           CAE      VARST5                                #  GET SLOPE
038301,000169: 05,3362           00006                           EXTEND                                         
038302,000170: 05,3363           71537                           MP       TEMP333                               #  MULT BY DELTA CSM WEIGHT
038303,000171: 05,3364           60000                           DOUBLE                                         
038304,000172: 05,3365           51536                           INDEX    PSI333                                
038305,000173: 05,3366           61540                           AD       VARST0                                #  ADD BREAKPOINT VALUE
038306,000174: 05,3367           51536                           INDEX    PSI333                                
038307,000175: 05,3370           55516                           TS       IXX                                   #  ****** OUTPUTS (IXX0, IXX1, IXX2) ******
038308,000176: 
038309,000177: 
038310,000178: 05,3371           11536                           CCS      PSI333                                #  BOOKKEEPING  - MASSPROP FINISHED OR NOT
038311,000179: 05,3372           13402                           TCF      BOKKEP2                               #  NO - GO TAKE CARE OF INDEXING REGISTERS
038312,000180: 
038313,000181: 05,3373           31514                           CAE      DAPDATR1                              #  UPDATE WEIGHT/G
038314,000182: 05,3374           74764                           MASK     BIT14                                 
038315,000183: 05,3375           10000                           CCS      A                                     
038316,000184: 05,3376           31521                           CA       LEMMASS                               
038317,000185: 05,3377           61522                           AD       CSMMASS                               
038318,000186: 05,3400           55524                           TS       WEIGHT/G                              #  SCALED AT B+16 IN KILOGRAMS
038319,000187: 05,3401           00002        ENDMASSP           TC       Q                                     
038320,000188: 
038321,000189: 05,3402           55536        BOKKEP2            TS       PSI333                                #  REDUCE PSI BY ONE
038322,000190: 05,3403           00006                           EXTEND                                         
038323,000191: 05,3404           27535                           DIM      PHI333                                
038324,000192: 05,3405           13360                           TCF      PEGGY                                 
038325,000193: 
038326,000194: 
038327,000195: 05,3406           00616        NOLEMVAL           DEC      25445.     B-20                       
038328,000196: 05,3407           02526                           DEC      87450.     B-20                       
038329,000197: 05,3410           02352                           DEC      .30715     B-2                        
038330,000198: 05,3411           01471                           DEC      1.22877    E-5        B+12            
038331,000199: 05,3412           00634                           DEC      1.6096     B-6                        
038332,000200: 05,3413           00612                           DEC      1.54       B-6                        
038333,000201: 05,3414           03706                           DEC      7.77177    B-6                        
038334,000202: 05,3415           04425                           DEC      3.46458    E-5        B+12            
038335,000203: 
038336,000204: 05,3416           00644        INTVALUE           DEC      26850      B-20                       
038337,000205: 05,3417           03710                           DEC      127518     B-20                       
038338,000206: 05,3420           04246                           DEC      .54059     B-2                        
038339,000207: 05,3421           02011                           DEC      .153964    E-4        B+12            
038340,000208: 05,3422           77501                           DEC      -.742923   B-6                        
038341,000209: 05,3423           00612                           DEC      1.5398     B-6                        
038342,000210: 05,3424           04656                           DEC      9.68       B-6                        
038343,000211: 05,3425           10372                           DEC      .647625    E-4        B+12            
038344,000212: 05,3426           77126                           DEC      -27228.    B-20                       
038345,000213: 05,3427           76261                           DEC      -.206476   B-2                        
038346,000214: 
038347,000215: 05,3430           00767        SLOPEVAL           DEC      1.96307    B-6                        
038348,000216: 05,3431           15624                           DEC      27.5774    B-6                        
038349,000217: 05,3432           03054                           DEC      2.3548     E-5        B+12            
038350,000218: 05,3433           04532                           DEC      2.1777     E-9        B+26            
038351,000219: 05,3434           10433                           DEC      1.044      E-3        B+8             
038352,000220: 05,3435           00000                           DEC      0          B-14                       
038353,000221: 05,3436           22070                           DEC      2.21068    E-3        B+8             
038354,000222: 05,3437           03204                           DEC      1.5166     E-9        B+26            
038355,000223: 05,3440           77266                           DEC      -1.284     B-6                        
038356,000224: 05,3441           02476                           DEC      2.         E-5        B+12            
038357,000225: 
038358,000226: 05,3442           70364        NEGBPW             DEC      -15402.17  B-16                       
038359,000227: 05,3443           75420        DXITFIX            DEC*     -1.88275   E-5        B+12*           

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