Source Code

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

The reconstruction began with source code of Zerlina 56, Luminary 210, and Luminary 131, previously transcribed from digitized copies of those programs. The code was created by combining the three, using Zerlina 56 as a base, since it was based off of Luminary 183. The differences between the three were carefully merged using the Luminary memos as a guide, with all changes made after Luminary 178 being backed out. 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 178 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.

015771,000002:                                                                                                  ## Copyright:   Public domain.
015772,000003:                                                                                                  ## Filename:    GIMBAL_LOCK_AVOIDANCE.agc
015773,000004:                                                                                                  ## Purpose:     A section of Luminary revision 178.
015774,000005:                                                                                                  ##              It is part of the reconstructed source code for the final
015775,000006:                                                                                                  ##              release of the flight software for the Lunar Module's
015776,000007:                                                                                                  ##              (LM) Apollo Guidance Computer (AGC) for Apollo 14. The
015777,000008:                                                                                                  ##              code has been recreated from copies of Zerlina 56, Luminary
015778,000009:                                                                                                  ##              210, and Luminary 131, as well as many Luminary memos.
015779,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
015780,000011:                                                                                                  ##              exactly match those specified for Luminary 178 in NASA
015781,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
015782,000013:                                                                                                  ##              that the reconstruction is correct.
015783,000014:                                                                                                  ## Reference:   p.  369
015784,000015:                                                                                                  ## Assembler:   yaYUL
015785,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
015786,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
015787,000018:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Zerlina 56.
015788,000019: 

Page 369

015790,000021: 15,2050                                           BANK     15                                    
015791,000022: 
015792,000023: 22,2000                                           SETLOC   KALCMON1                              
015793,000024: 22,2000                                           BANK                                           
015794,000025: 
015795,000026: 
015796,000027:                                                                                                  #  DETECTING GIMBAL LOCK
015797,000028: 22,2744  22,2744               LOCSKIRT           EQUALS   NOGIMLOC                              
015798,000029: 
015799,000030: 22,2744           77614        NOGIMLOC           SET                                            
015800,000031: 22,2745           01074                                    CALCMAN3                              
015801,000032: 22,2746           70740        WCALC              LXC,1    DLOAD*                                
015802,000033: 22,2747           01322                                    RATEINDX                              #  CHOOSE THE DESIRED MANEUVER RATE
015803,000034: 22,2750           04772                                    ARATE,1                               #  FROM A LIST OF FOUR
015804,000035: 22,2751           45002                           SR4      CALL                                  #  COMPUTE THE INCREMENTAL ROTATION MATRIX
015805,000036: 22,2752           44527                                    DELCOMP                               #  DEL CORRESPONDING TO A 1 SEC ROTATION
015806,000037:                                                                                                  #  ABOUT COF
015807,000038: 22,2753           74343                           DLOAD*   VXSC                                  
015808,000039: 22,2754           04772                                    ARATE,1                               
015809,000040: 22,2755           03270                                    COF                                   
015810,000041: 22,2756           17325                           STODL    BRATE                                 #  COMPONENT MANEUVER RATES 45 DEG/SEC
015811,000042: 22,2757           03335                                    AM                                    
015812,000043: 22,2760           55605                           DMP      DDV*                                  
015813,000044: 22,2761           05002                                    ANGLTIME                              
015814,000045: 22,2762           04772                                    ARATE,1                               
015815,000046: 22,2763           77661                           SR                                             
015816,000047: 22,2764           20606                                    5                                     
015817,000048: 22,2765           03333                           STORE    TM                                    #  MANEUVER EXECUTION TIME SCALED AS T2
015818,000049: 22,2766           77614                           SETGO                                          
015819,000050: 22,2767           01035                                    CALCMAN2                              #  0(OFF) = CONTINUE MANEUVER
015820,000051: 22,2770           45010                                    NEWANGL    +1                         #  1(ON) = START MANEUVER
015821,000052:                                                                                                  #           THE FOUR SELECTABLE FREE FALL MANEUVER RATES SELECTED BY
015822,000053:                                                                                                  #           LOADING RATEINDX WITH 0,2,4,6, RESPECTIVELY
015823,000054: 
015824,000055: 
015825,000056: 22,2771           00221 24255  ARATE              2DEC     .0088888888                            #  = 0.2 DEG/SEC       $ 22.5 DEG/SEC
015826,000057: 22,2773           00554 02660                     2DEC     .0222222222                            #  = 0.5 DEG/SEC       $ 22.5 DEG/SEC
015827,000058: 22,2775           02660 13301                     2DEC     .0888888888                            #  = 2.0 DEG/SEC       $ 22.5 DEG/SEC
015828,000059: 22,2777           16161 30707                     2DEC     .4444444444                            #  = 10.0 DEG/SEC      $ 22.5 DEG/SEC
015829,000060: 
015830,000061: 22,3001           00003 04000  ANGLTIME           2DEC     .0001907349                            #  = 100B-19     FUDGE FACTOR TO CONVERT
015831,000062:                                                                                                  #  MANEUVER ANGLE TO MANEUVER TIME

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