Source Code

These source code files are an attempted reconstruction of Sundance revision 306, the Apollo 9 LM (Lunar Module) AGC (Apollo Guidance Computer) flight software, created from binary dumps of original core rope program modules, as follows:
  • B1 — Revision 292
  • B2 — Revision 302
  • B3 — Revision 302
  • B4 — Revision 302
  • B5 — Revision 292
  • B6 — Revision 306
These dumps were then modified using memos, checklists, observed address changes, and the Sundance GSOPs to get the entire program to match Sundance revision 306 as closely as possible. Without more information, it is not possible to say how close it actually is; however, this code should be quite close. It is capable of flying the whole Apollo 9 mission using the original checklists and padload. Since only binary dumps (rather than listings) of Sundance are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

013491,000002:                                                                                                  ## Copyright:   Public domain.
013492,000003:                                                                                                  ## Filename:    KALCMANU_STEERING.agc
013493,000004:                                                                                                  ## Purpose:     A section of an attempt to reconstruct Sundance revision 306
013494,000005:                                                                                                  ##              as closely as possible with available information. Sundance
013495,000006:                                                                                                  ##              306 is the source code for the Lunar Module's (LM) Apollo
013496,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 9. This program was created
013497,000008:                                                                                                  ##              using the mixed-revision SundanceXXX as a starting point, and
013498,000009:                                                                                                  ##              pulling back features from Luminary 69 believed to have been
013499,000010:                                                                                                  ##              added based on memos, checklists, observed address changes,
013500,000011:                                                                                                  ##              or the Sundance GSOPs.
013501,000012:                                                                                                  ## Assembler:   yaYUL
013502,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
013503,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
013504,000015:                                                                                                  ## Mod history: 2020-07-24 MAS  Created from SundanceXXX.
013505,000016: 
013506,000017: 
013507,000018: 
013508,000019:                                                                                                  #  GENERATION OF STEERING COMMANDS FOR DIGITAL AUTOPILOT FREE FALL MANEUVERS
013509,000020: 
013510,000021:                                                                                                  #  NEW COMMANDS WILL BE GENERATED EVERY ONE SECOND DURING THE MANEUVER
013511,000022: 
013512,000023: 22,2777  E6,1704                                  EBANK=   TTEMP                                 
013513,000024: 
013514,000025: 22,2777           04655        NEWDELHI           TC       BANKCALL                              #  CHECK FOR AUTO STABILIZATION
013515,000026: 22,3000           54276                           CADR     ISITAUTO                              #  ONLY
013516,000027: 22,3001           10000                           CCS      A                                     
013517,000028: 22,3002           12724                           TCF      NOGO       -2                         
013518,000029: 22,3003           06014        NEWANGL            TC       INTPRET                               
013519,000030: 22,3004           75160                           AXC,1    AXC,2                                 
013520,000031: 22,3005           03243                                    MIS                                   #  COMPUTE THE NEW MATRIX FROM S/C TO
013521,000032: 22,3006           02236                                    KEL                                   #  STABLE MEMBER AXES
013522,000033: 22,3007           77624                           CALL                                           
013523,000034: 22,3010           44306                                    MXM3                                  
013524,000035: 22,3011           45575                           VLOAD    STADR                                 
013525,000036: 22,3012           50517                           STOVL    MIS        +12D                       #  CALCULATE NEW DESIRED CDU ANGLES
013526,000037: 22,3013           77626                           STADR                                          
013527,000038: 22,3014           50525                           STOVL    MIS        +6D                        
013528,000039: 22,3015           77626                           STADR                                          
013529,000040: 22,3016           74533                           STORE    MIS                                   
013530,000041: 22,3017           45160                           AXC,1    CALL                                  
013531,000042: 22,3020           03243                                    MIS                                   
013532,000043: 22,3021           44650                                    DCMTOCDU                              #  PICK UP THE NEW CDU ANGLES FROM MATRIX
013533,000044: 22,3022           77634                           RTB                                            
013534,000045: 22,3023           21516                                    V1STO2S                               
013535,000046: 22,3024           03301                           STORE    NCDU                                  #  NEW CDU ANGLES
013536,000047: 22,3025           77414                           BONCLR   EXIT                                  
013537,000048: 22,3026           01215                                    CALCMAN2                              
013538,000049: 22,3027           45116                                    MANUSTAT                              #  TO START MANEUVER
013539,000050: 22,3030           35025                           CAF      TWO                                   #        +0 OTHERWISE
013540,000051: 22,3031           55274        INCRDCDU           TS       SPNDX                                 
013541,000052: 22,3032           51274                           INDEX    SPNDX                                 
013542,000053: 22,3033           31673                           CA       BCDU                                  #  INITIAL CDU ANGLES
013543,000054: 22,3034           00006                           EXTEND                                         #  OR PREVIOUS DESIRED CDU ANGLES
013544,000055: 22,3035           51274                           INDEX    SPNDX                                 
013545,000056: 22,3036           21700                           MSU      NCDU                                  
013546,000057: 22,3037           00006                           EXTEND                                         
013547,000058: 22,2000                                           SETLOC   KALCMON1                              
013548,000059: 22,2000                                           BANK                                           
013549,000060: 
013550,000061: 22,3040           73115                           MP       DT/TAU                                
013551,000062: 22,3041           10000                           CCS      A                                     #  CONVERT TO 2S COMPLEMENT
013552,000063: 22,3042           65026                           AD       ONE                                   
013553,000064: 22,3043           13045                           TCF      +2                                    
013554,000065: 22,3044           40000                           COM                                            
013555,000066: 22,3045           51274                           INDEX    SPNDX                                 
013556,000067: 22,3046           55635                           TS       DELDCDU                               #  ANGLE INCREMENTS TO BE ADDED TO
013557,000068: 22,3047           51274                           INDEX    SPNDX                                 #  CDUXD, CDUYD, CDUZD EVERY TENTH SECOND
013558,000069: 22,3050           31700                           CA       NCDU                                  #  BY LEM DAP
013559,000070: 22,3051           51274                           INDEX    SPNDX                                 
013560,000071: 22,3052           57673                           XCH      BCDU                                  
013561,000072: 22,3053           51274                           INDEX    SPNDX                                 
013562,000073: 22,3054           55632                           TS       CDUXD                                 
013563,000074: 22,3055           11274                           CCS      SPNDX                                 
013564,000075: 22,3056           13031                           TCF      INCRDCDU                              #  LOOP FOR THREE AXES
013565,000076: 
013566,000077: 22,3057           00003                           RELINT                                         
013567,000078: 
013568,000079:                                                                                                  #  COMPARE PRESENT TIME WITH TIME TO TERMINATE MANEUVER
013569,000080: 
013570,000081: 22,3060           03071        TMANUCHK           TC       TIMECHK                               
013571,000082: 22,3061           13164                           TCF      CONTMANU                              
013572,000083: 22,3062           35026                           CAF      ONE                                   
013573,000084: 22,3063           00004        MANUSTAL           INHINT                                         #  END MAJOR PART OF MANEUVER WITHIN 1 SEC
013574,000085: 22,3064           05252                           TC       WAITLIST                              #  UNDER WAITLIST CALL TO MANUSTOP
013575,000086: 22,3065  E6,1704                                  EBANK=   TTEMP                                 
013576,000087: 22,3065           03207 44066                     2CADR    MANUSTOP                              
013577,000088: 
013578,000089: 22,3067           00003                           RELINT                                         
013579,000090: 22,3070           15225                           TCF      ENDOFJOB                              
013580,000091: 
013581,000092: 22,3071           00006        TIMECHK            EXTEND                                         
013582,000093: 22,3072           40025                           DCS      TIME2                                 
013583,000094: 22,3073           53705                           DXCH     TTEMP                                 
013584,000095: 22,3074           00006                           EXTEND                                         
013585,000096: 22,3075           31731                           DCA      TM                                    
013586,000097: 22,3076           21705                           DAS      TTEMP                                 
013587,000098: 22,3077           11704                           CCS      TTEMP                                 
013588,000099: 22,3100           00002                           TC       Q                                     
013589,000100: 22,3101           13103                           TCF      +2                                    
013590,000101: 22,3102           13113                           TCF      2NDRETRN                              
013591,000102: 22,3103           11705                           CCS      TTEMP      +1                         
013592,000103: 22,3104           00002                           TC       Q                                     
013593,000104: 22,3105           13107                           TCF      MANUOFF                               
013594,000105: 22,3106           40000                           COM                                            
013595,000106: 22,3107           63162        MANUOFF            AD       ONESEK     +1                         
013596,000107: 22,3110           00006                           EXTEND                                         
013597,000108: 22,3111           63113                           BZMF     2NDRETRN                              
013598,000109: 22,3112           24002                           INCR     Q                                     
013599,000110: 22,3113           24002        2NDRETRN           INCR     Q                                     
013600,000111: 22,3114           00002                           TC       Q                                     
013601,000112: 
013602,000113: 22,3115           03146        DT/TAU             DEC      .1                                    
013603,000114: 
013604,000115: 22,3116           77776        MANUSTAT           EXIT                                           #  INITIALIZATION ROUTINE
013605,000116: 22,3117           00006                           EXTEND                                         #  FOR AUTOMATIC MANEUVERS
013606,000117: 22,3120           30025                           DCA      TIME2                                 
013607,000118: 22,3121           21731                           DAS      TM                                    #  TM+T0         MANEUVER COMPLETION TIME
013608,000119: 22,3122           00006                           EXTEND                                         
013609,000120: 22,3123           43162                           DCS      ONESEK                                
013610,000121: 22,3124           21731                           DAS      TM                                    #  (TM+T0)-1
013611,000122: 22,3125           00004                           INHINT                                         
013612,000123: 22,3126           35025                           CAF      TWO                                   
013613,000124: 22,3127           55676        RATEBIAS           TS       KSPNDX                                
013614,000125: 22,3130           60000                           DOUBLE                                         
013615,000126: 22,3131           55677                           TS       KDPNDX                                
013616,000127: 22,3132           50000                           INDEX    A                                     
013617,000128: 22,3133           31722                           CA       BRATE                                 
013618,000129: 22,3134           51676                           INDEX    KSPNDX                                #  STORE MANEUVER RATE IN
013619,000130: 22,3135           55640                           TS       OMEGAPD                               #  OMEGAPD, OMEGAQD, OMEGARD
013620,000131: 22,3136           00006                           EXTEND                                         
013621,000132: 22,3137           63141                           BZMF     +2                                    #  COMPUTE ATTITUDE ERROR
013622,000133: 22,3140           40000                           COM                                            #  OFFSET = (WX)ABS(WX)/2AJX
013623,000134: 22,3141           00006                           EXTEND                                         #  WHERE AJX= 2-JET ACCELERATION
013624,000135: 22,3142           73163                           MP       BIASCALE                              #  = -1/16
013625,000136: 22,3143           00006                           EXTEND                                         
013626,000137: 22,3144           51677                           INDEX    KDPNDX                                
013627,000138: 22,3145           71722                           MP       BRATE                                 
013628,000139: 22,3146           00006                           EXTEND                                         
013629,000140: 22,3147           51676                           INDEX    KSPNDX                                
013630,000141: 22,3150           11522                           DV       1JACC                                 #  = AJX         $ 90 DEG/SEC-SEC
013631,000142: 22,3151           51676                           INDEX    KSPNDX                                
013632,000143: 22,3152           55301                           TS       DELPEROR                              #                $ 180 DEG
013633,000144: 22,3153           11676                           CCS      KSPNDX                                
013634,000145: 22,3154           13127                           TCF      RATEBIAS                              
013635,000146: 
013636,000147: 22,3155           30025                           CA       TIME1                                 
013637,000148: 22,3156           63162                           AD       ONESEK     +1                         
013638,000149: 22,3157           57703                           XCH      NEXTIME                               
013639,000150: 22,3160           13030                           TCF      INCRDCDU   -1                         
013640,000151: 
013641,000152: 22,3161           00000        ONESEK             DEC      0          B-14                       
013642,000153: 22,3162           00144                           DEC      100        B-14                       
013643,000154: 
013644,000155: 22,3163           75777        BIASCALE           OCT      75777                                 #  = -1/16
013645,000156: 
013646,000157: 22,3164           40025        CONTMANU           CS       TIME1                                 #  RESET FOR NEXT DCDU UPDATE
013647,000158: 22,3165           61703                           AD       NEXTIME                               
013648,000159: 22,3166           10000                           CCS      A                                     
013649,000160: 22,3167           65026                           AD       ONE                                   
013650,000161: 22,3170           13173                           TCF      MANUCALL                              
013651,000162: 22,3171           65010                           AD       NEGMAX                                
013652,000163: 22,3172           40000                           COM                                            
013653,000164: 22,3173           00004        MANUCALL           INHINT                                         #  CALL FOR NEXT UPDATE VIA WAITLIST
013654,000165: 22,3174           05252                           TC       WAITLIST                              
013655,000166: 22,3175  E6,1704                                  EBANK=   TTEMP                                 
013656,000167: 22,3175           03202 44066                     2CADR    UPDTCALL                              
013657,000168: 22,3177           33162                           CAF      ONESEK     +1                         #  INCREMENT TIME FOR NEXT UPDATE
013658,000169: 22,3200           27703                           ADS      NEXTIME                               
013659,000170: 22,3201           15225                           TCF      ENDOFJOB                              
013660,000171: 
013661,000172: 22,3202           37666        UPDTCALL           CAF      PRIO26                                #  SATELLITE PROGRAM TO CALL FOR UPDATE
013662,000173: 22,3203           05155                           TC       FINDVAC                               #  OF STEERING COMMANDS
013663,000174: 22,3204  E6,1704                                  EBANK=   TTEMP                                 
013664,000175: 22,3204           02777 44066                     2CADR    NEWDELHI                              
013665,000176: 
013666,000177: 22,3206           05331                           TC       TASKOVER                              
013667,000178: 
013668,000179:                                                                                                  #  ROUTINE FOR TERMINATING AUTOMATIC MANEUVERS
013669,000180: 
013670,000181: 22,3207           35030        MANUSTOP           CAF      ZERO                                  #  ZERO MANEUVER RATES
013671,000182: 22,3210           55637                           TS       DELDCDU2                              
013672,000183: 22,3211           55642                           TS       OMEGARD                               
013673,000184: 22,3212           55303                           TS       DELREROR                              
013674,000185: 22,3213           55636                           TS       DELDCDU1                              
013675,000186: 22,3214           55641                           TS       OMEGAQD                               
013676,000187: 22,3215           55302                           TS       DELQEROR                              
013677,000188: 22,3216           31210                           CA       CPSI                                  #  SET DESIRED GIMBAL ANGLES TO
013678,000189: 22,3217           55634                           TS       CDUZD                                 #  DESIRED FINAL GIMBAL ANGLES
013679,000190: 22,3220           31207                           CA       CTHETA                                
013680,000191: 22,3221           55633                           TS       CDUYD                                 
013681,000192: 22,3222           31206        ENDROLL            CA       CPHI                                  #  NO FINAL YAW
013682,000193: 22,3223           55632                           TS       CDUXD                                 
013683,000194: 22,3224           35030                           CAF      ZERO                                  
013684,000195: 22,3225           55640                           TS       OMEGAPD                               #  I.E. MANEUVER DID NOT GO THRU
013685,000196: 22,3226           55635                           TS       DELDCDU                               #  GIMBAL LOCK ORIGINALLY
013686,000197: 22,3227           55301                           TS       DELPEROR                              
013687,000198: 22,3230           31313        GOODMANU           CA       ATTPRIO                               #  RESTORE USERS PRIO
013688,000199: 22,3231           54063                           TS       NEWPRIO                               
013689,000200: 
013690,000201: 22,3232           35030                           CA       ZERO                                  #  ZERO ATTCADR
013691,000202: 22,3233           53312                           DXCH     ATTCADR                               
013692,000203: 
013693,000204: 22,3234           05166                           TC       SPVAC                                 #  RETURN TO USER
013694,000205: 
013695,000206: 22,3235           05331                           TC       TASKOVER                              
013696,000207: 
013697,000208: 

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