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.

039931,000002:                                                                                                  ## Copyright:   Public domain.
039932,000003:                                                                                                  ## Filename:    MYSUBS.agc
039933,000004:                                                                                                  ## Purpose:     A section of Skylark revision 048.
039934,000005:                                                                                                  ##              It is part of the source code for the Apollo Guidance Computer (AGC)
039935,000006:                                                                                                  ##              for Skylab-2, Skylab-3, Skylab-4, and ASTP. No original listings of
039936,000007:                                                                                                  ##              this software are available; instead, this file was created via
039937,000008:                                                                                                  ##              disassembly of dumps of the core rope modules actually flown on
039938,000009:                                                                                                  ##              Skylab-2. Access to these modules was provided by the New Mexico
039939,000010:                                                                                                  ##              Museum of Space History.
039940,000011:                                                                                                  ## Assembler:   yaYUL
039941,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
039942,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
039943,000014:                                                                                                  ## Mod history: 2023-09-04 MAS  Created from Artemis 072.
039944,000015: 
039945,000016: 
039946,000017: 21,2000                                           SETLOC   MYSUBS                                
039947,000018: 21,2000                                           BANK                                           
039948,000019: 
039949,000020: 21,2000  E6,1537                                  EBANK=   KMPAC                                 
039950,000021: 21,2000     5073               SPCOS1             EQUALS   SPCOS                                 
039951,000022: 21,2000     5074               SPSIN1             EQUALS   SPSIN                                 
039952,000023: 21,2000     5073               SPCOS2             EQUALS   SPCOS                                 
039953,000024: 21,2000     5074               SPSIN2             EQUALS   SPSIN                                 
039954,000025: 
039955,000026: 21,2000                                           COUNT*   $$/DAPMS                              
039956,000027: 
039957,000028:                                                                                                  #  ONE AND ONE HALF PRECISION MULTIPLICATION ROUTINE
039958,000029: 
039959,000030: 21,2000           55541        SMALLMP            TS       KMPTEMP                               #  A(X+Y)
039960,000031: 21,2001           00006                           EXTEND                                         
039961,000032: 21,2002           71540                           MP       KMPAC      +1                         
039962,000033: 21,2003           55540                           TS       KMPAC      +1                         #  AY
039963,000034: 21,2004           35003                           CAF      ZERO                                  
039964,000035: 21,2005           57537                           XCH      KMPAC                                 
039965,000036: 21,2006           00006                           EXTEND                                         
039966,000037: 21,2007           71541                           MP       KMPTEMP                               #  AX
039967,000038: 21,2010           21540                           DAS      KMPAC                                 #  AX+AY
039968,000039: 21,2011           00002                           TC       Q                                     
039969,000040: 
039970,000041:                                                                                                  #  SUBROUTINE FOR DOUBLE PRECISION ADDITIONS OF ANGLES
039971,000042:                                                                                                  #  A AND L CONTAIN A DP(1S) ANGLE SCALED BY 180 DEGS TO BE ADDED TO KMPAC.
039972,000043:                                                                                                  #  RESULT IS PLACED IN KMPAC.  TIMING = 6 MCT (22 MCT ON OVERFLOW)
039973,000044: 
039974,000045: 21,2012           21540        DPADD              DAS      KMPAC                                 
039975,000046: 21,2013           00006                           EXTEND                                         
039976,000047: 21,2014           12031                           BZF      TSK        +1                         #  NO OVERFLOW
039977,000048: 21,2015           11537                           CCS      KMPAC                                 
039978,000049: 21,2016           12032                           TCF      DPADD+                                #  + OVERFLOW
039979,000050: 21,2017           12021                           TCF      +2                                    
039980,000051: 21,2020           12034                           TCF      DPADD-                                #  - OVERFLOW
039981,000052: 21,2021           11540                           CCS      KMPAC      +1                         
039982,000053: 21,2022           12037                           TCF      DPADD2+                               #  UPPER = 0, LOWER +
039983,000054: 21,2023           12025                           TCF      +2                                    
039984,000055: 21,2024           40000                           COM                                            #  UPPER = 0, LOWER -
039985,000056: 21,2025           64761                           AD       POSMAX                                #  LOWER = 0, A=0
039986,000057: 21,2026           55540                           TS       KMPAC      +1                         #  CAN NOT OVERFLOW
039987,000058: 21,2027           34761                           CA       POSMAX                                #  UPPER WAS = 0
039988,000059: 21,2030           55537        TSK                TS       KMPAC                                 
039989,000060: 21,2031           00002                 +1        TC       Q                                     
039990,000061: 21,2032           64763        DPADD+             AD       NEGMAX                                #  KMPAC GREATER THAN 0
039991,000062: 21,2033           12030                           TCF      TSK                                   
039992,000063: 
039993,000064: 21,2034           40000        DPADD-             COM                                            
039994,000065: 21,2035           64761                           AD       POSMAX                                #  KMPAC LESS THAN 0
039995,000066: 21,2036           12030                           TCF      TSK                                   
039996,000067: 
039997,000068: 21,2037           64763        DPADD2+            AD       NEGMAX                                #  CAN NOT OVERFLOW
039998,000069: 21,2040           55540                           TS       KMPAC      +1                         
039999,000070: 21,2041           34763                           CA       NEGMAX                                #  UPPER WAS = 0
040000,000071: 21,2042           12030                           TCF      TSK                                   

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