Source Code

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

The reconstruction began with source code of Zerlina 56, Luminary 210, and Luminary 131, previously transcribed from digitized copies of those programs. The code was created by combining the three, using Zerlina 56 as a base, since it was based off of Luminary 183. The differences between the three were carefully merged using the Luminary memos as a guide, with all changes made after Luminary 178 being backed out. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 178 listing would be different.

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.

015839,000002:                                                                                                  ## Copyright:   Public domain.
015840,000003:                                                                                                  ## Filename:    KALCMANU_STEERING.agc
015841,000004:                                                                                                  ## Purpose:     A section of Luminary revision 178.
015842,000005:                                                                                                  ##              It is part of the reconstructed source code for the final
015843,000006:                                                                                                  ##              release of the flight software for the Lunar Module's
015844,000007:                                                                                                  ##              (LM) Apollo Guidance Computer (AGC) for Apollo 14. The
015845,000008:                                                                                                  ##              code has been recreated from copies of Zerlina 56, Luminary
015846,000009:                                                                                                  ##              210, and Luminary 131, as well as many Luminary memos.
015847,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
015848,000011:                                                                                                  ##              exactly match those specified for Luminary 178 in NASA
015849,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
015850,000013:                                                                                                  ##              that the reconstruction is correct.
015851,000014:                                                                                                  ## Reference:   pp. 370-374
015852,000015:                                                                                                  ## Assembler:   yaYUL
015853,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
015854,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
015855,000018:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Zerlina 56.
015856,000019: 

Page 370

015858,000021:                                                                                                  #  GENERATION OF STEERING COMMANDS FOR DIGITAL AUTOPILOT FREE FALL MANEUVERS
015859,000022: 
015860,000023:                                                                                                  #  NEW COMMANDS WILL BE GENERATED EVERY ONE SECOND DURING THE MANEUVER
015861,000024: 
015862,000025: 22,3003  E6,1706                                  EBANK=   TTEMP                                 
015863,000026: 
015864,000027: 22,3003           04616        NEWDELHI           TC       BANKCALL                              #  CHECK FOR AUTO STABILIZATION
015865,000028: 22,3004           54270                           CADR     ISITAUTO                              #  ONLY
015866,000029: 22,3005           10000                           CCS      A                                     
015867,000030: 22,3006           12730                           TCF      NOGO       -2                         
015868,000031: 22,3007           06042        NEWANGL            TC       INTPRET                               
015869,000032: 22,3010           75160                           AXC,1    AXC,2                                 
015870,000033: 22,3011           03245                                    MIS                                   #  COMPUTE THE NEW MATRIX FROM S/C TO
015871,000034: 22,3012           02230                                    KEL                                   #  STABLE MEMBER AXES
015872,000035: 22,3013           77624                           CALL                                           
015873,000036: 22,3014           44312                                    MXM3                                  
015874,000037: 22,3015           45575                           VLOAD    STADR                                 
015875,000038: 22,3016           50515                           STOVL    MIS        +12D                       #  CALCULATE NEW DESIRED CDU ANGLES
015876,000039: 22,3017           77626                           STADR                                          
015877,000040: 22,3020           50523                           STOVL    MIS        +6D                        
015878,000041: 22,3021           77626                           STADR                                          
015879,000042: 22,3022           74531                           STORE    MIS                                   
015880,000043: 22,3023           45160                           AXC,1    CALL                                  
015881,000044: 22,3024           03245                                    MIS                                   
015882,000045: 22,3025           44654                                    DCMTOCDU                              #  PICK UP THE NEW CDU ANGLES FROM MATRIX
015883,000046: 22,3026           77634                           RTB                                            
015884,000047: 22,3027           21621                                    V1STO2S                               
015885,000048: 22,3030           03303                           STORE    NCDU                                  #  NEW CDU ANGLES
015886,000049: 22,3031           77414                           BONCLR   EXIT                                  
015887,000050: 22,3032           01215                                    CALCMAN2                              
015888,000051: 22,3033           45122                                    MANUSTAT                              #  TO START MANEUVER
015889,000052: 22,3034           34752                           CAF      TWO                                   #           +0 OTHERWISE
015890,000053: 22,3035           55261        INCRDCDU           TS       SPNDX                                 
015891,000054: 22,3036           51261                           INDEX    SPNDX                                 
015892,000055: 22,3037           31675                           CA       BCDU                                  #  INITIAL CDU ANGLES
015893,000056: 22,3040           00006                           EXTEND                                         #  OR PREVIOUS DESIRED CDU ANGLES
015894,000057: 22,3041           51261                           INDEX    SPNDX                                 
015895,000058: 22,3042           21702                           MSU      NCDU                                  
015896,000059: 22,3043           00006                           EXTEND                                         
015897,000060: 22,2000                                           SETLOC   KALCMON1                              
015898,000061: 22,2000                                           BANK                                           
015899,000062: 
015900,000063: 22,3044           73121                           MP       DT/TAU                                
015901,000064: 22,3045           10000                           CCS      A                                     #  CONVERT TO 2S COMPLEMENT
015902,000065: 22,3046           64753                           AD       ONE                                   
015903,000066: 22,3047           13051                           TCF      +2                                    
015904,000067: 22,3050           40000                           COM                                            
015905,000068: 22,3051           51261                           INDEX    SPNDX                                 
015906,000069: 22,3052           55637                           TS       DELDCDU                               #  ANGLE INCREMENTS TO BE ADDED TO
015907,000070: 22,3053           51261                           INDEX    SPNDX                                 #  CDUXD, CDUYD, CDUZD EVERY TENTH SECOND
015908,000071: 

Page 371

015910,000073: 22,3054           31702                           CA       NCDU                                  #  BY LEM DAP
015911,000074: 22,3055           51261                           INDEX    SPNDX                                 
015912,000075: 22,3056           57675                           XCH      BCDU                                  
015913,000076: 22,3057           51261                           INDEX    SPNDX                                 
015914,000077: 22,3060           55634                           TS       CDUXD                                 
015915,000078: 22,3061           11261                           CCS      SPNDX                                 
015916,000079: 22,3062           13035                           TCF      INCRDCDU                              #  LOOP FOR THREE AXES
015917,000080: 
015918,000081: 22,3063           00003                           RELINT                                         
015919,000082: 
015920,000083:                                                                                                  #  COMPARE PRESENT TIME WITH TIME TO TERMINATE MANEUVER
015921,000084: 
015922,000085: 22,3064           03075        TMANUCHK           TC       TIMECHK                               
015923,000086: 22,3065           13170                           TCF      CONTMANU                              
015924,000087: 22,3066           34753                           CAF      ONE                                   
015925,000088: 22,3067           00004        MANUSTAL           INHINT                                         #  END MAJOR PART OF MANEUVER WITHIN 1 SEC
015926,000089: 22,3070           05214                           TC       WAITLIST                              #  UNDER WAITLIST CALL TO MANUSTOP
015927,000090: 22,3071  E6,1706                                  EBANK=   TTEMP                                 
015928,000091: 22,3071           03213 44066                     2CADR    MANUSTOP                              
015929,000092: 
015930,000093: 22,3073           00003                           RELINT                                         
015931,000094: 22,3074           15155                           TCF      ENDOFJOB                              
015932,000095: 
015933,000096: 22,3075           00006        TIMECHK            EXTEND                                         
015934,000097: 22,3076           40025                           DCS      TIME2                                 
015935,000098: 22,3077           53707                           DXCH     TTEMP                                 
015936,000099: 22,3100           00006                           EXTEND                                         
015937,000100: 22,3101           31733                           DCA      TM                                    
015938,000101: 22,3102           21707                           DAS      TTEMP                                 
015939,000102: 22,3103           11706                           CCS      TTEMP                                 
015940,000103: 22,3104           00002                           TC       Q                                     
015941,000104: 22,3105           13107                           TCF      +2                                    
015942,000105: 22,3106           13117                           TCF      2NDRETRN                              
015943,000106: 22,3107           11707                           CCS      TTEMP      +1                         
015944,000107: 22,3110           00002                           TC       Q                                     
015945,000108: 22,3111           13113                           TCF      MANUOFF                               
015946,000109: 22,3112           40000                           COM                                            
015947,000110: 22,3113           63166        MANUOFF            AD       ONESEK     +1                         
015948,000111: 22,3114           00006                           EXTEND                                         
015949,000112: 22,3115           63117                           BZMF     2NDRETRN                              
015950,000113: 22,3116           24002                           INCR     Q                                     
015951,000114: 22,3117           24002        2NDRETRN           INCR     Q                                     
015952,000115: 22,3120           00002                           TC       Q                                     
015953,000116: 
015954,000117: 22,3121           03146        DT/TAU             DEC      .1                                    
015955,000118: 
015956,000119: 22,3122           77776        MANUSTAT           EXIT                                           #  INITIALIZATION ROUTINE
015957,000120: 22,3123           00006                           EXTEND                                         #  FOR AUTOMATIC MANEUVERS
015958,000121: 22,3124           30025                           DCA      TIME2                                 

Page 372

015960,000123: 22,3125           21733                           DAS      TM                                    #  TM+T0    MANEUVER COMPLETION TIME
015961,000124: 22,3126           00006                           EXTEND                                         
015962,000125: 22,3127           43166                           DCS      ONESEK                                
015963,000126: 22,3130           21733                           DAS      TM                                    #  (TM+T0)-1
015964,000127: 22,3131           00004                           INHINT                                         
015965,000128: 22,3132           34752                           CAF      TWO                                   
015966,000129: 22,3133           55700        RATEBIAS           TS       KSPNDX                                
015967,000130: 22,3134           60000                           DOUBLE                                         
015968,000131: 22,3135           55701                           TS       KDPNDX                                
015969,000132: 22,3136           50000                           INDEX    A                                     
015970,000133: 22,3137           31724                           CA       BRATE                                 
015971,000134: 22,3140           51700                           INDEX    KSPNDX                                #  STORE MANEUVER RATE IN
015972,000135: 22,3141           55642                           TS       OMEGAPD                               #  OMEGAPD, OMEGAQD, OMEGARD
015973,000136: 22,3142           00006                           EXTEND                                         
015974,000137: 22,3143           63145                           BZMF     +2                                    #  COMPUTE ATTITUDE ERROR
015975,000138: 22,3144           40000                           COM                                            #  OFFSET = (WX)ABS(WX)/2AJX
015976,000139: 22,3145           00006                           EXTEND                                         #  WHERE AJX= 2-JET ACCELERATION
015977,000140: 22,3146           73167                           MP       BIASCALE                              #  = -1/16
015978,000141: 22,3147           00006                           EXTEND                                         
015979,000142: 22,3150           51701                           INDEX    KDPNDX                                
015980,000143: 22,3151           71724                           MP       BRATE                                 
015981,000144: 22,3152           00006                           EXTEND                                         
015982,000145: 22,3153           51700                           INDEX    KSPNDX                                
015983,000146: 22,3154           11530                           DV       1JACC                                 #  =AJX  $ 90 DEG/SEC-SEC
015984,000147: 22,3155           51700                           INDEX    KSPNDX                                
015985,000148: 22,3156           55274                           TS       DELPEROR                              #      $ 180 DEG
015986,000149: 22,3157           11700                           CCS      KSPNDX                                
015987,000150: 22,3160           13133                           TCF      RATEBIAS                              
015988,000151: 
015989,000152: 22,3161           30025                           CA       TIME1                                 
015990,000153: 22,3162           63166                           AD       ONESEK     +1                         
015991,000154: 22,3163           57705                           XCH      NEXTIME                               
015992,000155: 22,3164           13034                           TCF      INCRDCDU   -1                         
015993,000156: 
015994,000157: 22,3165           00000        ONESEK             DEC      0          B-14                       
015995,000158: 22,3166           00144                           DEC      100        B-14                       
015996,000159: 
015997,000160: 22,3167           75777        BIASCALE           OCT      75777                                 #  = -1/16
015998,000161: 
015999,000162: 22,3170           40025        CONTMANU           CS       TIME1                                 #  RESET FOR NEXT DCDU UPDATE
016000,000163: 22,3171           61705                           AD       NEXTIME                               
016001,000164: 22,3172           10000                           CCS      A                                     
016002,000165: 22,3173           64753                           AD       ONE                                   
016003,000166: 22,3174           13177                           TCF      MANUCALL                              
016004,000167: 22,3175           64735                           AD       NEGMAX                                
016005,000168: 22,3176           40000                           COM                                            
016006,000169: 22,3177           00004        MANUCALL           INHINT                                         #  CALL FOR NEXT UPDATE VIA WAITLIST
016007,000170: 22,3200           05214                           TC       WAITLIST                              
016008,000171: 22,3201  E6,1706                                  EBANK=   TTEMP                                 
016009,000172: 22,3201           03206 44066                     2CADR    UPDTCALL                              
016010,000173: 

Page 373

016012,000175: 22,3203           33166                           CAF      ONESEK     +1                         #  INCREMENT TIME FOR NEXT UPDATE
016013,000176: 22,3204           27705                           ADS      NEXTIME                               
016014,000177: 22,3205           15155                           TCF      ENDOFJOB                              
016015,000178: 
016016,000179: 
016017,000180: 22,3206           37717        UPDTCALL           CAF      PRIO26                                #  SATELLITE PROGRAM TO CALL FOR UPDATE
016018,000181: 22,3207           05105                           TC       FINDVAC                               #  OF STEERING COMMANDS
016019,000182: 22,3210  E6,1706                                  EBANK=   TTEMP                                 
016020,000183: 22,3210           03003 44066                     2CADR    NEWDELHI                              
016021,000184: 
016022,000185: 22,3212           05272                           TC       TASKOVER                              
016023,000186: 

Page 374

016025,000188:                                                                                                  #  ROUTINE FOR TERMINATING AUTOMATIC MANEUVERS
016026,000189: 
016027,000190: 22,3213           34755        MANUSTOP           CAF      ZERO                                  #  ZERO MANEUVER RATES
016028,000191: 22,3214           55641                           TS       DELDCDU2                              
016029,000192: 22,3215           55644                           TS       OMEGARD                               
016030,000193: 22,3216           55276                           TS       DELREROR                              
016031,000194: 22,3217           55640                           TS       DELDCDU1                              
016032,000195: 22,3220           55643                           TS       OMEGAQD                               
016033,000196: 22,3221           55275                           TS       DELQEROR                              
016034,000197: 22,3222           30323                           CA       CPSI                                  #  SET DESIRED GIMBAL ANGLES TO
016035,000198: 22,3223           55636                           TS       CDUZD                                 #  DESIRED FINAL GIMBAL ANGLES
016036,000199: 22,3224           30322                           CA       CTHETA                                
016037,000200: 22,3225           55635                           TS       CDUYD                                 
016038,000201: 22,3226           30321        ENDROLL            CA       CPHI                                  #  NO FINAL YAW
016039,000202: 22,3227           55634                           TS       CDUXD                                 
016040,000203: 22,3230           34755                           CAF      ZERO                                  
016041,000204: 22,3231           55642                           TS       OMEGAPD                               #  I.E. MANEUVER DID NOT GO THRU
016042,000205: 22,3232           55637                           TS       DELDCDU                               #  GIMBAL LOCK ORIGINALLY
016043,000206: 22,3233           55274                           TS       DELPEROR                              
016044,000207: 22,3234           31306        GOODMANU           CA       ATTPRIO                               #  RESTORE USERS PRIO
016045,000208: 22,3235           54063                           TS       NEWPRIO                               
016046,000209: 
016047,000210: 22,3236           34755                           CA       ZERO                                  #  ZERO ATTCADR
016048,000211: 22,3237           53305                           DXCH     ATTCADR                               
016049,000212: 
016050,000213: 22,3240           05116                           TC       SPVAC                                 #  RETURN TO USER
016051,000214: 
016052,000215: 22,3241           05272                           TC       TASKOVER                              
016053,000216: 
016054,000217: 

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