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. |
063846,000002: ## Copyright: Public domain.
063847,000003: ## Filename: ALARM_AND_ABORT.agc
063848,000004: ## Purpose: A section of Comanche revision 044.
063849,000005: ## It is part of the reconstructed source code for the
063850,000006: ## original release of the flight software for the Command
063851,000007: ## Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
063852,000008: ## The code has been recreated from a copy of Comanche 055. It
063853,000009: ## has been adapted such that the resulting bugger words
063854,000010: ## exactly match those specified for Comanche 44 in NASA drawing
063855,000011: ## 2021153D, which gives relatively high confidence that the
063856,000012: ## reconstruction is correct.
063857,000013: ## Assembler: yaYUL
063858,000014: ## Contact: Ron Burkey <info@sandroid.org>.
063859,000015: ## Website: www.ibiblio.org/apollo/index.html
063860,000016: ## Mod history: 2020-12-03 MAS Created from Comanche 51. Removed clearing of
063861,000017: ## STATEFLG, REINTFLG, and NODOFLAG from POODOO.
063862,000018: ## 2020-12-08 RSB Added justifying annotation related to the change
063863,000019: ## mentioned above.
063864,000020: ## 2020-12-13 RSB Incorporated feedback about the annotations.
063865,000021:
Page 1493 |
063867,000023: # THE FOLLOWING SUBROUTINE MAY BE CALLED TO DISPLAY A NON-ABORTIVE ALARM CONDITION. IT MAY BE CALLED
063868,000024: # EITHER IN INTERRUPT OR UNDER EXECUTIVE CONTROL.
063869,000025:
063870,000026: # CALLING SEQUENCE IS AS FOLLOWS:
063871,000027: # TC ALARM
063872,000028: # OCT NNNNN
063873,000029: # (RETURNS HERE)
063874,000030:
063875,000031: 5650 BLOCK 02
063876,000032: 4000 SETLOC FFTAG7
063877,000033: 4000 BANK
063878,000034:
063879,000035: 5650 0375 EBANK= FAILREG
063880,000036:
063881,000037: 5650 COUNT 02/ALARM
063882,000038:
063883,000039: # ALARM TURNS ON THE PROGRAM ALARM LIGHT, BUT DOES NOT DISPLAY.
063884,000040:
063885,000041: 5650 00004 ALARM INHINT
063886,000042:
063887,000043: 5651 30002 CA Q
063888,000044: 5652 55363 ALARM2 TS ALMCADR
063889,000045: 5653 50002 INDEX Q
063890,000046: 5654 30000 CA 0
063891,000047: 5655 54001 BORTENT TS L
063892,000048:
063893,000049: 5656 30006 PRIOENT CA BBANK
063894,000050: 5657 00006 +1 EXTEND
063895,000051: 5660 04007 ROR SUPERBNK # ADD SUPER BITS.
063896,000052: 5661 55364 TS ALMCADR +1
063897,000053:
063898,000054: 5662 30002 LARMENT CA Q # STORE RETURN FOR ALARM
063899,000055: 5663 54061 TS ITEMP1
063900,000056:
063901,000057: 5664 30164 CA LOC
063902,000058: 5665 54057 TS LOCALARM
063903,000059: 5666 30165 CA BANKSET
063904,000060: 5667 54060 TS BANKALRM
063905,000061:
063906,000062: 5670 10375 CHKFAIL1 CCS FAILREG # IS ANYTHING IN FAILREG
063907,000063: 5671 15674 TCF CHKFAIL2 # YES TRY NEXT REG
063908,000064: 5672 22375 LXCH FAILREG
063909,000065: 5673 15706 TCF PROGLARM # TURN ALARM LIGHT ON FOR FIRST ALARM
063910,000066:
063911,000067: 5674 10376 CHKFAIL2 CCS FAILREG +1
063912,000068: 5675 15700 TCF FAIL3
063913,000069: 5676 22376 LXCH FAILREG +1
063914,000070: 5677 15711 TCF MULTEXIT
063915,000071:
063916,000072: 5700 30377 FAIL3 CA FAILREG +2
Page 1494 |
063918,000074: 5701 74777 MASK POSMAX
063919,000075: 5702 10000 CCS A
063920,000076: 5703 15715 TCF MULTFAIL
063921,000077: 5704 22377 LXCH FAILREG +2
063922,000078: 5705 15711 TCF MULTEXIT
063923,000079:
063924,000080: 5706 41036 PROGLARM CS DSPTAB +11D
063925,000081: 5707 77765 MASK OCT40400
063926,000082: 5710 27036 ADS DSPTAB +11D
063927,000083:
063928,000084: 5711 56061 MULTEXIT XCH ITEMP1 # OBTAIN RETURN ADDRESS IN A
063929,000085: 5712 00003 RELINT
063930,000086: 5713 50000 INDEX A
063931,000087: 5714 00001 TC 1
063932,000088:
063933,000089: 5715 30001 MULTFAIL CA L
063934,000090: 5716 65001 AD BIT15
063935,000091: 5717 54377 TS FAILREG +2
063936,000092:
063937,000093: 5720 15711 TCF MULTEXIT
063938,000094:
063939,000095: # PRIOLARM DISPLAYS V05N09 VIA PRIODSPR WITH 3 RETURNS TO THE USER FROM THE ASTRONAUT AT CALL LOC +1,+2,+3 AND
063940,000096: # AN IMMEDIATE RETURN TO THE USER AT CALL LOC +4. EXAMPLE FOLLOWS,
063941,000097: # CAF OCTXX ALARM CODE
063942,000098: # TC BANKCALL
063943,000099: # CADR PRIOLARM
063944,000100:
063945,000101: # ... ...
063946,000102: # ... ...
063947,000103: # ... ... ASTRONAUT RETURN
063948,000104: # TC PHASCHNG IMMEDIATE RETURN TO USER. RESTART
063949,000105: # OCT X.1 PHASE CHANGE FOR PRIO DISPLAY
063950,000106:
063951,000107: 10,3766 BANK 10
063952,000108: 10,2000 SETLOC DISPLAYS
063953,000109: 10,2000 BANK
063954,000110:
063955,000111: 10,3766 COUNT 10/DSPLA
063956,000112: 10,3766 00004 PRIOLARM INHINT # * * * KEEP IN DISPLAY ROUTINES BANK
063957,000113: 10,3767 54001 TS L # SAVE ALARM CODE
063958,000114:
063959,000115: 10,3770 30133 CA BUF2 # 2 CADR OF PRIOLARM USER
063960,000116: 10,3771 55363 TS ALMCADR
063961,000117: 10,3772 30134 CA BUF2 +1
063962,000118: 10,3773 05657 TC PRIOENT +1 # * LEAVE L ALONE
063963,000119: 10,3774 77467 -2SEC DEC -200 B-14 # *** DONT MOVE
063964,000120: 10,3775 35050 CAF V05N09
063965,000121: 10,3776 12726 TCF PRIODSPR
063966,000122:
Page 1495 |
063968,000124:
063969,000125: 5721 BLOCK 02
063970,000126: 6000 SETLOC FFTAG13
063971,000127: 6000 BANK
063972,000128:
063973,000129: 7755 COUNT 02/ALARM
063974,000130:
063975,000131: 7755 00004 BAILOUT INHINT
063976,000132: 7756 30002 CA Q
063977,000133: 7757 55363 TS ALMCADR
063978,000134:
063979,000135: 7760 04662 TC BANKCALL
063980,000136: 7761 40000 CADR VAC5STOR
063981,000137:
063982,000138: 7762 51363 INDEX ALMCADR
063983,000139: 7763 30000 CAF 0
063984,000140: 7764 05655 TC BORTENT
063985,000141: 7765 40400 OCT40400 OCT 40400
063986,000142:
063987,000143: 7766 00004 INHINT
063988,000144: 7767 35016 WHIMPER CA TWO
063989,000145: 7770 60005 AD Z
063990,000146: 7771 54017 TS BRUPT
063991,000147: 7772 50017 RESUME
063992,000148: 7773 04701 TC POSTJUMP # RESUME SENDS CONTROL HERE
063993,000149: 7774 12651 CADR ENEMA
063994,000150:
063995,000151: 4000 SETLOC FFTAG7
063996,000152: 4000 BANK
063997,000153:
063998,000154: 5721 00004 POODOO INHINT
063999,000155: 5722 30002 CA Q
064000,000156: 5723 55363 TS ALMCADR
064001,000157:
064002,000158: 5724 04662 TC BANKCALL
064003,000159: 5725 40000 CADR VAC5STOR # STORE ERASABLES FOR DEBUGGING PURPOSES.
064004,000160:
064005,000161: 5726 51363 INDEX ALMCADR
064006,000162: 5727 30000 CAF 0
064007,000163: 5730 05655 ABORT2 TC BORTENT
064008,000164: 5731 77770 OCT77770 OCT 77770 # DONT MOVE
064009,000165: 5732 35012 CA V37FLBIT # IS AVERAGE G ON
064010,000166: 5733 70103 MASK FLAGWRD7
064011,000167: 5734 10000 CCS A
064012,000168: 5735 07766 TC WHIMPER -1 # YES. DONT DO POODOO. DO BAILOUT.
064013,000169:
Reconstruction: At this point in COMANCHE 51, there's a sequence of
instructions which have been removed in COMANCHE 44, namely:TC DOWNFLAG ADRES STATEFLG TC DOWNFLAG ADRES REINTFLG TC DOWNFLAG ADRES NODOFLAGThis removal is justified by the document Programmed Guidance Equations for COLOSSUS 2, p. GENP-23, which indicates — via the change bars in the pseudocode Set bit 5(STATEFLG) of FLAGWRD3 = 0 Set bit 7(INTGRAB) of RASFLAG = 0 (i.e., FLGWRD10) Set bit 1(NODOV37) of FLAGWRD2 = 0in POODOO — that these instructions were added some time between COMANCHE 45/2 and COMANCHE 51. As far as the differences in naming between the assembly language and the pseudocode are concerned — i.e., REINTFLG vs INTGRAB and NODOFLAG vs NODOV37 — the ERASABLE ASSIGNMENTS log section of COMANCHE 55 defines REINTFLG as bit 7 of flagword 10 and NODOFLAG as bit 1 of flagword 2, so the differing names clearly refer to the identical flags. |
064039,000195:
Page 1496 |
064041,000197: 5736 04662 TC BANKCALL
064042,000198: 5737 12501 CADR MR.KLEAN
064043,000199: 5740 07767 TC WHIMPER
064044,000200:
064045,000201: 5741 00004 CCSHOLE INHINT
064046,000202: 5742 30002 CA Q
064047,000203: 5743 55363 TS ALMCADR
064048,000204: 5744 04662 TC BANKCALL
064049,000205: 5745 40000 CADR VAC5STOR
064050,000206: 5746 35750 CA OCT1103
064051,000207: 5747 05730 TC ABORT2
064052,000208: 5750 01103 OCT1103 OCT 1103
064053,000209: 5751 00004 CURTAINS INHINT
064054,000210: 5752 30002 CA Q
064055,000211: 5753 05652 TC ALARM2
064056,000212: 5754 00217 OCT217 OCT 00217
064057,000213: 5755 01363 TC ALMCADR # RETURN TO USER
064058,000214:
064059,000215: 5756 5217 DOALARM EQUALS ENDOFJOB
064060,000216:
064061,000217: # CALLING SEQUENCE FOR VARALARM
064062,000218:
064063,000219: # CAF (ALARM)
064064,000220: # TC VARALARM
064065,000221:
064066,000222: # VARALARM TURNS ON PROGRAM ALARM LIGHT BUT DOES NOT DISPLAY
064067,000223:
064068,000224: 5756 00004 VARALARM INHINT
064069,000225:
064070,000226: 5757 54001 TS L # SAVE USERS ALARM CODE
064071,000227:
064072,000228: 5760 30002 CA Q # SAVE USERS Q
064073,000229: 5761 55363 TS ALMCADR
064074,000230:
064075,000231: 5762 05656 TC PRIOENT
064076,000232: 5763 00014 OCT14 OCT 14 # DONT MOVE
064077,000233:
064078,000234: 5764 01363 TC ALMCADR # RETURN TO USER
064079,000235:
064080,000236: 5765 7755 ABORT EQUALS BAILOUT # *** TEMPORARY UNTIL ABORT CALLS OUT
End of include-file ALARM_AND_ABORT.agc. Parent file is MAIN.agc