Source Code

These source code files are an attempted reconstruction of Sundance revision 306, the Apollo 9 LM (Lunar Module) AGC (Apollo Guidance Computer) flight software, created from binary dumps of original core rope program modules, as follows:
  • B1 — Revision 292
  • B2 — Revision 302
  • B3 — Revision 302
  • B4 — Revision 302
  • B5 — Revision 292
  • B6 — Revision 306
These dumps were then modified using memos, checklists, observed address changes, and the Sundance GSOPs to get the entire program to match Sundance revision 306 as closely as possible. Without more information, it is not possible to say how close it actually is; however, this code should be quite close. It is capable of flying the whole Apollo 9 mission using the original checklists and padload. Since only binary dumps (rather than listings) of Sundance are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

013427,000002:                                                                                                  ## Copyright:   Public domain.
013428,000003:                                                                                                  ## Filename:    GIMBAL_LOCK_AVOIDANCE.agc
013429,000004:                                                                                                  ## Purpose:     A section of an attempt to reconstruct Sundance revision 306
013430,000005:                                                                                                  ##              as closely as possible with available information. Sundance
013431,000006:                                                                                                  ##              306 is the source code for the Lunar Module's (LM) Apollo
013432,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 9. This program was created
013433,000008:                                                                                                  ##              using the mixed-revision SundanceXXX as a starting point, and
013434,000009:                                                                                                  ##              pulling back features from Luminary 69 believed to have been
013435,000010:                                                                                                  ##              added based on memos, checklists, observed address changes,
013436,000011:                                                                                                  ##              or the Sundance GSOPs.
013437,000012:                                                                                                  ## Assembler:   yaYUL
013438,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
013439,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
013440,000015:                                                                                                  ## Mod history: 2020-07-24 MAS  Created from SundanceXXX.
013441,000016: 
013442,000017: 
013443,000018: 15,2000                                           BANK     15                                    
013444,000019: 
013445,000020: 22,2000                                           SETLOC   KALCMON1                              
013446,000021: 22,2000                                           BANK                                           
013447,000022: 
013448,000023:                                                                                                  #  DETECTING GIMBAL LOCK
013449,000024: 22,2740  22,2740               LOCSKIRT           EQUALS   NOGIMLOC                              
013450,000025: 
013451,000026: 22,2740           77614        NOGIMLOC           SET                                            
013452,000027: 22,2741           01074                                    CALCMAN3                              
013453,000028: 22,2742           70740        WCALC              LXC,1    DLOAD*                                
013454,000029: 22,2743           01331                                    RATEINDX                              #  CHOOSE THE DESIRED MANEUVER RATE
013455,000030: 22,2744           04766                                    ARATE,1                               #  FROM A LIST OF FOUR
013456,000031: 22,2745           45002                           SR4      CALL                                  #  COMPUTE THE INCREMENTAL ROTATION MATRIX
013457,000032: 22,2746           44523                                    DELCOMP                               #  DEL CORRESPONDING TO A 1 SEC ROTATION
013458,000033:                                                                                                  #  ABOUT COF
013459,000034: 22,2747           74343                           DLOAD*   VXSC                                  
013460,000035: 22,2750           04766                                    ARATE,1                               
013461,000036: 22,2751           03266                                    COF                                   
013462,000037: 22,2752           17323                           STODL    BRATE                                 #  COMPONENT MANEUVER RATES 45 DEG/SEC
013463,000038: 22,2753           03333                                    AM                                    
013464,000039: 22,2754           55605                           DMP      DDV*                                  
013465,000040: 22,2755           04776                                    ANGLTIME                              
013466,000041: 22,2756           04766                                    ARATE,1                               
013467,000042: 22,2757           77661                           SR                                             
013468,000043: 22,2760           20606                                    5                                     
013469,000044: 22,2761           03331                           STORE    TM                                    #  MANEUVER EXECUTION TIME SCALED AS T2
013470,000045: 22,2762           77614                           SETGO                                          
013471,000046: 22,2763           01035                                    CALCMAN2                              #  0(OFF) = CONTINUE MANEUVER
013472,000047: 22,2764           45004                                    NEWANGL    +1                         #  1(ON) = START MANEUVER
013473,000048: 
013474,000049:                                                                                                  #  THE FOUR SELECTABLE FREE FALL MANEUVER RATES SELECTED BY
013475,000050:                                                                                                  #  LOADING RATEINDX WITH 0, 2, 4, 6, RESPECTIVELY
013476,000051: 
013477,000052: 22,2765           00221 24255  ARATE              2DEC     .0088888888                            #  = 0.2 DEG/SEC         $ 22.5 DEG/SEC
013478,000053: 
013479,000054: 22,2767           00554 02660                     2DEC     .0222222222                            #  = 0.5 DEG/SEC         $ 22.5 DEG/SEC
013480,000055: 
013481,000056: 22,2771           02660 13301                     2DEC     .0888888888                            #  = 2.0 DEG/SEC         $ 22.5 DEG/SEC
013482,000057: 
013483,000058: 22,2773           16161 30707                     2DEC     .4444444444                            #  = 10.0 DEG/SEC        $ 22.5 DEG/SEC
013484,000059: 
013485,000060: 22,2775           00003 04000  ANGLTIME           2DEC     .0001907349                            #  = 100B-19 FUDGE FACTOR TO CONVERT
013486,000061:                                                                                                  #  MANEUVER ANGLE TO MANEUVER TIME
013487,000062: 
013488,000063: 

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