Source Code
These source-code files are part of a reconstructed copy of Sundial E, the
final release of the Block II Command Module (CM) Apollo Guidance Computer
(AGC) system test software.
They have been created via disassembly of binary dumps of original core rope memory modules, part numbers 2003053-121, 2003053-151, and 2003972-211, belonging to the MIT Museum. Since only binary dumps (rather than listings) of Sundial 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. |
004789,000002: ## Copyright: Public domain.
004790,000003: ## Filename: WAITLIST.agc
004791,000004: ## Purpose: A section of Sundial E.
004792,000005: ## It is part of the reconstructed source code for the final
004793,000006: ## release of the Block II Command Module system test software. No
004794,000007: ## original listings of this program are available; instead, this
004795,000008: ## file was created via disassembly of dumps of Sundial core rope
004796,000009: ## modules and comparison with other AGC programs.
004797,000010: ## Assembler: yaYUL
004798,000011: ## Contact: Ron Burkey <info@sandroid.org>.
004799,000012: ## Website: www.ibiblio.org/apollo/index.html
004800,000013: ## Mod history: 2023-06-22 MAS Created from Aurora 12.
004801,000014: ## 2023-06-30 MAS Updated for Sundial E.
004802,000015:
004803,000016:
004804,000017: # GROUNDRULE....DELTA T SHOULD NOT EXCEED 12000 (= 2 MINUTES)
004805,000018:
004806,000019: 4451 SETLOC ENDEXECF
004807,000020:
004808,000021: 4451 E3,1400 EBANK= LST1 # TASK LISTS IN SWITCHED E BANK.
004809,000022:
004810,000023: 4451 56002 WAITLIST XCH Q # SAVE DELTA T IN Q AND RETURN IN
004811,000024: 4452 54065 TS WAITEXIT # WAITEXIT.
004812,000025: 4453 00006 EXTEND
004813,000026: 4454 50000 INDEX A
004814,000027: 4455 30001 DCA 0 # PICK UP 2CADR OF TASK.
004815,000028: 4456 54070 TS WAITADR # BBCON WILL REMAIN IN L.
004816,000029: 4457 34466 DLY2 CAF WAITBB # ENTRY FROM FIXDELAY AND VARDELAY.
004817,000030: 4460 56006 XCH BBANK
004818,000031: 4461 12566 TCF WAIT2
004819,000032:
004820,000033: # RETURN TO CALLER AFTER TASK INSERTION:
004821,000034:
004822,000035: 4462 30066 LVWTLIST CA WAITBANK
004823,000036: 4463 54006 TS BBANK
004824,000037: 4464 50065 INDEX WAITEXIT
004825,000038: 4465 00002 TC 2
004826,000039:
004827,000040: 4466 02003 WAITBB BBCON WAIT2
004828,000041:
004829,000042: # RETURN TO CALLER +2 AFTER WAITING DT SPECIFIED AT CALLER +1.
004830,000043:
004831,000044: 4467 50002 FIXDELAY INDEX Q # BOTH ROUTINES MUST BE CALLED UNDER
004832,000045: 4470 30000 CAF 0 # WAITLIST CONTROL AND TERMINATE THE TASK
004833,000046: 4471 24002 INCR Q # IN WHICH THEY WERE CALLED.
004834,000047:
004835,000048: # RETURN TO CALLER +1 AFTER WAITING THE DT AS ARRIVING IN A.
004836,000049:
004837,000050: 4472 56002 VARDELAY XCH Q # DT TO Q. TASK ADRES TO WAITADR.
004838,000051: 4473 54070 TS WAITADR
004839,000052: 4474 30006 CA BBANK # BBANK IS SAVED DURING DELAY.
004840,000053: 4475 54001 TS L
004841,000054: 4476 34501 CAF DELAYEX
004842,000055: 4477 54065 TS WAITEXIT # GO TO TASKOVER AFTER TASK ENTRY.
004843,000056: 4500 14457 TCF DLY2
004844,000057:
004845,000058: 4501 14503 DELAYEX TCF TASKOVER -2 # RETURNS TO TASKOVER
004846,000059:
004847,000060:
004848,000061: # ENDTASK MUST BE ENTERED IN FIXED-FIXED SO IT IS DISTINGUISHABLE BY ITS ADRES ALONE.
004849,000062:
004850,000063: 4502 73273 73774 ENDTASK -2CADR SVCT3
004851,000064:
004852,000065: 4504 14505 SVCT3 TCF TASKOVER
004853,000066:
004854,000067:
004855,000068: # BEGIN TASK INSERTION.
004856,000069:
004857,000070: 01,2566 SETLOC ENDEXECS
004858,000071:
004859,000072: 01,2566 54066 WAIT2 TS WAITBANK # BBANK OF CALLING PROGRAM.
004860,000073: 01,2567 40026 CS TIME3
004861,000074: 01,2570 62571 AD +1 # CCS A = + 1/4
004862,000075: 01,2571 10000 CCS A # TEST 1/4 - C(TIME3). IF POSITIVE,
004863,000076: # IT MEANS THAT TIME3 OVERFLOW HAS OCCURRED PRIOR TO CS TIME3 AND THAT
004864,000077: # C(TIME3) = T - T1, INSTEAD OF 1.0 - (T1 - T). THE FOLLOWING FOUR
004865,000078: # ORDERS SET C(A) = TD - T1 + 1 IN EITHER CASE.
004866,000079:
004867,000080: 01,2572 66042 AD OCT40001 # OVERFLOW HAS OCCURRED. SET C(A) =
004868,000081: 01,2573 40000 CS A # T - T1 + 3/4 - 1
004869,000082:
004870,000083: # NORMAL CASE (C(A) MINUS) YIELDS SAME C(A) -(-(1.0-(T1 - T))+1/4)-1
004871,000084:
004872,000085: 01,2574 62722 AD OCT50001
004873,000086: 01,2575 60002 AD Q # RESULT = TD - T1 + 1.
004874,000087:
004875,000088: 01,2576 10000 CCS A # TEST TD - T1 + 1
004876,000089:
004877,000090: 01,2577 61400 AD LST1 # IF TD - T1 POS, GO TO WTLST5 WITH
004878,000091: 01,2600 12642 TCF WTLST5 # C(A) = (TD - T1) + C(LST1) = TD-T2+1
004879,000092:
004880,000093: 01,2601 12602 NOOP
004881,000094: 01,2602 40002 CS Q
004882,000095:
004883,000096: # NOTE THAT THIS PROGRAM SECTION IS NEVER ENTERED WHEN T-T1 G/E -1,
004884,000097: # SINCE TD-T1+1 = (TD-T) + (T-T1+1), AND DELTA T = TD-T G/E +1 . (G/E
004885,000098: # SYMBOL MEANS GREATER THAN OR EQUAL TO). THUS THERE NEED BE NO CON-
004886,000099: # CERN OVER A PREVIOUS OR IMMINENT OVERFLOW OF TIME3 HERE.
004887,000100:
004888,000101: 01,2603 67635 AD POS1/2 # WHEN TD IS NEXT, FORM QUANTITY
004889,000102: 01,2604 67635 AD POS1/2 # 1.0 - DELTA T = 1.0 - (TD - T)
004890,000103: 01,2605 56026 XCH TIME3
004891,000104: 01,2606 67634 AD NEGMAX
004892,000105: 01,2607 60002 AD Q # 1.0 - DELTAT T NOW COMPLETE.
004893,000106: 01,2610 00006 EXTEND # ZERO INDEX Q.
004894,000107: 01,2611 22007 QXCH 7 # (ZQ)
004895,000108:
004896,000109:
004897,000110: 01,2612 57400 WTLST4 XCH LST1
004898,000111: 01,2613 57401 XCH LST1 +1
004899,000112: 01,2614 57402 XCH LST1 +2
004900,000113: 01,2615 57403 XCH LST1 +3
004901,000114: 01,2616 57404 XCH LST1 +4
004902,000115: 01,2617 57405 XCH LST1 +5
004903,000116: 01,2620 57406 XCH LST1 +6
004904,000117: 01,2621 57407 XCH LST1 +7
004905,000118:
004906,000119: 01,2622 30070 CA WAITADR # (MINOR PART OF TASK CADR HAS BEEN IN L.)
004907,000120: 01,2623 50002 INDEX Q
004908,000121: 01,2624 12625 TCF +1
004909,000122:
004910,000123: 01,2625 53411 DXCH LST2
004911,000124: 01,2626 53413 DXCH LST2 +2
004912,000125: 01,2627 53415 DXCH LST2 +4
004913,000126: 01,2630 53417 DXCH LST2 +6
004914,000127: 01,2631 53421 DXCH LST2 +8D
004915,000128: 01,2632 53423 DXCH LST2 +10D # AT END, CHECK THAT C(LST2 +10) IS STD
004916,000129: 01,2633 53425 DXCH LST2 +12D
004917,000130: 01,2634 53427 DXCH LST2 +14D
004918,000131: 01,2635 53431 DXCH LST2 +16D
004919,000132: 01,2636 64502 AD ENDTASK # END ITEM, AS CHECK FOR EXCEEDING
004920,000133: # THE LENGTH OF THE LIST.
004921,000134: 01,2637 00006 EXTEND # DUMMY TASK ADRES SHOULD BE IN FIXED-
004922,000135: 01,2640 14462 BZF LVWTLIST # FIXED SO ITS ADRES ALONE DISTINGUISHES
004923,000136: 01,2641 12715 TCF WTABORT # IT.
004924,000137:
004925,000138:
004926,000139: 01,2642 10000 WTLST5 CCS A # TEST TD - T2 + 1
004927,000140: 01,2643 61401 AD LST1 +1
004928,000141: 01,2644 12650 TCF +4
004929,000142: 01,2645 67652 AD ONE
004930,000143: 01,2646 02723 TC WTLST2
004931,000144: 01,2647 00001 OCT 1
004932,000145:
004933,000146: 01,2650 10000 +4 CCS A # TEST TD - T3 + 1
004934,000147: 01,2651 61402 AD LST1 +2
004935,000148: 01,2652 12656 TCF +4
004936,000149: 01,2653 67652 AD ONE
004937,000150: 01,2654 02723 TC WTLST2
004938,000151: 01,2655 00002 OCT 2
004939,000152:
004940,000153: 01,2656 10000 +4 CCS A # TEST TD - T4 + 1
004941,000154: 01,2657 61403 AD LST1 +3
004942,000155: 01,2660 12664 TCF +4
004943,000156: 01,2661 67652 AD ONE
004944,000157: 01,2662 02723 TC WTLST2
004945,000158: 01,2663 00003 OCT 3
004946,000159:
004947,000160: 01,2664 10000 +4 CCS A # TEST TD - T5 + 1
004948,000161: 01,2665 61404 AD LST1 +4
004949,000162: 01,2666 12672 TCF +4
004950,000163: 01,2667 67652 AD ONE
004951,000164: 01,2670 02723 TC WTLST2
004952,000165: 01,2671 00004 OCT 4
004953,000166:
004954,000167: 01,2672 10000 +4 CCS A # TEST TD - T6 + 1
004955,000168: 01,2673 61405 AD LST1 +5
004956,000169: 01,2674 12700 TCF +4
004957,000170: 01,2675 67652 AD ONE
004958,000171: 01,2676 02723 TC WTLST2
004959,000172: 01,2677 00005 OCT 5
004960,000173:
004961,000174: 01,2700 10000 +4 CCS A # TEST TD - T7 + 1
004962,000175: 01,2701 61406 AD LST1 +6
004963,000176: 01,2702 12706 TCF +4
004964,000177: 01,2703 67652 AD ONE
004965,000178: 01,2704 02723 TC WTLST2
004966,000179: 01,2705 00006 OCT 6
004967,000180:
004968,000181:
004969,000182: 01,2706 10000 +4 CCS A
004970,000183: 01,2707 61407 AD LST1 +7
004971,000184: 01,2710 12714 TCF +4
004972,000185: 01,2711 67652 AD ONE
004973,000186: 01,2712 02723 TC WTLST2
004974,000187: 01,2713 00007 OCT 7
004975,000188:
004976,000189: 01,2714 10000 +4 CCS A
004977,000190: 01,2715 05677 WTABORT TC ABORT # NO ROOM IN THE INN.
004978,000191: 01,2716 01203 OCT 1203
004979,000192:
004980,000193: 01,2717 67652 AD ONE
004981,000194: 01,2720 02723 TC WTLST2
004982,000195: 01,2721 00010 OCT 10
004983,000196:
004984,000197: 01,2722 50001 OCT50001 OCT 50001
004985,000198:
004986,000199:
004987,000200: # THE ENTRY TO WTLST2 JUST PRECEDING OCT N IS FOR T LE TD LE T -1.
004988,000201: # N N+1
004989,000202:
004990,000203: # (LE MEANS LESS THAN OR EQUAL TO). AT ENTRY, C(A) = -(TD - T + 1)
004991,000204: # N+1
004992,000205:
004993,000206: # THE LST1 ENTRY -(T - T +1) IS TO BE REPLACED BY -(TD - T + 1), AND
004994,000207: # N+1 N N
004995,000208:
004996,000209: # THE ENTRY -(T - TD + 1) IS TO BE INSERTED IMMEDIATELY FOLLOWING.
004997,000210: # N+1
004998,000211:
004999,000212: 01,2723 54071 WTLST2 TS WAITTEMP # C(A) = -(TD - T + 1)
005000,000213: 01,2724 50002 INDEX Q
005001,000214: 01,2725 30000 CAF 0
005002,000215: 01,2726 54002 TS Q # INDEX VALUE INTO Q.
005003,000216:
005004,000217: 01,2727 37652 CAF ONE
005005,000218: 01,2730 60071 AD WAITTEMP
005006,000219: 01,2731 50002 INDEX Q # C(A) = -(TD - T ) + 1.
005007,000220: 01,2732 27377 ADS LST1 -1 # N
005008,000221:
005009,000222: 01,2733 40071 CS WAITTEMP
005010,000223: 01,2734 50002 INDEX Q
005011,000224: 01,2735 12612 TCF WTLST4
005012,000225:
005013,000226: # C(TIME3) = 1.0 - (T1 - T)
005014,000227:
005015,000228: # C(LST1 ) = - (T2 - T1) + 1
005016,000229: # C(LST1+1) = - (T3 - T2) + 1
005017,000230: # C(LST1+2) = - (T4 - T3) + 1
005018,000231: # C(LST1+3) = - (T5 - T4) + 1
005019,000232: # C(LST1+4) = - (T6 - T5) + 1
005020,000233:
005021,000234: # C(LST2 ) = 2CADR TASK1
005022,000235: # C(LST2+2 ) = 2CADR TASK2
005023,000236: # C(LST2+4 ) = 2CADR TASK3
005024,000237: # C(LST2+6 ) = 2CADR TASK4
005025,000238: # C(LST2+8 ) = 2CADR TASK5
005026,000239: # C(LST2+10) = 2CADR TASK6
005027,000240:
005028,000241:
005029,000242: # ENTERS HERE ON T3 RUPT TO DISPATCH WAITLISTED TASK.
005030,000243:
005031,000244: 01,2736 54016 T3RUPT TS BANKRUPT
005032,000245: 01,2737 00006 EXTEND
005033,000246: 01,2740 22012 QXCH QRUPT
005034,000247:
005035,000248: 01,2741 37633 T3RUPT2 CAF NEG1/2 # DISPATCH WAITLIST TASK.
005036,000249: 01,2742 57407 XCH LST1 +7
005037,000250: 01,2743 57406 XCH LST1 +6
005038,000251: 01,2744 57405 XCH LST1 +5
005039,000252: 01,2745 57404 XCH LST1 +4 # 1. MOVE UP LST1 CONTENTS, ENTERING
005040,000253: 01,2746 57403 XCH LST1 +3 # A VALUE OF 1/2 +1 AT THE BOTTOM
005041,000254: 01,2747 57402 XCH LST1 +2 # FOR T6-T5, CORRESPONDING TO THE
005042,000255: 01,2750 57401 XCH LST1 +1 # INTERVAL 81.91 SEC FOR ENDTASK.
005043,000256: 01,2751 57400 XCH LST1
005044,000257: 01,2752 67632 AD POSMAX # 2. SET T3 = 1.0 - T2 -T USING LIST 1.
005045,000258: 01,2753 26026 ADS TIME3 # SO T3 WONT TICK DURING UPDATE.
005046,000259: 01,2754 55071 TS RUPTAGN
005047,000260: 01,2755 47657 CS ZERO
005048,000261: 01,2756 55071 TS RUPTAGN # SETS RUPTAGN TO +1 ON OVERFLOW.
005049,000262:
005050,000263: 01,2757 00006 EXTEND # DISPATCH TASK.
005051,000264: 01,2760 44503 DCS ENDTASK
005052,000265: 01,2761 53431 DXCH LST2 +16D
005053,000266: 01,2762 53427 DXCH LST2 +14D
005054,000267: 01,2763 53425 DXCH LST2 +12D
005055,000268: 01,2764 53423 DXCH LST2 +10D
005056,000269: 01,2765 53421 DXCH LST2 +8D
005057,000270: 01,2766 53417 DXCH LST2 +6
005058,000271: 01,2767 53415 DXCH LST2 +4
005059,000272: 01,2770 53413 DXCH LST2 +2
005060,000273: 01,2771 53411 DXCH LST2
005061,000274:
005062,000275: 01,2772 52006 DTCB
005063,000276:
005064,000277: 01,2773 ENDWAITS EQUALS
005065,000278:
005066,000279:
005067,000280: # RETURN, AFTER EXECUTION OF T3 OVERFLOW TASK:
005068,000281:
005069,000282: 4505 BLOCK 02
005070,000283:
005071,000284: 4505 11071 TASKOVER CCS RUPTAGN # IF +1 RETURN TO T3RUPT, IF -0 RESUME.
005072,000285: 4506 34466 CAF WAITBB
005073,000286: 4507 54006 TS BBANK
005074,000287: 4510 12741 TCF T3RUPT2 # DISPATCH NEXT TASK IF IT WAS DUE.
005075,000288:
005076,000289: 4511 00006 RESUME EXTEND
005077,000290: 4512 22012 QXCH QRUPT
005078,000291: 4513 30016 NOQRSM CA BANKRUPT
005079,000292: 4514 54006 TS BBANK
005080,000293: 4515 52011 NOQBRSM DXCH ARUPT
005081,000294: 4516 50017 RESUME
005082,000295:
005083,000296: 4517 ENDWAITF EQUALS # LAST FIXED-FIXED LOCATION OF T3RUPT.
End of include-file WAITLIST.agc. Parent file is MAIN.agc