Source Code

These source-code files were from the printout at the MIT Museum, with many thanks to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing it to us. The printout was digitally photographed by Paul Fjeld. A team of volunteers transcribed the source code manually from these images or, where appropriate, modified already-transcribed but similar source Luminary 131 (Apollo 13) source code to agree with the images from the printout. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 001 OF AGC PROGRAM LMY99 BY NASA 2021112-061
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

015321,000002:                                                                                                  ## Copyright:   Public domain.
015322,000003:                                                                                                  ## Filename:    KALCMANU_STEERING.agc
015323,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
015324,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
015325,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
015326,000007:                                                                                                  ## Assembler:   yaYUL
015327,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
015328,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
015329,000010:                                                                                                  ## Pages:       365-369
015330,000011:                                                                                                  ## Mod history: 2009-05-17 RSB  Adapted from the corresponding 
015331,000012:                                                                                                  ##                              Luminary131 file, using page 
015332,000013:                                                                                                  ##                              images from Luminary 1A.
015333,000014:                                                                                                  ##              2011-01-06 JL   Added missing comment characters.
015334,000015:                                                                                                  ##              2016-12-14 RSB  Proofed text comments with octopus/ProoferComments
015335,000016:                                                                                                  ##                              and corrected the errors found.
015336,000017:                                                                                                  ##              2017-03-07 RSB  Removed yaYUL workaround that no longer 
015337,000018:                                                                                                  ##                              seems to be needed.
015338,000019:                                                                                                  ##              2017-03-17 RSB  Comment-text fixes identified in diff'ing
015339,000020:                                                                                                  ##                              Luminary 99 vs Comanche 55.
015340,000021: 
015341,000022:                                                                                                  ## This source code has been transcribed or otherwise adapted from
015342,000023:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
015343,000024:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
015344,000025:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
015345,000026:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
015346,000027:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
015347,000028:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
015348,000029:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
015349,000030:                                                                                                  ## actually created.
015350,000031:                                                                                                  ##
015351,000032:                                                                                                  ## Notations on the hardcopy document read, in part:
015352,000033:                                                                                                  ##
015353,000034:                                                                                                  ##      Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
015354,000035:                                                                                                  ##      16:27 JULY 14, 1969 
015355,000036: 

Page 365

015357,000038:                                                                                                  #  GENERATION OF STEERING COMMANDS FOR DIGITAL AUTOPILOT FREE FALL MANEUVERS
015358,000039: 
015359,000040:                                                                                                  #  NEW COMMANDS WILL BE GENERATED EVERY ONE SECOND DURING THE MANEUVER
015360,000041: 
015361,000042: 22,3003  E6,1707                                  EBANK=   TTEMP                                 
015362,000043: 
015363,000044: 22,3003           04616        NEWDELHI           TC       BANKCALL                              #  CHECK FOR AUTO STABILIZATION
015364,000045: 22,3004           54262                           CADR     ISITAUTO                              #  ONLY
015365,000046: 22,3005           10000                           CCS      A                                     
015366,000047: 22,3006           12730                           TCF      NOGO       -2                         
015367,000048: 22,3007           06037        NEWANGL            TC       INTPRET                               
015368,000049: 22,3010           75160                           AXC,1    AXC,2                                 
015369,000050: 22,3011           03246                                    MIS                                   #  COMPUTE THE NEW MATRIX FROM S/C TO
015370,000051: 22,3012           02230                                    KEL                                   #  STABLE MEMBER AXES
015371,000052: 22,3013           77624                           CALL                                           
015372,000053: 22,3014           44312                                    MXM3                                  
015373,000054: 22,3015           45575                           VLOAD    STADR                                 
015374,000055: 22,3016           50514                           STOVL    MIS        +12D                       #  CALCULATE NEW DESIRED CDU ANGLES
015375,000056: 22,3017           77626                           STADR                                          
015376,000057: 22,3020           50522                           STOVL    MIS        +6D                        
015377,000058: 22,3021           77626                           STADR                                          
015378,000059: 22,3022           74530                           STORE    MIS                                   
015379,000060: 22,3023           45160                           AXC,1    CALL                                  
015380,000061: 22,3024           03246                                    MIS                                   
015381,000062: 22,3025           44654                                    DCMTOCDU                              #  PICK UP THE NEW CDU ANGLES FROM MATRIX
015382,000063: 22,3026           77634                           RTB                                            
015383,000064: 22,3027           21620                                    V1STO2S                               
015384,000065: 22,3030           03304                           STORE    NCDU                                  #  NEW CDU ANGLES
015385,000066: 22,3031           77414                           BONCLR   EXIT                                  
015386,000067: 22,3032           01215                                    CALCMAN2                              
015387,000068: 22,3033           45122                                    MANUSTAT                              #  TO START MANEUVER
015388,000069: 22,3034           34752                           CAF      TWO                                   #        +0 OTHERWISE
015389,000070: 22,3035           55272        INCRDCDU           TS       SPNDX                                 
015390,000071: 22,3036           51272                           INDEX    SPNDX                                 
015391,000072: 22,3037           31676                           CA       BCDU                                  #  INITIAL CDU ANGLES
015392,000073: 22,3040           00006                           EXTEND                                         #  OR PREVIOUS DESIRED CDU ANGLES
015393,000074: 22,3041           51272                           INDEX    SPNDX                                 
015394,000075: 22,3042           21703                           MSU      NCDU                                  
015395,000076: 22,3043           00006                           EXTEND                                         
015396,000077: 22,2000                                           SETLOC   KALCMON1                              
015397,000078: 22,2000                                           BANK                                           
015398,000079: 
015399,000080: 22,3044           73121                           MP       DT/TAU                                
015400,000081: 22,3045           10000                           CCS      A                                     #  CONVERT TO 2S COMPLEMENT
015401,000082: 22,3046           64753                           AD       ONE                                   
015402,000083: 22,3047           13051                           TCF      +2                                    
015403,000084: 22,3050           40000                           COM                                            
015404,000085: 22,3051           51272                           INDEX    SPNDX                                 
015405,000086: 22,3052           55640                           TS       DELDCDU                               #  ANGLE INCREMENTS TO BE ADDED TO
015406,000087: 22,3053           51272                           INDEX    SPNDX                                 #  CDUXD, CDUYD, CDUZD EVERY TENTH SECOND

Page 366

015408,000089: 22,3054           31703                           CA       NCDU                                  #  BY LEM DAP
015409,000090: 22,3055           51272                           INDEX    SPNDX                                 
015410,000091: 22,3056           57676                           XCH      BCDU                                  
015411,000092: 22,3057           51272                           INDEX    SPNDX                                 
015412,000093: 22,3060           55635                           TS       CDUXD                                 
015413,000094: 22,3061           11272                           CCS      SPNDX                                 
015414,000095: 22,3062           13035                           TCF      INCRDCDU                              #  LOOP FOR THREE AXES
015415,000096: 
015416,000097: 22,3063           00003                           RELINT                                         
015417,000098: 
015418,000099:                                                                                                  #  COMPARE PRESENT TIME WITH TIME TO TERMINATE MANEUVER
015419,000100: 
015420,000101: 22,3064           03075        TMANUCHK           TC       TIMECHK                               
015421,000102: 22,3065           13170                           TCF      CONTMANU                              
015422,000103: 22,3066           34753                           CAF      ONE                                   
015423,000104: 22,3067           00004        MANUSTAL           INHINT                                         #  END MAJOR PART OF MANEUVER WITHIN 1 SEC
015424,000105: 22,3070           05203                           TC       WAITLIST                              #  UNDER WAITLIST CALL TO MANUSTOP
015425,000106: 22,3071  E6,1707                                  EBANK=   TTEMP                                 
015426,000107: 22,3071           03213 44066                     2CADR    MANUSTOP                              
015427,000108: 
015428,000109: 22,3073           00003                           RELINT                                         
015429,000110: 22,3074           15155                           TCF      ENDOFJOB                              
015430,000111: 
015431,000112: 22,3075           00006        TIMECHK            EXTEND                                         
015432,000113: 22,3076           40025                           DCS      TIME2                                 
015433,000114: 22,3077           53710                           DXCH     TTEMP                                 
015434,000115: 22,3100           00006                           EXTEND                                         
015435,000116: 22,3101           31734                           DCA      TM                                    
015436,000117: 22,3102           21710                           DAS      TTEMP                                 
015437,000118: 22,3103           11707                           CCS      TTEMP                                 
015438,000119: 22,3104           00002                           TC       Q                                     
015439,000120: 22,3105           13107                           TCF      +2                                    
015440,000121: 22,3106           13117                           TCF      2NDRETRN                              
015441,000122: 22,3107           11710                           CCS      TTEMP      +1                         
015442,000123: 22,3110           00002                           TC       Q                                     
015443,000124: 22,3111           13113                           TCF      MANUOFF                               
015444,000125: 22,3112           40000                           COM                                            
015445,000126: 22,3113           63166        MANUOFF            AD       ONESEK     +1                         
015446,000127: 22,3114           00006                           EXTEND                                         
015447,000128: 22,3115           63117                           BZMF     2NDRETRN                              
015448,000129: 22,3116           24002                           INCR     Q                                     
015449,000130: 22,3117           24002        2NDRETRN           INCR     Q                                     
015450,000131: 22,3120           00002                           TC       Q                                     
015451,000132: 
015452,000133: 22,3121           03146        DT/TAU             DEC      .1                                    
015453,000134: 
015454,000135: 22,3122           77776        MANUSTAT           EXIT                                           #  INITIALIZATION ROUTINE
015455,000136: 22,3123           00006                           EXTEND                                         #  FOR AUTOMATIC MANEUVERS
015456,000137: 22,3124           30025                           DCA      TIME2                                 

Page 367

015458,000139: 22,3125           21734                           DAS      TM                                    #  TM+T0         MANEUVER COMPLETION TIME
015459,000140: 22,3126           00006                           EXTEND                                         
015460,000141: 22,3127           43166                           DCS      ONESEK                                
015461,000142: 22,3130           21734                           DAS      TM                                    #  (TM+T0)-1
015462,000143: 22,3131           00004                           INHINT                                         
015463,000144: 22,3132           34752                           CAF      TWO                                   
015464,000145: 22,3133           55701        RATEBIAS           TS       KSPNDX                                
015465,000146: 22,3134           60000                           DOUBLE                                         
015466,000147: 22,3135           55702                           TS       KDPNDX                                
015467,000148: 22,3136           50000                           INDEX    A                                     
015468,000149: 22,3137           31725                           CA       BRATE                                 
015469,000150: 22,3140           51701                           INDEX    KSPNDX                                #  STORE MANEUVER RATE IN
015470,000151: 22,3141           55643                           TS       OMEGAPD                               #  OMEGAPD, OMEGAQD, OMEGARD
015471,000152: 22,3142           00006                           EXTEND                                         
015472,000153: 22,3143           63145                           BZMF     +2                                    #  COMPUTE ATTITUDE ERROR
015473,000154: 22,3144           40000                           COM                                            #  OFFSET = (WX)ABS(WX)/2AJX
015474,000155: 22,3145           00006                           EXTEND                                         #  WHERE AJX= 2-JET ACCELERATION
015475,000156: 22,3146           73167                           MP       BIASCALE                              #  = -1/16
015476,000157: 22,3147           00006                           EXTEND                                         
015477,000158: 22,3150           51702                           INDEX    KDPNDX                                
015478,000159: 22,3151           71725                           MP       BRATE                                 
015479,000160: 22,3152           00006                           EXTEND                                         
015480,000161: 22,3153           51701                           INDEX    KSPNDX                                
015481,000162: 22,3154           11530                           DV       1JACC                                 #  = AJX         $ 90 DEG/SEC-SEC
015482,000163: 22,3155           51701                           INDEX    KSPNDX                                
015483,000164: 22,3156           55277                           TS       DELPEROR                              #                $ 180 DEG
015484,000165: 22,3157           11701                           CCS      KSPNDX                                
015485,000166: 22,3160           13133                           TCF      RATEBIAS                              
015486,000167: 
015487,000168: 22,3161           30025                           CA       TIME1                                 
015488,000169: 22,3162           63166                           AD       ONESEK     +1                         
015489,000170: 22,3163           57706                           XCH      NEXTIME                               
015490,000171: 22,3164           13034                           TCF      INCRDCDU   -1                         
015491,000172: 
015492,000173: 22,3165           00000        ONESEK             DEC      0          B-14                       
015493,000174: 22,3166           00144                           DEC      100        B-14                       
015494,000175: 
015495,000176: 22,3167           75777        BIASCALE           OCT      75777                                 #  = -1/16
015496,000177: 
015497,000178: 22,3170           40025        CONTMANU           CS       TIME1                                 #  RESET FOR NEXT DCDU UPDATE
015498,000179: 22,3171           61706                           AD       NEXTIME                               
015499,000180: 22,3172           10000                           CCS      A                                     
015500,000181: 22,3173           64753                           AD       ONE                                   
015501,000182: 22,3174           13177                           TCF      MANUCALL                              
015502,000183: 22,3175           64735                           AD       NEGMAX                                
015503,000184: 22,3176           40000                           COM                                            
015504,000185: 22,3177           00004        MANUCALL           INHINT                                         #  CALL FOR NEXT UPDATE VIA WAITLIST
015505,000186: 22,3200           05203                           TC       WAITLIST                              
015506,000187: 22,3201  E6,1707                                  EBANK=   TTEMP                                 
015507,000188: 22,3201           03206 44066                     2CADR    UPDTCALL                              

Page 368

015509,000190: 22,3203           33166                           CAF      ONESEK     +1                         #  INCREMENT TIME FOR NEXT UPDATE
015510,000191: 22,3204           27706                           ADS      NEXTIME                               
015511,000192: 22,3205           15155                           TCF      ENDOFJOB                              
015512,000193: 
015513,000194: 22,3206           37714        UPDTCALL           CAF      PRIO26                                #  SATELLITE PROGRAM TO CALL FOR UPDATE
015514,000195: 22,3207           05105                           TC       FINDVAC                               #  OF STEERING COMMANDS
015515,000196: 22,3210  E6,1707                                  EBANK=   TTEMP                                 
015516,000197: 22,3210           03003 44066                     2CADR    NEWDELHI                              
015517,000198: 
015518,000199: 22,3212           05261                           TC       TASKOVER                              
015519,000200: 

Page 369

015521,000202:                                                                                                  #  ROUTINE FOR TERMINATING AUTOMATIC MANEUVERS
015522,000203: 
015523,000204: 22,3213           34755        MANUSTOP           CAF      ZERO                                  #  ZERO MANEUVER RATES
015524,000205: 22,3214           55642                           TS       DELDCDU2                              
015525,000206: 22,3215           55645                           TS       OMEGARD                               
015526,000207: 22,3216           55301                           TS       DELREROR                              
015527,000208: 22,3217           55641                           TS       DELDCDU1                              
015528,000209: 22,3220           55644                           TS       OMEGAQD                               
015529,000210: 22,3221           55300                           TS       DELQEROR                              
015530,000211: 22,3222           30323                           CA       CPSI                                  #  SET DESIRED GIMBAL ANGLES TO
015531,000212: 22,3223           55637                           TS       CDUZD                                 #  DESIRED FINAL GIMBAL ANGLES
015532,000213: 22,3224           30322                           CA       CTHETA                                
015533,000214: 22,3225           55636                           TS       CDUYD                                 
015534,000215: 22,3226           30321        ENDROLL            CA       CPHI                                  #  NO FINAL YAW
015535,000216: 22,3227           55635                           TS       CDUXD                                 
015536,000217: 22,3230           34755                           CAF      ZERO                                  
015537,000218: 22,3231           55643                           TS       OMEGAPD                               #  I.E. MANEUVER DID NOT GO THRU
015538,000219: 22,3232           55640                           TS       DELDCDU                               #  GIMBAL LOCK ORIGINALLY
015539,000220: 22,3233           55277                           TS       DELPEROR                              
015540,000221: 22,3234           31311        GOODMANU           CA       ATTPRIO                               #  RESTORE USERS PRIO
015541,000222: 22,3235           54063                           TS       NEWPRIO                               
015542,000223: 
015543,000224: 22,3236           34755                           CA       ZERO                                  #  ZERO ATTCADR
015544,000225: 22,3237           53310                           DXCH     ATTCADR                               
015545,000226: 
015546,000227: 22,3240           05116                           TC       SPVAC                                 #  RETURN TO USER
015547,000228: 
015548,000229: 22,3241           05261                           TC       TASKOVER                              
015549,000230: 
015550,000231: 

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