Source Code

These source-code files are part of a reconstructed copy of LUM69 Revision 2, the flown Apollo 10 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with source code of Luminary 69 revision 0 previously transcribed from a digitized copy of that program. The code was then updated by back-porting the R-2 lunar potential model from previously-transcribed source code of Luminary 99. These required changes were described in the original Luminary memos 75 and 78. The reconstructed code 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 069 printout, although the added code would likely have changed page numbers for a real LUM69 Revision 2 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.

016208,000002:                                                                                                  ## Copyright:   Public domain.
016209,000003:                                                                                                  ## Filename:    GIMBAL_LOCK_AVOIDANCE.agc
016210,000004:                                                                                                  ## Purpose:     A section of LUM69 revision 2.
016211,000005:                                                                                                  ##              It is part of the reconstructed source code for the flown
016212,000006:                                                                                                  ##              version of the flight software for the Lunar Module's (LM)
016213,000007:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 10. The code has
016214,000008:                                                                                                  ##              been recreated from a copy of Luminary revsion 069, using
016215,000009:                                                                                                  ##              changes present in Luminary 099 which were described in
016216,000010:                                                                                                  ##              Luminary memos 75 and 78. The code has been adapted such
016217,000011:                                                                                                  ##              that the resulting bugger words exactly match those specified
016218,000012:                                                                                                  ##              for LUM69 revision 2 in NASA drawing 2021152B, which gives
016219,000013:                                                                                                  ##              relatively high confidence that the reconstruction is correct.
016220,000014:                                                                                                  ## Reference:   p.  377
016221,000015:                                                                                                  ## Assembler:   yaYUL
016222,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
016223,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
016224,000018:                                                                                                  ## Mod history: 2019-07-27 MAS  Created from Luminary 69.
016225,000019: 

Page 377

016227,000021: 15,2050                                           BANK     15                                    
016228,000022: 
016229,000023: 22,2000                                           SETLOC   KALCMON1                              
016230,000024: 22,2000                                           BANK                                           
016231,000025: 
016232,000026:                                                                                                  #  DETECTING GIMBAL LOCK
016233,000027: 22,2744  22,2744               LOCSKIRT           EQUALS   NOGIMLOC                              
016234,000028: 
016235,000029: 22,2744           77614        NOGIMLOC           SET                                            
016236,000030: 22,2745           01074                                    CALCMAN3                              
016237,000031: 22,2746           70740        WCALC              LXC,1    DLOAD*                                
016238,000032: 22,2747           01325                                    RATEINDX                              #  CHOOSE THE DESIRED MANEUVER RATE
016239,000033: 22,2750           04772                                    ARATE,1                               #  FROM A LIST OF FOUR
016240,000034: 22,2751           45002                           SR4      CALL                                  #  COMPUTE THE INCREMENTAL ROTATION MATRIX
016241,000035: 22,2752           44527                                    DELCOMP                               #  DEL CORRESPONDING TO A 1 SEC ROTATION
016242,000036:                                                                                                  #  ABOUT COF
016243,000037: 22,2753           74343                           DLOAD*   VXSC                                  
016244,000038: 22,2754           04772                                    ARATE,1                               
016245,000039: 22,2755           03267                                    COF                                   
016246,000040: 22,2756           17324                           STODL    BRATE                                 #  COMPONENT MANEUVER RATES 45 DEG/SEC
016247,000041: 22,2757           03334                                    AM                                    
016248,000042: 22,2760           55605                           DMP      DDV*                                  
016249,000043: 22,2761           05002                                    ANGLTIME                              
016250,000044: 22,2762           04772                                    ARATE,1                               
016251,000045: 22,2763           77661                           SR                                             
016252,000046: 22,2764           20606                                    5                                     
016253,000047: 22,2765           03332                           STORE    TM                                    #  MANEUVER EXECUTION TIME SCALED AS T2
016254,000048: 22,2766           77614                           SETGO                                          
016255,000049: 22,2767           01035                                    CALCMAN2                              #  0(OFF) = CONTINUE MANEUVER
016256,000050: 22,2770           45010                                    NEWANGL    +1                         #  1(ON) = START MANEUVER
016257,000051: 
016258,000052:                                                                                                  #  THE FOUR SELECTABLE FREE FALL MANEUVER RATES SELECTED BY
016259,000053:                                                                                                  #  LOADING RATEINDX WITH 0, 2, 4, 6, RESPECTIVELY
016260,000054: 
016261,000055: 22,2771           00221 24255  ARATE              2DEC     .0088888888                            #  = 0.2 DEG/SEC         $ 22.5 DEG/SEC
016262,000056: 
016263,000057: 22,2773           00554 02660                     2DEC     .0222222222                            #  = 0.5 DEG/SEC         $ 22.5 DEG/SEC
016264,000058: 
016265,000059: 22,2775           02660 13301                     2DEC     .0888888888                            #  = 2.0 DEG/SEC         $ 22.5 DEG/SEC
016266,000060: 
016267,000061: 22,2777           16161 30707                     2DEC     .4444444444                            #  = 10.0 DEG/SEC        $ 22.5 DEG/SEC
016268,000062: 
016269,000063: 22,3001           00003 04000  ANGLTIME           2DEC     .0001907349                            #  = 100B-19 FUDGE FACTOR TO CONVERT
016270,000064:                                                                                                  #  MANEUVER ANGLE TO MANEUVER TIME
016271,000065: 
016272,000066: 

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