Source Code

These source-code files were transcribed from scans made from Don Eyles's personal copy of Luminary 069. They were scanned at archive.org's Boston facility, and the scanning was sponsored by Onno Hommes. The code was transcribed from these scans by a team of volunteers who are referenced in the program comments. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". In some cases, where similar code blocks exist in previously-transcribed AGC programs (primarily Luminary 99, from Apollo 11) those code blocks were used as a starting point and then corrected to agree with the Luminary 69 scans. The full scans are available at the Virtual AGC project's collection at archive.org, while more-convenient reduced-size (but reduced-quality) images are available at the main Virtual AGC website. Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 069 OF AGC PROGRAM LUMINARY BY NASA 2021112-011
	19:02 NOV. 25,1968
Note that the date is the date of the printout, not the date of the program revision.

016304,000002:                                                                                                  ## Copyright:   Public domain.
016305,000003:                                                                                                  ## Filename:    GIMBAL_LOCK_AVOIDANCE.agc
016306,000004:                                                                                                  ## Purpose:     The main source file for Luminary revision 069.
016307,000005:                                                                                                  ##              It is part of the source code for the original release
016308,000006:                                                                                                  ##              of the flight software for the Lunar Module's (LM) Apollo
016309,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 10. The actual flown
016310,000008:                                                                                                  ##              version was Luminary 69 revision 2, which included a
016311,000009:                                                                                                  ##              newer lunar gravity model and only affected module 2.
016312,000010:                                                                                                  ##              This file is intended to be a faithful transcription, except
016313,000011:                                                                                                  ##              that the code format has been changed to conform to the
016314,000012:                                                                                                  ##              requirements of the yaYUL assembler rather than the
016315,000013:                                                                                                  ##              original YUL assembler.
016316,000014:                                                                                                  ## Reference:   p.  377
016317,000015:                                                                                                  ## Assembler:   yaYUL
016318,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
016319,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
016320,000018:                                                                                                  ## Mod history: 2016-12-13 MAS  Created from Luminary 99.
016321,000019:                                                                                                  ##              2016-12-14 MAS  Updated from comment-proofed Luminary 99 version.
016322,000020:                                                                                                  ##              2017-01-13 RRB  Updated for Luminary 69.
016323,000021:                                                                                                  ##              2017-01-27 RSB  Proofed comment text using octopus/prooferComments
016324,000022:                                                                                                  ##                              and fixed errors found.
016325,000023:                                                                                                  ##              2017-08-22 RSB  Fixed comment-text typo identified in ZERLINA 56.
016326,000024: 

Page 377

016328,000026: 15,2050                                           BANK     15                                    
016329,000027: 
016330,000028: 22,2000                                           SETLOC   KALCMON1                              
016331,000029: 22,2000                                           BANK                                           
016332,000030: 
016333,000031:                                                                                                  #  DETECTING GIMBAL LOCK
016334,000032: 22,2744  22,2744               LOCSKIRT           EQUALS   NOGIMLOC                              
016335,000033: 
016336,000034: 22,2744           77614        NOGIMLOC           SET                                            
016337,000035: 22,2745           01074                                    CALCMAN3                              
016338,000036: 22,2746           70740        WCALC              LXC,1    DLOAD*                                
016339,000037: 22,2747           01325                                    RATEINDX                              #  CHOOSE THE DESIRED MANEUVER RATE
016340,000038: 22,2750           04772                                    ARATE,1                               #  FROM A LIST OF FOUR
016341,000039: 22,2751           45002                           SR4      CALL                                  #  COMPUTE THE INCREMENTAL ROTATION MATRIX
016342,000040: 22,2752           44527                                    DELCOMP                               #  DEL CORRESPONDING TO A 1 SEC ROTATION
016343,000041:                                                                                                  #  ABOUT COF
016344,000042: 22,2753           74343                           DLOAD*   VXSC                                  
016345,000043: 22,2754           04772                                    ARATE,1                               
016346,000044: 22,2755           03267                                    COF                                   
016347,000045: 22,2756           17324                           STODL    BRATE                                 #  COMPONENT MANEUVER RATES 45 DEG/SEC
016348,000046: 22,2757           03334                                    AM                                    
016349,000047: 22,2760           55605                           DMP      DDV*                                  
016350,000048: 22,2761           05002                                    ANGLTIME                              
016351,000049: 22,2762           04772                                    ARATE,1                               
016352,000050: 22,2763           77661                           SR                                             
016353,000051: 22,2764           20606                                    5                                     
016354,000052: 22,2765           03332                           STORE    TM                                    #  MANEUVER EXECUTION TIME SCALED AS T2
016355,000053: 22,2766           77614                           SETGO                                          
016356,000054: 22,2767           01035                                    CALCMAN2                              #  0(OFF) = CONTINUE MANEUVER
016357,000055: 22,2770           45010                                    NEWANGL    +1                         #  1(ON) = START MANEUVER
016358,000056: 
016359,000057:                                                                                                  #  THE FOUR SELECTABLE FREE FALL MANEUVER RATES SELECTED BY
016360,000058:                                                                                                  #  LOADING RATEINDX WITH 0, 2, 4, 6, RESPECTIVELY
016361,000059: 
016362,000060: 22,2771           00221 24255  ARATE              2DEC     .0088888888                            #  = 0.2 DEG/SEC         $ 22.5 DEG/SEC
016363,000061: 
016364,000062: 22,2773           00554 02660                     2DEC     .0222222222                            #  = 0.5 DEG/SEC         $ 22.5 DEG/SEC
016365,000063: 
016366,000064: 22,2775           02660 13301                     2DEC     .0888888888                            #  = 2.0 DEG/SEC         $ 22.5 DEG/SEC
016367,000065: 
016368,000066: 22,2777           16161 30707                     2DEC     .4444444444                            #  = 10.0 DEG/SEC        $ 22.5 DEG/SEC
016369,000067: 
016370,000068: 22,3001           00003 04000  ANGLTIME           2DEC     .0001907349                            #  = 100B-19 FUDGE FACTOR TO CONVERT
016371,000069:                                                                                                  #  MANEUVER ANGLE TO MANEUVER TIME
016372,000070: 
016373,000071: 

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