Source Code

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

The reconstruction began with reconstructed source code for Luminary 97. Changes between revisions 96 and 97 were backed out, as described by anomal report LNY-59. transcribed from a digitized copy of that program. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152D. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 96 listing.

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.

014888,000002:                                                                                                  ## Copyright:   Public domain.
014889,000003:                                                                                                  ## Filename:    GIMBAL_LOCK_AVOIDANCE.agc
014890,000004:                                                                                                  ## Purpose:     A section of Luminary revision 96.
014891,000005:                                                                                                  ##              It is part of the reconstructed source code for the
014892,000006:                                                                                                  ##              original release of the flight software for the Lunar 
014893,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
014894,000008:                                                                                                  ##              The code has been recreated from a previously reconstructed
014895,000009:                                                                                                  ##              copy of Luminary 97 by undoing changes described in anomaly
014896,000010:                                                                                                  ##              report LNY-59. The code has been adapted such that the
014897,000011:                                                                                                  ##              resulting bugger words exactly match those specified for
014898,000012:                                                                                                  ##              Luminary 96 in NASA drawing 2021152D, which gives relatively
014899,000013:                                                                                                  ##              high confidence that the reconstruction is correct.
014900,000014:                                                                                                  ## Reference:   p.  364
014901,000015:                                                                                                  ## Assembler:   yaYUL
014902,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
014903,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
014904,000018:                                                                                                  ## Mod history: 2019-08-04 MAS  Created from Luminary 97.
014905,000019: 

Page 364

014907,000021: 15,2050                                           BANK     15                                    
014908,000022: 
014909,000023: 22,2000                                           SETLOC   KALCMON1                              
014910,000024: 22,2000                                           BANK                                           
014911,000025: 
014912,000026:                                                                                                  #  DETECTING GIMBAL LOCK
014913,000027: 22,2744  22,2744               LOCSKIRT           EQUALS   NOGIMLOC                              
014914,000028: 
014915,000029: 22,2744           77614        NOGIMLOC           SET                                            
014916,000030: 22,2745           01074                                    CALCMAN3                              
014917,000031: 22,2746           70740        WCALC              LXC,1    DLOAD*                                
014918,000032: 22,2747           01325                                    RATEINDX                              #  CHOOSE THE DESIRED MANEUVER RATE
014919,000033: 22,2750           04772                                    ARATE,1                               #  FROM A LIST OF FOUR
014920,000034: 22,2751           45002                           SR4      CALL                                  #  COMPUTE THE INCREMENTAL ROTATION MATRIX
014921,000035: 22,2752           44527                                    DELCOMP                               #  DEL CORRESPONDING TO A 1 SEC ROTATION
014922,000036:                                                                                                  #  ABOUT COF
014923,000037: 22,2753           74343                           DLOAD*   VXSC                                  
014924,000038: 22,2754           04772                                    ARATE,1                               
014925,000039: 22,2755           03271                                    COF                                   
014926,000040: 22,2756           17326                           STODL    BRATE                                 #  COMPONENT MANEUVER RATES 45 DEG/SEC
014927,000041: 22,2757           03336                                    AM                                    
014928,000042: 22,2760           55605                           DMP      DDV*                                  
014929,000043: 22,2761           05002                                    ANGLTIME                              
014930,000044: 22,2762           04772                                    ARATE,1                               
014931,000045: 22,2763           77661                           SR                                             
014932,000046: 22,2764           20606                                    5                                     
014933,000047: 22,2765           03334                           STORE    TM                                    #  MANEUVER EXECUTION TIME SCALED AS T2
014934,000048: 22,2766           77614                           SETGO                                          
014935,000049: 22,2767           01035                                    CALCMAN2                              #  0(OFF) = CONTINUE MANEUVER
014936,000050: 22,2770           45010                                    NEWANGL    +1                         #  1(ON) = START MANEUVER
014937,000051: 
014938,000052:                                                                                                  #  THE FOUR SELECTABLE FREE FALL MANEUVER RATES SELECTED BY
014939,000053:                                                                                                  #  LOADING RATEINDX WITH 0, 2, 4, 6, RESPECTIVELY
014940,000054: 
014941,000055: 22,2771           00221 24255  ARATE              2DEC     .0088888888                            #  = 0.2 DEG/SEC         $ 22.5 DEG/SEC
014942,000056: 
014943,000057: 22,2773           00554 02660                     2DEC     .0222222222                            #  = 0.5 DEG/SEC         $ 22.5 DEG/SEC
014944,000058: 
014945,000059: 22,2775           02660 13301                     2DEC     .0888888888                            #  = 2.0 DEG/SEC         $ 22.5 DEG/SEC
014946,000060: 
014947,000061: 22,2777           16161 30707                     2DEC     .4444444444                            #  = 10.0 DEG/SEC        $ 22.5 DEG/SEC
014948,000062: 
014949,000063: 22,3001           00003 04000  ANGLTIME           2DEC     .0001907349                            #  = 100B-19 FUDGE FACTOR TO CONVERT
014950,000064:                                                                                                  #  MANEUVER ANGLE TO MANEUVER TIME
014951,000065: 
014952,000066: 

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