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.

042806,000002:                                                                                                  ## Copyright:   Public domain.
042807,000003:                                                                                                  ## Filename:    RCS-CSM_DAP_EXECUTIVE_PROGRAMS.agc
042808,000004:                                                                                                  ## Purpose:     A section of Skylark revision 048.
042809,000005:                                                                                                  ##              It is part of the source code for the Apollo Guidance Computer (AGC)
042810,000006:                                                                                                  ##              for Skylab-2, Skylab-3, Skylab-4, and ASTP. No original listings of
042811,000007:                                                                                                  ##              this software are available; instead, this file was created via
042812,000008:                                                                                                  ##              disassembly of dumps of the core rope modules actually flown on
042813,000009:                                                                                                  ##              Skylab-2. Access to these modules was provided by the New Mexico
042814,000010:                                                                                                  ##              Museum of Space History.
042815,000011:                                                                                                  ## Assembler:   yaYUL
042816,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
042817,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
042818,000014:                                                                                                  ## Mod history: 2023-09-04 MAS  Created from Artemis 072.
042819,000015: 
042820,000016:                                                                                                  #  CALCULATION OF  AMGB, AMBG     ONCE EVERY SECOND
042821,000017: 
042822,000018:                                                                                                  #   AMGB =  1    SIN(PSI)                0
042823,000019:                                                                                                  #           0    COS(PSI)COS(PHI)        SIN(PHI)
042824,000020:                                                                                                  #           0    -COS(PSI)SIN(PHI)       COS(PHI)
042825,000021: 
042826,000022:                                                                                                  #   AMBG =  1    -TAN(PSI)COS(PHI)       TAN(PSI)SIN(PHI)
042827,000023:                                                                                                  #           0    COS(PHI)/COS(PSI)       -SIN(PHI)/COS(PSI)
042828,000024:                                                                                                  #           0    SIN(PHI)                COS(PHI)
042829,000025: 
042830,000026:                                                                                                  #   WHERE PHI AND PSI ARE CDU ANGLES
042831,000027: 
042832,000028: 22,2000                                           SETLOC   DAPS8                                 
042833,000029: 22,2000                                           BANK                                           
042834,000030: 
042835,000031: 22,3522                                           COUNT*   $$/DAPEX                              
042836,000032: 22,3522  E6,1537                                  EBANK=   KMPAC                                 
042837,000033: 22,3522           30102        AMBGUPDT           CA       FLAGWRD6                              #  CHECK FOR RCS AUTOPILOT
042838,000034: 22,3523           74076                           MASK     DPCONFIG                              
042839,000035: 22,3524           00006                           EXTEND                                         
042840,000036: 22,3525           65220                           BZMF     ENDOFJOB                              #  BIT15 = 0, BIT14 = 1
042841,000037: 22,3526           74764                           MASK     DAP2BIT                               #  IF NOT RCS, EXIT
042842,000038: 22,3527           00006                           EXTEND                                         
042843,000039: 22,3530           15220                           BZF      ENDOFJOB                              #  TO PROTECT TVC DAP ON SWITCHOVER
042844,000040: 
042845,000041: 22,3531           30034                           CA       CDUZ                                  
042846,000042: 22,3532           05074                           TC       SPSIN2                                
042847,000043: 22,3533           55671                           TS       AMGB1                                 #  CALCULATE AMGB
042848,000044: 22,3534           30034                           CA       CDUZ                                  
042849,000045: 22,3535           05073                           TC       SPCOS2                                
042850,000046: 22,3536           55676                           TS       CAPSI                                 #  MUST CHECK FOR GIMBAL LOCK
042851,000047: 22,3537           34631                           CAF      QUADANGL                              #  = 7.25  DEGREES JET QUAD ANGULAR OFFSET
042852,000048: 22,3540           00006                           EXTEND                                         
042853,000049: 22,3541           20032                           MSU      CDUX                                  
042854,000050: 22,3542           40000                           COM                                            #  CDUX - 7.25 DEG
042855,000051: 22,3543           05073                           TC       SPCOS1                                
042856,000052: 22,3544           55675                           TS       AMGB8                                 
042857,000053: 22,3545           00006                           EXTEND                                         
042858,000054: 22,3546           71676                           MP       CAPSI                                 
042859,000055: 22,3547           55672                           TS       AMGB4                                 
042860,000056: 22,3550           34631                           CAF      QUADANGL                              
042861,000057: 22,3551           00006                           EXTEND                                         
042862,000058: 22,3552           20032                           MSU      CDUX                                  
042863,000059: 22,3553           40000                           COM                                            #  CDUX - 7.25 DEG
042864,000060: 22,3554           05074                           TC       SPSIN1                                
042865,000061: 22,3555           55673                           TS       AMGB5                                 
042866,000062: 22,3556           00006                           EXTEND                                         
042867,000063: 22,3557           71676                           MP       CAPSI                                 
042868,000064: 22,3560           40000                           COM                                            
042869,000065: 22,3561           55674                           TS       AMGB7                                 
042870,000066: 22,3562           15220                           TCF      ENDOFJOB                              
042871,000067:    4000                                           SETLOC   FFTAG12                               
042872,000068:    4000                                           BANK                                           
042873,000069: 
042874,000070:    4631                                           COUNT*   $$/DAPEX                              
042875,000071:    4631           01224        QUADANGL           DEC      660        B-14                       #  = 7.25 DEGREES

End of include-file RCS-CSM_DAP_EXECUTIVE_PROGRAMS.agc.  Parent file is MAIN.agc