Source Code

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

The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memo 85, using asterisks indicating changed lines in the listing as a guide. While no listing of this version is known to exist, nor are the memory-bank checksums available, the reconstruction is believed to be correct because it was an an intermediate step in reconstructing Luminary 97 whose reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152G. 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 98 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.

014844,000002:                                                                                                  ## Copyright:   Public domain.
014845,000003:                                                                                                  ## Filename:    GIMBAL_LOCK_AVOIDANCE.agc
014846,000004:                                                                                                  ## Purpose:     A section of Luminary revision 98.
014847,000005:                                                                                                  ##              It is part of the reconstructed source code for the a
014848,000006:                                                                                                  ##              development version of the flight software for the Lunar 
014849,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
014850,000008:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
014851,000009:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
014852,000010:                                                                                                  ##              the listing and Luminary Memo #85, which lists changes between
014853,000011:                                                                                                  ##              Luminary 98 and 99.
014854,000012:                                                                                                  ## Reference:   p.  364
014855,000013:                                                                                                  ## Assembler:   yaYUL
014856,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
014857,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
014858,000016:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
014859,000017: 

Page 364

014861,000019: 15,2050                                           BANK     15                                    
014862,000020: 
014863,000021: 22,2000                                           SETLOC   KALCMON1                              
014864,000022: 22,2000                                           BANK                                           
014865,000023: 
014866,000024:                                                                                                  #  DETECTING GIMBAL LOCK
014867,000025: 22,2744  22,2744               LOCSKIRT           EQUALS   NOGIMLOC                              
014868,000026: 
014869,000027: 22,2744           77614        NOGIMLOC           SET                                            
014870,000028: 22,2745           01074                                    CALCMAN3                              
014871,000029: 22,2746           70740        WCALC              LXC,1    DLOAD*                                
014872,000030: 22,2747           01325                                    RATEINDX                              #  CHOOSE THE DESIRED MANEUVER RATE
014873,000031: 22,2750           04772                                    ARATE,1                               #  FROM A LIST OF FOUR
014874,000032: 22,2751           45002                           SR4      CALL                                  #  COMPUTE THE INCREMENTAL ROTATION MATRIX
014875,000033: 22,2752           44527                                    DELCOMP                               #  DEL CORRESPONDING TO A 1 SEC ROTATION
014876,000034:                                                                                                  #  ABOUT COF
014877,000035: 22,2753           74343                           DLOAD*   VXSC                                  
014878,000036: 22,2754           04772                                    ARATE,1                               
014879,000037: 22,2755           03271                                    COF                                   
014880,000038: 22,2756           17326                           STODL    BRATE                                 #  COMPONENT MANEUVER RATES 45 DEG/SEC
014881,000039: 22,2757           03336                                    AM                                    
014882,000040: 22,2760           55605                           DMP      DDV*                                  
014883,000041: 22,2761           05002                                    ANGLTIME                              
014884,000042: 22,2762           04772                                    ARATE,1                               
014885,000043: 22,2763           77661                           SR                                             
014886,000044: 22,2764           20606                                    5                                     
014887,000045: 22,2765           03334                           STORE    TM                                    #  MANEUVER EXECUTION TIME SCALED AS T2
014888,000046: 22,2766           77614                           SETGO                                          
014889,000047: 22,2767           01035                                    CALCMAN2                              #  0(OFF) = CONTINUE MANEUVER
014890,000048: 22,2770           45010                                    NEWANGL    +1                         #  1(ON) = START MANEUVER
014891,000049: 
014892,000050:                                                                                                  #  THE FOUR SELECTABLE FREE FALL MANEUVER RATES SELECTED BY
014893,000051:                                                                                                  #  LOADING RATEINDX WITH 0, 2, 4, 6, RESPECTIVELY
014894,000052: 
014895,000053: 22,2771           00221 24255  ARATE              2DEC     .0088888888                            #  = 0.2 DEG/SEC         $ 22.5 DEG/SEC
014896,000054: 
014897,000055: 22,2773           00554 02660                     2DEC     .0222222222                            #  = 0.5 DEG/SEC         $ 22.5 DEG/SEC
014898,000056: 
014899,000057: 22,2775           02660 13301                     2DEC     .0888888888                            #  = 2.0 DEG/SEC         $ 22.5 DEG/SEC
014900,000058: 
014901,000059: 22,2777           16161 30707                     2DEC     .4444444444                            #  = 10.0 DEG/SEC        $ 22.5 DEG/SEC
014902,000060: 
014903,000061: 22,3001           00003 04000  ANGLTIME           2DEC     .0001907349                            #  = 100B-19 FUDGE FACTOR TO CONVERT
014904,000062:                                                                                                  #  MANEUVER ANGLE TO MANEUVER TIME
014905,000063: 
014906,000064: 

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