Source Code

This is a reconstructed version of Luminary 130, the initial AGC program released in November 1969 for the Apollo 13 LM. Three more releases followed before the flown revision was finally manufactured in February 1970.

This reconstruction was created from a previous transcription of the original listing of Luminary 131, combined with Luminary memo #129 which describes the small difference between the Luminary 130 and 131. The reconstructed source code was verified by matching memory-bank checksums to those listed for Luminary 130 in drawing 2021152G.

In this source code, program comments from the original (Luminary 131) code are prefixed with '#', while those added later by the Virtual AGC project are prefixed with '##'.

015360,000002:                                                                                                  ## Copyright:   Public domain.
015361,000003:                                                                                                  ## Filename:    KALCMANU_STEERING.agc
015362,000004:                                                                                                  ## Purpose:     A section of the reconstructed source code for Luminary 130.
015363,000005:                                                                                                  ##              This was the original program released for the Apollo 13 LM,
015364,000006:                                                                                                  ##              although several more revisions would follow. It has been
015365,000007:                                                                                                  ##              reconstructed from a listing of Luminary 131, from which it
015366,000008:                                                                                                  ##              differs on only two lines in P70-P71. The difference is
015367,000009:                                                                                                  ##              described in detail in Luminary memo #129, which was used
015368,000010:                                                                                                  ##              to perform the reconstruction. This file is intended to be a
015369,000011:                                                                                                  ##              faithful reconstruction, except that the code format has been
015370,000012:                                                                                                  ##              changed to conform to the requirements of the yaYUL assembler
015371,000013:                                                                                                  ##              rather than the original YUL assembler.
015372,000014:                                                                                                  ## Reference:   pp. 367-371
015373,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
015374,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
015375,000017:                                                                                                  ## Mod history: 05/11/03 RSB    Began transcribing.
015376,000018:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
015377,000019:                                                                                                  ##              2011-05-07 JL   Removed workarounds.
015378,000020:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
015379,000021:                                                                                                  ##                              original harcopy, as opposed to the PDF page
015380,000022:                                                                                                  ##                              numbers in 1701.pdf.
015381,000023:                                                                                                  ##              2017-01-28 RSB  WTIH -> WITH.
015382,000024:                                                                                                  ##              2017-02-23 RSB  Proofed comment text using octopus/ProoferComments.
015383,000025:                                                                                                  ##              2017-02-28 RSB  Fixed lingering typos.
015384,000026:                                                                                                  ##              2017-03-17 RSB  Comment-text fixes identified in diff'ing
015385,000027:                                                                                                  ##                              Luminary 99 vs Comanche 55.
015386,000028:                                                                                                  ##              2018-09-04 MAS  Copied from Luminary 131 for Luminary 130.
015387,000029: 

Page 367

015389,000031:                                                                                                  #  GENERATION OF STEERING COMMANDS FOR DIGITAL AUTOPILOT FREE FALL MANEUVERS
015390,000032: 
015391,000033:                                                                                                  #  NEW COMMANDS WILL BE GENERATED EVERY ONE SECOND DURING THE MANEUVER
015392,000034: 
015393,000035: 22,3003  E6,1706                                  EBANK=   TTEMP                                 
015394,000036: 
015395,000037: 22,3003           04616        NEWDELHI           TC       BANKCALL                              #  CHECK FOR AUTO STABILIZATION
015396,000038: 22,3004           54266                           CADR     ISITAUTO                              #  ONLY
015397,000039: 22,3005           10000                           CCS      A                                     
015398,000040: 22,3006           12730                           TCF      NOGO       -2                         
015399,000041: 22,3007           06042        NEWANGL            TC       INTPRET                               
015400,000042: 22,3010           75160                           AXC,1    AXC,2                                 
015401,000043: 22,3011           03245                                    MIS                                   #  COMPUTE THE NEW MATRIX FROM S/C TO
015402,000044: 22,3012           02230                                    KEL                                   #  STABLE MEMBER AXES
015403,000045: 22,3013           77624                           CALL                                           
015404,000046: 22,3014           44312                                    MXM3                                  
015405,000047: 22,3015           45575                           VLOAD    STADR                                 
015406,000048: 22,3016           50515                           STOVL    MIS        +12D                       #  CALCULATE NEW DESIRED CDU ANGLES
015407,000049: 22,3017           77626                           STADR                                          
015408,000050: 22,3020           50523                           STOVL    MIS        +6D                        
015409,000051: 22,3021           77626                           STADR                                          
015410,000052: 22,3022           74531                           STORE    MIS                                   
015411,000053: 22,3023           45160                           AXC,1    CALL                                  
015412,000054: 22,3024           03245                                    MIS                                   
015413,000055: 22,3025           44654                                    DCMTOCDU                              #  PICK UP THE NEW CDU ANGLES FROM MATRIX
015414,000056: 22,3026           77634                           RTB                                            
015415,000057: 22,3027           21621                                    V1STO2S                               
015416,000058: 22,3030           03303                           STORE    NCDU                                  #  NEW CDU ANGLES
015417,000059: 22,3031           77414                           BONCLR   EXIT                                  
015418,000060: 22,3032           01215                                    CALCMAN2                              
015419,000061: 22,3033           45122                                    MANUSTAT                              #  TO START MANEUVER
015420,000062: 22,3034           34752                           CAF      TWO                                   #        +0 OTHERWISE
015421,000063: 22,3035           55261        INCRDCDU           TS       SPNDX                                 
015422,000064: 22,3036           51261                           INDEX    SPNDX                                 
015423,000065: 22,3037           31675                           CA       BCDU                                  #  INITIAL CDU ANGLES
015424,000066: 22,3040           00006                           EXTEND                                         #  OR PREVIOUS DESIRED CDU ANGLES
015425,000067: 22,3041           51261                           INDEX    SPNDX                                 
015426,000068: 22,3042           21702                           MSU      NCDU                                  
015427,000069: 22,3043           00006                           EXTEND                                         
015428,000070: 22,2000                                           SETLOC   KALCMON1                              
015429,000071: 22,2000                                           BANK                                           
015430,000072: 
015431,000073: 22,3044           73121                           MP       DT/TAU                                
015432,000074: 22,3045           10000                           CCS      A                                     #  CONVERT TO 2S COMPLEMENT
015433,000075: 22,3046           64753                           AD       ONE                                   
015434,000076: 22,3047           13051                           TCF      +2                                    
015435,000077: 22,3050           40000                           COM                                            
015436,000078: 22,3051           51261                           INDEX    SPNDX                                 
015437,000079: 22,3052           55637                           TS       DELDCDU                               #  ANGLE INCREMENTS TO BE ADDED TO
015438,000080: 22,3053           51261                           INDEX    SPNDX                                 #  CDUXD, CDUYD, CDUZD EVERY TENTH SECOND

Page 368

015440,000082: 22,3054           31702                           CA       NCDU                                  #  BY LEM DAP
015441,000083: 22,3055           51261                           INDEX    SPNDX                                 
015442,000084: 22,3056           57675                           XCH      BCDU                                  
015443,000085: 22,3057           51261                           INDEX    SPNDX                                 
015444,000086: 22,3060           55634                           TS       CDUXD                                 
015445,000087: 22,3061           11261                           CCS      SPNDX                                 
015446,000088: 22,3062           13035                           TCF      INCRDCDU                              #  LOOP FOR THREE AXES
015447,000089: 
015448,000090: 22,3063           00003                           RELINT                                         
015449,000091: 
015450,000092:                                                                                                  #  COMPARE PRESENT TIME WITH TIME TO TERMINATE MANEUVER
015451,000093: 
015452,000094: 22,3064           03075        TMANUCHK           TC       TIMECHK                               
015453,000095: 22,3065           13170                           TCF      CONTMANU                              
015454,000096: 22,3066           34753                           CAF      ONE                                   
015455,000097: 22,3067           00004        MANUSTAL           INHINT                                         #  END MAJOR PART OF MANEUVER WITHIN 1 SEC
015456,000098: 22,3070           05203                           TC       WAITLIST                              #  UNDER WAITLIST CALL TO MANUSTOP
015457,000099: 22,3071  E6,1706                                  EBANK=   TTEMP                                 
015458,000100: 22,3071           03213 44066                     2CADR    MANUSTOP                              
015459,000101: 
015460,000102: 22,3073           00003                           RELINT                                         
015461,000103: 22,3074           15155                           TCF      ENDOFJOB                              
015462,000104: 
015463,000105: 22,3075           00006        TIMECHK            EXTEND                                         
015464,000106: 22,3076           40025                           DCS      TIME2                                 
015465,000107: 22,3077           53707                           DXCH     TTEMP                                 
015466,000108: 22,3100           00006                           EXTEND                                         
015467,000109: 22,3101           31733                           DCA      TM                                    
015468,000110: 22,3102           21707                           DAS      TTEMP                                 
015469,000111: 22,3103           11706                           CCS      TTEMP                                 
015470,000112: 22,3104           00002                           TC       Q                                     
015471,000113: 22,3105           13107                           TCF      +2                                    
015472,000114: 22,3106           13117                           TCF      2NDRETRN                              
015473,000115: 22,3107           11707                           CCS      TTEMP      +1                         
015474,000116: 22,3110           00002                           TC       Q                                     
015475,000117: 22,3111           13113                           TCF      MANUOFF                               
015476,000118: 22,3112           40000                           COM                                            
015477,000119: 22,3113           63166        MANUOFF            AD       ONESEK     +1                         
015478,000120: 22,3114           00006                           EXTEND                                         
015479,000121: 22,3115           63117                           BZMF     2NDRETRN                              
015480,000122: 22,3116           24002                           INCR     Q                                     
015481,000123: 22,3117           24002        2NDRETRN           INCR     Q                                     
015482,000124: 22,3120           00002                           TC       Q                                     
015483,000125: 
015484,000126: 22,3121           03146        DT/TAU             DEC      .1                                    
015485,000127: 
015486,000128: 22,3122           77776        MANUSTAT           EXIT                                           #  INITIALIZATION ROUTINE
015487,000129: 22,3123           00006                           EXTEND                                         #  FOR AUTOMATIC MANEUVERS
015488,000130: 22,3124           30025                           DCA      TIME2                                 

Page 369

015490,000132: 22,3125           21733                           DAS      TM                                    #  TM+T0         MANEUVER COMPLETION TIME
015491,000133: 22,3126           00006                           EXTEND                                         
015492,000134: 22,3127           43166                           DCS      ONESEK                                
015493,000135: 22,3130           21733                           DAS      TM                                    #  (TM+T0)-1
015494,000136: 22,3131           00004                           INHINT                                         
015495,000137: 22,3132           34752                           CAF      TWO                                   
015496,000138: 22,3133           55700        RATEBIAS           TS       KSPNDX                                
015497,000139: 22,3134           60000                           DOUBLE                                         
015498,000140: 22,3135           55701                           TS       KDPNDX                                
015499,000141: 22,3136           50000                           INDEX    A                                     
015500,000142: 22,3137           31724                           CA       BRATE                                 
015501,000143: 22,3140           51700                           INDEX    KSPNDX                                #  STORE MANEUVER RATE IN
015502,000144: 22,3141           55642                           TS       OMEGAPD                               #  OMEGAPD, OMEGAQD, OMEGARD
015503,000145: 22,3142           00006                           EXTEND                                         
015504,000146: 22,3143           63145                           BZMF     +2                                    #  COMPUTE ATTITUDE ERROR
015505,000147: 22,3144           40000                           COM                                            #  OFFSET = (WX)ABS(WX)/2AJX
015506,000148: 22,3145           00006                           EXTEND                                         #  WHERE AJX= 2-JET ACCELERATION
015507,000149: 22,3146           73167                           MP       BIASCALE                              #  = -1/16
015508,000150: 22,3147           00006                           EXTEND                                         
015509,000151: 22,3150           51701                           INDEX    KDPNDX                                
015510,000152: 22,3151           71724                           MP       BRATE                                 
015511,000153: 22,3152           00006                           EXTEND                                         
015512,000154: 22,3153           51700                           INDEX    KSPNDX                                
015513,000155: 22,3154           11530                           DV       1JACC                                 #  = AJX  $ 90 DEG/SEC-SEC
015514,000156: 22,3155           51700                           INDEX    KSPNDX                                
015515,000157: 22,3156           55274                           TS       DELPEROR                              #       $ 180 DEG
015516,000158: 22,3157           11700                           CCS      KSPNDX                                
015517,000159: 22,3160           13133                           TCF      RATEBIAS                              
015518,000160: 
015519,000161: 22,3161           30025                           CA       TIME1                                 
015520,000162: 22,3162           63166                           AD       ONESEK     +1                         
015521,000163: 22,3163           57705                           XCH      NEXTIME                               
015522,000164: 22,3164           13034                           TCF      INCRDCDU   -1                         
015523,000165: 
015524,000166: 22,3165           00000        ONESEK             DEC      0          B-14                       
015525,000167: 22,3166           00144                           DEC      100        B-14                       
015526,000168: 
015527,000169: 22,3167           75777        BIASCALE           OCT      75777                                 #  = -1/16
015528,000170: 
015529,000171: 22,3170           40025        CONTMANU           CS       TIME1                                 #  RESET FOR NEXT DCDU UPDATE
015530,000172: 22,3171           61705                           AD       NEXTIME                               
015531,000173: 22,3172           10000                           CCS      A                                     
015532,000174: 22,3173           64753                           AD       ONE                                   
015533,000175: 22,3174           13177                           TCF      MANUCALL                              
015534,000176: 22,3175           64735                           AD       NEGMAX                                
015535,000177: 22,3176           40000                           COM                                            
015536,000178: 22,3177           00004        MANUCALL           INHINT                                         #  CALL FOR NEXT UPDATE VIA WAITLIST
015537,000179: 22,3200           05203                           TC       WAITLIST                              
015538,000180: 22,3201  E6,1706                                  EBANK=   TTEMP                                 
015539,000181: 22,3201           03206 44066                     2CADR    UPDTCALL                              

Page 370

015541,000183: 22,3203           33166                           CAF      ONESEK     +1                         #  INCREMENT TIME FOR NEXT UPDATE
015542,000184: 22,3204           27705                           ADS      NEXTIME                               
015543,000185: 22,3205           15155                           TCF      ENDOFJOB                              
015544,000186: 
015545,000187: 22,3206           37717        UPDTCALL           CAF      PRIO26                                #  SATELLITE PROGRAM TO CALL FOR UPDATE
015546,000188: 22,3207           05105                           TC       FINDVAC                               #  OF STEERING COMMANDS
015547,000189: 22,3210  E6,1706                                  EBANK=   TTEMP                                 
015548,000190: 22,3210           03003 44066                     2CADR    NEWDELHI                              
015549,000191: 
015550,000192: 22,3212           05261                           TC       TASKOVER                              
015551,000193: 

Page 371

015553,000195:                                                                                                  #  ROUTINE FOR TERMINATING AUTOMATIC MANEUVERS
015554,000196: 
015555,000197: 22,3213           34755        MANUSTOP           CAF      ZERO                                  #  ZERO MANEUVER RATES
015556,000198: 22,3214           55641                           TS       DELDCDU2                              
015557,000199: 22,3215           55644                           TS       OMEGARD                               
015558,000200: 22,3216           55276                           TS       DELREROR                              
015559,000201: 22,3217           55640                           TS       DELDCDU1                              
015560,000202: 22,3220           55643                           TS       OMEGAQD                               
015561,000203: 22,3221           55275                           TS       DELQEROR                              
015562,000204: 22,3222           30323                           CA       CPSI                                  #  SET DESIRED GIMBAL ANGLES TO
015563,000205: 22,3223           55636                           TS       CDUZD                                 #  DESIRED FINAL GIMBAL ANGLES
015564,000206: 22,3224           30322                           CA       CTHETA                                
015565,000207: 22,3225           55635                           TS       CDUYD                                 
015566,000208: 22,3226           30321        ENDROLL            CA       CPHI                                  #  NO FINAL YAW
015567,000209: 22,3227           55634                           TS       CDUXD                                 
015568,000210: 22,3230           34755                           CAF      ZERO                                  
015569,000211: 22,3231           55642                           TS       OMEGAPD                               #  I.E. MANEUVER DID NOT GO THRU
015570,000212: 22,3232           55637                           TS       DELDCDU                               #  GIMBAL LOCK ORIGINALLY
015571,000213: 22,3233           55274                           TS       DELPEROR                              
015572,000214: 22,3234           31306        GOODMANU           CA       ATTPRIO                               #  RESTORE USERS PRIO
015573,000215: 22,3235           54063                           TS       NEWPRIO                               
015574,000216: 
015575,000217: 22,3236           34755                           CA       ZERO                                  #  ZERO ATTCADR
015576,000218: 22,3237           53305                           DXCH     ATTCADR                               
015577,000219: 
015578,000220: 22,3240           05116                           TC       SPVAC                                 #  RETURN TO USER
015579,000221: 
015580,000222: 22,3241           05261                           TC       TASKOVER                              
015581,000223: 
015582,000224: 

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