Source Code
These source-code files are part of a reconstructed copy of Comanche 45/2 (AKA Manche45 revision 2),
the final, flown mission release of the Apollo 10 Command Module (CM) Apollo Guidance
Computer (AGC) software. Comanche 45/2 was preceded by Comanche 44 and Comanche 45. The
reconstruction is believed to be exactly accurate, but in the absence of an actual Apollo-era
listing of Comanche 45/2, some explanation of the reconstruction process is needed
to insure confidence in that accuracy.
The starting point was the source code of Comanche 45 (itself previously accurately reconstructed). Comanche 45 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 45 and 45/2. The now-reconstructed Comanche 45/2 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 tend to match those in the Comanche 55, the most-similar revision of Comanche for which we have access to an actual non-reconstructed hardcopy; the source code would likely have different page numbers in a contemporary Comanche 45 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 44. Here's a guide to the Apollo documentation referenced in those annotations:
|
060034,000002: ## Copyright: Public domain.
060035,000003: ## Filename: RESTARTS_ROUTINE.agc
060036,000004: ## Purpose: A section of Manche45 revision 2.
060037,000005: ## It is part of the reconstructed source code for the
060038,000006: ## final, flown release of the flight software for the Command
060039,000007: ## Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
060040,000008: ## The code has been recreated from a copy of Comanche 055. It
060041,000009: ## has been adapted such that the resulting bugger words
060042,000010: ## exactly match those specified for Manche 45/2 in NASA drawing
060043,000011: ## 2021153D, which gives relatively high confidence that the
060044,000012: ## reconstruction is correct.
060045,000013: ## Assembler: yaYUL
060046,000014: ## Contact: Ron Burkey <info@sandroid.org>.
060047,000015: ## Website: www.ibiblio.org/apollo/index.html
060048,000016: ## Mod history: 2020-12-24 MAS Created from Comanche 45.
060049,000017:
Page 1414 |
060051,000019: 01,3520 BANK 01
060052,000020: 01,2000 SETLOC RESTART
060053,000021: 01,2000 BANK
060054,000022:
060055,000023: 01,3520 E3,1436 EBANK= PHSNAME1 # GOPROG MUST SWITCH TO THIS EBANK
060056,000024:
060057,000025: 01,3520 COUNT 01/RSROU
060058,000026:
060059,000027: 01,3520 30161 RESTARTS CA MPAC +5 # GET GROUP NUMBER -1
060060,000028: 01,3521 60000 DOUBLE # SAVE FOR INDEXING
060061,000029: 01,3522 54155 TS TEMP2G
060062,000030:
060063,000031: 01,3523 33762 CA PHS2CADR # SET UP EXIT IN CASE IT IS AN EVEN
060064,000032: 01,3524 54157 TS TEMPSWCH # TABLE PHASE
060065,000033:
060066,000034: 01,3525 33557 CA RTRNCADR # TO SAVE TIME ASSUME IT WILL GET NEXT
060067,000035: 01,3526 54707 TS GOLOC +2 # GROUP AFTER THIS
060068,000036:
060069,000037: 01,3527 30154 CA TEMPPHS
060070,000038: 01,3530 75051 MASK OCT1400
060071,000039: 01,3531 10000 CCS A # IS IT A VARIABLE OR TABLE RESTART
060072,000040: 01,3532 13543 TCF ITSAVAR # IT:S A VARIABLE RESTART
060073,000041:
060074,000042: 01,3533 10154 GETPART2 CCS TEMPPHS # IS IT AN X.1 RESTART
060075,000043: 01,3534 10000 CCS A
060076,000044: 01,3535 13643 TCF ITSATBL # NO, ITS A TABLE RESTART
060077,000045:
060078,000046: 01,3536 35066 CA PRIO14 # IT IS AN X.1 RESTART, THEREFORE START
060079,000047: 01,3537 05147 TC FINDVAC # THE DISPLAY RESTART JOB
060080,000048: 01,3540 E3,1400 EBANK= LST1
060081,000049: 01,3540 03261 20063 2CADR INITDSP
060082,000050:
060083,000051: 01,3542 03557 TC RTRNCADR # FINISHED WITH THIS GROUP, GET NEXT ONE
060084,000052:
060085,000053: 01,3543 75051 ITSAVAR MASK OCT1400 # IS IT TYPE B ?
060086,000054: 01,3544 10000 CCS A
060087,000055: 01,3545 13614 TCF ITSLIKEB # YES, IT IS TYPE B
060088,000056:
060089,000057: 01,3546 00006 EXTEND # STORE THE JOB (OR TASK) 2CADR FOR EXIT
060090,000058: 01,3547 50155 NDX TEMP2G
060091,000059: 01,3550 31437 DCA PHSNAME1
060092,000060: 01,3551 52706 DXCH GOLOC
060093,000061:
060094,000062: 01,3552 30154 CA TEMPPHS # SEE IF THIS IS A JOB, TASK, OR A LONGCAL
060095,000063: 01,3553 75023 MASK OCT7
060096,000064: 01,3554 67715 AD MINUS2
060097,000065: 01,3555 10000 CCS A
060098,000066: 01,3556 13726 TCF ITSLNGCL # ITS A LONGCALL
060099,000067:
Page 1415 |
060101,000069: 01,3557 04675 RTRNCADR TC SWRETURN # CANT GET HERE
060102,000070: 01,3560 13562 TCF ITSAWAIT
060103,000071:
060104,000072: 01,3561 13627 TCF ITSAJOB # ITS A JOB
060105,000073:
060106,000074: 01,3562 33766 ITSAWAIT CA WTLTCADR # SET UP WAITLIST CALL
060107,000075: 01,3563 54704 TS GOLOC -1
060108,000076:
060109,000077: 01,3564 50155 NDX TEMP2G # DIRECTLY STORED
060110,000078: 01,3565 31054 CA PHSPRDT1
060111,000079: 01,3566 10000 TIMETEST CCS A # IS IT AN IMMEDIATE RESTART
060112,000080: 01,3567 24000 INCR A # NO,
060113,000081: 01,3570 13573 TCF FINDTIME # FIND OUT WHEN IT SHOULD BEGIN
060114,000082:
060115,000083: 01,3571 15500 TCF ITSINDIR # STORED INDIRECTLY
060116,000084:
060117,000085: 01,3572 13612 TCF IMEDIATE # IT WANTS AN IMMEDIATE RESTART
060118,000086:
060119,000087: # ***** THIS MUST BE IN FIXED FIXED *****
060120,000088:
060121,000089: 5500 BLOCK 02
060122,000090: 4000 SETLOC FFTAG2
060123,000091: 4000 BANK
060124,000092:
060125,000093: 5500 COUNT 02/RSROU
060126,000094:
060127,000095: 5500 22706 ITSINDIR LXCH GOLOC +1 # GET THE CORRECT E BANK IN CASE THIS IS
060128,000096: 5501 22006 LXCH BB # SWITCHED ERRASIBLE
060129,000097:
060130,000098: 5502 50000 NDX A # GET THE TIME INDIRECTLY
060131,000099: 5503 30001 CA 1
060132,000100:
060133,000101: 5504 22006 LXCH BB # RESTORE THE BB AND GOLOC
060134,000102: 5505 22706 LXCH GOLOC +1
060135,000103:
060136,000104: 5506 13573 TCF FINDTIME # FIND OUT WHEN IT SHOULD BEGIN
060137,000105:
060138,000106: # ***** YOU MAY RETURN TO SWITCHED FIXED *****
060139,000107:
060140,000108: 01,3573 BANK 01
060141,000109: 01,2000 SETLOC RESTART
060142,000110: 01,2000 BANK
060143,000111:
060144,000112: 01,3573 COUNT 01/RSROU
060145,000113:
060146,000114: 01,3573 40000 FINDTIME COM # MAKE NEGITIVE SINCE IT WILL BE SUBTRACTD
060147,000115: 01,3574 54001 TS L # AND SAVE
060148,000116: 01,3575 50155 NDX TEMP2G
060149,000117: 01,3576 41053 CS TBASE1
060150,000118: 01,3577 00006 EXTEND
Page 1416 |
060152,000120: 01,3600 60025 SU TIME1
060153,000121: 01,3601 10000 CCS A
060154,000122: 01,3602 40000 COM
060155,000123: 01,3603 67700 AD OCT37776
060156,000124: 01,3604 65017 AD ONE
060157,000125: 01,3605 60001 AD L
060158,000126: 01,3606 10000 CCS A
060159,000127: 01,3607 35021 CA ZERO
060160,000128: 01,3610 13612 TCF +2
060161,000129: 01,3611 13612 TCF +1
060162,000130: 01,3612 65017 IMEDIATE AD ONE
060163,000131: 01,3613 00704 TC GOLOC -1
060164,000132: 01,3614 33557 ITSLIKEB CA RTRNCADR # TYPE B, SO STORE RETURN IN
060165,000133: 01,3615 54157 TS TEMPSWCH # TEMPSWCH IN CASE OF AN EVEN PHASE
060166,000134:
060167,000135: 01,3616 33763 CA PRT2CADR # SET UP EXIT TO GET TABLE PART OF THIS
060168,000136: 01,3617 54707 TS GOLOC +2 # VARIABLE TYPE OF PHASE
060169,000137:
060170,000138: 01,3620 30154 CA TEMPPHS # MAKE THE PHASE LOOK RIGHT FOR THE TABLE
060171,000139: 01,3621 76043 MASK OCT177 # PART OF THIS VARIABLE PHASE
060172,000140: 01,3622 54154 TS TEMPPHS
060173,000141:
060174,000142: 01,3623 00006 EXTEND
060175,000143: 01,3624 50155 NDX TEMP2G # OBTAIN THE JOB:S 2CADR
060176,000144: 01,3625 31437 DCA PHSNAME1
060177,000145: 01,3626 52706 DXCH GOLOC
060178,000146:
060179,000147: 01,3627 50155 ITSAJOB NDX TEMP2G # NOW ADD THE PRIORITY AND LET:S GO
060180,000148: 01,3630 31054 CA PHSPRDT1
060181,000149: 01,3631 54704 CHKNOVAC TS GOLOC -1 # SAVE PRIO UNTIL WE SEE IF ITS
060182,000150: 01,3632 00006 EXTEND # A FINDVAC OR A NOVAC
060183,000151: 01,3633 63637 BZMF ITSNOVAC
060184,000152:
060185,000153: 01,3634 33765 CAF FVACCADR # POSITIVE, SET UP FINDVAC CALL.
060186,000154: 01,3635 56704 XCH GOLOC -1 # PICK UP PRIO,
060187,000155: 01,3636 00704 TC GOLOC -1 # AND GO
060188,000156:
060189,000157: 01,3637 33767 ITSNOVAC CAF NOVACADR # NEGATIVE,
060190,000158: 01,3640 56704 XCH GOLOC -1 # SET UP NOVAC CALL,
060191,000159: 01,3641 40000 COM # CORRECT PRIO,
060192,000160: 01,3642 00704 TC GOLOC -1 # AND GO
060193,000161:
060194,000162: 01,3643 54020 ITSATBL TS CYR # FIND OUT IF THE PHASE IS ODD OR EVEN
060195,000163: 01,3644 10020 CCS CYR
060196,000164: 01,3645 13646 TCF +1 # IT:S EVEN
060197,000165: 01,3646 13744 TCF ITSEVEN
060198,000166:
060199,000167: 01,3647 33557 CA RTRNCADR # IN CASE THIS IS THE SECOND PART OF A
060200,000168: 01,3650 54707 TS GOLOC +2 # TYPE B RESTART, WE NEED PROPER EXIT
Page 1417 |
060202,000170: 01,3651 30154 CA TEMPPHS # SET UP POINTER FOR FINDING OUR PLACE IN
060203,000171: 01,3652 54021 TS SR # THE RESTART TABLES
060204,000172: 01,3653 60021 AD SR
060205,000173: 01,3654 50155 NDX TEMP2G
060206,000174: 01,3655 62001 AD SIZETAB +1
060207,000175: 01,3656 54156 TS POINTER
060208,000176:
060209,000177: 01,3657 00006 CONTBL2 EXTEND # FIND OUT WHAT:S IN THE TABLE
060210,000178: 01,3660 50156 NDX POINTER
060211,000179: 01,3661 32002 DCA CADRTAB # GET THE 2CADR
060212,000180:
060213,000181: 01,3662 22706 LXCH GOLOC +1 # STORE THE BB INFORMATION
060214,000182:
060215,000183: 01,3663 10000 CCS A # IS IT A JOB OR IS IT TIMED
060216,000184: 01,3664 24000 INCR A # POSITIVE, MUST BE A JOB
060217,000185: 01,3665 13740 TCF ITSAJOB2
060218,000186:
060219,000187: 01,3666 24000 INCR A # MUST BE EITHER A WAITLIST OR LONGCALL
060220,000188: 01,3667 54705 TS GOLOC # LET-S STORE THE CORRECT CADR
060221,000189:
060222,000190: 01,3670 33766 CA WTLTCADR # SET UP OUR EXIT TO WAITLIST
060223,000191: 01,3671 54704 TS GOLOC -1
060224,000192:
060225,000193: 01,3672 30706 CA GOLOC +1 # NOW FIND OUT IF IT IS A WAITLIST CALL
060226,000194: 01,3673 75006 MASK BIT10 # THIS SHOULD BE ONE IF WE HAVE -BB
060227,000195: 01,3674 10000 CCS A # FOR THAT MATTER SO SHOULD BE BITS 9,8,7,
060228,000196: # 6,5, AND LAST BUT NOT LEAST (PERHAPS NOT
060229,000197: # IN IMPORTANCE ANYWAY. BIT 4
060230,000198: 01,3675 13733 TCF ITSWTLST # IT IS A WAITLIST CALL
060231,000199:
060232,000200: 01,3676 50156 NDX POINTER # OBTAIN THE ORIGINAL DELTA T
060233,000201: 01,3677 32000 CA PRDTTAB # ADDRESS FOR THIS LONGCALL
060234,000202:
060235,000203: 01,3700 15507 TCF ITSLGCL1 # NOW GO GET THE DELTA TIME
060236,000204:
060237,000205: # ***** THIS MUST BE IN FIXED FIXED *****
060238,000206:
060239,000207: 5507 BLOCK 02
060240,000208: 4000 SETLOC FFTAG2
060241,000209: 4000 BANK
060242,000210:
060243,000211: 5507 COUNT 02/RSROU
060244,000212:
060245,000213: 5507 22706 ITSLGCL1 LXCH GOLOC +1 # OBTAIN THE CORRECT E BANK
060246,000214: 5510 22006 LXCH BB
060247,000215: 5511 22706 LXCH GOLOC +1 # AND PRESERVE OUR E AND F BANKS
060248,000216:
060249,000217: 5512 00006 EXTEND # GET THE DELTA TIME
060250,000218: 5513 50000 NDX A
060251,000219: 5514 30001 DCA 0
Page 1418 |
060253,000221: 5515 22706 LXCH GOLOC +1 # RESTORE OUR E AND F BANK
060254,000222: 5516 22006 LXCH BB # RESTORE THE TASKS E AND F BANKS
060255,000223: 5517 22706 LXCH GOLOC +1 # AND PRESERVE OUR L
060256,000224: 5520 13701 TCF ITSLGCL2 # NOW LET:S PROCESS THIS LONGCALL
060257,000225:
060258,000226: # ***** YOU MAY RETURN TO SWITCHED FIXED *****
060259,000227:
060260,000228: 01,3701 BANK 01
060261,000229: 01,2000 SETLOC RESTART
060262,000230: 01,2000 BANK
060263,000231:
060264,000232: 01,3701 COUNT 01/RSROU
060265,000233: 01,3701 53140 ITSLGCL2 DXCH LONGTIME
060266,000234:
060267,000235: 01,3702 00006 EXTEND # CALCULATE TIME LEFT
060268,000236: 01,3703 40025 DCS TIME2
060269,000237: 01,3704 21140 DAS LONGTIME
060270,000238: 01,3705 00006 EXTEND
060271,000239: 01,3706 31136 DCA LONGBASE
060272,000240: 01,3707 21140 DAS LONGTIME
060273,000241:
060274,000242: 01,3710 11137 CCS LONGTIME # FIND OUT HOW THIS SHOULD BE RESTARTED
060275,000243: 01,3711 13721 TCF LONGCLCL
060276,000244: 01,3712 13714 TCF +2
060277,000245: 01,3713 13607 TCF IMEDIATE -3
060278,000246: 01,3714 11140 CCS LONGTIME +1
060279,000247: 01,3715 13721 TCF LONGCLCL
060280,000248: 01,3716 13717 NOOP # CAN:T GET HERE *********
060281,000249: 01,3717 13607 TCF IMEDIATE -3
060282,000250: 01,3720 13612 TCF IMEDIATE
060283,000251:
060284,000252: 01,3721 33764 LONGCLCL CA LGCLCADR # WE WILL GO TO LONGCALL
060285,000253: 01,3722 54704 TS GOLOC -1
060286,000254:
060287,000255: 01,3723 00006 EXTEND # PREPARE OUR ENTRY TO LONGCALL
060288,000256: 01,3724 31140 DCA LONGTIME
060289,000257: 01,3725 00704 TC GOLOC -1
060290,000258:
060291,000259: 01,3726 33766 ITSLNGCL CA WTLTCADR # ASSUME IT WILL GO TO WAITLIST
060292,000260: 01,3727 54704 TS GOLOC -1
060293,000261:
060294,000262: 01,3730 50155 NDX TEMP2G
060295,000263: 01,3731 41054 CS PHSPRDT1 # GET THE DELTA T ADDRESS
060296,000264:
060297,000265: 01,3732 15507 TCF ITSLGCL1 # NOW GET THE DELTA TIME
060298,000266:
060299,000267: 01,3733 40706 ITSWTLST CS GOLOC +1 # CORRECT THE BBCON INFORMATION
060300,000268: 01,3734 54706 TS GOLOC +1
Page 1419 |
060302,000270: 01,3735 50156 NDX POINTER # GET THE DT AND FIND OUT IF IT WAS STORED
060303,000271: 01,3736 32000 CA PRDTTAB # DIRECTLY OR INDIRECTLY
060304,000272:
060305,000273: 01,3737 13566 TCF TIMETEST # FIND OUT HOW THE TIME IS STORED
060306,000274:
060307,000275: 01,3740 56705 ITSAJOB2 XCH GOLOC # STORE THE CADR
060308,000276:
060309,000277: 01,3741 50156 NDX POINTER # ADD THE PRIORITY AND LET:S GO
060310,000278: 01,3742 32000 CA PRDTTAB
060311,000279:
060312,000280: 01,3743 13631 TCF CHKNOVAC
060313,000281:
060314,000282: 01,3744 30157 ITSEVEN CA TEMPSWCH # SET UP FOR EITHER THE SECOND PART OF THE
060315,000283: 01,3745 54707 TS GOLOC +2 # TABLE, OR A RETURN FOR THE NEXT GROUP
060316,000284:
060317,000285: 01,3746 50155 NDX TEMP2G # SET UP POINTER FOR OUR LOCATION WITHIN
060318,000286: 01,3747 32000 CA SIZETAB # THE TABLE
060319,000287: 01,3750 60154 AD TEMPPHS # THIS MAY LOOK BAD BUT LET:S SEE YOU DO
060320,000288: 01,3751 60154 AD TEMPPHS # BETTER IN TIME OR NUMBERR OF LOCATIONS
060321,000289: 01,3752 60154 AD TEMPPHS
060322,000290: 01,3753 54156 TS POINTER
060323,000291:
060324,000292: 01,3754 13657 TCF CONTBL2 # NOW PROCESS WHAT IS IN THE TABLE
060325,000293:
060326,000294: 01,3755 36214 PHSPART2 CA THREE # SET THE POINTER FOR THE SECOND HALF OF
060327,000295: 01,3756 26156 ADS POINTER # THE TABLE
060328,000296:
060329,000297: 01,3757 33557 CA RTRNCADR # THIS WILL BE OUR LAST TIME THROUGH THE
060330,000298: 01,3760 54707 TS GOLOC +2 # EVEN TABLE, SO AFTER IT GET THE NEXT
060331,000299: # GROUP
060332,000300: 01,3761 13657 TCF CONTBL2 # SO LET:S GET THE SECOND ENTRY IN THE TBL
060333,000301:
060334,000302: 01,3762 0154 TEMPPHS EQUALS MPAC
060335,000303: 01,3762 0155 TEMP2G EQUALS MPAC +1
060336,000304: 01,3762 0156 POINTER EQUALS MPAC +2
060337,000305: 01,3762 0157 TEMPSWCH EQUALS MPAC +3
060338,000306: 01,3762 0705 GOLOC EQUALS VAC5 +20D
060339,000307: 01,3762 7715 MINUS2 EQUALS NEG2
060340,000308: 01,3762 6043 OCT177 EQUALS LOW7
060341,000309:
060342,000310: 01,3762 03755 PHS2CADR GENADR PHSPART2
060343,000311: 01,3763 03533 PRT2CADR GENADR GETPART2
060344,000312: 01,3764 05342 LGCLCADR GENADR LONGCALL
060345,000313: 01,3765 05147 FVACCADR GENADR FINDVAC
060346,000314: 01,3766 05245 WTLTCADR GENADR WAITLIST
060347,000315: 01,3767 05134 NOVACADR GENADR NOVAC
060348,000316:
060349,000317:
060350,000318:
060351,000319:
End of include-file RESTARTS_ROUTINE.agc. Parent file is MAIN.agc