Source Code
These source-code files are part of a reconstructed copy of Comanche 44, the
initial release (though not the final mission release) of the Apollo 10
Command Module (CM) Apollo Guidance Computer (AGC) software. Subsequent releases
were Comanche 45 and Comanche 45/2 (the flown release on Apollo 10). The reconstruction
is believed to be exactly accurate, but in the absence of an actual Apollo-era
listing of Comanche 44, some explanation of the reconstruction process is needed
to insure confidence in that accuracy.
The starting point was the source code of Comanche 51 (separately previously reconstructed from an Apollo-era listing of Comanche 55, flown on Apollo 11). Comanche 51 source code was then modified by undoing changes known to have been made between revisions 44 and 51. The now-reconstructed Comanche 44 source code was verified by assembling it and checking that the assembled code had the expected known-correct memory-bank checksums. Note that page numbers in the reconstructed code match those on the Comanche 55 printout, although the source code would likely have different page numbers in a contemporary Comanche 44 listing. Annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change relative to Comanche 51. Here's a guide to the Apollo documentation referenced in those annotations:
Comments expected to have been present in 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. |
017929,000002: ## Copyright: Public domain.
017930,000003: ## Filename: KALCMANU_STEERING.agc
017931,000004: ## Purpose: A section of Comanche revision 044.
017932,000005: ## It is part of the reconstructed source code for the
017933,000006: ## original release of the flight software for the Command
017934,000007: ## Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
017935,000008: ## The code has been recreated from a copy of Comanche 055. It
017936,000009: ## has been adapted such that the resulting bugger words
017937,000010: ## exactly match those specified for Comanche 44 in NASA drawing
017938,000011: ## 2021153D, which gives relatively high confidence that the
017939,000012: ## reconstruction is correct.
017940,000013: ## Assembler: yaYUL
017941,000014: ## Contact: Ron Burkey <info@sandroid.org>.
017942,000015: ## Website: www.ibiblio.org/apollo/index.html
017943,000016: ## Mod history: 2020-12-03 MAS Created from Comanche 51.
017944,000017: ## 2021-05-30 ABS ZEROERROR -> ZEROEROR
017945,000018:
Page 414 |
017947,000020: # GENERATION OF STEERING COMMANDS FOR DIGITAL AUTOPILOT FREE FALL MANEUVERS
017948,000021:
017949,000022: # NEW COMMANDS WILL BE GENERATED EVERY ONE SECOND DURING THE MANEUVER
017950,000023:
017951,000024: 15,2000 BANK 15
017952,000025:
017953,000026: 22,2000 SETLOC KALCMON1
017954,000027: 22,2000 BANK
017955,000028:
017956,000029: 22,3026 E6,1661 EBANK= BCDU
017957,000030:
017958,000031: 22,3026 COUNT 22/KALC
017959,000032:
017960,000033: 22,3026 41332 NEWDELHI CS HOLDFLAG # SEE IF MANEUVER HAS BEEN INTERRUPTED
017961,000034: 22,3027 00006 EXTEND # BY ASTRONAUT
017962,000035: 22,3030 62726 BZMF NOGO -2 # IF SO, TERMINATE KALCMANU
017963,000036: 22,3031 06006 NEWANGL TC INTPRET
017964,000037: 22,3032 75160 AXC,1 AXC,2
017965,000038: 22,3033 03320 MIS # COMPUTE THE NEW MATRIX FROM S/C TO
017966,000039: 22,3034 03425 DEL # STABLE MEMBER AXES
017967,000040: 22,3035 77624 CALL
017968,000041: 22,3036 44304 MXM3
017969,000042: 22,3037 45575 VLOAD STADR
017970,000043: 22,3040 50442 STOVL MIS +12D # CALCULATE NEW DESIRED CDU ANGLES
017971,000044: 22,3041 77626 STADR
017972,000045: 22,3042 50450 STOVL MIS +6D
017973,000046: 22,3043 77626 STADR
017974,000047: 22,3044 74456 STORE MIS
017975,000048: 22,3045 45160 AXC,1 CALL
017976,000049: 22,3046 03320 MIS
017977,000050: 22,3047 44655 DCMTOCDU # PICK UP THE NEW CDU ANGLES FROM MATRIX
017978,000051: 22,3050 77634 RTB
017979,000052: 22,3051 45552 V1STO2S
017980,000053: 22,3052 03267 STORE NCDU # NEW CDU ANGLES
017981,000054: 22,3053 77414 BONCLR EXIT
017982,000055: 22,3054 01215 CALCMAN2
017983,000056: 22,3055 40065 MANUSTAT # TO START MANEUVER
017984,000057: 22,3056 35016 CAF TWO # +0 OTHERWISE
017985,000058: 22,3057 55664 INCRDCDU TS KSPNDX
017986,000059: 22,3060 60000 DOUBLE
017987,000060: 22,3061 55665 TS KDPNDX
017988,000061: 22,3062 51664 INDEX KSPNDX
017989,000062: 22,3063 31666 CA NCDU # NEW DESIRED CDU ANGLES
017990,000063: 22,3064 00006 EXTEND
017991,000064: 22,3065 51664 INDEX KSPNDX
017992,000065: 22,3066 21661 MSU BCDU # INITIAL S/C ANGLE OR PREVIOUS DESIRED
017993,000066: 22,3067 00006 EXTEND # CDU ANGLES
017994,000067: 22,3070 73002 MP QUADROT
017995,000068: 22,3071 51665 INDEX KDPNDX
017996,000069: 22,3072 53576 DXCH DELCDUX # ANGLE INCREMENTS TO BE ADDED TO
Page 415 |
017998,000071: 22,3073 51664 INDEX KSPNDX # DCDU EVERY TENTH SEC
017999,000072: 22,3074 31666 CA NCDU # BY LEM DAP
018000,000073: 22,3075 51664 INDEX KSPNDX
018001,000074: 22,3076 57661 XCH BCDU
018002,000075: 22,3077 51665 INDEX KDPNDX
018003,000076: 22,3100 55646 TS CDUXD
018004,000077: 22,3101 11664 CCS KSPNDX
018005,000078: 22,3102 13057 TCF INCRDCDU # LOOP FOR THREE AXES
018006,000079:
018007,000080: 22,3103 00003 RELINT
018008,000081: # COMPARE PRESENT TIME WITH TIME TO TERMINATE MANEUVER
018009,000082:
018010,000083: 22,3104 03115 TMANUCHK TC TIMECHK
018011,000084: 22,3105 04701 TC POSTJUMP
018012,000085: 22,3106 40131 CADR CONTMANU
018013,000086:
018014,000087: 22,3107 35017 CAF ONE
018015,000088: 22,3110 05245 MANUSTAL TC WAITLIST
018016,000089: 22,3111 E6,1661 EBANK= BCDU
018017,000090: 22,3111 02000 42066 2CADR MANUSTOP
018018,000091:
018019,000092: 22,3113 00003 RELINT
018020,000093: 22,3114 15217 TCF ENDOFJOB
018021,000094:
018022,000095:
018023,000096: 22,3115 00006 TIMECHK EXTEND
018024,000097: 22,3116 40025 DCS TIME2
018025,000098: 22,3117 53673 DXCH TTEMP
018026,000099: 22,3120 00006 EXTEND
018027,000100: 22,3121 31717 DCA TM
018028,000101: 22,3122 21673 DAS TTEMP
018029,000102: 22,3123 11672 CCS TTEMP
018030,000103: 22,3124 00002 TC Q
018031,000104: 22,3125 13127 TCF +2
018032,000105: 22,3126 13137 TCF 2NDRETRN
018033,000106: 22,3127 11673 CCS TTEMP +1
018034,000107: 22,3130 00002 TC Q
018035,000108: 22,3131 13133 TCF MANUOFF
018036,000109: 22,3132 40000 COM
018037,000110: 22,3133 65041 MANUOFF AD 1SEC
018038,000111: 22,3134 00006 EXTEND
018039,000112: 22,3135 63137 BZMF 2NDRETRN
018040,000113: 22,3136 24002 INCR Q
018041,000114: 22,3137 24002 2NDRETRN INCR Q
018042,000115: 22,3140 24002 INCR Q
018043,000116: 22,3141 00002 TC Q
018044,000117:
018045,000118: 20,2000 SETLOC MANUSTUF
018046,000119: 20,2000 BANK
Page 416 |
018048,000121: 20,2065 77776 MANUSTAT EXIT # INITIALIZATION ROUTINE
018049,000122: 20,2066 00006 EXTEND # FOR AUTOMATIC MANEUVERS
018050,000123: 20,2067 30025 DCA TIME2
018051,000124: 20,2070 21717 DAS TM # TM+T0 MANEUVER COMPLETION TIME
018052,000125: 20,2071 45041 CS 1SEC
018053,000126: 20,2072 54001 TS L
018054,000127: 20,2073 45021 CS ZERO
018055,000128: 20,2074 21717 DAS TM # (TM+T0)-1
018056,000129: 20,2075 00004 INHINT
018057,000130: 20,2076 45017 CS ONE # ENABLE AUTOPILOT TO PERFORM
018058,000131: 20,2077 55332 TS HOLDFLAG # AUTOMATIC MANEUVERS
018059,000132: 20,2100 41130 CS RATEINDX # SEE IF MANEUVERING AT HIGH RATE
018060,000133: 20,2101 66211 AD SIX
018061,000134: 20,2102 00006 EXTEND
018062,000135: 20,2103 62105 BZMF HIGHGAIN
018063,000136: 20,2104 12110 TCF +4
018064,000137: 20,2105 41501 HIGHGAIN CS RCSFLAGS # IF SO, SET HIGH RATE FLAG (BIT 15 OF
018065,000138: 20,2106 75001 MASK BIT15 # RCSFLAGS)
018066,000139: 20,2107 27501 ADS RCSFLAGS
018067,000140: 20,2110 53711 DXCH BRATE # X-AXIS MANEUVER RATE
018068,000141: 20,2111 53526 DXCH WBODY
018069,000142: 20,2112 53713 DXCH BRATE +2 # Y-AXIS MANEUVER RATE
018070,000143: 20,2113 53530 DXCH WBODY1
018071,000144: 20,2114 53715 DXCH BRATE +4 # Z-AXIS MANEUVER RATE
018072,000145: 20,2115 53532 DXCH WBODY2
018073,000146: 20,2116 31675 CA BIASTEMP +1 # INSERT ATTITUDE ERROR BIASES
018074,000147: 20,2117 55564 TS BIAS # INTO AUTOPILOT
018075,000148: 20,2120 31677 CA BIASTEMP +3
018076,000149: 20,2121 55565 TS BIAS1
018077,000150: 20,2122 31701 CA BIASTEMP +5
018078,000151: 20,2123 55566 TS BIAS2
018079,000152: 20,2124 30025 CA TIME1
018080,000153: 20,2125 65041 AD 1SEC
018081,000154: 20,2126 57671 XCH NEXTIME
018082,000155: 20,2127 04701 TC POSTJUMP
018083,000156: 20,2130 45056 CADR INCRDCDU -1
018084,000157:
018085,000158: 20,2131 00004 CONTMANU INHINT # CONTINUE WITH UPDATE PROCESS
018086,000159: 20,2132 40025 CS TIME1
018087,000160: 20,2133 61671 AD NEXTIME
018088,000161: 20,2134 10000 CCS A
018089,000162: 20,2135 65017 AD ONE
018090,000163: 20,2136 12141 TCF MANUCALL
018091,000164: 20,2137 65001 AD NEGMAX
018092,000165: 20,2140 40000 COM
018093,000166: 20,2141 05245 MANUCALL TC WAITLIST
018094,000167: 20,2142 E6,1661 EBANK= BCDU
018095,000168: 20,2142 02150 40066 2CADR UPDTCALL
018096,000169:
018097,000170: 20,2144 00003 RELINT
Page 417 |
018099,000172: 20,2145 35041 CAF 1SEC # INCREMENT TIME FOR NEXT UPDATE
018100,000173: 20,2146 27671 ADS NEXTIME
018101,000174: 20,2147 15217 TCF ENDOFJOB
018102,000175:
018103,000176:
018104,000177: 20,2150 37663 UPDTCALL CAF PRIO26 # CALL FOR UPDATE
018105,000178: 20,2151 05147 TC FINDVAC # OF STEERING COMMANDS
018106,000179: 20,2152 E6,1661 EBANK= BCDU
018107,000180: 20,2152 03026 44066 2CADR NEWDELHI
018108,000181:
018109,000182: 20,2154 05324 TC TASKOVER
018110,000183:
Page 418 |
018112,000185: # ROUTINE FOR TERMINATING AUTOMATIC MANEUVERS
018113,000186:
018114,000187: 21,2000 SETLOC KALCMON3
018115,000188: 21,2000 BANK
018116,000189:
018117,000190: 21,2000 04537 MANUSTOP TC STOPYZ
018118,000191: 21,2001 04740 TC IBNKCALL
018119,000192: 21,2002 45144 CADR LOADYZ
018120,000193:
018121,000194: 21,2003 31155 ENDROLL CA CPHI
018122,000195: 21,2004 55646 TS CDUXD # SET CDUXD TO THE COMMANDED OUTER GIMBAL
018123,000196: 21,2005 04526 TC STOPRATE
018124,000197: 21,2006 31327 ENDMANU CA ATTPRIO # RESTORE USERS PRIORITY
018125,000198: 21,2007 54063 TS NEWPRIO
018126,000199:
018127,000200: 21,2010 35021 CA ZERO # ZERO ATTCADR
018128,000201: 21,2011 53326 DXCH ATTCADR
018129,000202:
018130,000203: 21,2012 05160 TC SPVAC # RETURN TO USER OF GOMANUR
018131,000204:
018132,000205: 21,2013 05324 TC TASKOVER
018133,000206:
018134,000207: 4000 SETLOC STOPRAT
018135,000208: 4000 BANK
018136,000209: 4526 35021 STOPRATE CAF ZERO
018137,000210: 4527 55575 TS DELCDUX
018138,000211: 4530 55576 TS DELCDUX +1 # ZERO ROLL INCREMENTAL ANGLES
018139,000212: 4531 55525 TS WBODY # RATE
018140,000213: 4532 55526 TS WBODY +1
018141,000214: 4533 55564 TS BIAS # BIAS
018142,000215:
018143,000216: 4534 45001 CS BIT15 # MAKE SURE HIGH RATE FLAG (BIT 15 OF
018144,000217: 4535 71501 MASK RCSFLAGS # RCSFLAGS) IS RESET.
018145,000218: 4536 55501 TS RCSFLAGS
018146,000219:
018147,000220: 4537 35021 STOPYZ CAF ZERO
018148,000221: 4540 55577 TS DELCDUY # ZERO PITCH, YAW
018149,000222: 4541 55600 TS DELCDUY +1 # INCREMENTAL ANGLES
018150,000223: 4542 55601 TS DELCDUZ
018151,000224: 4543 55602 TS DELCDUZ +1
018152,000225: 4544 55527 TS WBODY1 # RATES
018153,000226: 4545 55530 TS WBODY1 +1
018154,000227: 4546 55531 TS WBODY2
018155,000228: 4547 55532 TS WBODY2 +1
018156,000229: 4550 55565 TS BIAS1 # BIASES
018157,000230: 4551 55566 TS BIAS2
018158,000231: 4552 00002 TC Q
018159,000232:
018160,000233: 20,2000 SETLOC MANUSTUF
018161,000234: 20,2000 BANK
018162,000235:
Page 419 |
018164,000237: 20,2155 30032 ZEROEROR CA CDUX # PICK UP CDU ANGLES AND STORE IN
018165,000238: 20,2156 55646 TS CDUXD # CDU DESIRED
018166,000239: 20,2157 30033 CA CDUY
018167,000240: 20,2160 55650 TS CDUYD
018168,000241: 20,2161 30034 CA CDUZ
018169,000242: 20,2162 55652 TS CDUZD
018170,000243: 20,2163 00002 TC Q
018171,000244:
018172,000245: 22,2000 SETLOC KALCMON1
018173,000246: 22,2000 BANK
018174,000247:
018175,000248: 22,3142 31155 LOADCDUD CA CPHI # STORE TERMINAL ANGLES INTO
018176,000249: 22,3143 55646 TS CDUXD # COMMAND ANGLES
018177,000250: 22,3144 31156 LOADYZ CA CTHETA
018178,000251: 22,3145 55650 TS CDUYD
018179,000252: 22,3146 31157 CA CPSI
018180,000253: 22,3147 55652 TS CDUZD
018181,000254: 22,3150 00002 TC Q
End of include-file KALCMANU_STEERING.agc. Parent file is MAIN.agc