Source Code
These source-code files were from the printout at the MIT Museum, with many thanks
to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing
it to us. The printout was digitally photographed by Paul Fjeld. A team of
volunteers transcribed the source code manually from these images or, where
appropriate, modified already-transcribed but similar source Colossus 249 (Apollo 9)
source code to agree with the images from the printout. Note that the page images
presented online are of reduced quality, and that higher-quality images
are available. Report any conversion errors or legibility
problems in page images to info@sandroid.org.
Notations on the program listing read, in part:GAP: ASSEMBLE REVISION 055 OF AGC PROGRAM COMANCHE BY NASA 2021113-051 10:28 APR. 1,1969Note that the date is the date of the printout, not the date of the program revision. |
061618,000002: ## Copyright: Public domain.
061619,000003: ## Filename: RESTARTS_ROUTINE.agc
061620,000004: ## Purpose: Part of the source code for Comanche, build 055. It
061621,000005: ## is part of the source code for the Command Module's
061622,000006: ## (CM) Apollo Guidance Computer (AGC), Apollo 11.
061623,000007: ## Assembler: yaYUL
061624,000008: ## Reference: pp. 1414-1419
061625,000009: ## Contact: Ron Burkey <info@sandroid.org>
061626,000010: ## Website: http://www.ibiblio.org/apollo.
061627,000011: ## Mod history: 2009-05-07 RSB Adapted from Colossus249 file of the same
061628,000012: ## name, and page images. Corrected various
061629,000013: ## typos in the transcription of program
061630,000014: ## comments, and these should be back-ported
061631,000015: ## to Colossus249.
061632,000016: ## 2010-08-28 JL Added missing comment character.
061633,000017: ## 2016-12-22 RSB Proofed comment text using octopus/ProoferComments
061634,000018: ## and corrected the errors found.
061635,000019: ## 2017-01-18 RSB Fixed comment-text errors noted while diff'ing
061636,000020: ## vs Colossus 249.
061637,000021: ## 2017-03-14 RSB Comment-text fixes noted in proofing Luminary 116.
061638,000022:
061639,000023: ## The contents of the "Comanche055" files, in general, are transcribed
061640,000024: ## from scanned documents.
061641,000025: ##
061642,000026: ## Assemble revision 055 of AGC program Comanche by NASA
061643,000027: ## 2021113-051. April 1, 1969.
061644,000028: ##
061645,000029: ## This AGC program shall also be referred to as Colossus 2A
061646,000030: ##
061647,000031: ## Prepared by
061648,000032: ## Massachusetts Institute of Technology
061649,000033: ## 75 Cambridge Parkway
061650,000034: ## Cambridge, Massachusetts
061651,000035: ##
061652,000036: ## under NASA contract NAS 9-4065.
061653,000037: ##
061654,000038: ## Refer directly to the online document mentioned above for further
061655,000039: ## information. Please report any errors to info@sandroid.org.
061656,000040:
Page 1414 |
061658,000042: 01,3520 BANK 01
061659,000043: 01,2000 SETLOC RESTART
061660,000044: 01,2000 BANK
061661,000045:
061662,000046: 01,3520 E3,1436 EBANK= PHSNAME1 # GOPROG MUST SWITCH TO THIS EBANK
061663,000047:
061664,000048: 01,3520 COUNT 01/RSROU
061665,000049:
061666,000050: 01,3520 30161 RESTARTS CA MPAC +5 # GET GROUP NUMBER -1
061667,000051: 01,3521 60000 DOUBLE # SAVE FOR INDEXING
061668,000052: 01,3522 54155 TS TEMP2G
061669,000053:
061670,000054: 01,3523 33762 CA PHS2CADR # SET UP EXIT IN CASE IT IS AN EVEN
061671,000055: 01,3524 54157 TS TEMPSWCH # TABLE PHASE
061672,000056:
061673,000057: 01,3525 33557 CA RTRNCADR # TO SAVE TIME ASSUME IT WILL GET NEXT
061674,000058: 01,3526 54707 TS GOLOC +2 # GROUP AFTER THIS
061675,000059:
061676,000060: 01,3527 30154 CA TEMPPHS
061677,000061: 01,3530 75051 MASK OCT1400
061678,000062: 01,3531 10000 CCS A # IS IT A VARIABLE OR TABLE RESTART
061679,000063: 01,3532 13543 TCF ITSAVAR # IT:S A VARIABLE RESTART
061680,000064:
061681,000065: 01,3533 10154 GETPART2 CCS TEMPPHS # IS IT AN X.1 RESTART
061682,000066: 01,3534 10000 CCS A
061683,000067: 01,3535 13643 TCF ITSATBL # NO, ITS A TABLE RESTART
061684,000068:
061685,000069: 01,3536 35066 CA PRIO14 # IT IS AN X.1 RESTART, THEREFORE START
061686,000070: 01,3537 05147 TC FINDVAC # THE DISPLAY RESTART JOB
061687,000071: 01,3540 E3,1400 EBANK= LST1
061688,000072: 01,3540 03261 20063 2CADR INITDSP
061689,000073:
061690,000074: 01,3542 03557 TC RTRNCADR # FINISHED WITH THIS GROUP, GET NEXT ONE
061691,000075:
061692,000076: 01,3543 75051 ITSAVAR MASK OCT1400 # IS IT TYPE B ?
061693,000077: 01,3544 10000 CCS A
061694,000078: 01,3545 13614 TCF ITSLIKEB # YES, IT IS TYPE B
061695,000079:
061696,000080: 01,3546 00006 EXTEND # STORE THE JOB (OR TASK) 2CADR FOR EXIT
061697,000081: 01,3547 50155 NDX TEMP2G
061698,000082: 01,3550 31437 DCA PHSNAME1
061699,000083: 01,3551 52706 DXCH GOLOC
061700,000084:
061701,000085: 01,3552 30154 CA TEMPPHS # SEE IF THIS IS A JOB, TASK, OR A LONGCAL
061702,000086: 01,3553 75023 MASK OCT7
061703,000087: 01,3554 67715 AD MINUS2
061704,000088: 01,3555 10000 CCS A
061705,000089: 01,3556 13726 TCF ITSLNGCL # ITS A LONGCALL
061706,000090:
Page 1415 |
061708,000092: 01,3557 04675 RTRNCADR TC SWRETURN # CANT GET HERE
061709,000093: 01,3560 13562 TCF ITSAWAIT
061710,000094:
061711,000095: 01,3561 13627 TCF ITSAJOB # ITS A JOB
061712,000096:
061713,000097: 01,3562 33766 ITSAWAIT CA WTLTCADR # SET UP WAITLIST CALL
061714,000098: 01,3563 54704 TS GOLOC -1
061715,000099:
061716,000100: 01,3564 50155 NDX TEMP2G # DIRECTLY STORED
061717,000101: 01,3565 31054 CA PHSPRDT1
061718,000102: 01,3566 10000 TIMETEST CCS A # IS IT AN IMMEDIATE RESTART
061719,000103: 01,3567 24000 INCR A # NO,
061720,000104: 01,3570 13573 TCF FINDTIME # FIND OUT WHEN IT SHOULD BEGIN
061721,000105:
061722,000106: 01,3571 15500 TCF ITSINDIR # STORED INDIRECTLY
061723,000107:
061724,000108: 01,3572 13612 TCF IMEDIATE # IT WANTS AN IMMEDIATE RESTART
061725,000109:
061726,000110: # ***** THIS MUST BE IN FIXED FIXED *****
061727,000111:
061728,000112: 5500 BLOCK 02
061729,000113: 4000 SETLOC FFTAG2
061730,000114: 4000 BANK
061731,000115:
061732,000116: 5500 COUNT 02/RSROU
061733,000117:
061734,000118: 5500 22706 ITSINDIR LXCH GOLOC +1 # GET THE CORRECT E BANK IN CASE THIS IS
061735,000119: 5501 22006 LXCH BB # SWITCHED ERRASIBLE
061736,000120:
061737,000121: 5502 50000 NDX A # GET THE TIME INDIRECTLY
061738,000122: 5503 30001 CA 1
061739,000123:
061740,000124: 5504 22006 LXCH BB # RESTORE THE BB AND GOLOC
061741,000125: 5505 22706 LXCH GOLOC +1
061742,000126:
061743,000127: 5506 13573 TCF FINDTIME # FIND OUT WHEN IT SHOULD BEGIN
061744,000128:
061745,000129: # ***** YOU MAY RETURN TO SWITCHED FIXED *****
061746,000130:
061747,000131: 01,3573 BANK 01
061748,000132: 01,2000 SETLOC RESTART
061749,000133: 01,2000 BANK
061750,000134:
061751,000135: 01,3573 COUNT 01/RSROU
061752,000136:
061753,000137: 01,3573 40000 FINDTIME COM # MAKE NEGITIVE SINCE IT WILL BE SUBTRACTD
061754,000138: 01,3574 54001 TS L # AND SAVE
061755,000139: 01,3575 50155 NDX TEMP2G
061756,000140: 01,3576 41053 CS TBASE1
061757,000141: 01,3577 00006 EXTEND
Page 1416 |
061759,000143: 01,3600 60025 SU TIME1
061760,000144: 01,3601 10000 CCS A
061761,000145: 01,3602 40000 COM
061762,000146: 01,3603 67700 AD OCT37776
061763,000147: 01,3604 65017 AD ONE
061764,000148: 01,3605 60001 AD L
061765,000149: 01,3606 10000 CCS A
061766,000150: 01,3607 35021 CA ZERO
061767,000151: 01,3610 13612 TCF +2
061768,000152: 01,3611 13612 TCF +1
061769,000153: 01,3612 65017 IMEDIATE AD ONE
061770,000154: 01,3613 00704 TC GOLOC -1
061771,000155: 01,3614 33557 ITSLIKEB CA RTRNCADR # TYPE B, SO STORE RETURN IN
061772,000156: 01,3615 54157 TS TEMPSWCH # TEMPSWCH IN CASE OF AN EVEN PHASE
061773,000157:
061774,000158: 01,3616 33763 CA PRT2CADR # SET UP EXIT TO GET TABLE PART OF THIS
061775,000159: 01,3617 54707 TS GOLOC +2 # VARIABLE TYPE OF PHASE
061776,000160:
061777,000161: 01,3620 30154 CA TEMPPHS # MAKE THE PHASE LOOK RIGHT FOR THE TABLE
061778,000162: 01,3621 76043 MASK OCT177 # PART OF THIS VARIABLE PHASE
061779,000163: 01,3622 54154 TS TEMPPHS
061780,000164:
061781,000165: 01,3623 00006 EXTEND
061782,000166: 01,3624 50155 NDX TEMP2G # OBTAIN THE JOB:S 2CADR
061783,000167: 01,3625 31437 DCA PHSNAME1
061784,000168: 01,3626 52706 DXCH GOLOC
061785,000169:
061786,000170: 01,3627 50155 ITSAJOB NDX TEMP2G # NOW ADD THE PRIORITY AND LET:S GO
061787,000171: 01,3630 31054 CA PHSPRDT1
061788,000172: 01,3631 54704 CHKNOVAC TS GOLOC -1 # SAVE PRIO UNTIL WE SEE IF ITS
061789,000173: 01,3632 00006 EXTEND # A FINDVAC OR A NOVAC
061790,000174: 01,3633 63637 BZMF ITSNOVAC
061791,000175:
061792,000176: 01,3634 33765 CAF FVACCADR # POSITIVE, SET UP FINDVAC CALL.
061793,000177: 01,3635 56704 XCH GOLOC -1 # PICK UP PRIO,
061794,000178: 01,3636 00704 TC GOLOC -1 # AND GO
061795,000179:
061796,000180: 01,3637 33767 ITSNOVAC CAF NOVACADR # NEGATIVE,
061797,000181: 01,3640 56704 XCH GOLOC -1 # SET UP NOVAC CALL,
061798,000182: 01,3641 40000 COM # CORRECT PRIO,
061799,000183: 01,3642 00704 TC GOLOC -1 # AND GO
061800,000184:
061801,000185: 01,3643 54020 ITSATBL TS CYR # FIND OUT IF THE PHASE IS ODD OR EVEN
061802,000186: 01,3644 10020 CCS CYR
061803,000187: 01,3645 13646 TCF +1 # IT:S EVEN
061804,000188: 01,3646 13744 TCF ITSEVEN
061805,000189:
061806,000190: 01,3647 33557 CA RTRNCADR # IN CASE THIS IS THE SECOND PART OF A
061807,000191: 01,3650 54707 TS GOLOC +2 # TYPE B RESTART, WE NEED PROPER EXIT
Page 1417 |
061809,000193: 01,3651 30154 CA TEMPPHS # SET UP POINTER FOR FINDING OUR PLACE IN
061810,000194: 01,3652 54021 TS SR # THE RESTART TABLES
061811,000195: 01,3653 60021 AD SR
061812,000196: 01,3654 50155 NDX TEMP2G
061813,000197: 01,3655 62001 AD SIZETAB +1
061814,000198: 01,3656 54156 TS POINTER
061815,000199:
061816,000200: 01,3657 00006 CONTBL2 EXTEND # FIND OUT WHAT:S IN THE TABLE
061817,000201: 01,3660 50156 NDX POINTER
061818,000202: 01,3661 32002 DCA CADRTAB # GET THE 2CADR
061819,000203:
061820,000204: 01,3662 22706 LXCH GOLOC +1 # STORE THE BB INFORMATION
061821,000205:
061822,000206: 01,3663 10000 CCS A # IS IT A JOB OR IS IT TIMED
061823,000207: 01,3664 24000 INCR A # POSITIVE, MUST BE A JOB
061824,000208: 01,3665 13740 TCF ITSAJOB2
061825,000209:
061826,000210: 01,3666 24000 INCR A # MUST BE EITHER A WAITLIST OR LONGCALL
061827,000211: 01,3667 54705 TS GOLOC # LET-S STORE THE CORRECT CADR
061828,000212:
061829,000213: 01,3670 33766 CA WTLTCADR # SET UP OUR EXIT TO WAITLIST
061830,000214: 01,3671 54704 TS GOLOC -1
061831,000215:
061832,000216: 01,3672 30706 CA GOLOC +1 # NOW FIND OUT IF IT IS A WAITLIST CALL
061833,000217: 01,3673 75006 MASK BIT10 # THIS SHOULD BE ONE IF WE HAVE -BB
061834,000218: 01,3674 10000 CCS A # FOR THAT MATTER SO SHOULD BE BITS 9,8,7,
061835,000219: # 6,5, AND LAST BUT NOT LEAST (PERHAPS NOT
061836,000220: # IN IMPORTANCE ANYWAY. BIT 4
061837,000221: 01,3675 13733 TCF ITSWTLST # IT IS A WAITLIST CALL
061838,000222:
061839,000223: 01,3676 50156 NDX POINTER # OBTAIN THE ORIGINAL DELTA T
061840,000224: 01,3677 32000 CA PRDTTAB # ADDRESS FOR THIS LONGCALL
061841,000225:
061842,000226: 01,3700 15507 TCF ITSLGCL1 # NOW GO GET THE DELTA TIME
061843,000227:
061844,000228: # ***** THIS MUST BE IN FIXED FIXED *****
061845,000229:
061846,000230: 5507 BLOCK 02
061847,000231: 4000 SETLOC FFTAG2
061848,000232: 4000 BANK
061849,000233:
061850,000234: 5507 COUNT 02/RSROU
061851,000235:
061852,000236: 5507 22706 ITSLGCL1 LXCH GOLOC +1 # OBTAIN THE CORRECT E BANK
061853,000237: 5510 22006 LXCH BB
061854,000238: 5511 22706 LXCH GOLOC +1 # AND PRESERVE OUR E AND F BANKS
061855,000239:
061856,000240: 5512 00006 EXTEND # GET THE DELTA TIME
061857,000241: 5513 50000 NDX A
061858,000242: 5514 30001 DCA 0
Page 1418 |
061860,000244: 5515 22706 LXCH GOLOC +1 # RESTORE OUR E AND F BANK
061861,000245: 5516 22006 LXCH BB # RESTORE THE TASKS E AND F BANKS
061862,000246: 5517 22706 LXCH GOLOC +1 # AND PRESERVE OUR L
061863,000247: 5520 13701 TCF ITSLGCL2 # NOW LET:S PROCESS THIS LONGCALL
061864,000248:
061865,000249: # ***** YOU MAY RETURN TO SWITCHED FIXED *****
061866,000250:
061867,000251: 01,3701 BANK 01
061868,000252: 01,2000 SETLOC RESTART
061869,000253: 01,2000 BANK
061870,000254:
061871,000255: 01,3701 COUNT 01/RSROU
061872,000256: 01,3701 53140 ITSLGCL2 DXCH LONGTIME
061873,000257:
061874,000258: 01,3702 00006 EXTEND # CALCULATE TIME LEFT
061875,000259: 01,3703 40025 DCS TIME2
061876,000260: 01,3704 21140 DAS LONGTIME
061877,000261: 01,3705 00006 EXTEND
061878,000262: 01,3706 31136 DCA LONGBASE
061879,000263: 01,3707 21140 DAS LONGTIME
061880,000264:
061881,000265: 01,3710 11137 CCS LONGTIME # FIND OUT HOW THIS SHOULD BE RESTARTED
061882,000266: 01,3711 13721 TCF LONGCLCL
061883,000267: 01,3712 13714 TCF +2
061884,000268: 01,3713 13607 TCF IMEDIATE -3
061885,000269: 01,3714 11140 CCS LONGTIME +1
061886,000270: 01,3715 13721 TCF LONGCLCL
061887,000271: 01,3716 13717 NOOP # CAN:T GET HERE *********
061888,000272: 01,3717 13607 TCF IMEDIATE -3
061889,000273: 01,3720 13612 TCF IMEDIATE
061890,000274:
061891,000275: 01,3721 33764 LONGCLCL CA LGCLCADR # WE WILL GO TO LONGCALL
061892,000276: 01,3722 54704 TS GOLOC -1
061893,000277:
061894,000278: 01,3723 00006 EXTEND # PREPARE OUR ENTRY TO LONGCALL
061895,000279: 01,3724 31140 DCA LONGTIME
061896,000280: 01,3725 00704 TC GOLOC -1
061897,000281:
061898,000282: 01,3726 33766 ITSLNGCL CA WTLTCADR # ASSUME IT WILL GO TO WAITLIST
061899,000283: 01,3727 54704 TS GOLOC -1
061900,000284:
061901,000285: 01,3730 50155 NDX TEMP2G
061902,000286: 01,3731 41054 CS PHSPRDT1 # GET THE DELTA T ADDRESS
061903,000287:
061904,000288: 01,3732 15507 TCF ITSLGCL1 # NOW GET THE DELTA TIME
061905,000289:
061906,000290: 01,3733 40706 ITSWTLST CS GOLOC +1 # CORRECT THE BBCON INFORMATION
061907,000291: 01,3734 54706 TS GOLOC +1
Page 1419 |
061909,000293: 01,3735 50156 NDX POINTER # GET THE DT AND FIND OUT IF IT WAS STORED
061910,000294: 01,3736 32000 CA PRDTTAB # DIRECTLY OR INDIRECTLY
061911,000295:
061912,000296: 01,3737 13566 TCF TIMETEST # FIND OUT HOW THE TIME IS STORED
061913,000297:
061914,000298: 01,3740 56705 ITSAJOB2 XCH GOLOC # STORE THE CADR
061915,000299:
061916,000300: 01,3741 50156 NDX POINTER # ADD THE PRIORITY AND LET:S GO
061917,000301: 01,3742 32000 CA PRDTTAB
061918,000302:
061919,000303: 01,3743 13631 TCF CHKNOVAC
061920,000304:
061921,000305: 01,3744 30157 ITSEVEN CA TEMPSWCH # SET UP FOR EITHER THE SECOND PART OF THE
061922,000306: 01,3745 54707 TS GOLOC +2 # TABLE, OR A RETURN FOR THE NEXT GROUP
061923,000307:
061924,000308: 01,3746 50155 NDX TEMP2G # SET UP POINTER FOR OUR LOCATION WITHIN
061925,000309: 01,3747 32000 CA SIZETAB # THE TABLE
061926,000310: 01,3750 60154 AD TEMPPHS # THIS MAY LOOK BAD BUT LET:S SEE YOU DO
061927,000311: 01,3751 60154 AD TEMPPHS # BETTER IN TIME OR NUMBERR OF LOCATIONS
061928,000312: 01,3752 60154 AD TEMPPHS
061929,000313: 01,3753 54156 TS POINTER
061930,000314:
061931,000315: 01,3754 13657 TCF CONTBL2 # NOW PROCESS WHAT IS IN THE TABLE
061932,000316:
061933,000317: 01,3755 36214 PHSPART2 CA THREE # SET THE POINTER FOR THE SECOND HALF OF
061934,000318: 01,3756 26156 ADS POINTER # THE TABLE
061935,000319:
061936,000320: 01,3757 33557 CA RTRNCADR # THIS WILL BE OUR LAST TIME THROUGH THE
061937,000321: 01,3760 54707 TS GOLOC +2 # EVEN TABLE, SO AFTER IT GET THE NEXT
061938,000322: # GROUP
061939,000323: 01,3761 13657 TCF CONTBL2 # SO LET:S GET THE SECOND ENTRY IN THE TBL
061940,000324:
061941,000325: 01,3762 0154 TEMPPHS EQUALS MPAC
061942,000326: 01,3762 0155 TEMP2G EQUALS MPAC +1
061943,000327: 01,3762 0156 POINTER EQUALS MPAC +2
061944,000328: 01,3762 0157 TEMPSWCH EQUALS MPAC +3
061945,000329: 01,3762 0705 GOLOC EQUALS VAC5 +20D
061946,000330: 01,3762 7715 MINUS2 EQUALS NEG2
061947,000331: 01,3762 6043 OCT177 EQUALS LOW7
061948,000332:
061949,000333: 01,3762 03755 PHS2CADR GENADR PHSPART2
061950,000334: 01,3763 03533 PRT2CADR GENADR GETPART2
061951,000335: 01,3764 05342 LGCLCADR GENADR LONGCALL
061952,000336: 01,3765 05147 FVACCADR GENADR FINDVAC
061953,000337: 01,3766 05245 WTLTCADR GENADR WAITLIST
061954,000338: 01,3767 05134 NOVACADR GENADR NOVAC
061955,000339:
061956,000340:
061957,000341:
061958,000342:
End of include-file RESTARTS_ROUTINE.agc. Parent file is MAIN.agc