Source Code

These source-code files are part of a reconstructed copy of Artemis 071, the first release of the Apollo 15 through 17 Command Module (CM) Apollo Guidance Computer (AGC) software.

The reconstruction began with source code of Artemis 072 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes between the two versions. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021154-. Note that page numbers in the reconstructed code match those on the Artemis 072 printout, although the changed code would likely have changed page numbers for a real Artemis 071 listing.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

018480,000002:                                                                                                  ## Copyright:   Public domain.
018481,000003:                                                                                                  ## Filename:    KALCMANU_STEERING.agc
018482,000004:                                                                                                  ## Purpose:     A section of Artemis revision 071.
018483,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
018484,000006:                                                                                                  ##              release of the flight software for the Command Module's
018485,000007:                                                                                                  ##              (CM) Apollo Guidance Computer (AGC) for Apollo 15 through
018486,000008:                                                                                                  ##              17. The code has been recreated from a copy of Artemis 072.
018487,000009:                                                                                                  ##              It has been adapted such that the resulting bugger words
018488,000010:                                                                                                  ##              exactly match those specified for Artemis 071 in NASA
018489,000011:                                                                                                  ##              drawing 2021154-, which gives relatively high confidence
018490,000012:                                                                                                  ##              that the reconstruction is correct.
018491,000013:                                                                                                  ## Reference:   418
018492,000014:                                                                                                  ## Assembler:   yaYUL
018493,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
018494,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
018495,000017:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Artemis 072.
018496,000018: 

Page 418

018498,000020: 
018499,000021:                                                                                                  #  GENERATION OF STEERING COMMANDS FOR DIGITAL AUTOPILOT FREE FALL MANEUVERS
018500,000022: 
018501,000023:                                                                                                  #  NEW COMMANDS WILL BE GENERATED EVERY ONE SECOND DURING THE MANEUVER
018502,000024: 
018503,000025: 22,2000                                           SETLOC   KALCMON1                              
018504,000026: 22,2000                                           BANK                                           
018505,000027: 
018506,000028: 22,3037  E6,1661                                  EBANK=   BCDU                                  
018507,000029: 
018508,000030: 22,3037                                           COUNT*   $$/KALC                               
018509,000031: 22,3037           34767        NEWDELHI           CAF      R67BIT                                
018510,000032: 22,3040           70104                           MASK     FLAGWRD8                              
018511,000033: 22,3041           00006                           EXTEND                                         
018512,000034: 22,3042           13047                           BZF      NEWANGL    -3                         #  NON-R67 SEQUENCE
018513,000035: 
018514,000036: 22,3043           34764                           CAF      TRACKBIT                              
018515,000037: 22,3044           70075                           MASK     FLAGWRD1                              
018516,000038: 22,3045           00006                           EXTEND                                         #  CHECK TRACKFLAG
018517,000039: 22,3046           13161                           BZF      MYSTEND                               #  IF OFF DO MYSTEND
018518,000040: 
018519,000041: 22,3047           41340                 -3        CS       HOLDFLAG                              
018520,000042: 22,3050           00006                           EXTEND                                         #  CHECK HOLDFLAG
018521,000043: 22,3051           62720                           BZMF     NOGOM2                                #  IF POS, DO STOPRATE
018522,000044: 
018523,000045: 22,3052           06006        NEWANGL            TC       INTPRET                               
018524,000046: 22,3053           75160                 +1        AXC,1    AXC,2                                 
018525,000047: 22,3054           03320                                    MIS                                   #  COMPUTE THE NEW MATRIX FROM S/C TO
018526,000048: 22,3055           03425                                    DEL                                   #  STABLE MEMBER AXES
018527,000049: 22,3056           77624                           CALL                                           
018528,000050: 22,3057           44304                                    MXM3                                  
018529,000051: 22,3060           45575                           VLOAD    STADR                                 
018530,000052: 22,3061           50442                           STOVL    MIS        +12D                       #  CALCULATE NEW DESIRED CDU ANGLES
018531,000053: 22,3062           77626                           STADR                                          
018532,000054: 22,3063           50450                           STOVL    MIS        +6D                        
018533,000055: 22,3064           77626                           STADR                                          
018534,000056: 22,3065           74456                           STORE    MIS                                   
018535,000057: 22,3066           45160                           AXC,1    CALL                                  
018536,000058: 22,3067           03320                                    MIS                                   
018537,000059: 22,3070           44647                                    DCMTOCDU                              #  PICK UP THE NEW CDU ANGLES FROM MATRIX
018538,000060: 22,3071           77634                           RTB                                            
018539,000061: 22,3072           45644                                    V1STO2S                               
018540,000062: 22,3073           03267        NWNGL17D           STORE    NCDU                                  #  NEW CDU ANGLES (TAG IS USED BY EDIT)
018541,000063: 22,3074           77414                           BONCLR   EXIT                                  
018542,000064: 22,3075           01215                                    CALCMAN2                              
018543,000065: 22,3076           40064                                    MANUSTAT                              #  TO START MANEUVER
018544,000066: 22,3077           34767                 -1        CAF      TWO                                   #           +0 OTHERWISE
018545,000067: 22,3100           55664        INCRDCDU           TS       KSPNDX                                
018546,000068: 22,3101           60000                           DOUBLE                                         
018547,000069: 22,3102           55665                           TS       KDPNDX                                
018548,000070: 22,3103           51664                           INDEX    KSPNDX                                

Page 419

018550,000072: 22,3104           31666                           CA       NCDU                                  #  NEW DESIRED CDU ANGLES
018551,000073: 22,3105           00006                           EXTEND                                         
018552,000074: 22,3106           51664                           INDEX    KSPNDX                                
018553,000075: 22,3107           21661                           MSU      BCDU                                  #  INITIAL S/C ANGLE OR PREVIOUS DESIRED
018554,000076: 22,3110           00006                           EXTEND                                         #  CDU ANGLES
018555,000077: 22,3111           73013                           MP       QUADROT                               
018556,000078: 22,3112           51665                           INDEX    KDPNDX                                
018557,000079: 22,3113           53576                           DXCH     DELCDUX                               #  ANGLE INCREMENTS TO BE ADDED TO
018558,000080: 22,3114           51664                           INDEX    KSPNDX                                #  DCDU EVERY TENTH SEC
018559,000081: 22,3115           31666                           CA       NCDU                                  #  BY LEM DAP
018560,000082: 22,3116           51664                           INDEX    KSPNDX                                
018561,000083: 22,3117           57661                           XCH      BCDU                                  
018562,000084: 22,3120           51665                           INDEX    KDPNDX                                
018563,000085: 22,3121           55646                           TS       CDUXD                                 
018564,000086: 22,3122           11664                           CCS      KSPNDX                                
018565,000087: 22,3123           13100                           TCF      INCRDCDU                              #  LOOP FOR THREE AXES
018566,000088: 
018567,000089: 22,3124           00003                           RELINT                                         
018568,000090: 
018569,000091:                                                                                                  #  COMPARE PRESENT TIME WITH TIME TO TERMINATE MANEUVER
018570,000092: 
018571,000093: 22,3125           03135        TMANUCHK           TC       TIMECHK                               
018572,000094: 22,3126           04655                           TC       POSTJUMP                              
018573,000095: 22,3127           40143                           CADR     CONTMANU                              
018574,000096: 
018575,000097: 22,3130           34770                           CAF      ONE                                   
018576,000098: 22,3131           05233        MANUSTAL           TC       WAITLIST                              
018577,000099: 22,3132  E6,1661                                  EBANK=   BCDU                                  
018578,000100: 22,3132           02303 20066                     2CADR    MANUSTOP                              
018579,000101: 
018580,000102: 22,3134           15205                           TCF      ENDOFJOB                              
018581,000103: 
018582,000104: 
018583,000105: 22,3135           00006        TIMECHK            EXTEND                                         
018584,000106: 22,3136           40025                           DCS      TIME2                                 
018585,000107: 22,3137           53673                           DXCH     TTEMP                                 
018586,000108: 22,3140           00006                           EXTEND                                         
018587,000109: 22,3141           31717                           DCA      TM                                    
018588,000110: 22,3142           21673                           DAS      TTEMP                                 
018589,000111: 22,3143           11672                           CCS      TTEMP                                 
018590,000112: 22,3144           00002                           TC       Q                                     
018591,000113: 22,3145           13147                           TCF      +2                                    
018592,000114: 22,3146           13157                           TCF      2NDRETRN                              
018593,000115: 22,3147           11673                           CCS      TTEMP      +1                         
018594,000116: 22,3150           00002                           TC       Q                                     
018595,000117: 22,3151           13153                           TCF      MANUOFF                               
018596,000118: 22,3152           40000                           COM                                            
018597,000119: 22,3153           65016        MANUOFF            AD       1SEC                                  
018598,000120: 22,3154           00006                           EXTEND                                         
018599,000121: 22,3155           63157                           BZMF     2NDRETRN                              
018600,000122: 22,3156           24002                           INCR     Q                                     

Page 420

018602,000124: 22,3157           24002        2NDRETRN           INCR     Q                                     
018603,000125: 22,3160           16706                           TCF      Q+1                                   
018604,000126: 22,3161           04655        MYSTEND            TC       POSTJUMP                              
018605,000127: 22,3162           74416                           CADR     FIXDB                                 
018606,000128: 
018607,000129: 20,2000                                           SETLOC   MANUSTUF                              
018608,000130: 20,2000                                           BANK                                           
018609,000131: 
018610,000132: 20,2064                                           COUNT*   $$/KALC                               
018611,000133: 20,2064           77776        MANUSTAT           EXIT                                           #  INITIALIZATION ROUTINE FOR AUTO
018612,000134: 20,2065           34767                           CAF      R67BIT                                #                      MANEUVERS
018613,000135: 20,2066           70104                           MASK     FLAGWRD8                              
018614,000136: 20,2067           00006                           EXTEND                                         
018615,000137: 20,2070           12075                           BZF      +5                                    
018616,000138: 20,2071           00006                           EXTEND                                         #  R67 RUNNING
018617,000139: 20,2072           34750                           DCA      DPOSMAX                               
018618,000140: 20,2073           53717                           DXCH     TM                                    
018619,000141: 20,2074           12104                           TCF      TMDON                                 
018620,000142: 20,2075           00006                           EXTEND                                         #  NON-R67 PROGRAM
018621,000143: 20,2076           30025                           DCA      TIME2                                 
018622,000144: 20,2077           21717                           DAS      TM                                    #  TM+T0    MANEUVER COMPLETION TIME
018623,000145: 20,2100           45016                           CS       1SEC                                  
018624,000146: 20,2101           54001                           TS       L                                     
018625,000147: 20,2102           44772                           CS       ZERO                                  
018626,000148: 20,2103           21717                           DAS      TM                                    #  (TM+T0)-1
018627,000149: 20,2104           00004        TMDON              INHINT                                         
018628,000150: 20,2105           44770                           CS       ONE                                   #  ENABLE AUTOPILOT TO PERFORM
018629,000151: 20,2106           55340                           TS       HOLDFLAG                              #  AUTOMATIC MANEUVERS
018630,000152: 20,2107           40774                           CS       RATEINDX                              #  SEE IF MANEUVERING AT HIGH RATE
018631,000153: 20,2110           66211                           AD       SIX                                   
018632,000154: 20,2111           00006                           EXTEND                                         
018633,000155: 20,2112           62114                           BZMF     HIGHGAIN                              
018634,000156: 20,2113           12117                           TCF      +4                                    
018635,000157: 20,2114           41501        HIGHGAIN           CS       RCSFLAGS                              #  IF SO, SET HIGH RATE FLAG (BIT 15 OF
018636,000158: 20,2115           74752                           MASK     BIT15                                 #  RCSFLAGS)
018637,000159: 20,2116           27501                           ADS      RCSFLAGS                              
018638,000160: 20,2117           00006                           EXTEND                                         
018639,000161: 20,2120           31711                           DCA      BRATE                                 #  X-AXIS MANEUVER RATE
018640,000162: 20,2121           53526                           DXCH     WBODY                                 
018641,000163: 20,2122           00006                           EXTEND                                         
018642,000164: 20,2123           31713                           DCA      BRATE      +2                         #  Y-AXIS MANEUVER RATE
018643,000165: 20,2124           53530                           DXCH     WBODY1                                
018644,000166: 20,2125           00006                           EXTEND                                         
018645,000167: 20,2126           31715                           DCA      BRATE      +4                         #  Z-AXIS MANEUVER RATE
018646,000168: 20,2127           53532                           DXCH     WBODY2                                
018647,000169: 20,2130           31675                           CA       BIASTEMP   +1                         #  INSERT ATTITUDE ERROR BIASES
018648,000170: 20,2131           55564                           TS       BIAS                                  #  INTO AUTOPILOT
018649,000171: 20,2132           31677                           CA       BIASTEMP   +3                         
018650,000172: 20,2133           55565                           TS       BIAS1                                 
018651,000173: 20,2134           31701                           CA       BIASTEMP   +5                         

Page 421

018653,000175: 20,2135           55566                           TS       BIAS2                                 
018654,000176: 20,2136           30025                           CA       TIME1                                 
018655,000177: 20,2137           65016                           AD       1SEC                                  
018656,000178: 20,2140           57671                           XCH      NEXTIME                               
018657,000179: 20,2141           04655                           TC       POSTJUMP                              
018658,000180: 20,2142           45077                           CADR     INCRDCDU   -1                         
018659,000181: 
018660,000182: 20,2143           00004        CONTMANU           INHINT                                         #  CONTINUE WITH UPDATE PROCESS
018661,000183: 20,2144           40025                           CS       TIME1                                 
018662,000184: 20,2145           61671                           AD       NEXTIME                               
018663,000185: 20,2146           10000                           CCS      A                                     
018664,000186: 20,2147           64770                           AD       ONE                                   
018665,000187: 20,2150           12153                           TCF      MANUCALL                              
018666,000188: 20,2151           64752                           AD       NEGMAX                                
018667,000189: 20,2152           40000                           COM                                            
018668,000190: 20,2153           05223        MANUCALL           TC       TWIDDLE                               
018669,000191: 20,2154           02161                           ADRES    UPDTCALL                              
018670,000192: 20,2155           00003                           RELINT                                         
018671,000193: 20,2156           35016                           CAF      1SEC                                  #  INCREMENT TIME FOR NEXT UPDATE
018672,000194: 20,2157           27671                           ADS      NEXTIME                               
018673,000195: 20,2160           15205                           TCF      ENDOFJOB                              
018674,000196: 
018675,000197: 20,2161           34767        UPDTCALL           CAF      R67BIT                                
018676,000198: 20,2162           70104                           MASK     FLAGWRD8                              
018677,000199: 20,2163           00006                           EXTEND                                         
018678,000200: 20,2164           12171                           BZF      +5                                    
018679,000201: 
018680,000202: 20,2165           11774                           CCS      R61CNTR                               
018681,000203: 20,2166           12170                           TCF      +2                                    
018682,000204: 20,2167           12176                           TCF      DOREMIS                               
018683,000205: 20,2170           55774                           TS       R61CNTR                               
018684,000206: 
018685,000207: 20,2171           37650                           CAF      PRIO26                                
018686,000208: 20,2172           05135                           TC       FINDVAC                               #  OF STEERING COMMANDS
018687,000209: 20,2173  E6,1661                                  EBANK=   BCDU                                  
018688,000210: 20,2173           03037 44066                     2CADR    NEWDELHI                              
018689,000211: 
018690,000212: 20,2175           05314                           TC       TASKOVER                              
018691,000213: 
018692,000214: 20,2176           37650        DOREMIS            CAF      PRIO26                                
018693,000215: 20,2177           05135                           TC       FINDVAC                               
018694,000216: 20,2200  E6,1661                                  EBANK=   BCDU                                  
018695,000217: 20,2200           02374 74066                     2CADR    R67RSTRT                              #  MAKE SURE MIS DOES DEGRADE
018696,000218: 
018697,000219: 20,2202           05314                           TC       TASKOVER                              
018698,000220: 

Page 422

018700,000222:                                                                                                  #  ROUTINE FOR TERMINATING AUTOMATIC MANEUVERS
018701,000223: 
018702,000224: 10,2000                                           SETLOC   KALCMON3                              
018703,000225: 10,2000                                           BANK                                           
018704,000226: 
018705,000227: 10,2303                                           COUNT*   $$/KALC                               
018706,000228: 10,2303           04474        MANUSTOP           TC       STOPYZ                                
018707,000229: 10,2304           04714                           TC       IBNKCALL                              
018708,000230: 10,2305           45165                           CADR     LOADYZ                                
018709,000231: 
018710,000232: 10,2306           31307        ENDROLL            CA       CPHI                                  
018711,000233: 10,2307           55646                           TS       CDUXD                                 #  SET CDUXD TO THE COMMANDED OUTER GIMBAL
018712,000234: 10,2310           04463                           TC       STOPRATE                              
018713,000235: 10,2311           35053        ENDMANU            CAF      PRIO14                                
018714,000236: 10,2312           05135                           TC       FINDVAC                               
018715,000237: 10,2313  E6,1774                                  EBANK=   R61CNTR                               
018716,000238: 10,2313           02141 56066                     2CADR    ENDMANUV                              
018717,000239: 
018718,000240: 10,2315           05314                           TC       TASKOVER                              
018719,000241: 
018720,000242:    4000                                           SETLOC   STOPRAT                               
018721,000243:    4000                                           BANK                                           
018722,000244:    4463                                           COUNT*   $$/KALC                               
018723,000245:    4463           34772        STOPRATE           CAF      ZERO                                  
018724,000246:    4464           55575                           TS       DELCDUX                               
018725,000247:    4465           55576                           TS       DELCDUX    +1                         #  ZERO ROLL INCREMENTAL ANGLES
018726,000248:    4466           55525                           TS       WBODY                                 #  RATE
018727,000249:    4467           55526                           TS       WBODY      +1                         
018728,000250:    4470           55564                           TS       BIAS                                  #  BIAS
018729,000251: 
018730,000252:    4471           44752                           CS       BIT15                                 #  MAKE SURE HIGH RATE FLAG (BIT 15 OF
018731,000253:    4472           71501                           MASK     RCSFLAGS                              #  RCSFLAGS) IS RESET.
018732,000254:    4473           55501                           TS       RCSFLAGS                              
018733,000255: 
018734,000256:    4474           34772        STOPYZ             CAF      ZERO                                  
018735,000257:    4475           55577                           TS       DELCDUY                               #  ZERO PITCH, YAW
018736,000258:    4476           55600                           TS       DELCDUY    +1                         #  INCREMENTAL ANGLES
018737,000259:    4477           55601                           TS       DELCDUZ                               
018738,000260:    4500           55602                           TS       DELCDUZ    +1                         
018739,000261:    4501           55527                           TS       WBODY1                                #  RATES
018740,000262:    4502           55530                           TS       WBODY1     +1                         
018741,000263:    4503           55531                           TS       WBODY2                                
018742,000264:    4504           55532                           TS       WBODY2     +1                         
018743,000265:    4505           55565                           TS       BIAS1                                 #  BIASES
018744,000266:    4506           55566                           TS       BIAS2                                 
018745,000267:    4507           00002                           TC       Q                                     
018746,000268: 
018747,000269: 20,2000                                           SETLOC   MANUSTUF                              
018748,000270: 20,2000                                           BANK                                           
018749,000271: 

Page 423

018751,000273: 20,2203                                           COUNT*   $$/KALC                               
018752,000274: 20,2203           30032        ZEROEROR           CA       CDUX                                  #  PICK UP CDU ANGLES AND STORE IN
018753,000275: 20,2204           55646                           TS       CDUXD                                 #  CDU DESIRED
018754,000276: 20,2205           30033                           CA       CDUY                                  
018755,000277: 20,2206           55650                           TS       CDUYD                                 
018756,000278: 20,2207           30034                           CA       CDUZ                                  
018757,000279: 20,2210           55652                           TS       CDUZD                                 
018758,000280: 20,2211           00002                           TC       Q                                     
018759,000281: 
018760,000282: 22,2000                                           SETLOC   KALCMON1                              
018761,000283: 22,2000                                           BANK                                           
018762,000284: 
018763,000285: 22,3163                                           COUNT*   $$/KALC                               
018764,000286: 22,3163           31307        LOADCDUD           CA       CPHI                                  #  STORE TERMINAL ANGLES INTO
018765,000287: 22,3164           55646                           TS       CDUXD                                 #  COMMAND ANGLES
018766,000288: 22,3165           31310        LOADYZ             CA       CTHETA                                
018767,000289: 22,3166           55650                           TS       CDUYD                                 
018768,000290: 22,3167           31311                           CA       CPSI                                  
018769,000291: 22,3170           55652                           TS       CDUZD                                 
018770,000292: 22,3171           00002                           TC       Q                                     

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