Source Code
These source-code files are part of a reconstructed copy of Comanche 72, the
first release of the Apollo Guidance Computer (AGC) Command Module (CM) software
for Apollo 13.
They have been adapted from sources files created from a listing of Comanche 55. These source files were updated to match binary dumps of a set of Comanche 67 rope modules. They were then further modified by applying known changes between Comanche 67 and Comanche 72. A binary dump of module B2 of Comanche 72, part number 2010802-021, was also used to validate changes made to banks 05-13. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments. Since no contemporary listings of Comanche 72 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. |
017528,000002: ## Copyright: Public domain.
017529,000003: ## Filename: KALCMANU_STEERING.agc
017530,000004: ## Purpose: A section of Comanche revision 072.
017531,000005: ## It is part of the reconstructed source code for the first
017532,000006: ## release of the software for the Command Module's (CM) Apollo
017533,000007: ## Guidance Computer (AGC) for Apollo 13. No original listings
017534,000008: ## of this program are available; instead, this file was recreated
017535,000009: ## from a printout of Comanche 055, binary dumps of a set of
017536,000010: ## Comanche 067 rope modules, and changelogs between Comanche 067
017537,000011: ## and 072. It has been adapted such that the resulting bugger words
017538,000012: ## exactly match those specified for Comanche 072 in NASA drawing
017539,000013: ## 2021153G, which gives relatively high confidence that the
017540,000014: ## reconstruction is correct.
017541,000015: ## Assembler: yaYUL
017542,000016: ## Contact: Ron Burkey <info@sandroid.org>.
017543,000017: ## Website: www.ibiblio.org/apollo/index.html
017544,000018: ## Mod history: 2024-05-13 MAS Created from Comanche 067.
017545,000019:
017546,000020: # GENERATION OF STEERING COMMANDS FOR DIGITAL AUTOPILOT FREE FALL MANEUVERS
017547,000021:
017548,000022: # NEW COMMANDS WILL BE GENERATED EVERY ONE SECOND DURING THE MANEUVER
017549,000023:
017550,000024: 15,2000 BANK 15
017551,000025:
017552,000026: 22,2000 SETLOC KALCMON1
017553,000027: 22,2000 BANK
017554,000028:
017555,000029: 22,3026 E6,1661 EBANK= BCDU
017556,000030:
017557,000031: 22,3026 COUNT 22/KALC
017558,000032:
017559,000033: 22,3026 41332 NEWDELHI CS HOLDFLAG # SEE IF MANEUVER HAS BEEN INTERRUPTED
017560,000034: 22,3027 00006 EXTEND # BY ASTRONAUT
017561,000035: 22,3030 62726 BZMF NOGO -2 # IF SO, TERMINATE KALCMANU
017562,000036: 22,3031 06006 NEWANGL TC INTPRET
017563,000037: 22,3032 75160 AXC,1 AXC,2
017564,000038: 22,3033 03320 MIS # COMPUTE THE NEW MATRIX FROM S/C TO
017565,000039: 22,3034 03425 DEL # STABLE MEMBER AXES
017566,000040: 22,3035 77624 CALL
017567,000041: 22,3036 44304 MXM3
017568,000042: 22,3037 45575 VLOAD STADR
017569,000043: 22,3040 50442 STOVL MIS +12D # CALCULATE NEW DESIRED CDU ANGLES
017570,000044: 22,3041 77626 STADR
017571,000045: 22,3042 50450 STOVL MIS +6D
017572,000046: 22,3043 77626 STADR
017573,000047: 22,3044 74456 STORE MIS
017574,000048: 22,3045 45160 AXC,1 CALL
017575,000049: 22,3046 03320 MIS
017576,000050: 22,3047 44655 DCMTOCDU # PICK UP THE NEW CDU ANGLES FROM MATRIX
017577,000051: 22,3050 77634 RTB
017578,000052: 22,3051 45552 V1STO2S
017579,000053: 22,3052 03267 STORE NCDU # NEW CDU ANGLES
017580,000054: 22,3053 77414 BONCLR EXIT
017581,000055: 22,3054 01215 CALCMAN2
017582,000056: 22,3055 40065 MANUSTAT # TO START MANEUVER
017583,000057: 22,3056 35032 CAF TWO # +0 OTHERWISE
017584,000058: 22,3057 55664 INCRDCDU TS KSPNDX
017585,000059: 22,3060 60000 DOUBLE
017586,000060: 22,3061 55665 TS KDPNDX
017587,000061: 22,3062 51664 INDEX KSPNDX
017588,000062: 22,3063 31666 CA NCDU # NEW DESIRED CDU ANGLES
017589,000063: 22,3064 00006 EXTEND
017590,000064: 22,3065 51664 INDEX KSPNDX
017591,000065: 22,3066 21661 MSU BCDU # INITIAL S/C ANGLE OR PREVIOUS DESIRED
017592,000066: 22,3067 00006 EXTEND # CDU ANGLES
017593,000067: 22,3070 73002 MP QUADROT
017594,000068: 22,3071 51665 INDEX KDPNDX
017595,000069: 22,3072 53576 DXCH DELCDUX # ANGLE INCREMENTS TO BE ADDED TO
017596,000070: 22,3073 51664 INDEX KSPNDX # DCDU EVERY TENTH SEC
017597,000071: 22,3074 31666 CA NCDU # BY LEM DAP
017598,000072: 22,3075 51664 INDEX KSPNDX
017599,000073: 22,3076 57661 XCH BCDU
017600,000074: 22,3077 51665 INDEX KDPNDX
017601,000075: 22,3100 55646 TS CDUXD
017602,000076: 22,3101 11664 CCS KSPNDX
017603,000077: 22,3102 13057 TCF INCRDCDU # LOOP FOR THREE AXES
017604,000078:
017605,000079: 22,3103 00003 RELINT
017606,000080: # COMPARE PRESENT TIME WITH TIME TO TERMINATE MANEUVER
017607,000081:
017608,000082: 22,3104 03115 TMANUCHK TC TIMECHK
017609,000083: 22,3105 04715 TC POSTJUMP
017610,000084: 22,3106 40131 CADR CONTMANU
017611,000085:
017612,000086: 22,3107 35033 CAF ONE
017613,000087: 22,3110 05261 MANUSTAL TC WAITLIST
017614,000088: 22,3111 E6,1661 EBANK= BCDU
017615,000089: 22,3111 02012 42066 2CADR MANUSTOP
017616,000090:
017617,000091: 22,3113 00003 RELINT
017618,000092: 22,3114 15233 TCF ENDOFJOB
017619,000093:
017620,000094:
017621,000095: 22,3115 00006 TIMECHK EXTEND
017622,000096: 22,3116 40025 DCS TIME2
017623,000097: 22,3117 53673 DXCH TTEMP
017624,000098: 22,3120 00006 EXTEND
017625,000099: 22,3121 31717 DCA TM
017626,000100: 22,3122 21673 DAS TTEMP
017627,000101: 22,3123 11672 CCS TTEMP
017628,000102: 22,3124 00002 TC Q
017629,000103: 22,3125 13127 TCF +2
017630,000104: 22,3126 13137 TCF 2NDRETRN
017631,000105: 22,3127 11673 CCS TTEMP +1
017632,000106: 22,3130 00002 TC Q
017633,000107: 22,3131 13133 TCF MANUOFF
017634,000108: 22,3132 40000 COM
017635,000109: 22,3133 65055 MANUOFF AD 1SEC
017636,000110: 22,3134 00006 EXTEND
017637,000111: 22,3135 63137 BZMF 2NDRETRN
017638,000112: 22,3136 24002 INCR Q
017639,000113: 22,3137 24002 2NDRETRN INCR Q
017640,000114: 22,3140 24002 INCR Q
017641,000115: 22,3141 00002 TC Q
017642,000116:
017643,000117: 20,2000 SETLOC MANUSTUF
017644,000118: 20,2000 BANK
017645,000119: 20,2065 77776 MANUSTAT EXIT # INITIALIZATION ROUTINE
017646,000120: 20,2066 00006 EXTEND # FOR AUTOMATIC MANEUVERS
017647,000121: 20,2067 30025 DCA TIME2
017648,000122: 20,2070 21717 DAS TM # TM+T0 MANEUVER COMPLETION TIME
017649,000123: 20,2071 45055 CS 1SEC
017650,000124: 20,2072 54001 TS L
017651,000125: 20,2073 45035 CS ZERO
017652,000126: 20,2074 21717 DAS TM # (TM+T0)-1
017653,000127: 20,2075 00004 INHINT
017654,000128: 20,2076 45033 CS ONE # ENABLE AUTOPILOT TO PERFORM
017655,000129: 20,2077 55332 TS HOLDFLAG # AUTOMATIC MANEUVERS
017656,000130: 20,2100 41130 CS RATEINDX # SEE IF MANEUVERING AT HIGH RATE
017657,000131: 20,2101 66211 AD SIX
017658,000132: 20,2102 00006 EXTEND
017659,000133: 20,2103 62105 BZMF HIGHGAIN
017660,000134: 20,2104 12110 TCF +4
017661,000135: 20,2105 41501 HIGHGAIN CS RCSFLAGS # IF SO, SET HIGH RATE FLAG (BIT 15 OF
017662,000136: 20,2106 75015 MASK BIT15 # RCSFLAGS)
017663,000137: 20,2107 27501 ADS RCSFLAGS
017664,000138: 20,2110 53711 DXCH BRATE # X-AXIS MANEUVER RATE
017665,000139: 20,2111 53526 DXCH WBODY
017666,000140: 20,2112 53713 DXCH BRATE +2 # Y-AXIS MANEUVER RATE
017667,000141: 20,2113 53530 DXCH WBODY1
017668,000142: 20,2114 53715 DXCH BRATE +4 # Z-AXIS MANEUVER RATE
017669,000143: 20,2115 53532 DXCH WBODY2
017670,000144: 20,2116 31675 CA BIASTEMP +1 # INSERT ATTITUDE ERROR BIASES
017671,000145: 20,2117 55564 TS BIAS # INTO AUTOPILOT
017672,000146: 20,2120 31677 CA BIASTEMP +3
017673,000147: 20,2121 55565 TS BIAS1
017674,000148: 20,2122 31701 CA BIASTEMP +5
017675,000149: 20,2123 55566 TS BIAS2
017676,000150: 20,2124 30025 CA TIME1
017677,000151: 20,2125 65055 AD 1SEC
017678,000152: 20,2126 57671 XCH NEXTIME
017679,000153: 20,2127 04715 TC POSTJUMP
017680,000154: 20,2130 45056 CADR INCRDCDU -1
017681,000155:
017682,000156: 20,2131 00004 CONTMANU INHINT # CONTINUE WITH UPDATE PROCESS
017683,000157: 20,2132 40025 CS TIME1
017684,000158: 20,2133 61671 AD NEXTIME
017685,000159: 20,2134 10000 CCS A
017686,000160: 20,2135 65033 AD ONE
017687,000161: 20,2136 12141 TCF MANUCALL
017688,000162: 20,2137 65015 AD NEGMAX
017689,000163: 20,2140 40000 COM
017690,000164: 20,2141 05261 MANUCALL TC WAITLIST
017691,000165: 20,2142 E6,1661 EBANK= BCDU
017692,000166: 20,2142 02150 40066 2CADR UPDTCALL
017693,000167:
017694,000168: 20,2144 00003 RELINT
017695,000169: 20,2145 35055 CAF 1SEC # INCREMENT TIME FOR NEXT UPDATE
017696,000170: 20,2146 27671 ADS NEXTIME
017697,000171: 20,2147 15233 TCF ENDOFJOB
017698,000172:
017699,000173:
017700,000174: 20,2150 37663 UPDTCALL CAF PRIO26 # CALL FOR UPDATE
017701,000175: 20,2151 05163 TC FINDVAC # OF STEERING COMMANDS
017702,000176: 20,2152 E6,1661 EBANK= BCDU
017703,000177: 20,2152 03026 44066 2CADR NEWDELHI
017704,000178:
017705,000179: 20,2154 05340 TC TASKOVER
017706,000180:
017707,000181: # ROUTINE FOR TERMINATING AUTOMATIC MANEUVERS
017708,000182:
017709,000183: 21,2000 SETLOC KALCMON3
017710,000184: 21,2000 BANK
017711,000185:
017712,000186: 21,2012 04537 MANUSTOP TC STOPYZ
017713,000187: 21,2013 04754 TC IBNKCALL
017714,000188: 21,2014 45144 CADR LOADYZ
017715,000189:
017716,000190: 21,2015 31155 ENDROLL CA CPHI
017717,000191: 21,2016 55646 TS CDUXD # SET CDUXD TO THE COMMANDED OUTER GIMBAL
017718,000192: 21,2017 04526 TC STOPRATE
017719,000193: 21,2020 31327 ENDMANU CA ATTPRIO # RESTORE USERS PRIORITY
017720,000194: 21,2021 54063 TS NEWPRIO
017721,000195:
017722,000196: 21,2022 35035 CA ZERO # ZERO ATTCADR
017723,000197: 21,2023 53326 DXCH ATTCADR
017724,000198:
017725,000199: 21,2024 05174 TC SPVAC # RETURN TO USER OF GOMANUR
017726,000200:
017727,000201: 21,2025 05340 TC TASKOVER
017728,000202:
017729,000203: 4000 SETLOC STOPRAT
017730,000204: 4000 BANK
017731,000205: 4526 35035 STOPRATE CAF ZERO
017732,000206: 4527 55575 TS DELCDUX
017733,000207: 4530 55576 TS DELCDUX +1 # ZERO ROLL INCREMENTAL ANGLES
017734,000208: 4531 55525 TS WBODY # RATE
017735,000209: 4532 55526 TS WBODY +1
017736,000210: 4533 55564 TS BIAS # BIAS
017737,000211:
017738,000212: 4534 45015 CS BIT15 # MAKE SURE HIGH RATE FLAG (BIT 15 OF
017739,000213: 4535 71501 MASK RCSFLAGS # RCSFLAGS) IS RESET.
017740,000214: 4536 55501 TS RCSFLAGS
017741,000215:
017742,000216: 4537 35035 STOPYZ CAF ZERO
017743,000217: 4540 55577 TS DELCDUY # ZERO PITCH, YAW
017744,000218: 4541 55600 TS DELCDUY +1 # INCREMENTAL ANGLES
017745,000219: 4542 55601 TS DELCDUZ
017746,000220: 4543 55602 TS DELCDUZ +1
017747,000221: 4544 55527 TS WBODY1 # RATES
017748,000222: 4545 55530 TS WBODY1 +1
017749,000223: 4546 55531 TS WBODY2
017750,000224: 4547 55532 TS WBODY2 +1
017751,000225: 4550 55565 TS BIAS1 # BIASES
017752,000226: 4551 55566 TS BIAS2
017753,000227: 4552 00002 TC Q
017754,000228:
017755,000229: 20,2000 SETLOC MANUSTUF
017756,000230: 20,2000 BANK
017757,000231:
017758,000232: 20,2155 30032 ZEROEROR CA CDUX # PICK UP CDU ANGLES AND STORE IN
017759,000233: 20,2156 55646 TS CDUXD # CDU DESIRED
017760,000234: 20,2157 30033 CA CDUY
017761,000235: 20,2160 55650 TS CDUYD
017762,000236: 20,2161 30034 CA CDUZ
017763,000237: 20,2162 55652 TS CDUZD
017764,000238: 20,2163 00002 TC Q
017765,000239:
017766,000240: 22,2000 SETLOC KALCMON1
017767,000241: 22,2000 BANK
017768,000242:
017769,000243: 22,3142 31155 LOADCDUD CA CPHI # STORE TERMINAL ANGLES INTO
017770,000244: 22,3143 55646 TS CDUXD # COMMAND ANGLES
017771,000245: 22,3144 31156 LOADYZ CA CTHETA
017772,000246: 22,3145 55650 TS CDUYD
017773,000247: 22,3146 31157 CA CPSI
017774,000248: 22,3147 55652 TS CDUZD
017775,000249: 22,3150 00002 TC Q
End of include-file KALCMANU_STEERING.agc. Parent file is MAIN.agc