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.

016370,000002:                                                                                                  ## Copyright:   Public domain.
016371,000003:                                                                                                  ## Filename:    KALCMANU_STEERING.agc
016372,000004:                                                                                                  ## Purpose:     The main source file for Luminary revision 069.
016373,000005:                                                                                                  ##              It is part of the source code for the original release
016374,000006:                                                                                                  ##              of the flight software for the Lunar Module's (LM) Apollo
016375,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 10. The actual flown
016376,000008:                                                                                                  ##              version was Luminary 69 revision 2, which included a
016377,000009:                                                                                                  ##              newer lunar gravity model and only affected module 2.
016378,000010:                                                                                                  ##              This file is intended to be a faithful transcription, except
016379,000011:                                                                                                  ##              that the code format has been changed to conform to the
016380,000012:                                                                                                  ##              requirements of the yaYUL assembler rather than the
016381,000013:                                                                                                  ##              original YUL assembler.
016382,000014:                                                                                                  ## Reference:   pp. 378-382
016383,000015:                                                                                                  ## Assembler:   yaYUL
016384,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
016385,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
016386,000018:                                                                                                  ## Mod history: 2016-12-13 MAS  Created from Luminary 99.
016387,000019:                                                                                                  ##              2016-12-14 MAS  Updated from comment-proofed Luminary 99 version.
016388,000020:                                                                                                  ##              2017-01-17 RRB  Updated for Luminary 69.
016389,000021:                                                                                                  ##              2017-01-27 RSB  Proofed comment text using octopus/prooferComments
016390,000022:                                                                                                  ##                              and fixed errors found.
016391,000023:                                                                                                  ##              2017-03-07 RSB  Removed yaYUL workaround that no longer 
016392,000024:                                                                                                  ##                              seems to be needed.
016393,000025:                                                                                                  ##              2017-03-17 RSB  Comment-text fixes identified in diff'ing
016394,000026:                                                                                                  ##                              Luminary 99 vs Comanche 55.
016395,000027: 

Page 378

016397,000029:                                                                                                  #  GENERATION OF STEERING COMMANDS FOR DIGITAL AUTOPILOT FREE FALL MANEUVERS
016398,000030: 
016399,000031:                                                                                                  #  NEW COMMANDS WILL BE GENERATED EVERY ONE SECOND DURING THE MANEUVER
016400,000032: 
016401,000033: 22,3003  E6,1705                                  EBANK=   TTEMP                                 
016402,000034: 
016403,000035: 22,3003           04616        NEWDELHI           TC       BANKCALL                              #  CHECK FOR AUTO STABILIZATION
016404,000036: 22,3004           54240                           CADR     ISITAUTO                              #  ONLY
016405,000037: 22,3005           10000                           CCS      A                                     
016406,000038: 22,3006           12730                           TCF      NOGO       -2                         
016407,000039: 22,3007           06036        NEWANGL            TC       INTPRET                               
016408,000040: 22,3010           75160                           AXC,1    AXC,2                                 
016409,000041: 22,3011           03244                                    MIS                                   #  COMPUTE THE NEW MATRIX FROM S/C TO
016410,000042: 22,3012           02234                                    KEL                                   #  STABLE MEMBER AXES
016411,000043: 22,3013           77624                           CALL                                           
016412,000044: 22,3014           44312                                    MXM3                                  
016413,000045: 22,3015           45575                           VLOAD    STADR                                 
016414,000046: 22,3016           50516                           STOVL    MIS        +12D                       #  CALCULATE NEW DESIRED CDU ANGLES
016415,000047: 22,3017           77626                           STADR                                          
016416,000048: 22,3020           50524                           STOVL    MIS        +6D                        
016417,000049: 22,3021           77626                           STADR                                          
016418,000050: 22,3022           74532                           STORE    MIS                                   
016419,000051: 22,3023           45160                           AXC,1    CALL                                  
016420,000052: 22,3024           03244                                    MIS                                   
016421,000053: 22,3025           44654                                    DCMTOCDU                              #  PICK UP THE NEW CDU ANGLES FROM MATRIX
016422,000054: 22,3026           77634                           RTB                                            
016423,000055: 22,3027           21524                                    V1STO2S                               
016424,000056: 22,3030           03302                           STORE    NCDU                                  #  NEW CDU ANGLES
016425,000057: 22,3031           77414                           BONCLR   EXIT                                  
016426,000058: 22,3032           01215                                    CALCMAN2                              
016427,000059: 22,3033           45122                                    MANUSTAT                              #  TO START MANEUVER
016428,000060: 22,3034           34752                           CAF      TWO                                   #        +0 OTHERWISE
016429,000061: 22,3035           55272        INCRDCDU           TS       SPNDX                                 
016430,000062: 22,3036           51272                           INDEX    SPNDX                                 
016431,000063: 22,3037           31674                           CA       BCDU                                  #  INITIAL CDU ANGLES
016432,000064: 22,3040           00006                           EXTEND                                         #  OR PREVIOUS DESIRED CDU ANGLES
016433,000065: 22,3041           51272                           INDEX    SPNDX                                 
016434,000066: 22,3042           21701                           MSU      NCDU                                  
016435,000067: 22,3043           00006                           EXTEND                                         
016436,000068: 22,2000                                           SETLOC   KALCMON1                              
016437,000069: 22,2000                                           BANK                                           
016438,000070: 
016439,000071: 22,3044           73121                           MP       DT/TAU                                
016440,000072: 22,3045           10000                           CCS      A                                     #  CONVERT TO 2S COMPLEMENT
016441,000073: 22,3046           64753                           AD       ONE                                   
016442,000074: 22,3047           13051                           TCF      +2                                    
016443,000075: 22,3050           40000                           COM                                            
016444,000076: 22,3051           51272                           INDEX    SPNDX                                 
016445,000077: 22,3052           55636                           TS       DELDCDU                               #  ANGLE INCREMENTS TO BE ADDED TO
016446,000078: 22,3053           51272                           INDEX    SPNDX                                 #  CDUXD, CDUYD, CDUZD EVERY TENTH SECOND

Page 379

016448,000080: 22,3054           31701                           CA       NCDU                                  #  BY LEM DAP
016449,000081: 22,3055           51272                           INDEX    SPNDX                                 
016450,000082: 22,3056           57674                           XCH      BCDU                                  
016451,000083: 22,3057           51272                           INDEX    SPNDX                                 
016452,000084: 22,3060           55633                           TS       CDUXD                                 
016453,000085: 22,3061           11272                           CCS      SPNDX                                 
016454,000086: 22,3062           13035                           TCF      INCRDCDU                              #  LOOP FOR THREE AXES
016455,000087: 
016456,000088: 22,3063           00003                           RELINT                                         
016457,000089: 
016458,000090:                                                                                                  #  COMPARE PRESENT TIME WITH TIME TO TERMINATE MANEUVER
016459,000091: 
016460,000092: 22,3064           03075        TMANUCHK           TC       TIMECHK                               
016461,000093: 22,3065           13170                           TCF      CONTMANU                              
016462,000094: 22,3066           34753                           CAF      ONE                                   
016463,000095: 22,3067           00004        MANUSTAL           INHINT                                         #  END MAJOR PART OF MANEUVER WITHIN 1 SEC
016464,000096: 22,3070           05203                           TC       WAITLIST                              #  UNDER WAITLIST CALL TO MANUSTOP
016465,000097: 22,3071  E6,1705                                  EBANK=   TTEMP                                 
016466,000098: 22,3071           03213 44066                     2CADR    MANUSTOP                              
016467,000099: 
016468,000100: 22,3073           00003                           RELINT                                         
016469,000101: 22,3074           15155                           TCF      ENDOFJOB                              
016470,000102: 
016471,000103: 22,3075           00006        TIMECHK            EXTEND                                         
016472,000104: 22,3076           40025                           DCS      TIME2                                 
016473,000105: 22,3077           53706                           DXCH     TTEMP                                 
016474,000106: 22,3100           00006                           EXTEND                                         
016475,000107: 22,3101           31732                           DCA      TM                                    
016476,000108: 22,3102           21706                           DAS      TTEMP                                 
016477,000109: 22,3103           11705                           CCS      TTEMP                                 
016478,000110: 22,3104           00002                           TC       Q                                     
016479,000111: 22,3105           13107                           TCF      +2                                    
016480,000112: 22,3106           13117                           TCF      2NDRETRN                              
016481,000113: 22,3107           11706                           CCS      TTEMP      +1                         
016482,000114: 22,3110           00002                           TC       Q                                     
016483,000115: 22,3111           13113                           TCF      MANUOFF                               
016484,000116: 22,3112           40000                           COM                                            
016485,000117: 22,3113           63166        MANUOFF            AD       ONESEK     +1                         
016486,000118: 22,3114           00006                           EXTEND                                         
016487,000119: 22,3115           63117                           BZMF     2NDRETRN                              
016488,000120: 22,3116           24002                           INCR     Q                                     
016489,000121: 22,3117           24002        2NDRETRN           INCR     Q                                     
016490,000122: 22,3120           00002                           TC       Q                                     
016491,000123: 
016492,000124: 22,3121           03146        DT/TAU             DEC      .1                                    
016493,000125: 
016494,000126: 22,3122           77776        MANUSTAT           EXIT                                           #  INITIALIZATION ROUTINE
016495,000127: 22,3123           00006                           EXTEND                                         #  FOR AUTOMATIC MANEUVERS
016496,000128: 22,3124           30025                           DCA      TIME2                                 

Page 380

016498,000130: 22,3125           21732                           DAS      TM                                    #  TM+T0         MANEUVER COMPLETION TIME
016499,000131: 22,3126           00006                           EXTEND                                         
016500,000132: 22,3127           43166                           DCS      ONESEK                                
016501,000133: 22,3130           21732                           DAS      TM                                    #  (TM+T0)-1
016502,000134: 22,3131           00004                           INHINT                                         
016503,000135: 22,3132           34752                           CAF      TWO                                   
016504,000136: 22,3133           55677        RATEBIAS           TS       KSPNDX                                
016505,000137: 22,3134           60000                           DOUBLE                                         
016506,000138: 22,3135           55700                           TS       KDPNDX                                
016507,000139: 22,3136           50000                           INDEX    A                                     
016508,000140: 22,3137           31723                           CA       BRATE                                 
016509,000141: 22,3140           51677                           INDEX    KSPNDX                                #  STORE MANEUVER RATE IN
016510,000142: 22,3141           55641                           TS       OMEGAPD                               #  OMEGAPD, OMEGAQD, OMEGARD
016511,000143: 22,3142           00006                           EXTEND                                         
016512,000144: 22,3143           63145                           BZMF     +2                                    #  COMPUTE ATTITUDE ERROR
016513,000145: 22,3144           40000                           COM                                            #  OFFSET = (WX)ABS(WX)/2AJX
016514,000146: 22,3145           00006                           EXTEND                                         #  WHERE AJX= 2-JET ACCELERATION
016515,000147: 22,3146           73167                           MP       BIASCALE                              #  = -1/16
016516,000148: 22,3147           00006                           EXTEND                                         
016517,000149: 22,3150           51700                           INDEX    KDPNDX                                
016518,000150: 22,3151           71723                           MP       BRATE                                 
016519,000151: 22,3152           00006                           EXTEND                                         
016520,000152: 22,3153           51677                           INDEX    KSPNDX                                
016521,000153: 22,3154           11530                           DV       1JACC                                 #  = AJX         $ 90 DEG/SEC-SEC
016522,000154: 22,3155           51677                           INDEX    KSPNDX                                
016523,000155: 22,3156           55277                           TS       DELPEROR                              #                $ 180 DEG
016524,000156: 22,3157           11677                           CCS      KSPNDX                                
016525,000157: 22,3160           13133                           TCF      RATEBIAS                              
016526,000158: 
016527,000159: 22,3161           30025                           CA       TIME1                                 
016528,000160: 22,3162           63166                           AD       ONESEK     +1                         
016529,000161: 22,3163           57704                           XCH      NEXTIME                               
016530,000162: 22,3164           13034                           TCF      INCRDCDU   -1                         
016531,000163: 
016532,000164: 22,3165           00000        ONESEK             DEC      0          B-14                       
016533,000165: 22,3166           00144                           DEC      100        B-14                       
016534,000166: 
016535,000167: 22,3167           75777        BIASCALE           OCT      75777                                 #  = -1/16
016536,000168: 
016537,000169: 22,3170           40025        CONTMANU           CS       TIME1                                 #  RESET FOR NEXT DCDU UPDATE
016538,000170: 22,3171           61704                           AD       NEXTIME                               
016539,000171: 22,3172           10000                           CCS      A                                     
016540,000172: 22,3173           64753                           AD       ONE                                   
016541,000173: 22,3174           13177                           TCF      MANUCALL                              
016542,000174: 22,3175           64735                           AD       NEGMAX                                
016543,000175: 22,3176           40000                           COM                                            
016544,000176: 22,3177           00004        MANUCALL           INHINT                                         #  CALL FOR NEXT UPDATE VIA WAITLIST
016545,000177: 22,3200           05203                           TC       WAITLIST                              
016546,000178: 22,3201  E6,1705                                  EBANK=   TTEMP                                 
016547,000179: 22,3201           03206 44066                     2CADR    UPDTCALL                              

Page 381

016549,000181: 22,3203           33166                           CAF      ONESEK     +1                         #  INCREMENT TIME FOR NEXT UPDATE
016550,000182: 22,3204           27704                           ADS      NEXTIME                               
016551,000183: 22,3205           15155                           TCF      ENDOFJOB                              
016552,000184: 
016553,000185: 22,3206           37713        UPDTCALL           CAF      PRIO26                                #  SATELLITE PROGRAM TO CALL FOR UPDATE
016554,000186: 22,3207           05105                           TC       FINDVAC                               #  OF STEERING COMMANDS
016555,000187: 22,3210  E6,1705                                  EBANK=   TTEMP                                 
016556,000188: 22,3210           03003 44066                     2CADR    NEWDELHI                              
016557,000189: 
016558,000190: 22,3212           05261                           TC       TASKOVER                              
016559,000191: 

Page 382

016561,000193:                                                                                                  #  ROUTINE FOR TERMINATING AUTOMATIC MANEUVERS
016562,000194: 
016563,000195: 22,3213           34755        MANUSTOP           CAF      ZERO                                  #  ZERO MANEUVER RATES
016564,000196: 22,3214           55640                           TS       DELDCDU2                              
016565,000197: 22,3215           55643                           TS       OMEGARD                               
016566,000198: 22,3216           55301                           TS       DELREROR                              
016567,000199: 22,3217           55637                           TS       DELDCDU1                              
016568,000200: 22,3220           55642                           TS       OMEGAQD                               
016569,000201: 22,3221           55300                           TS       DELQEROR                              
016570,000202: 22,3222           30323                           CA       CPSI                                  #  SET DESIRED GIMBAL ANGLES TO
016571,000203: 22,3223           55635                           TS       CDUZD                                 #  DESIRED FINAL GIMBAL ANGLES
016572,000204: 22,3224           30322                           CA       CTHETA                                
016573,000205: 22,3225           55634                           TS       CDUYD                                 
016574,000206: 22,3226           30321        ENDROLL            CA       CPHI                                  #  NO FINAL YAW
016575,000207: 22,3227           55633                           TS       CDUXD                                 
016576,000208: 22,3230           34755                           CAF      ZERO                                  
016577,000209: 22,3231           55641                           TS       OMEGAPD                               #  I.E. MANEUVER DID NOT GO THRU
016578,000210: 22,3232           55636                           TS       DELDCDU                               #  GIMBAL LOCK ORIGINALLY
016579,000211: 22,3233           55277                           TS       DELPEROR                              
016580,000212: 22,3234           31311        GOODMANU           CA       ATTPRIO                               #  RESTORE USERS PRIO
016581,000213: 22,3235           54063                           TS       NEWPRIO                               
016582,000214: 
016583,000215: 22,3236           34755                           CA       ZERO                                  #  ZERO ATTCADR
016584,000216: 22,3237           53310                           DXCH     ATTCADR                               
016585,000217: 
016586,000218: 22,3240           05116                           TC       SPVAC                                 #  RETURN TO USER
016587,000219: 
016588,000220: 22,3241           05261                           TC       TASKOVER                              
016589,000221: 
016590,000222: 

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