Source Code
These source-code files are part of a reconstructed copy of Comanche 72/3 (AKA Manche72 revision 3),
the final, flown mission release of the Apollo Guidance Computer (AGC) Command Module (CM) software
for Apollo 13.
The starting point was the source code of Comanche 72 (itself previously reconstructed). Comanche 72 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 72 and 72/3. 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/3 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. |
062130,000002: ## Copyright: Public domain.
062131,000003: ## Filename: ALARM_AND_ABORT.agc
062132,000004: ## Purpose: A section of Manche72 revision 3.
062133,000005: ## It is part of the reconstructed source code for the final, flown
062134,000006: ## release of the software for the Command Module's (CM) Apollo
062135,000007: ## Guidance Computer (AGC) for Apollo 13. No original listings
062136,000008: ## of this program are available; instead, this file was recreated
062137,000009: ## from a reconstructed copy of Comanche 072. It has been adapted
062138,000010: ## such that the resulting bugger words exactly match those
062139,000011: ## specified for Manche72 revision 3 in NASA drawing 2021153G,
062140,000012: ## which gives relatively high confidence that the reconstruction
062141,000013: ## is correct.
062142,000014: ## Assembler: yaYUL
062143,000015: ## Contact: Ron Burkey <info@sandroid.org>.
062144,000016: ## Website: www.ibiblio.org/apollo/index.html
062145,000017: ## Mod history: 2024-05-19 MAS Created from Comanche 072.
062146,000018:
062147,000019: # THE FOLLOWING SUBROUTINE MAY BE CALLED TO DISPLAY A NON-ABORTIVE ALARM CONDITION. IT MAY BE CALLED
062148,000020: # EITHER IN INTERRUPT OR UNDER EXECUTIVE CONTROL.
062149,000021:
062150,000022: # CALLING SEQUENCE IS AS FOLLOWS:
062151,000023: # TC ALARM
062152,000024: # OCT NNNNN
062153,000025: # (RETURNS HERE)
062154,000026:
062155,000027: 5664 BLOCK 02
062156,000028: 4000 SETLOC FFTAG7
062157,000029: 4000 BANK
062158,000030:
062159,000031: 5664 0374 EBANK= FAILREG
062160,000032:
062161,000033: 5664 COUNT 02/ALARM
062162,000034:
062163,000035: # ALARM TURNS ON THE PROGRAM ALARM LIGHT, BUT DOES NOT DISPLAY.
062164,000036:
062165,000037: 5664 00004 ALARM INHINT
062166,000038:
062167,000039: 5665 30002 CA Q
062168,000040: 5666 55363 ALARM2 TS ALMCADR
062169,000041: 5667 50002 INDEX Q
062170,000042: 5670 30000 CA 0
062171,000043: 5671 54001 BORTENT TS L
062172,000044:
062173,000045: 5672 30006 PRIOENT CA BBANK
062174,000046: 5673 00006 +1 EXTEND
062175,000047: 5674 04007 ROR SUPERBNK # ADD SUPER BITS.
062176,000048: 5675 55364 TS ALMCADR +1
062177,000049:
062178,000050: 5676 30002 LARMENT CA Q # STORE RETURN FOR ALARM
062179,000051: 5677 54061 TS ITEMP1
062180,000052:
062181,000053: 5700 30164 CA LOC
062182,000054: 5701 54057 TS LOCALARM
062183,000055: 5702 30165 CA BANKSET
062184,000056: 5703 54060 TS BANKALRM
062185,000057:
062186,000058: 5704 10374 CHKFAIL1 CCS FAILREG # IS ANYTHING IN FAILREG
062187,000059: 5705 15711 TCF CHKFAIL2 # YES TRY NEXT REG
062188,000060: 5706 30001 CA L
062189,000061: 5707 54374 TS FAILREG
062190,000062: 5710 15715 TCF PROGLARM # TURN ALARM LIGHT ON FOR FIRST ALARM
062191,000063:
062192,000064: 5711 10375 CHKFAIL2 CCS FAILREG +1
062193,000065: 5712 15715 TCF PROGLARM
062194,000066: 5713 30001 CA L
062195,000067: 5714 54375 TS FAILREG +1
062196,000068:
062197,000069: 5715 22376 PROGLARM LXCH FAILREG +2 # STORE AS "MOST RECENT" ALARM CODE
062198,000070:
062199,000071: 5716 41036 CS DSPTAB +11D # TURN ON PROGRAM ALARM IF OFF
062200,000072: 5717 77765 MASK OCT40400
062201,000073: 5720 27036 ADS DSPTAB +11D
062202,000074:
062203,000075: 5721 56061 MULTEXIT XCH ITEMP1 # OBTAIN RETURN ADDRESS IN A
062204,000076: 5722 00003 RELINT
062205,000077: 5723 50000 INDEX A
062206,000078: 5724 00001 TC 1
062207,000079:
062208,000080: # PRIOLARM DISPLAYS V05N09 VIA PRIODSPR WITH 3 RETURNS TO THE USER FROM THE ASTRONAUT AT CALL LOC +1,+2,+3 AND
062209,000081: # AN IMMEDIATE RETURN TO THE USER AT CALL LOC +4. EXAMPLE FOLLOWS,
062210,000082: # CAF OCTXX ALARM CODE
062211,000083: # TC BANKCALL
062212,000084: # CADR PRIOLARM
062213,000085:
062214,000086: # ... ...
062215,000087: # ... ...
062216,000088: # ... ... ASTRONAUT RETURN
062217,000089: # TC PHASCHNG IMMEDIATE RETURN TO USER. RESTART
062218,000090: # OCT X.1 PHASE CHANGE FOR PRIO DISPLAY
062219,000091:
062220,000092: 10,3766 BANK 10
062221,000093: 10,2000 SETLOC DISPLAYS
062222,000094: 10,2000 BANK
062223,000095:
062224,000096: 10,3766 COUNT 10/DSPLA
062225,000097: 10,3766 00004 PRIOLARM INHINT # * * * KEEP IN DISPLAY ROUTINES BANK
062226,000098: 10,3767 54001 TS L # SAVE ALARM CODE
062227,000099:
062228,000100: 10,3770 30133 CA BUF2 # 2 CADR OF PRIOLARM USER
062229,000101: 10,3771 55363 TS ALMCADR
062230,000102: 10,3772 30134 CA BUF2 +1
062231,000103: 10,3773 05673 TC PRIOENT +1 # * LEAVE L ALONE
062232,000104: 10,3774 77467 -2SEC DEC -200 B-14 # *** DONT MOVE
062233,000105: 10,3775 35064 CAF V05N09
062234,000106: 10,3776 12726 TCF PRIODSPR
062235,000107:
062236,000108:
062237,000109: 5725 BLOCK 02
062238,000110: 6000 SETLOC FFTAG13
062239,000111: 6000 BANK
062240,000112:
062241,000113: 7755 COUNT 02/ALARM
062242,000114:
062243,000115: 7755 00004 BAILOUT INHINT
062244,000116: 7756 30002 CA Q
062245,000117: 7757 55363 TS ALMCADR
062246,000118:
062247,000119: 7760 04676 TC BANKCALL
062248,000120: 7761 40000 CADR VAC5STOR
062249,000121:
062250,000122: 7762 51363 INDEX ALMCADR
062251,000123: 7763 30000 CAF 0
062252,000124: 7764 05671 TC BORTENT
062253,000125: 7765 40400 OCT40400 OCT 40400
062254,000126:
062255,000127: 7766 00004 INHINT
062256,000128: 7767 35032 WHIMPER CA TWO
062257,000129: 7770 60005 AD Z
062258,000130: 7771 54017 TS BRUPT
062259,000131: 7772 50017 RESUME
062260,000132: 7773 04715 TC POSTJUMP # RESUME SENDS CONTROL HERE
062261,000133: 7774 12651 CADR ENEMA
062262,000134:
062263,000135: 4000 SETLOC FFTAG7
062264,000136: 4000 BANK
062265,000137:
062266,000138: 5725 00004 POODOO INHINT
062267,000139: 5726 30002 CA Q
062268,000140: 5727 55363 TS ALMCADR
062269,000141:
062270,000142: 5730 04676 TC BANKCALL
062271,000143: 5731 40000 CADR VAC5STOR # STORE ERASABLES FOR DEBUGGING PURPOSES.
062272,000144:
062273,000145: 5732 51363 INDEX ALMCADR
062274,000146: 5733 30000 CAF 0
062275,000147: 5734 05671 ABORT2 TC BORTENT
062276,000148: 5735 77770 OCT77770 OCT 77770 # DONT MOVE
062277,000149: 5736 35026 CA V37FLBIT # IS AVERAGE G ON
062278,000150: 5737 70103 MASK FLAGWRD7
062279,000151: 5740 10000 CCS A
062280,000152: 5741 07766 TC WHIMPER -1 # YES. DONT DO POODOO. DO BAILOUT.
062281,000153:
062282,000154: 5742 05574 TC DOWNFLAG
062283,000155: 5743 00067 ADRES STATEFLG
062284,000156:
062285,000157: 5744 05574 TC DOWNFLAG
062286,000158:
062287,000159: 5745 00236 ADRES REINTFLG
062288,000160:
062289,000161: 5746 05574 TC DOWNFLAG
062290,000162: 5747 00054 ADRES NODOFLAG
062291,000163:
062292,000164: 5750 04676 TC BANKCALL
062293,000165: 5751 12501 CADR MR.KLEAN
062294,000166: 5752 07767 TC WHIMPER
062295,000167:
062296,000168: 5753 00004 CCSHOLE INHINT
062297,000169: 5754 30002 CA Q
062298,000170: 5755 55363 TS ALMCADR
062299,000171: 5756 04676 TC BANKCALL
062300,000172: 5757 40000 CADR VAC5STOR
062301,000173: 5760 35762 CA OCT21103
062302,000174: 5761 05734 TC ABORT2
062303,000175: 5762 21103 OCT21103 OCT 21103
062304,000176: 5763 00004 CURTAINS INHINT
062305,000177: 5764 30002 CA Q
062306,000178: 5765 05666 TC ALARM2
062307,000179: 5766 00217 OCT217 OCT 00217
062308,000180: 5767 01363 TC ALMCADR # RETURN TO USER
062309,000181:
062310,000182: 5770 5233 DOALARM EQUALS ENDOFJOB
062311,000183:
062312,000184: # CALLING SEQUENCE FOR VARALARM
062313,000185:
062314,000186: # CAF (ALARM)
062315,000187: # TC VARALARM
062316,000188:
062317,000189: # VARALARM TURNS ON PROGRAM ALARM LIGHT BUT DOES NOT DISPLAY
062318,000190:
062319,000191: 5770 00004 VARALARM INHINT
062320,000192:
062321,000193: 5771 54001 TS L # SAVE USERS ALARM CODE
062322,000194:
062323,000195: 5772 30002 CA Q # SAVE USERS Q
062324,000196: 5773 55363 TS ALMCADR
062325,000197:
062326,000198: 5774 05672 TC PRIOENT
062327,000199: 5775 00014 OCT14 OCT 14 # DONT MOVE
062328,000200:
062329,000201: 5776 01363 TC ALMCADR # RETURN TO USER
062330,000202:
062331,000203: 5777 7755 ABORT EQUALS BAILOUT # *** TEMPORARY UNTIL ABORT CALLS OUT
End of include-file ALARM_AND_ABORT.agc. Parent file is MAIN.agc