Source Code

These source-code files are part of a reconstructed copy of Luminary 163, the first (unflown) release of the Apollo 14 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with reconstructed source code for Luminary 173. Changes between revision 163 and 173 were backed out, as described by Luminary memos 157 and 158. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 163 listing would be different.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

015735,000002:                                                                                                  ## Copyright:   Public domain.
015736,000003:                                                                                                  ## Filename:    GIMBAL_LOCK_AVOIDANCE.agc
015737,000004:                                                                                                  ## Purpose:     A section of Luminary revision 163.
015738,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
015739,000006:                                                                                                  ##              (unflown) release of the flight software for the Lunar
015740,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
015741,000008:                                                                                                  ##              The code has been recreated from a reconstructed copy of
015742,000009:                                                                                                  ##              Luminary 173, as well as Luminary memos 157 amd 158.
015743,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
015744,000011:                                                                                                  ##              exactly match those specified for Luminary 163 in NASA
015745,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
015746,000013:                                                                                                  ##              that the reconstruction is correct.
015747,000014:                                                                                                  ## Reference:   p.  369
015748,000015:                                                                                                  ## Assembler:   yaYUL
015749,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
015750,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
015751,000018:                                                                                                  ## Mod history: 2019-08-21 MAS  Created from Luminary 173.
015752,000019: 

Page 369

015754,000021: 15,2050                                           BANK     15                                    
015755,000022: 
015756,000023: 22,2000                                           SETLOC   KALCMON1                              
015757,000024: 22,2000                                           BANK                                           
015758,000025: 
015759,000026: 
015760,000027:                                                                                                  #  DETECTING GIMBAL LOCK
015761,000028: 22,2744  22,2744               LOCSKIRT           EQUALS   NOGIMLOC                              
015762,000029: 
015763,000030: 22,2744           77614        NOGIMLOC           SET                                            
015764,000031: 22,2745           01074                                    CALCMAN3                              
015765,000032: 22,2746           70740        WCALC              LXC,1    DLOAD*                                
015766,000033: 22,2747           01322                                    RATEINDX                              #  CHOOSE THE DESIRED MANEUVER RATE
015767,000034: 22,2750           04772                                    ARATE,1                               #  FROM A LIST OF FOUR
015768,000035: 22,2751           45002                           SR4      CALL                                  #  COMPUTE THE INCREMENTAL ROTATION MATRIX
015769,000036: 22,2752           44527                                    DELCOMP                               #  DEL CORRESPONDING TO A 1 SEC ROTATION
015770,000037:                                                                                                  #  ABOUT COF
015771,000038: 22,2753           74343                           DLOAD*   VXSC                                  
015772,000039: 22,2754           04772                                    ARATE,1                               
015773,000040: 22,2755           03270                                    COF                                   
015774,000041: 22,2756           17325                           STODL    BRATE                                 #  COMPONENT MANEUVER RATES 45 DEG/SEC
015775,000042: 22,2757           03335                                    AM                                    
015776,000043: 22,2760           55605                           DMP      DDV*                                  
015777,000044: 22,2761           05002                                    ANGLTIME                              
015778,000045: 22,2762           04772                                    ARATE,1                               
015779,000046: 22,2763           77661                           SR                                             
015780,000047: 22,2764           20606                                    5                                     
015781,000048: 22,2765           03333                           STORE    TM                                    #  MANEUVER EXECUTION TIME SCALED AS T2
015782,000049: 22,2766           77614                           SETGO                                          
015783,000050: 22,2767           01035                                    CALCMAN2                              #  0(OFF) = CONTINUE MANEUVER
015784,000051: 22,2770           45010                                    NEWANGL    +1                         #  1(ON) = START MANEUVER
015785,000052:                                                                                                  #           THE FOUR SELECTABLE FREE FALL MANEUVER RATES SELECTED BY
015786,000053:                                                                                                  #           LOADING RATEINDX WITH 0,2,4,6, RESPECTIVELY
015787,000054: 
015788,000055: 
015789,000056: 22,2771           00221 24255  ARATE              2DEC     .0088888888                            #  = 0.2 DEG/SEC       $ 22.5 DEG/SEC
015790,000057: 22,2773           00554 02660                     2DEC     .0222222222                            #  = 0.5 DEG/SEC       $ 22.5 DEG/SEC
015791,000058: 22,2775           02660 13301                     2DEC     .0888888888                            #  = 2.0 DEG/SEC       $ 22.5 DEG/SEC
015792,000059: 22,2777           16161 30707                     2DEC     .4444444444                            #  = 10.0 DEG/SEC      $ 22.5 DEG/SEC
015793,000060: 
015794,000061: 22,3001           00003 04000  ANGLTIME           2DEC     .0001907349                            #  = 100B-19     FUDGE FACTOR TO CONVERT
015795,000062:                                                                                                  #  MANEUVER ANGLE TO MANEUVER TIME

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