Source Code

These source-code files were obtained by digitally photographing an Artemis 72 (Apollo 15-17 Command Module) program listing from a private collection and then modifying pre-existing Comanche 55 (Apollo 11) source files to incorporate changes. Photography was by Ron Burkey, and transcription was performed by a team of volunteers. Note that the page images presented online are of reduced quality, and that additional images may be 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 072 OF AGC PROGRAM ARTEMIS 
	BY NASA 2021114-011 11:40 FEB. 26, 1971
Note that the date is the date of the printout, not the date of the program revision.

018566,000002:                                                                                                  ## Copyright:   Public domain.
018567,000003:                                                                                                  ## Filename:    KALCMANU_STEERING.agc
018568,000004:                                                                                                  ## Purpose:     Part of the source code for Artemis (i.e., Colossus 3),
018569,000005:                                                                                                  ##              build 072.  This is for the Command Module's (CM) 
018570,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for 
018571,000007:                                                                                                  ##              Apollo 15-17.
018572,000008:                                                                                                  ## Assembler:   yaYUL
018573,000009:                                                                                                  ## Contact:     Sergio Navarro <sergionavarrog@gmail.com>
018574,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
018575,000011:                                                                                                  ## Page Scans:  www.ibiblio.org/apollo/ScansForConversion/Artemis072/
018576,000012:                                                                                                  ## Mod history: 2009-08-19 SN   Adapted from corresponding Comanche 055 file.
018577,000013:                                                                                                  ##              2009-09-04 JL   Fix typos.
018578,000014:                                                                                                  ##              2010-01-31 JL   Fixed build errors.
018579,000015:                                                                                                  ##              2010-02-20 RSB  Un-##'d this header.
018580,000016:                                                                                                  ##              2017-02-05 RSB  Proofed comment text by diff'ing vs Comanche 55
018581,000017:                                                                                                  ##                              and corrected errors found.
018582,000018: 

Page 418

018584,000020: 
018585,000021:                                                                                                  #  GENERATION OF STEERING COMMANDS FOR DIGITAL AUTOPILOT FREE FALL MANEUVERS
018586,000022: 
018587,000023:                                                                                                  #  NEW COMMANDS WILL BE GENERATED EVERY ONE SECOND DURING THE MANEUVER
018588,000024: 
018589,000025: 22,2000                                           SETLOC   KALCMON1                              
018590,000026: 22,2000                                           BANK                                           
018591,000027: 
018592,000028: 22,3037  E6,1661                                  EBANK=   BCDU                                  
018593,000029: 
018594,000030: 22,3037                                           COUNT*   $$/KALC                               
018595,000031: 22,3037           34767        NEWDELHI           CAF      R67BIT                                
018596,000032: 22,3040           70104                           MASK     FLAGWRD8                              
018597,000033: 22,3041           00006                           EXTEND                                         
018598,000034: 22,3042           13047                           BZF      NEWANGL    -3                         #  NON-R67 SEQUENCE
018599,000035: 
018600,000036: 22,3043           34764                           CAF      TRACKBIT                              
018601,000037: 22,3044           70075                           MASK     FLAGWRD1                              
018602,000038: 22,3045           00006                           EXTEND                                         #  CHECK TRACKFLAG
018603,000039: 22,3046           13161                           BZF      MYSTEND                               #  IF OFF DO MYSTEND
018604,000040: 
018605,000041: 22,3047           41340                 -3        CS       HOLDFLAG                              
018606,000042: 22,3050           00006                           EXTEND                                         #  CHECK HOLDFLAG
018607,000043: 22,3051           62720                           BZMF     NOGOM2                                #  IF POS, DO STOPRATE
018608,000044: 
018609,000045: 22,3052           06006        NEWANGL            TC       INTPRET                               
018610,000046: 22,3053           75160                 +1        AXC,1    AXC,2                                 
018611,000047: 22,3054           03320                                    MIS                                   #  COMPUTE THE NEW MATRIX FROM S/C TO
018612,000048: 22,3055           03425                                    DEL                                   #  STABLE MEMBER AXES
018613,000049: 22,3056           77624                           CALL                                           
018614,000050: 22,3057           44304                                    MXM3                                  
018615,000051: 22,3060           45575                           VLOAD    STADR                                 
018616,000052: 22,3061           50442                           STOVL    MIS        +12D                       #  CALCULATE NEW DESIRED CDU ANGLES
018617,000053: 22,3062           77626                           STADR                                          
018618,000054: 22,3063           50450                           STOVL    MIS        +6D                        
018619,000055: 22,3064           77626                           STADR                                          
018620,000056: 22,3065           74456                           STORE    MIS                                   
018621,000057: 22,3066           45160                           AXC,1    CALL                                  
018622,000058: 22,3067           03320                                    MIS                                   
018623,000059: 22,3070           44647                                    DCMTOCDU                              #  PICK UP THE NEW CDU ANGLES FROM MATRIX
018624,000060: 22,3071           77634                           RTB                                            
018625,000061: 22,3072           45644                                    V1STO2S                               
018626,000062: 22,3073           03267        NWNGL17D           STORE    NCDU                                  #  NEW CDU ANGLES (TAG IS USED BY EDIT)
018627,000063: 22,3074           77414                           BONCLR   EXIT                                  
018628,000064: 22,3075           01215                                    CALCMAN2                              
018629,000065: 22,3076           40064                                    MANUSTAT                              #  TO START MANEUVER
018630,000066: 22,3077           34767                 -1        CAF      TWO                                   #           +0 OTHERWISE
018631,000067: 22,3100           55664        INCRDCDU           TS       KSPNDX                                
018632,000068: 22,3101           60000                           DOUBLE                                         
018633,000069: 22,3102           55665                           TS       KDPNDX                                
018634,000070: 22,3103           51664                           INDEX    KSPNDX                                

Page 419

018636,000072: 22,3104           31666                           CA       NCDU                                  #  NEW DESIRED CDU ANGLES
018637,000073: 22,3105           00006                           EXTEND                                         
018638,000074: 22,3106           51664                           INDEX    KSPNDX                                
018639,000075: 22,3107           21661                           MSU      BCDU                                  #  INITIAL S/C ANGLE OR PREVIOUS DESIRED
018640,000076: 22,3110           00006                           EXTEND                                         #  CDU ANGLES
018641,000077: 22,3111           73013                           MP       QUADROT                               
018642,000078: 22,3112           51665                           INDEX    KDPNDX                                
018643,000079: 22,3113           53576                           DXCH     DELCDUX                               #  ANGLE INCREMENTS TO BE ADDED TO
018644,000080: 22,3114           51664                           INDEX    KSPNDX                                #  DCDU EVERY TENTH SEC
018645,000081: 22,3115           31666                           CA       NCDU                                  #  BY LEM DAP
018646,000082: 22,3116           51664                           INDEX    KSPNDX                                
018647,000083: 22,3117           57661                           XCH      BCDU                                  
018648,000084: 22,3120           51665                           INDEX    KDPNDX                                
018649,000085: 22,3121           55646                           TS       CDUXD                                 
018650,000086: 22,3122           11664                           CCS      KSPNDX                                
018651,000087: 22,3123           13100                           TCF      INCRDCDU                              #  LOOP FOR THREE AXES
018652,000088: 
018653,000089: 22,3124           00003                           RELINT                                         
018654,000090: 
018655,000091:                                                                                                  #  COMPARE PRESENT TIME WITH TIME TO TERMINATE MANEUVER
018656,000092: 
018657,000093: 22,3125           03135        TMANUCHK           TC       TIMECHK                               
018658,000094: 22,3126           04655                           TC       POSTJUMP                              
018659,000095: 22,3127           40143                           CADR     CONTMANU                              
018660,000096: 
018661,000097: 22,3130           34770                           CAF      ONE                                   
018662,000098: 22,3131           05233        MANUSTAL           TC       WAITLIST                              
018663,000099: 22,3132  E6,1661                                  EBANK=   BCDU                                  
018664,000100: 22,3132           02303 20066                     2CADR    MANUSTOP                              
018665,000101: 
018666,000102: 22,3134           15205                           TCF      ENDOFJOB                              
018667,000103: 
018668,000104: 
018669,000105: 22,3135           00006        TIMECHK            EXTEND                                         
018670,000106: 22,3136           40025                           DCS      TIME2                                 
018671,000107: 22,3137           53673                           DXCH     TTEMP                                 
018672,000108: 22,3140           00006                           EXTEND                                         
018673,000109: 22,3141           31717                           DCA      TM                                    
018674,000110: 22,3142           21673                           DAS      TTEMP                                 
018675,000111: 22,3143           11672                           CCS      TTEMP                                 
018676,000112: 22,3144           00002                           TC       Q                                     
018677,000113: 22,3145           13147                           TCF      +2                                    
018678,000114: 22,3146           13157                           TCF      2NDRETRN                              
018679,000115: 22,3147           11673                           CCS      TTEMP      +1                         
018680,000116: 22,3150           00002                           TC       Q                                     
018681,000117: 22,3151           13153                           TCF      MANUOFF                               
018682,000118: 22,3152           40000                           COM                                            
018683,000119: 22,3153           65016        MANUOFF            AD       1SEC                                  
018684,000120: 22,3154           00006                           EXTEND                                         
018685,000121: 22,3155           63157                           BZMF     2NDRETRN                              
018686,000122: 22,3156           24002                           INCR     Q                                     

Page 420

018688,000124: 22,3157           24002        2NDRETRN           INCR     Q                                     
018689,000125: 22,3160           16706                           TCF      Q+1                                   
018690,000126: 22,3161           04655        MYSTEND            TC       POSTJUMP                              
018691,000127: 22,3162           74416                           CADR     FIXDB                                 
018692,000128: 
018693,000129: 20,2000                                           SETLOC   MANUSTUF                              
018694,000130: 20,2000                                           BANK                                           
018695,000131: 
018696,000132: 20,2064                                           COUNT*   $$/KALC                               
018697,000133: 20,2064           77776        MANUSTAT           EXIT                                           #  INITIALIZATION ROUTINE FOR AUTO
018698,000134: 20,2065           34767                           CAF      R67BIT                                #                      MANEUVERS
018699,000135: 20,2066           70104                           MASK     FLAGWRD8                              
018700,000136: 20,2067           00006                           EXTEND                                         
018701,000137: 20,2070           12075                           BZF      +5                                    
018702,000138: 20,2071           00006                           EXTEND                                         #  R67 RUNNING
018703,000139: 20,2072           34750                           DCA      DPOSMAX                               
018704,000140: 20,2073           53717                           DXCH     TM                                    
018705,000141: 20,2074           12104                           TCF      TMDON                                 
018706,000142: 20,2075           00006                           EXTEND                                         #  NON-R67 PROGRAM
018707,000143: 20,2076           30025                           DCA      TIME2                                 
018708,000144: 20,2077           21717                           DAS      TM                                    #  TM+T0    MANEUVER COMPLETION TIME
018709,000145: 20,2100           45016                           CS       1SEC                                  
018710,000146: 20,2101           54001                           TS       L                                     
018711,000147: 20,2102           44772                           CS       ZERO                                  
018712,000148: 20,2103           21717                           DAS      TM                                    #  (TM+T0)-1
018713,000149: 20,2104           00004        TMDON              INHINT                                         
018714,000150: 20,2105           44770                           CS       ONE                                   #  ENABLE AUTOPILOT TO PERFORM
018715,000151: 20,2106           55340                           TS       HOLDFLAG                              #  AUTOMATIC MANEUVERS
018716,000152: 20,2107           40774                           CS       RATEINDX                              #  SEE IF MANEUVERING AT HIGH RATE
018717,000153: 20,2110           66211                           AD       SIX                                   
018718,000154: 20,2111           00006                           EXTEND                                         
018719,000155: 20,2112           62114                           BZMF     HIGHGAIN                              
018720,000156: 20,2113           12117                           TCF      +4                                    
018721,000157: 20,2114           41501        HIGHGAIN           CS       RCSFLAGS                              #  IF SO, SET HIGH RATE FLAG (BIT 15 OF
018722,000158: 20,2115           74752                           MASK     BIT15                                 #  RCSFLAGS)
018723,000159: 20,2116           27501                           ADS      RCSFLAGS                              
018724,000160: 20,2117           00006                           EXTEND                                         
018725,000161: 20,2120           31711                           DCA      BRATE                                 #  X-AXIS MANEUVER RATE
018726,000162: 20,2121           53526                           DXCH     WBODY                                 
018727,000163: 20,2122           00006                           EXTEND                                         
018728,000164: 20,2123           31713                           DCA      BRATE      +2                         #  Y-AXIS MANEUVER RATE
018729,000165: 20,2124           53530                           DXCH     WBODY1                                
018730,000166: 20,2125           00006                           EXTEND                                         
018731,000167: 20,2126           31715                           DCA      BRATE      +4                         #  Z-AXIS MANEUVER RATE
018732,000168: 20,2127           53532                           DXCH     WBODY2                                
018733,000169: 20,2130           31675                           CA       BIASTEMP   +1                         #  INSERT ATTITUDE ERROR BIASES
018734,000170: 20,2131           55564                           TS       BIAS                                  #  INTO AUTOPILOT
018735,000171: 20,2132           31677                           CA       BIASTEMP   +3                         
018736,000172: 20,2133           55565                           TS       BIAS1                                 
018737,000173: 20,2134           31701                           CA       BIASTEMP   +5                         

Page 421

018739,000175: 20,2135           55566                           TS       BIAS2                                 
018740,000176: 20,2136           30025                           CA       TIME1                                 
018741,000177: 20,2137           65016                           AD       1SEC                                  
018742,000178: 20,2140           57671                           XCH      NEXTIME                               
018743,000179: 20,2141           04655                           TC       POSTJUMP                              
018744,000180: 20,2142           45077                           CADR     INCRDCDU   -1                         
018745,000181: 
018746,000182: 20,2143           00004        CONTMANU           INHINT                                         #  CONTINUE WITH UPDATE PROCESS
018747,000183: 20,2144           40025                           CS       TIME1                                 
018748,000184: 20,2145           61671                           AD       NEXTIME                               
018749,000185: 20,2146           10000                           CCS      A                                     
018750,000186: 20,2147           64770                           AD       ONE                                   
018751,000187: 20,2150           12153                           TCF      MANUCALL                              
018752,000188: 20,2151           64752                           AD       NEGMAX                                
018753,000189: 20,2152           40000                           COM                                            
018754,000190: 20,2153           05223        MANUCALL           TC       TWIDDLE                               
018755,000191: 20,2154           02161                           ADRES    UPDTCALL                              
018756,000192: 20,2155           00003                           RELINT                                         
018757,000193: 20,2156           35016                           CAF      1SEC                                  #  INCREMENT TIME FOR NEXT UPDATE
018758,000194: 20,2157           27671                           ADS      NEXTIME                               
018759,000195: 20,2160           15205                           TCF      ENDOFJOB                              
018760,000196: 
018761,000197: 20,2161           34767        UPDTCALL           CAF      R67BIT                                
018762,000198: 20,2162           70104                           MASK     FLAGWRD8                              
018763,000199: 20,2163           00006                           EXTEND                                         
018764,000200: 20,2164           12171                           BZF      +5                                    
018765,000201: 
018766,000202: 20,2165           11774                           CCS      R61CNTR                               
018767,000203: 20,2166           12170                           TCF      +2                                    
018768,000204: 20,2167           12176                           TCF      DOREMIS                               
018769,000205: 20,2170           55774                           TS       R61CNTR                               
018770,000206: 
018771,000207: 20,2171           37650                           CAF      PRIO26                                
018772,000208: 20,2172           05135                           TC       FINDVAC                               #  OF STEERING COMMANDS
018773,000209: 20,2173  E6,1661                                  EBANK=   BCDU                                  
018774,000210: 20,2173           03037 44066                     2CADR    NEWDELHI                              
018775,000211: 
018776,000212: 20,2175           05314                           TC       TASKOVER                              
018777,000213: 
018778,000214: 20,2176           37650        DOREMIS            CAF      PRIO26                                
018779,000215: 20,2177           05135                           TC       FINDVAC                               
018780,000216: 20,2200  E6,1661                                  EBANK=   BCDU                                  
018781,000217: 20,2200           02374 74066                     2CADR    R67RSTRT                              #  MAKE SURE MIS DOES DEGRADE
018782,000218: 
018783,000219: 20,2202           05314                           TC       TASKOVER                              
018784,000220: 

Page 422

018786,000222:                                                                                                  #  ROUTINE FOR TERMINATING AUTOMATIC MANEUVERS
018787,000223: 
018788,000224: 10,2000                                           SETLOC   KALCMON3                              
018789,000225: 10,2000                                           BANK                                           
018790,000226: 
018791,000227: 10,2303                                           COUNT*   $$/KALC                               
018792,000228: 10,2303           04474        MANUSTOP           TC       STOPYZ                                
018793,000229: 10,2304           04714                           TC       IBNKCALL                              
018794,000230: 10,2305           45165                           CADR     LOADYZ                                
018795,000231: 
018796,000232: 10,2306           31307        ENDROLL            CA       CPHI                                  
018797,000233: 10,2307           55646                           TS       CDUXD                                 #  SET CDUXD TO THE COMMANDED OUTER GIMBAL
018798,000234: 10,2310           04463                           TC       STOPRATE                              
018799,000235: 10,2311           35053        ENDMANU            CAF      PRIO14                                
018800,000236: 10,2312           05135                           TC       FINDVAC                               
018801,000237: 10,2313  E6,1774                                  EBANK=   R61CNTR                               
018802,000238: 10,2313           02141 56066                     2CADR    ENDMANUV                              
018803,000239: 
018804,000240: 10,2315           05314                           TC       TASKOVER                              
018805,000241: 
018806,000242:    4000                                           SETLOC   STOPRAT                               
018807,000243:    4000                                           BANK                                           
018808,000244:    4463                                           COUNT*   $$/KALC                               
018809,000245:    4463           34772        STOPRATE           CAF      ZERO                                  
018810,000246:    4464           55575                           TS       DELCDUX                               
018811,000247:    4465           55576                           TS       DELCDUX    +1                         #  ZERO ROLL INCREMENTAL ANGLES
018812,000248:    4466           55525                           TS       WBODY                                 #  RATE
018813,000249:    4467           55526                           TS       WBODY      +1                         
018814,000250:    4470           55564                           TS       BIAS                                  #  BIAS
018815,000251: 
018816,000252:    4471           44752                           CS       BIT15                                 #  MAKE SURE HIGH RATE FLAG (BIT 15 OF
018817,000253:    4472           71501                           MASK     RCSFLAGS                              #  RCSFLAGS) IS RESET.
018818,000254:    4473           55501                           TS       RCSFLAGS                              
018819,000255: 
018820,000256:    4474           34772        STOPYZ             CAF      ZERO                                  
018821,000257:    4475           55577                           TS       DELCDUY                               #  ZERO PITCH, YAW
018822,000258:    4476           55600                           TS       DELCDUY    +1                         #  INCREMENTAL ANGLES
018823,000259:    4477           55601                           TS       DELCDUZ                               
018824,000260:    4500           55602                           TS       DELCDUZ    +1                         
018825,000261:    4501           55527                           TS       WBODY1                                #  RATES
018826,000262:    4502           55530                           TS       WBODY1     +1                         
018827,000263:    4503           55531                           TS       WBODY2                                
018828,000264:    4504           55532                           TS       WBODY2     +1                         
018829,000265:    4505           55565                           TS       BIAS1                                 #  BIASES
018830,000266:    4506           55566                           TS       BIAS2                                 
018831,000267:    4507           00002                           TC       Q                                     
018832,000268: 
018833,000269: 20,2000                                           SETLOC   MANUSTUF                              
018834,000270: 20,2000                                           BANK                                           
018835,000271: 

Page 423

018837,000273: 20,2203                                           COUNT*   $$/KALC                               
018838,000274: 20,2203           30032        ZEROEROR           CA       CDUX                                  #  PICK UP CDU ANGLES AND STORE IN
018839,000275: 20,2204           55646                           TS       CDUXD                                 #  CDU DESIRED
018840,000276: 20,2205           30033                           CA       CDUY                                  
018841,000277: 20,2206           55650                           TS       CDUYD                                 
018842,000278: 20,2207           30034                           CA       CDUZ                                  
018843,000279: 20,2210           55652                           TS       CDUZD                                 
018844,000280: 20,2211           00002                           TC       Q                                     
018845,000281: 
018846,000282: 22,2000                                           SETLOC   KALCMON1                              
018847,000283: 22,2000                                           BANK                                           
018848,000284: 
018849,000285: 22,3163                                           COUNT*   $$/KALC                               
018850,000286: 22,3163           31307        LOADCDUD           CA       CPHI                                  #  STORE TERMINAL ANGLES INTO
018851,000287: 22,3164           55646                           TS       CDUXD                                 #  COMMAND ANGLES
018852,000288: 22,3165           31310        LOADYZ             CA       CTHETA                                
018853,000289: 22,3166           55650                           TS       CDUYD                                 
018854,000290: 22,3167           31311                           CA       CPSI                                  
018855,000291: 22,3170           55652                           TS       CDUZD                                 
018856,000292: 22,3171           00002                           TC       Q                                     

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