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.

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

Page 369

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

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