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.

025022,000002:                                                                                                  ## Copyright:   Public domain.
025023,000003:                                                                                                  ## Filename:    P30,P38.agc
025024,000004:                                                                                                  ## Purpose:     A section of Skylark revision 048.
025025,000005:                                                                                                  ##              It is part of the source code for the Apollo Guidance Computer (AGC)
025026,000006:                                                                                                  ##              for Skylab-2, Skylab-3, Skylab-4, and ASTP. No original listings of
025027,000007:                                                                                                  ##              this software are available; instead, this file was created via
025028,000008:                                                                                                  ##              disassembly of dumps of the core rope modules actually flown on
025029,000009:                                                                                                  ##              Skylab-2. Access to these modules was provided by the New Mexico
025030,000010:                                                                                                  ##              Museum of Space History.
025031,000011:                                                                                                  ## Assembler:   yaYUL
025032,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
025033,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
025034,000014:                                                                                                  ## Mod history: 2023-09-04 MAS  Created from Artemis 072.
025035,000015:                                                                                                  ##              2024-03-05 MAS  Updated for Skylark 48.
025036,000016: 
025037,000017:                                                                                                  #  PROGRAM DESCRIPTION   P30     DATE 5-1-69
025038,000018: 
025039,000019:                                                                                                  #  MOD.I BY S. ZELDIN-  TO ADD P31 AND ADAPT P30 FOR P31 USE.    22DEC67
025040,000020:                                                                                                  #  MOD.II BY P.WOLFF TO REDUCE CODING AND DELETE RESTART PROTECTION      4-30-69
025041,000021:                                                                                                  #  MOD.III BY C.BEALS TO DELETE P31      1NOV69
025042,000022: 
025043,000023:                                                                                                  #  FUNCTIONAL DESCRIPTION
025044,000024:                                                                                                  #        P30 (EXTERNAL DELTA-V TARGETTING PROGRAM)
025045,000025:                                                                                                  #                ACCEPTS ASTRONAUT INPUTS OF TIG,DELV(LV) AND COMPUTES, FOR DISPLAY,
025046,000026:                                                                                                  #                APOGEE, PERIGEE, DELV(MAG), MGA ASSOCIATED WITH DESIRED MANEUVER
025047,000027: 
025048,000028:                                                                                                  #  THE FOLLOWING SUBROUTINES ARE USED IN P30
025049,000029:                                                                                                  #        S30/31.1  COMPUTES APOGEE AND PERIGEE ALTITUDE
025050,000030:                                                                                                  #        P30/P31 - DISPLAYS TIG
025051,000031:                                                                                                  #        CNTUP30 - DISPLAYS DELV(LV)
025052,000032:                                                                                                  #        COMPTGO   CLOCKTASK COMPUTE TTOGO
025053,000033:                                                                                                  #        LOMAT     COMPUTE X,Y,Z IN LV COORDS
025054,000034:                                                                                                  #        PARAM30 - DISPLAYS APOGEE, PERIGEE, DELV(MAG), MGA, TIME FROM TIG,
025055,000035:                                                                                                  #                  MARKS SINCE LAST THRUSTING MANEUVER
025056,000036: 
025057,000037:                                                                                                  #  CALLING SEQUENCE VIA JOB FROM V37
025058,000038: 
025059,000039:                                                                                                  #  EXIT VIA V37 CALL OR GOTOPOOH
025060,000040: 
025061,000041:                                                                                                  #  OUTPUT FOR POWERED FLIGHT
025062,000042:                                                                                                  #        VTIG    X
025063,000043:                                                                                                  #        RTIG
025064,000044:                                                                                                  #        DELVSIN X
025065,000045: 
025066,000046:                                                                                                  #  P30 CALCULATIONS
025067,000047: 
025068,000048:                                                                                                  #  P30 CALC BASED ON STORED TARGET PARAMETERS (R OF IGNITION (RTIG), V OF
025069,000049:                                                                                                  #  IGNITION (VTIG), TIME OF IGNITION (TIG), DELV(LV), COMPUTE PERIGEE ALTITUDE
025070,000050:                                                                                                  #  APOGEE ALTITUDE AND DELTA-V REQUIRED IN REF. COORDS. (DELVSIN)
025071,000051:                                                                                                  #  
025072,000052:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
025073,000053:                                                                                                  #        TIG             TIME OF IGNITION                        DP      B28CS
025074,000054:                                                                                                  #        DELVSLV         SPECIFIED DELTA-V IN LOCAL VERT.
025075,000055:                                                                                                  #                        COORDS. OF ACTIVE VEHICLE AT
025076,000056:                                                                                                  #                        TIME OF IGNITION                        VCT.    B+7M/CS
025077,000057: 
025078,000058:                                                                                                  #  SUBROUTINES CALLED
025079,000059:                                                                                                  #        THISPREC
025080,000060: 
025081,000061:                                                                                                  #  OUTPUT
025082,000062:                                                                                                  #        RTIG            POSITION AT TIG                         VCT.    B+29M
025083,000063:                                                                                                  #        VTIG            VELOCITY AT TIG                         VCT.    B+7M
025084,000064:                                                                                                  #        DELVSIN         DELVSLV IN REF COORDS                   VCT.    B+7M/CS
025085,000065: 
025086,000066:                                                                                                  #  DEBRIS QTEMP    TEMP. ERASABLE
025087,000067:                                                                                                  #         QPRET, MPAC
025088,000068:                                                                                                  #         PUSHLIST
025089,000069: 
025090,000070: 35,2000                                           SETLOC   P30S1                                 
025091,000071: 35,2000                                           BANK                                           
025092,000072: 
025093,000073: 35,2250  E7,1603                                  EBANK=   +MGA                                  
025094,000074: 
025095,000075: 35,2250                                           COUNT*   $$/P30                                
025096,000076: 35,2250           07710        P30                TC       UPFLAG                                
025097,000077: 35,2251           00027                           ADRES    UPDATFLG                              #  SET UPDATFLG
025098,000078: 35,2252           07710                           TC       UPFLAG                                
025099,000079: 35,2253           00031                           ADRES    TRACKFLG                              #  SET TRACKFLG
025100,000080: 35,2254           35041        DSP0633            CAF      V06N33                                #  DISPLAY TIME OF IGNITION
025101,000081: 35,2255           05550                           TC       VNFLASH                               
025102,000082: 35,2256           34603                           CAF      V06N81                                
025103,000083: 35,2257           05550                           TC       VNFLASH                               
025104,000084: 35,2260           07710                           TC       UPFLAG                                
025105,000085: 35,2261           00045                           ADRES    XDELVFLG                              #  BIT 8 FLAG 2
025106,000086: 35,2262           06006                           TC       INTPRET                               
025107,000087: 35,2263           71214                           CLEAR    DLOAD                                 
025108,000088: 35,2264           00670                                    UPDATFLG                              #  RESET UPDATFLG
025109,000089: 35,2265           03413                                    TIG                                   #  TIME IGNITION SCALED AT 2(+28)CS
025110,000090: 35,2266           34041                           STCALL   TDEC1                                 
025111,000091: 35,2267           11400                                    THISPREC                              #  ENCKE ROUTINE FOR
025112,000092: 
025113,000093: 35,2270           77775                           VLOAD                                          
025114,000094: 35,2271           00007                                    VATT                                  
025115,000095: 35,2272           27616                           STOVL    VTIG                                  
025116,000096: 35,2273           00001                                    RATT                                  
025117,000097: 35,2274           03610                           STORE    RTIG                                  
025118,000098: 35,2275           03516                           STORE    RACT3                                 
025119,000099: 35,2276           53435                           VXV      UNIT                                  
025120,000100: 35,2277           03616                                    VTIG                                  
025121,000101: 35,2300           36543                           STCALL   UNRM                                  
025122,000102: 35,2301           73333                                    LOMAT                                 
025123,000103: 35,2302           61375                           VLOAD    VXM                                   
025124,000104: 35,2303           03405                                    DELVSLV                               
025125,000105: 35,2304           00001                                    0                                     
025126,000106: 35,2305           77772                           VSL1                                           
025127,000107: 35,2306           03624                           STORE    DELVSIN                               
025128,000108: 35,2307           77646                           ABVAL                                          
025129,000109: 35,2310           27764                           STOVL    VGDISP                                #  MAG DELV
025130,000110: 35,2311           03610                                    RTIG                                  
025131,000111: 35,2312           53315                           PDVL     VAD                                   
025132,000112: 35,2313           03624                                    DELVSIN                               
025133,000113: 35,2314           03616                                    VTIG                                  
025134,000114: 35,2315           77624                           CALL                                           
025135,000115: 35,2316           54021                                    S30/31.1                              
025136,000116: 35,2317           77776                           EXIT                                           
025137,000117: 35,2320           32366        PARAM30            CAF      V06N42                                #  DISPLAY HAPO, HPER, DELTAV
025138,000118: 35,2321           05550                           TC       VNFLASH                               
025139,000119: 35,2322           06006        REFTEST            TC       INTPRET                               
025140,000120: 35,2323           77214                           BOFF     VLOAD                                 
025141,000121: 35,2324           01742                                    REFSMFLG                              #  TEST FOR REFSMFLAG ON
025142,000122: 35,2325           72357                                    NOTSET                                
025143,000123: 35,2326           03624                                    DELVSIN                               
025144,000124: 35,2327           45006                           PUSH     CALL                                  
025145,000125: 35,2330           56734                                    GET+MGA                               
025146,000126: 35,2331           77776                           EXIT                                           
025147,000127: 35,2332           02340        DISPMGA            TC       COMPTGO                               
025148,000128: 
025149,000129: 35,2333           34604        DISP45             CAF      V16N45                                #  DISPLAY MARK CNT, TFI, +MGA
025150,000130: 35,2334           05550                           TC       VNFLASH                               
025151,000131: 35,2335           07722                           TC       DOWNFLAG                              
025152,000132: 35,2336           00155                           ADRES    TIMRFLAG                              #  RESET TIMRFLAG
025153,000133: 35,2337           14103                           TCF      GOTOPOOH                              
025154,000134: 
025155,000135: 35,2340           00006        COMPTGO            EXTEND                                         
025156,000136: 35,2341           23262                           QXCH     PHSPRDT6                              
025157,000137: 
025158,000138: 35,2342           07710                           TC       UPFLAG                                #  SET TIMRFLAG
025159,000139: 35,2343           00155                           ADRES    TIMRFLAG                              
025160,000140: 35,2344           35003                           CAF      ZERO                                  
025161,000141: 35,2345           54772                           TS       NVWORD1                               
025162,000142: 
025163,000143: 35,2346           35001                           CAF      ONE                                   
025164,000144: 35,2347           05246                           TC       WAITLIST                              
025165,000145: 35,2350  E7,1412                                  EBANK=   TIG                                   
025166,000146: 35,2350           03071 50067                     2CADR    CLOKTASK                              
025167,000147: 
025168,000148: 35,2352           05375                           TC       2PHSCHNG                              
025169,000149: 35,2353           40036                           OCT      40036                                 #  6.3SPOT FOR CLOKTASK
025170,000150: 35,2354           05024                           OCT      05024                                 #  GROUP 4 CONTINUES HERE
025171,000151: 35,2355           13000                           OCT      13000                                 
025172,000152: 
025173,000153: 35,2356  01,2333               6P3SPT1            =        6.3SPOT                               
025174,000154: 35,2356           01262                           TC       PHSPRDT6                              
025175,000155: 
025176,000156: 35,2357           57545        NOTSET             DLOAD    DCOMP                                 
025177,000157: 35,2360           32365                                    MARSDP                                
025178,000158: 35,2361           03604                           STORE    +MGA                                  
025179,000159: 35,2362           77634                           RTB                                            
025180,000160: 35,2363           72332                                    DISPMGA                               
025181,000161: 35,2364           00000        MARSDP             OCT      00000                                 #  (00000) (16440) = (+00001)
025182,000162: 35,2365           35100                           OCT      35100                                 
025183,000163:                                                                                                  #  ( .01 ) DEGREES IN THE LOW ORDER REGISTE
025184,000164: 
025185,000165: 35,2366           01452        V06N42             VN       0642                                  
025186,000166: 
025187,000167: 
025188,000168:                                                                                                  #  S30/31.1      SUBROUTINE USED BY P30/P31 CALCULATIONS
025189,000169:                                                                                                  #  MOD NO 1              LOG SECTION P30,P37
025190,000170: 
025191,000171:                                                                                                  #  FUNCTIONAL DESCRIPTION
025192,000172:                                                                                                  #        THROUGH A SERIES OF CALLS COMPUTES APOGEE AND PERIGEE ALTITUDE
025193,000173: 
025194,000174:                                                                                                  #  SUBROUTINES CALLED
025195,000175:                                                                                                  #        PERIAPO1
025196,000176:                                                                                                  #        MAXCHK
025197,000177: 
025198,000178:                                                                                                  #  CALLING SEQUENCE
025199,000179:                                                                                                  #        L       CALL
025200,000180:                                                                                                  #        L+1             S30/31.1
025201,000181: 
025202,000182:                                                                                                  #  NORMAL EXIT MODE
025203,000183:                                                                                                  #        AT L+2 OR CALLING SEQUENCE
025204,000184: 
025205,000185:                                                                                                  #  OUTPUT
025206,000186:                                                                                                  #        HAPO            APOGEE ALT.             DP      B+29 M
025207,000187:                                                                                                  #        HPER            PERIGEE ALT.            DP      B+29 M
025208,000188: 
025209,000189: 26,2000                                           SETLOC   P30S1A                                
025210,000190: 26,2000                                           BANK                                           
025211,000191: 
025212,000192: 26,2021                                           COUNT*   $$/P30                                
025213,000193: 26,2021           45020        S30/31.1           STQ      CALL                                  
025214,000194: 26,2022           03635                                    QTEMP                                 
025215,000195: 26,2023           45375                                    PERIAPO1                              
025216,000196: 26,2024           77624                           CALL                                           
025217,000197: 26,2025           46764                                    MAXCHK                                
025218,000198: 26,2026           16236                           STODL    HPER                                  #  PERIGEE ALT B+29
025219,000199: 26,2027           00005                                    4D                                    
025220,000200: 26,2030           77624                           CALL                                           
025221,000201: 26,2031           46764                                    MAXCHK                                
025222,000202: 26,2032           36234                           STCALL   HAPO                                  #  APOGEE ALT B+29
025223,000203: 26,2033           03635                                    QTEMP                                 
025224,000204: 
025225,000205: 
025226,000206: 
025227,000207:    4000                                           SETLOC   P30SUBS                               
025228,000208:    4000                                           BANK                                           
025229,000209:    4564                                           COUNT*   $$/P30                                
025230,000210:    4564  E4,1636                                  EBANK=   SUBEXIT                               
025231,000211:    4564           00006        P20FLGON           EXTEND                                         
025232,000212:    4565           23636                           QXCH     SUBEXIT                               
025233,000213:    4566           07710                           TC       UPFLAG                                
025234,000214:    4567           00031                           ADRES    TRACKFLG                              
025235,000215:    4570           07710                           TC       UPFLAG                                
025236,000216:    4571           00027                           ADRES    UPDATFLG                              
025237,000217:    4572           07722                           TC       DOWNFLAG                              
025238,000218:    4573           00244                           ADRES    PCFLAG                                
025239,000219:    4574           01636                           TC       SUBEXIT                               
025240,000220: 
025241,000221: 22,2000                                           SETLOC   P38TAG                                
025242,000222: 22,2000                                           BANK                                           
025243,000223:                                                                                                  #  PLANE CHANGE TARGETING PROGRAM        P38
025244,000224:                                                                                                  #  
025245,000225:                                                                                                  #  PURPOSE
025246,000226:                                                                                                  #        TO COMPUTE PARAMETERS FOR PLANE CHANGE MANEUVER
025247,000227: 
025248,000228:                                                                                                  #  INPUT
025249,000229:                                                                                                  #        LASTTIG
025250,000230:                                                                                                  #  
025251,000231:                                                                                                  #  OUTPUT
025252,000232:                                                                                                  #        TIG             TIME OF PLANE CHANGE MANEUVER  COMPUTED TO BE
025253,000233:                                                                                                  #                        LASTTIG + 90 DEG TRANSFER TIME
025254,000234:                                                                                                  #        DELVLVC         DELTA VELOCITY AT PC - LOCAL VERTICAL
025255,000235:                                                                                                  #        DELVSIN         DELTA VELOCITY AT PC - REFERENCE
025256,000236: 
025257,000237: 22,3271                                           COUNT*   $$/P38                                
025258,000238: 22,3271           04564        P38                TC       P20FLGON                              #  SET TRACK,UPDATE - CLEAR PC FLAGS
025259,000239: 22,3272           07710                           TC       UPFLAG                                
025260,000240: 22,3273           00244                           ADRES    PCFLAG                                
025261,000241: 
025262,000242: 22,3274           06006                           TC       INTPRET                               
025263,000243: 22,3275           71214                           CLEAR    DLOAD                                 
025264,000244: 22,3276           01271                                    FINALFLG                              
025265,000245: 22,3277           03413                                    TIG                                   
025266,000246: 22,3300           03726                           STORE    LASTTIG                               
025267,000247: 22,3301           77776                           EXIT                                           
025268,000248: 22,3302           33372                           CAF      V06N39                                
025269,000249: 22,3303           05550                           TC       VNFLASH                               
025270,000250: 22,3304           06006                           TC       INTPRET                               
025271,000251: 22,3305           71214        P38A               SET      DLOAD                                 
025272,000252: 22,3306           01067                                    XDELVFLG                              
025273,000253: 22,3307           03726                                    LASTTIG                               
025274,000254: 22,3310           34041                           STCALL   TDEC1                                 
025275,000255: 22,3311           11400                                    CSMPREC                               #  INTEGRATE STATES TO LASTTIG
025276,000256: 22,3312           43145                           DLOAD    SET                                   
025277,000257: 22,3313           15204                                    ZEROVECS                              
025278,000258: 22,3314           03466                                    RVSW                                  
025279,000259: 22,3315           16726                           STODL    CSTH                                  #  COS 90 DEGREES
025280,000260: 22,3316           05371                                    CS359+                                
025281,000261: 22,3317           26724                           STOVL    SNTH                                  #  SINE 90 DEGREES
025282,000262: 22,3320           00001                                    RATT                                  
025283,000263: 22,3321           26651                           STOVL    RVEC                                  
025284,000264: 22,3322           00007                                    VATT                                  
025285,000265: 22,3323           36740                           STCALL   VVEC                                  #  COMPUTE TRANSFER TIME OF 90 DEG
025286,000266: 22,3324           25004                                    TIMETHET                              
025287,000267: 22,3325           77615                           DAD                                            
025288,000268: 22,3326           03726                                    LASTTIG                               
025289,000269: 22,3327           03413                           STORE    TIG                                   
025290,000270: 22,3330           77776                           EXIT                                           
025291,000271: 22,3331           35041                           CAF      V06N33                                
025292,000272: 22,3332           05550                           TC       VNFLASH                               
025293,000273: 22,3333           06006                           TC       INTPRET                               
025294,000274: 22,3334           77624                           CALL                                           
025295,000275: 22,3335           73430                                    VN1645                                
025296,000276: 22,3336           77775        P38RECYC           VLOAD                                          
025297,000277: 22,3337           15204                                    ZEROVECS                              
025298,000278: 22,3340           17405                           STODL    DELVLVC                               
025299,000279: 22,3341           03413                                    TIG                                   
025300,000280: 22,3342           34041                           STCALL   TDEC1                                 
025301,000281: 22,3343           45416                                    PRECSET                               
025302,000282: 22,3344           43014                           BON      SET                                   
025303,000283: 22,3345           01311                                    FINALFLG                              
025304,000284: 22,3346           45350                                    +2                                    
025305,000285: 22,3347           00470                                    UPDATFLG                              
025306,000286: 22,3350           77775                 +2        VLOAD                                          
025307,000287: 22,3351           03524                                    VACT3                                 
025308,000288: 22,3352           27616                           STOVL    VTIG                                  
025309,000289: 22,3353           03516                                    RACT3                                 
025310,000290: 22,3354           37610                           STCALL   RTIG                                  
025311,000291: 22,3355           15667                                    DISPN90                               
025312,000292: 22,3356           77624                           CALL                                           
025313,000293: 22,3357           73333                                    LOMAT                                 
025314,000294: 22,3360           61375                           VLOAD    VXM                                   
025315,000295: 22,3361           03405                                    DELVLVC                               #  ROTATE DV (LV TO REF)
025316,000296: 22,3362           00001                                    0D                                    
025317,000297: 22,3363           77772                           VSL1                                           
025318,000298: 22,3364           37624                           STCALL   DELVSIN                               
025319,000299: 22,3365           73430                                    VN1645                                
025320,000300: 22,3366           77650                           GOTO                                           
025321,000301: 22,3367           45336                                    P38RECYC                              
025322,000302: 
025323,000303: 22,3370           17777 37776  CS359+             2DEC     +.499999992                            
025324,000304: 22,3372           01447        V06N39             VN       0639                                  

End of include-file P30,P38.agc.  Parent file is MAIN.agc