Source Code

This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the third release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 96 and 97. A bug (which had been around since at least Apollo 10, Luminary 69) was discovered in Rev 0 shortly before the Apollo 11 flight, resulting in a last minute revision into Rev 1, which is what actually flew rather than the Rev 0 presented here. A hardcopy of Rev 0 is known to exist — it belonged to AGC developer Allan Klumpp for many years — but unfortunately the Virtual AGC Project has not had access to that hardcopy. Thus the code you see here had been reconstructed (we believe accurately) rather than transcribed. The first step of the reconstruction of the Rev 0 source code was the transcription of the Rev 1 source code from a hardcopy in the MIT Museum collection. The process of reverting the active portion of the source code (i.e., other than program comments) from Rev 1 to Rev 0 was very minor, consisting only of moving the position of the STARTSB1 label in FRESH START AND RESTART. Allan had previously given us the checksums of the memory banks of Rev 0, and we have verified the program presented here has checksums identical to all banks of Allan's listing of Rev 0. The notations on Allan's Rev 0 program listing read, in part:

	GAP:  ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-051

A single program comment is known to differ between Rev 0 and Rev 1, but these are harder to reconstruct and verify than changes to the active portion of the code. Thus it is possible that there are additional differences between the program comments in Rev 0 and Rev 1 that are unknown to us, and therefore are not reflected in the code presented here.

015654,000002:                                                                                                  ## Copyright:   Public domain.
015655,000003:                                                                                                  ## Filename:    KALCMANU_STEERING.agc
015656,000004:                                                                                                  ## Purpose:     Part of the reconstructed source code for LMY99 Rev 0,
015657,000005:                                                                                                  ##              otherwise known as Luminary Rev 99, the third release
015658,000006:                                                                                                  ##              of the Apollo Guidance Computer (AGC) software for Apollo 11.
015659,000007:                                                                                                  ##              It differs from LMY99 Rev 1 (the flown version) only in the
015660,000008:                                                                                                  ##              placement of a single label. The corrections shown here have
015661,000009:                                                                                                  ##              been verified to have the same bank checksums as AGC developer
015662,000010:                                                                                                  ##              Allan Klumpp's copy of Luminary Rev 99, and so are believed
015663,000011:                                                                                                  ##              to be accurate. This file is intended to be a faithful 
015664,000012:                                                                                                  ##              recreation, except that the code format has been changed to 
015665,000013:                                                                                                  ##              conform to the requirements of the yaYUL assembler rather than 
015666,000014:                                                                                                  ##              the original YUL assembler.
015667,000015:                                                                                                  ##
015668,000016:                                                                                                  ## Assembler:   yaYUL
015669,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
015670,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo.
015671,000019:                                                                                                  ## Pages:       365-369
015672,000020:                                                                                                  ## Mod history: 2009-05-17 RSB  Adapted from the corresponding 
015673,000021:                                                                                                  ##                              Luminary131 file, using page 
015674,000022:                                                                                                  ##                              images from Luminary 1A.
015675,000023:                                                                                                  ##              2011-01-06 JL   Added missing comment characters.
015676,000024:                                                                                                  ##              2016-12-14 RSB  Proofed text comments with octopus/ProoferComments
015677,000025:                                                                                                  ##                              and corrected the errors found.
015678,000026:                                                                                                  ##              2017-03-07 RSB  Removed yaYUL workaround that no longer 
015679,000027:                                                                                                  ##                              seems to be needed.
015680,000028:                                                                                                  ##              2017-03-17 RSB  Comment-text fixes identified in diff'ing
015681,000029:                                                                                                  ##                              Luminary 99 vs Comanche 55.
015682,000030:                                                                                                  ##              2017-08-01 MAS  Created from LMY99 Rev 1.
015683,000031: 
015684,000032:                                                                                                  ## This source code has been transcribed or otherwise adapted from
015685,000033:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
015686,000034:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
015687,000035:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
015688,000036:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
015689,000037:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
015690,000038:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
015691,000039:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
015692,000040:                                                                                                  ## actually created.
015693,000041:                                                                                                  ##
015694,000042:                                                                                                  ## The code has been modified to match LMY99 Revision 0, otherwise
015695,000043:                                                                                                  ## known as Luminary Revision 99, the Apollo 11 software release preceeding
015696,000044:                                                                                                  ## the listing from which it was transcribed. It has been verified to
015697,000045:                                                                                                  ## contain the same bank checksums as AGC developer Allan Klumpp's listing
015698,000046:                                                                                                  ## of Luminary Revision 99 (for which we do not have scans).
015699,000047:                                                                                                  ##
015700,000048:                                                                                                  ## Notations on Allan Klumpp's listing read, in part:
015701,000049:                                                                                                  ##
015702,000050:                                                                                                  ##      ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
015703,000051: 

Page 365

015705,000053:                                                                                                  #  GENERATION OF STEERING COMMANDS FOR DIGITAL AUTOPILOT FREE FALL MANEUVERS
015706,000054: 
015707,000055:                                                                                                  #  NEW COMMANDS WILL BE GENERATED EVERY ONE SECOND DURING THE MANEUVER
015708,000056: 
015709,000057: 22,3003  E6,1707                                  EBANK=   TTEMP                                 
015710,000058: 
015711,000059: 22,3003           04616        NEWDELHI           TC       BANKCALL                              #  CHECK FOR AUTO STABILIZATION
015712,000060: 22,3004           54262                           CADR     ISITAUTO                              #  ONLY
015713,000061: 22,3005           10000                           CCS      A                                     
015714,000062: 22,3006           12730                           TCF      NOGO       -2                         
015715,000063: 22,3007           06037        NEWANGL            TC       INTPRET                               
015716,000064: 22,3010           75160                           AXC,1    AXC,2                                 
015717,000065: 22,3011           03246                                    MIS                                   #  COMPUTE THE NEW MATRIX FROM S/C TO
015718,000066: 22,3012           02230                                    KEL                                   #  STABLE MEMBER AXES
015719,000067: 22,3013           77624                           CALL                                           
015720,000068: 22,3014           44312                                    MXM3                                  
015721,000069: 22,3015           45575                           VLOAD    STADR                                 
015722,000070: 22,3016           50514                           STOVL    MIS        +12D                       #  CALCULATE NEW DESIRED CDU ANGLES
015723,000071: 22,3017           77626                           STADR                                          
015724,000072: 22,3020           50522                           STOVL    MIS        +6D                        
015725,000073: 22,3021           77626                           STADR                                          
015726,000074: 22,3022           74530                           STORE    MIS                                   
015727,000075: 22,3023           45160                           AXC,1    CALL                                  
015728,000076: 22,3024           03246                                    MIS                                   
015729,000077: 22,3025           44654                                    DCMTOCDU                              #  PICK UP THE NEW CDU ANGLES FROM MATRIX
015730,000078: 22,3026           77634                           RTB                                            
015731,000079: 22,3027           21620                                    V1STO2S                               
015732,000080: 22,3030           03304                           STORE    NCDU                                  #  NEW CDU ANGLES
015733,000081: 22,3031           77414                           BONCLR   EXIT                                  
015734,000082: 22,3032           01215                                    CALCMAN2                              
015735,000083: 22,3033           45122                                    MANUSTAT                              #  TO START MANEUVER
015736,000084: 22,3034           34752                           CAF      TWO                                   #        +0 OTHERWISE
015737,000085: 22,3035           55272        INCRDCDU           TS       SPNDX                                 
015738,000086: 22,3036           51272                           INDEX    SPNDX                                 
015739,000087: 22,3037           31676                           CA       BCDU                                  #  INITIAL CDU ANGLES
015740,000088: 22,3040           00006                           EXTEND                                         #  OR PREVIOUS DESIRED CDU ANGLES
015741,000089: 22,3041           51272                           INDEX    SPNDX                                 
015742,000090: 22,3042           21703                           MSU      NCDU                                  
015743,000091: 22,3043           00006                           EXTEND                                         
015744,000092: 22,2000                                           SETLOC   KALCMON1                              
015745,000093: 22,2000                                           BANK                                           
015746,000094: 
015747,000095: 22,3044           73121                           MP       DT/TAU                                
015748,000096: 22,3045           10000                           CCS      A                                     #  CONVERT TO 2S COMPLEMENT
015749,000097: 22,3046           64753                           AD       ONE                                   
015750,000098: 22,3047           13051                           TCF      +2                                    
015751,000099: 22,3050           40000                           COM                                            
015752,000100: 22,3051           51272                           INDEX    SPNDX                                 
015753,000101: 22,3052           55640                           TS       DELDCDU                               #  ANGLE INCREMENTS TO BE ADDED TO
015754,000102: 22,3053           51272                           INDEX    SPNDX                                 #  CDUXD, CDUYD, CDUZD EVERY TENTH SECOND

Page 366

015756,000104: 22,3054           31703                           CA       NCDU                                  #  BY LEM DAP
015757,000105: 22,3055           51272                           INDEX    SPNDX                                 
015758,000106: 22,3056           57676                           XCH      BCDU                                  
015759,000107: 22,3057           51272                           INDEX    SPNDX                                 
015760,000108: 22,3060           55635                           TS       CDUXD                                 
015761,000109: 22,3061           11272                           CCS      SPNDX                                 
015762,000110: 22,3062           13035                           TCF      INCRDCDU                              #  LOOP FOR THREE AXES
015763,000111: 
015764,000112: 22,3063           00003                           RELINT                                         
015765,000113: 
015766,000114:                                                                                                  #  COMPARE PRESENT TIME WITH TIME TO TERMINATE MANEUVER
015767,000115: 
015768,000116: 22,3064           03075        TMANUCHK           TC       TIMECHK                               
015769,000117: 22,3065           13170                           TCF      CONTMANU                              
015770,000118: 22,3066           34753                           CAF      ONE                                   
015771,000119: 22,3067           00004        MANUSTAL           INHINT                                         #  END MAJOR PART OF MANEUVER WITHIN 1 SEC
015772,000120: 22,3070           05203                           TC       WAITLIST                              #  UNDER WAITLIST CALL TO MANUSTOP
015773,000121: 22,3071  E6,1707                                  EBANK=   TTEMP                                 
015774,000122: 22,3071           03213 44066                     2CADR    MANUSTOP                              
015775,000123: 
015776,000124: 22,3073           00003                           RELINT                                         
015777,000125: 22,3074           15155                           TCF      ENDOFJOB                              
015778,000126: 
015779,000127: 22,3075           00006        TIMECHK            EXTEND                                         
015780,000128: 22,3076           40025                           DCS      TIME2                                 
015781,000129: 22,3077           53710                           DXCH     TTEMP                                 
015782,000130: 22,3100           00006                           EXTEND                                         
015783,000131: 22,3101           31734                           DCA      TM                                    
015784,000132: 22,3102           21710                           DAS      TTEMP                                 
015785,000133: 22,3103           11707                           CCS      TTEMP                                 
015786,000134: 22,3104           00002                           TC       Q                                     
015787,000135: 22,3105           13107                           TCF      +2                                    
015788,000136: 22,3106           13117                           TCF      2NDRETRN                              
015789,000137: 22,3107           11710                           CCS      TTEMP      +1                         
015790,000138: 22,3110           00002                           TC       Q                                     
015791,000139: 22,3111           13113                           TCF      MANUOFF                               
015792,000140: 22,3112           40000                           COM                                            
015793,000141: 22,3113           63166        MANUOFF            AD       ONESEK     +1                         
015794,000142: 22,3114           00006                           EXTEND                                         
015795,000143: 22,3115           63117                           BZMF     2NDRETRN                              
015796,000144: 22,3116           24002                           INCR     Q                                     
015797,000145: 22,3117           24002        2NDRETRN           INCR     Q                                     
015798,000146: 22,3120           00002                           TC       Q                                     
015799,000147: 
015800,000148: 22,3121           03146        DT/TAU             DEC      .1                                    
015801,000149: 
015802,000150: 22,3122           77776        MANUSTAT           EXIT                                           #  INITIALIZATION ROUTINE
015803,000151: 22,3123           00006                           EXTEND                                         #  FOR AUTOMATIC MANEUVERS
015804,000152: 22,3124           30025                           DCA      TIME2                                 

Page 367

015806,000154: 22,3125           21734                           DAS      TM                                    #  TM+T0         MANEUVER COMPLETION TIME
015807,000155: 22,3126           00006                           EXTEND                                         
015808,000156: 22,3127           43166                           DCS      ONESEK                                
015809,000157: 22,3130           21734                           DAS      TM                                    #  (TM+T0)-1
015810,000158: 22,3131           00004                           INHINT                                         
015811,000159: 22,3132           34752                           CAF      TWO                                   
015812,000160: 22,3133           55701        RATEBIAS           TS       KSPNDX                                
015813,000161: 22,3134           60000                           DOUBLE                                         
015814,000162: 22,3135           55702                           TS       KDPNDX                                
015815,000163: 22,3136           50000                           INDEX    A                                     
015816,000164: 22,3137           31725                           CA       BRATE                                 
015817,000165: 22,3140           51701                           INDEX    KSPNDX                                #  STORE MANEUVER RATE IN
015818,000166: 22,3141           55643                           TS       OMEGAPD                               #  OMEGAPD, OMEGAQD, OMEGARD
015819,000167: 22,3142           00006                           EXTEND                                         
015820,000168: 22,3143           63145                           BZMF     +2                                    #  COMPUTE ATTITUDE ERROR
015821,000169: 22,3144           40000                           COM                                            #  OFFSET = (WX)ABS(WX)/2AJX
015822,000170: 22,3145           00006                           EXTEND                                         #  WHERE AJX= 2-JET ACCELERATION
015823,000171: 22,3146           73167                           MP       BIASCALE                              #  = -1/16
015824,000172: 22,3147           00006                           EXTEND                                         
015825,000173: 22,3150           51702                           INDEX    KDPNDX                                
015826,000174: 22,3151           71725                           MP       BRATE                                 
015827,000175: 22,3152           00006                           EXTEND                                         
015828,000176: 22,3153           51701                           INDEX    KSPNDX                                
015829,000177: 22,3154           11530                           DV       1JACC                                 #  = AJX         $ 90 DEG/SEC-SEC
015830,000178: 22,3155           51701                           INDEX    KSPNDX                                
015831,000179: 22,3156           55277                           TS       DELPEROR                              #                $ 180 DEG
015832,000180: 22,3157           11701                           CCS      KSPNDX                                
015833,000181: 22,3160           13133                           TCF      RATEBIAS                              
015834,000182: 
015835,000183: 22,3161           30025                           CA       TIME1                                 
015836,000184: 22,3162           63166                           AD       ONESEK     +1                         
015837,000185: 22,3163           57706                           XCH      NEXTIME                               
015838,000186: 22,3164           13034                           TCF      INCRDCDU   -1                         
015839,000187: 
015840,000188: 22,3165           00000        ONESEK             DEC      0          B-14                       
015841,000189: 22,3166           00144                           DEC      100        B-14                       
015842,000190: 
015843,000191: 22,3167           75777        BIASCALE           OCT      75777                                 #  = -1/16
015844,000192: 
015845,000193: 22,3170           40025        CONTMANU           CS       TIME1                                 #  RESET FOR NEXT DCDU UPDATE
015846,000194: 22,3171           61706                           AD       NEXTIME                               
015847,000195: 22,3172           10000                           CCS      A                                     
015848,000196: 22,3173           64753                           AD       ONE                                   
015849,000197: 22,3174           13177                           TCF      MANUCALL                              
015850,000198: 22,3175           64735                           AD       NEGMAX                                
015851,000199: 22,3176           40000                           COM                                            
015852,000200: 22,3177           00004        MANUCALL           INHINT                                         #  CALL FOR NEXT UPDATE VIA WAITLIST
015853,000201: 22,3200           05203                           TC       WAITLIST                              
015854,000202: 22,3201  E6,1707                                  EBANK=   TTEMP                                 
015855,000203: 22,3201           03206 44066                     2CADR    UPDTCALL                              

Page 368

015857,000205: 22,3203           33166                           CAF      ONESEK     +1                         #  INCREMENT TIME FOR NEXT UPDATE
015858,000206: 22,3204           27706                           ADS      NEXTIME                               
015859,000207: 22,3205           15155                           TCF      ENDOFJOB                              
015860,000208: 
015861,000209: 22,3206           37714        UPDTCALL           CAF      PRIO26                                #  SATELLITE PROGRAM TO CALL FOR UPDATE
015862,000210: 22,3207           05105                           TC       FINDVAC                               #  OF STEERING COMMANDS
015863,000211: 22,3210  E6,1707                                  EBANK=   TTEMP                                 
015864,000212: 22,3210           03003 44066                     2CADR    NEWDELHI                              
015865,000213: 
015866,000214: 22,3212           05261                           TC       TASKOVER                              
015867,000215: 

Page 369

015869,000217:                                                                                                  #  ROUTINE FOR TERMINATING AUTOMATIC MANEUVERS
015870,000218: 
015871,000219: 22,3213           34755        MANUSTOP           CAF      ZERO                                  #  ZERO MANEUVER RATES
015872,000220: 22,3214           55642                           TS       DELDCDU2                              
015873,000221: 22,3215           55645                           TS       OMEGARD                               
015874,000222: 22,3216           55301                           TS       DELREROR                              
015875,000223: 22,3217           55641                           TS       DELDCDU1                              
015876,000224: 22,3220           55644                           TS       OMEGAQD                               
015877,000225: 22,3221           55300                           TS       DELQEROR                              
015878,000226: 22,3222           30323                           CA       CPSI                                  #  SET DESIRED GIMBAL ANGLES TO
015879,000227: 22,3223           55637                           TS       CDUZD                                 #  DESIRED FINAL GIMBAL ANGLES
015880,000228: 22,3224           30322                           CA       CTHETA                                
015881,000229: 22,3225           55636                           TS       CDUYD                                 
015882,000230: 22,3226           30321        ENDROLL            CA       CPHI                                  #  NO FINAL YAW
015883,000231: 22,3227           55635                           TS       CDUXD                                 
015884,000232: 22,3230           34755                           CAF      ZERO                                  
015885,000233: 22,3231           55643                           TS       OMEGAPD                               #  I.E. MANEUVER DID NOT GO THRU
015886,000234: 22,3232           55640                           TS       DELDCDU                               #  GIMBAL LOCK ORIGINALLY
015887,000235: 22,3233           55277                           TS       DELPEROR                              
015888,000236: 22,3234           31311        GOODMANU           CA       ATTPRIO                               #  RESTORE USERS PRIO
015889,000237: 22,3235           54063                           TS       NEWPRIO                               
015890,000238: 
015891,000239: 22,3236           34755                           CA       ZERO                                  #  ZERO ATTCADR
015892,000240: 22,3237           53310                           DXCH     ATTCADR                               
015893,000241: 
015894,000242: 22,3240           05116                           TC       SPVAC                                 #  RETURN TO USER
015895,000243: 
015896,000244: 22,3241           05261                           TC       TASKOVER                              
015897,000245: 
015898,000246: 

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