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.

019759,000002:                                                                                                  ## Copyright:   Public domain.
019760,000003:                                                                                                  ## Filename:    R31.agc
019761,000004:                                                                                                  ## Purpose:     A section of Skylark revision 048.
019762,000005:                                                                                                  ##              It is part of the source code for the Apollo Guidance Computer (AGC)
019763,000006:                                                                                                  ##              for Skylab-2, Skylab-3, Skylab-4, and ASTP. No original listings of
019764,000007:                                                                                                  ##              this software are available; instead, this file was created via
019765,000008:                                                                                                  ##              disassembly of dumps of the core rope modules actually flown on
019766,000009:                                                                                                  ##              Skylab-2. Access to these modules was provided by the New Mexico
019767,000010:                                                                                                  ##              Museum of Space History.
019768,000011:                                                                                                  ## Assembler:   yaYUL
019769,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
019770,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
019771,000014:                                                                                                  ## Mod history: 2023-09-04 MAS  Created from Artemis 072.
019772,000015:                                                                                                  ##              2024-03-05 MAS  Updated for Skylark 48.
019773,000016: 
019774,000017: 31,2000                                           SETLOC   R31                                   
019775,000018: 31,2000                                           BANK                                           
019776,000019: 
019777,000020: 31,2000                                           COUNT*   $$/R3134                              
019778,000021: 31,2000           35057        R31CALL            CAF      PRIO3                                 
019779,000022: 31,2001           05150                           TC       FINDVAC                               
019780,000023: 31,2002  E4,1636                                  EBANK=   SUBEXIT                               
019781,000024: 31,2002           02031 62064                     2CADR    V83CALL                               
019782,000025: 
019783,000026: 31,2004           04647        DSPDELAY           TC       BANKCALL                              
019784,000027: 31,2005           01730                           CADR     1SECDELY                              
019785,000028: 31,2006           31237                           CA       EXTVBACT                              
019786,000029: 31,2007           74766                           MASK     BIT12                                 
019787,000030: 31,2010           00006                           EXTEND                                         
019788,000031: 31,2011           12004                           BZF      DSPDELAY                              
019789,000032: 
019790,000033: 31,2012           30105        DISPN5X            CA       FLAGWRD9                              #  TEST R31FLAG (IN SUNDANCE R31FLAG WILL
019791,000034: 31,2013           74776                           MASK     R31FLBIT                              #  ALWAYS BE SET AS R34 DOES NOT EXIST
019792,000035: 31,2014           00006                           EXTEND                                         
019793,000036: 31,2015           12020                           BZF      +3                                    
019794,000037: 31,2016           32135                           CAF      V16N54                                #  R31    USE NOUN 54
019795,000038: 31,2017           02021                           TC       +2                                    
019796,000039: 31,2020           32136                           CAF      V16N53                                #  R34    USE NOUN 53
019797,000040: 31,2021           04647                           TC       BANKCALL                              
019798,000041: 31,2022           20456                           CADR     GOMARKF                               
019799,000042: 31,2023           05601                           TC       B5OFF                                 
019800,000043: 31,2024           05601                           TC       B5OFF                                 
019801,000044: 31,2025           12012                           TCF      DISPN5X                               
019802,000045: 
019803,000046: 31,2026           06006        V83                TC       INTPRET                               
019804,000047: 31,2027           77650                           GOTO                                           
019805,000048: 31,2030           62175                                    HAVEBASE                              #  INTEG STATE VECTORS
019806,000049: 31,2031           06006        V83CALL            TC       INTPRET                               
019807,000050: 31,2032           77650                           GOTO                                           
019808,000051: 31,2033           62144                                    STATEXTP                              #  EXTRAPOLATE STATE VECTORS
019809,000052: 31,2034           52375        COMPDISP           VLOAD    VSU                                   
019810,000053: 31,2035           00001                                    RATT                                  
019811,000054: 31,2036           02210                                    RONE                                  
019812,000055: 31,2037           51406                           PUSH     ABVAL                                 #  RATT-RONE TO 0D               PD= 6
019813,000056: 31,2040           02202                           STORE    RANGE                                 #  METERS B-29
019814,000057: 31,2041           77301                           NORM     VLOAD                                 
019815,000058: 31,2042           00047                                    X1                                    #  RATT-RONE                     PD= 0
019816,000059: 31,2043           77762                           VSR1                                           
019817,000060: 31,2044           53457                           VSL*     UNIT                                  
019818,000061: 31,2045           20201                                    0,1                                   
019819,000062: 31,2046           52315                           PDVL     VSU                                   #  UNIT(LOS) TO 0D               PD= 6
019820,000063: 31,2047           00007                                    VATT                                  
019821,000064: 31,2050           02216                                    VONE                                  
019822,000065: 31,2051           77641                           DOT                                            #  (VATT-VONE).UNIT(LOS)         PD= 0
019823,000066: 31,2052           77752                           SL1                                            
019824,000067: 31,2053           36204                           STCALL   RRATE                                 #  RANGE RATE M/CS B-7
019825,000068: 31,2054           47471                                    CDUTRIG                               #  TO INITIALIZE FOR *NBSM*
019826,000069: 31,2055           77624                           CALL                                           
019827,000070: 31,2056           62267                                    R34LOS                                #  NOTE. PDL MUST = 0.
019828,000071: 31,2057           53575        R34ANG             VLOAD    UNIT                                  
019829,000072: 31,2060           02210                                    RONE                                  
019830,000073: 31,2061           77715                           PDVL                                           #  UR TO 0D                      PD= 6
019831,000074: 31,2062           15202                                    THISAXIS                              #  UNITX FOR CM, UNITZ FOR LM
019832,000075: 31,2063           77214                           BON      VLOAD                                 #  CHK R31FLAG. ON=R31 THETA, OFF=R34 PHI
019833,000076: 31,2064           04713                                    R31FLAG                               
019834,000077: 31,2065           62067                                    +2                                    #        R31-THETA
019835,000078: 31,2066           00015                                    12D                                   
019836,000079: 31,2067           77624                           CALL                                           
019837,000080: 31,2070           47625                                    *NBSM*                                
019838,000081: 31,2071           41505                           VXM      PUSH                                  #  UXORZ TO 6D                   PD=12D
019839,000082: 31,2072           01720                                    REFSMMAT                              
019840,000083: 31,2073           72431                           VPROJ    VSL2                                  
019841,000084: 31,2074           00001                                    0D                                    
019842,000085: 31,2075           53445                           BVSU     UNIT                                  
019843,000086: 31,2076           00007                                    6D                                    
019844,000087: 31,2077           47315                           PDVL     VXV                                   #  UP/2 TO 12D                   PD=18D
019845,000088: 31,2100           02210                                    RONE                                  
019846,000089: 31,2101           02216                                    VONE                                  
019847,000090: 31,2102           47256                           UNIT     VXV                                   
019848,000091: 31,2103           02210                                    RONE                                  
019849,000092: 31,2104           63241                           DOT      PDVL                                  #  SIGN TO 12D, UP/2 TO MPAC     PD=18D
019850,000093: 31,2105           00015                                    12D                                   
019851,000094: 31,2106           50372                           VSL1     DOT                                   #  UP.UXORZ
019852,000095: 31,2107           00007                                    6D                                    
019853,000096: 31,2110           72565                           SIGN     SL1                                   
019854,000097: 31,2111           00015                                    12D                                   
019855,000098: 31,2112           77726                           ACOS                                           
019856,000099: 31,2113           26206                           STOVL    RTHETA                                
019857,000100: 31,2114           02210                                    RONE                                  
019858,000101: 31,2115           51041                           DOT      BPL                                   
019859,000102: 31,2116           00007                                    6D                                    
019860,000103: 31,2117           62124                                    +5                                    
019861,000104: 31,2120           44345                           DLOAD    BDSU                                  #  IF UXORZ.R NEG, RTHETA = 1 - RTHETA
019862,000105: 31,2121           02206                                    RTHETA                                
019863,000106: 31,2122           15212                                    DPPOSMAX                              
019864,000107: 31,2123           02206                           STORE    RTHETA                                #  RTHETA BETWEEN 0 AND 1 REV.
019865,000108: 31,2124           77776                 +5        EXIT                                           
019866,000109: 31,2125           34775                           CAF      BIT5                                  #  HAVE WE BEEN ANSWERED
019867,000110: 31,2126           71237                           MASK     EXTVBACT                              
019868,000111: 31,2127           00006                           EXTEND                                         
019869,000112: 31,2130           12137                           BZF      ISITP37                               
019870,000113: 
019871,000114: 31,2131           41237                           CS       EXTVBACT                              
019872,000115: 31,2132           74766                           MASK     BIT12                                 
019873,000116: 31,2133           27237                           ADS      EXTVBACT                              
019874,000117: 
019875,000118: 31,2134           12026                           TCF      V83                                   
019876,000119: 31,2135           04066        V16N54             VN       1654                                  
019877,000120: 31,2136           04065        V16N53             VN       1653                                  
019878,000121: 31,2137           05367        ISITP37            TC       CHECKMM                               
019879,000122: 31,2140           00045                           MM       37         B-14                       
019880,000123: 31,2141           15537                           TCF      ENDEXT                                #  NO, DIE
019881,000124: 
019882,000125: 31,2142           05542                           TC       CLEARMRK                              
019883,000126: 31,2143           14105                           TCF      MNKGOPOO                              
019884,000127: 
019885,000128:                                                                                                  #  STATEXTP DOES AN INITIAL PRECISION EXTRAPOLATION OF THE
019886,000129:                                                                                                  #  LEM STATE VECTOR TO PRESENT TIME OR TO PIPTIME IF AV G
019887,000130:                                                                                                  #  IS ON AND SAVES AS BASE VECTOR. IF AV G IS ON RN + VN
019888,000131:                                                                                                  #  ARE USED AS THE CM STATE VECTOR AND THE INITIAL R RDOT
019889,000132:                                                                                                  #  RTHETA ARE COMPUTED WITH NO FURTHER INTEGRATION. IF AV
019890,000133:                                                                                                  #  G IS OFF A PRECISION EXTRAPOLATION IS MADE OF THE CM
019891,000134:                                                                                                  #  STATE VECTOR TO PRESENT TIME AND.....
019892,000135:                                                                                                  #    THE CM + LM STATE VECTORS ARE INTEGRATED TO PRES TIME
019893,000136:                                                                                                  #    USING PRECISION OR CONIC AS SURFFLAG IS SET OR CLEAR.
019894,000137:                                                                                                  #    IF AV G IS ON THEN SUBSEQUENT PASSES WILL PROVIDE
019895,000138:                                                                                                  #    USE OF RN + VN AS CM STATE VECTOR AND THE LM STATE
019896,000139:                                                                                                  #    VECTOR WILL BE PRECISION INTEGRATED USING LEMPREC
019897,000140:                                                                                                  #    IF SURFFLAG IS SET.
019898,000141:                                                                                                  #      CM STATE VECTOR RONE VONE + LM STATE VECTOR RATT
019899,000142:                                                                                                  #      VATT ARE USED IN COMPUTING R RDOT RTHETA.
019900,000143: 
019901,000144: 31,2144           43034        STATEXTP           RTB      BOF                                   #  INITIAL INTEGRATION
019902,000145: 31,2145           45563                                    LOADTIME                              
019903,000146: 31,2146           03751                                    V37FLAG                               
019904,000147: 31,2147           62152                                    BOTHGO                                #  AV G OFF, USE PRESENT TIME
019905,000148: 31,2150           77624                           CALL                                           
019906,000149: 31,2151           62251                                    GETRVN                                #       ON,  USE RN, VN, PIPTIME
019907,000150: 31,2152           02224        BOTHGO             STORE    BASETIME                              
019908,000151: 31,2153           34041                           STCALL   TDEC1                                 
019909,000152: 31,2154           11414                                    LEMPREC                               
019910,000153: 31,2155           77775                           VLOAD                                          #  BASE VECTOR, LM
019911,000154: 31,2156           00017                                    RATT1                                 
019912,000155: 31,2157           26126                           STOVL    BASEOTP                               #    POS.
019913,000156: 31,2160           00025                                    VATT1                                 
019914,000157: 31,2161           02142                           STORE    BASEOTV                               #    VEL.
019915,000158: 31,2162           71214                           BON      DLOAD                                 
019916,000159: 31,2163           03711                                    V37FLAG                               
019917,000160: 31,2164           62034                                    COMPDISP                              #  COMPUTE R RDOT RTHETA FROM
019918,000161:                                                                                                  #  RONE(RN) VONE(VN) RATT+VATT(LEMPREC)
019919,000162: 31,2165           00015                                    TAT                                   
019920,000163: 31,2166           34041                           STCALL   TDEC1                                 
019921,000164: 31,2167           11400                                    CSMPREC                               
019922,000165: 31,2170           77775                           VLOAD                                          #  BASE VECTOR, CM
019923,000166: 31,2171           00017                                    RATT1                                 
019924,000167: 31,2172           26156                           STOVL    BASETHP                               #   POS.
019925,000168: 31,2173           00025                                    VATT1                                 
019926,000169: 31,2174           02226                           STORE    BASETHV                               #   VEL.
019927,000170: 31,2175           47014        HAVEBASE           BON      RTB                                   #  SUBSEQUENT INTEGRATIONS
019928,000171: 31,2176           03711                                    V37FLAG                               
019929,000172: 31,2177           62242                                    GETRVN5                               
019930,000173: 31,2200           45563                                    LOADTIME                              
019931,000174: 31,2201           34041                           STCALL   TDEC1                                 #  AV G OFF. SET INTEG. OF CM
019932,000175: 31,2202           11720                                    INTSTALL                              
019933,000176: 31,2203           77775                           VLOAD                                          
019934,000177: 31,2204           02156                                    BASETHP                               
019935,000178: 31,2205           25535                           STOVL    RCV                                   
019936,000179: 31,2206           02226                                    BASETHV                               
019937,000180: 31,2207           15543                           STODL    VCV                                   
019938,000181: 31,2210           02224                                    BASETIME                              
019939,000182: 31,2211           77614                           SET                                            
019940,000183: 31,2212           01473                                    INTYPFLG                              
019941,000184: 31,2213           35517                           STCALL   TET                                   
019942,000185: 31,2214           11444                                    INTEGRVS                              #  INTEGRATION --- AT LAST---
019943,000186: 31,2215           77775                           VLOAD                                          
019944,000187: 31,2216           00001                                    RATT                                  
019945,000188: 31,2217           26210                           STOVL    RONE                                  
019946,000189: 31,2220           00007                                    VATT                                  
019947,000190: 31,2221           16216                           STODL    VONE                                  #  GET SET FOR CONIC EXTRAP.,OTHER
019948,000191: 31,2222           00015                                    TAT                                   
019949,000192: 31,2223           77624                           CALL                                           
019950,000193: 31,2224           11720                                    INTSTALL                              #  LEMCONIC IF NOT DOWN
019951,000194: 31,2225           77614                           SET                                            
019952,000195: 31,2226           01473                                    INTYPFLG                              
019953,000196: 31,2227           00041        OTHINT             STORE    TDEC1                                 #  ENTERED IF AV G ON TO INTEG LM
019954,000197: 31,2230           77775                           VLOAD                                          
019955,000198: 31,2231           02126                                    BASEOTP                               
019956,000199: 31,2232           25535                           STOVL    RCV                                   
019957,000200: 31,2233           02142                                    BASEOTV                               
019958,000201: 31,2234           15543                           STODL    VCV                                   
019959,000202: 31,2235           02224                                    BASETIME                              
019960,000203: 31,2236           35517                           STCALL   TET                                   
019961,000204: 31,2237           11444                                    INTEGRVS                              
019962,000205: 31,2240           77650                           GOTO                                           
019963,000206: 31,2241           62034                                    COMPDISP                              #  COMPUTE R RDOT RTHETA         
019964,000207: 31,2242           77624        GETRVN5            CALL                                           #  AV G ON
019965,000208: 31,2243           62251                                    GETRVN                                
019966,000209: 31,2244           77624                           CALL                                           
019967,000210: 31,2245           11720                                    INTSTALL                              
019968,000211: 31,2246           52014                           CLEAR    GOTO                                  #  INTEGRVS (PREC) IF LM NOT DOWN
019969,000212: 31,2247           01673                                    INTYPFLG                              
019970,000213: 31,2250           62227                                    OTHINT                                
019971,000214: 31,2251           77620        GETRVN             STQ                                            
019972,000215: 31,2252           00000                                    0D                                    
019973,000216: 31,2253           52175                           VLOAD    GOTO                                  #  AV G ON, RONE = RN  VONE = VN
019974,000217: 31,2254           01022                                    RN                                    #   AND USE PIPTIME
019975,000218: 31,2255           62256                                    +1                                    
019976,000219: 31,2256           36210                           STCALL   RONE                                  
019977,000220: 31,2257           62260                                    +1                                    
019978,000221: 31,2260           52175                           VLOAD    GOTO                                  
019979,000222: 31,2261           01030                                    VN                                    
019980,000223: 31,2262           62263                                    +1                                    
019981,000224: 31,2263           16216                           STODL    VONE                                  
019982,000225: 31,2264           01036                                    PIPTIME                               
019983,000226: 31,2265           77650                           GOTO                                           
019984,000227: 31,2266           00000                                    0D                                    
019985,000228: 31,2000                                           SETLOC   R34                                   
019986,000229: 31,2000                                           BANK                                           
019987,000230: 31,2267                                           COUNT*   $$/R3134                              
019988,000231: 31,2267           77776        R34LOS             EXIT                                           
019989,000232: 31,2270           30036                           CA       CDUS                                  
019990,000233: 31,2271           50120                           INDEX    FIXLOC                                
019991,000234: 31,2272           54011                           TS       9D                                    
019992,000235: 31,2273           30035                           CA       CDUT                                  
019993,000236: 31,2274           50120                           INDEX    FIXLOC                                
019994,000237: 31,2275           54013                           TS       11D                                   
019995,000238: 31,2276           30120                           CA       FIXLOC                                
019996,000239: 31,2277           66211                           AD       SIX                                   
019997,000240: 31,2300           40000                           COM                                            
019998,000241: 31,2301           50120                           INDEX    FIXLOC                                
019999,000242: 31,2302           54046                           TS       X1                                    
020000,000243: 31,2303           06006                           TC       INTPRET                               
020001,000244: 31,2304           77624                           CALL                                           
020002,000245: 31,2305           46000                                    SXTNB                                 
020003,000246: 31,2306           34015                           STCALL   12D                                   
020004,000247: 31,2307           62057                                    R34ANG                                

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