Proof WAITLIST (#274) (#330)

Proof WAITLIST (#274)
This commit is contained in:
cai 2018-05-28 10:03:11 +08:00 committed by James Harris
parent 4e0940e275
commit 95475a353e

View File

@ -28,15 +28,15 @@
# Colossus 2A
# Page 1221
# PROGRAM DESCRIPTION DATE -- 10 OCTOBER 1966
# MOD NO -- 2 LOG SECTION -- WAITLIST
# MOD BY -- MILLER (DTMAX INCREASED TO 162.5 SEC) ASSEMBLY -- SUNBURST REV 5
# PROGRAM DESCRIPTION DATE - 10 OCTOBER 1966
# MOD NO - 2 LOG SECTION - WAITLIST
# MOD BY - MILLER (DTMAX INCREASED TO 162.5 SEC) ASSEMBLY SUNBURST REV 5
# MOD 3 BY KERNAN (INHINT INSERTED AT WAITLIST) 2/28/68 SKIPPER REV 4
# MOD 4BY KERNAN (TWIDDLE IN 54) 3/28/68 SKIPPER REV 13.
#
# FUNCTIONAL DESCRIPTION --
# PART OF A SECTION OF PROGRAMS -- WAITLIST, TASKOVER, T3RUPT, USED TO CALL A PROGRAM (CALLED A TASK),
# WHICH IS TO BEGIN IN C(A) CENTISECONDS. WAITLIST UPDATES TIME3, LST1, AND LST2. THE MEANING OF THESE LISTS
# FUNCTIONAL DESCRIPTION-
# PART OF A SECTION OF PROGRAMS,-WAITLIST, TASKOVER, T3RUPT, USED TO CALL A PROGRAM, (CALLED A TASK),
# WHICH IS TO BEGIN IN C(A) CENTISECONDS. WAITLIST UPDATES TIME3, LST1 AND LST2. THE MEANING OF THESE LISTS
# FOLLOW.
#
# C(TIME3) = 16384 -(T1-T) CENTISECONDS, (T=PRESENT TIME, T1-TIME FOR TASK1)
@ -54,59 +54,68 @@
# C(LST2 +14) = 2CADR OF TASK8
# C(LST2 +16) = 2CADR OF TASK9
#
# WARNINGS --
# WARNINGS-
# --------
# 1) 1 <= C(A) <= 16250D (1 CENTISECOND TO 162.5 SEC)
# 2) 9 TASKS MAXIMUM
# 3) TASKS CALLED UNDER INTERRUPT INHIBITED
# 4) TASKS END BY TC TASKOVER
#
# CALLING SEQUENCE --
# CALLING SEQUENCE-
#
# L-1 CA DELTAT (TIME IN CENTISECONDS TO TASK START)
# L TC WAITLIST
# L+1 2CADR DESIRED TASK
# L+2 (MINOR OF 2CADR)
# L+3 RELINT (RETURNS HERE)
#
# TWIDDLE --
# TWIDDLE-
# -------
# TWIDDLE IS FOR USE WHEN THE TASK BEING SET UP IS IN THE SAME EBANK AND FBANK AS THE USER. IN
# SUCH CASES, IT IMPROVES UPON WAITLIST BY ELIMINATING THE NEED FOR THE BBCON HALF OF THE 2CADR,
# Page 1222
# SAVING A WORD. TWIDDLE IS LIKE WAITLIST IN EVERY RESPECT EXCEPT CALLING SEQUENCE, TO WIT,
# SAVING A WORD. TWIDDLE IS LIKE WAITLIST IN EVERY RESPECT EXCEPT CALLING SEQUENCE, TO WIT-
#
# L-1 CA DELTAT
# L TC TWIDDLE
# L+1 ADRES DESIRED TASK
# L+2 RELINT (RETURNS HERE)
#
# NORMAL EXIT MODES --
# AT L+3 OF CALLING SEQUENCE.
# NORMAL EXIT MODES-
#
# AT L+3 OF CALLING SEQUENCE
#
# ALARM OR ABORT EXIT MODES-
#
# ALARM OR ABORT EXIT MODES --
# TC ABORT
# OCT 1203 (WAITLIST OVERFLOW -- TOO MANY TASKS)
# OCT 1203 (WAITLIST OVERFLOW - TOO MANY TASKS)
#
# ERASABLE INITIALIZATION REQUIRED --
# ACCOMPLISHED BY FRESH START -- LST2, ..., LST2 +16 = ENDTASK
# ERASABLE INITIALIZATION REQUIRED-
#
# ACCOMPLISHED BY FRESH START,-- LST2,..., LST2 +16 =ENDTASK
# LST1,..., LST1 +7 =NEG1/2
#
# OUTPUT--
#
# LST1 AND LST2 UPDATED WITH NEW TASK AND ASSOCIATED TIME.
# DEBRIS-
# CENTRALS- A,Q,L
# OTHER - WAITEXIT, WAITADR, WAITTEMP, WAITBANK
# DETAILED ANALYSIS OF TIMING-
#
# DEBRIS --
# CENTRALS -- A,Q,L
# OTHER -- WAITEXIT, WAITADR, WAITTEMP, WAITBANK
#
# DETAILED ANALYSIS OF TIMING --
# CONTROL WILL NOT BE RETURNED TO THE SPECIFIED ADDRESS (2CADR) IN EXACTLY DELTA T CENTISECONDS.
# THE APPROXIMATE TIME MAY BE CALCULATED AS FOLLOWS:
# THE APPROXIMATE TIME MAY BE CALCULATED AS FOLLOWS
#
# LET T0 = THE TIME OF THE TC WAITLIST
# LET TS = T0 +147U + COUNTER INCREMENTS (SET UP TIME)
# LET X = TS -(100TS)/100 (VARIANCE FROM COUNTERS)
# LET Y = LENGTH OF TIME OF INHIBIT INTERRUPT AFTER T3RUPT
# LET Z = LENGTH OF TIME TO PROCESS TASKS WHICH ARE DUE THIS T3RUPT BUT DISPATCHED EARLIER.
# (Z=0, USUALLY).
# (Z=0, USUALLY)
# LET DELTD = THE ACTUAL TIME TAKEN TO GIVE CONTROL TO 2CADR
# THEN DELTD = TS+DELTA T -X +Y +Z +1.05MS* +COUNTERS*
# *THE TIME TAKEN BY WAITLIST ITSELF AND THE COUNTER TICKING DURING THIS WAITLIST TIME.
#
# IN SHORT, THE ACTUAL TIME TO RETURN CONTROL TO A 2CADR IS AUGMENTED BY THE TIME TO SET UP THE TASK'S
# INTERRUPT, ALL COUNTERS TICKING, THE T3RUPT PROCESSING TIME, THE WAITLIST PROCESSING TIME AND THE POSSIBILITY
# OF OTHER TASKS INHIBITING THE INTERRUPT.
@ -154,8 +163,7 @@ WAITBB BBCON WAIT2
# RETURN TO CALLER +2 AFTER WAITING DT SPECIFIED AT CALLER +1.
FIXDELAY INDEX Q # BOTH ROUTINES MUST BE CALLED UNDER
# Was CAF --- RSB 2004.
CA 0 # WAITLIST CONTROL AND TERMINATE THE TASK
CAF 0 # WAITLIST CONTROL AND TERMINATE THE TASK
INCR Q # IN WHICH THEY WERE CALLED.
# RETURN TO CALLER +1 AFTER WAITING THE DT AS ARRIVING IN A.
@ -171,7 +179,7 @@ VARDELAY XCH Q # DT TO Q. TASK ADRES TO WAITADR.
TS WAITEXIT # GO TO TASKOVER AFTER TASK ENTRY.
TCF DLY2
DELAYEX TCF TASKOVER -2 # RETURNS TO TASKOVER.
DELAYEX TCF TASKOVER -2 # RETURNS TO TASKOVER
# Page 1225
# ENDTASK MUST ENTERED IN FIXED-FIXED SO IT IS DISTINGUISHABLE BY ITS ADRES ALONE.
@ -179,6 +187,7 @@ DELAYEX TCF TASKOVER -2 # RETURNS TO TASKOVER.
EBANK= LST1
ENDTASK -2CADR SVCT3
SVCT3 CCS FLAGWRD2 # DRIFT FLAG
TCF TASKOVER
TCF TASKOVER
@ -201,7 +210,7 @@ SVCT3 CCS FLAGWRD2 # DRIFT FLAG
SVCT3X TC FIXDELAY # DELAY MAX OF 2 TIMES FOR IMU ZERO
DEC 500
TC SVCT3
TC SVCT3 # CHECK DRIFT FLAG AGAIN
# Page 1226
# BEGIN TASK INSERTION.
@ -225,7 +234,7 @@ WAIT2 TS WAITBANK # BBANK OF CALLING PROGRAM.
AD OCT40201
AD Q # RESULT = TD - T1 + 1.
CCS A # TEST TD - T1 +1.
CCS A # TEST TD - T1 + 1
AD LST1 # IF TD - T1 POS, GO TO WTLST5 WITH
TCF WTLST5 # C(A) = (TD - T1) + C(LST1) = TD-T2+1
@ -327,7 +336,7 @@ WTLST5 CCS A # TEST TD - T2 + 1
OCT 7
+4 CCS A
WTABORT TC BAILOUT # NO ROOM IN THE INN
WTABORT TC BAILOUT # NO ROOM IN THE INN.
OCT 1203
AD ONE
@ -337,7 +346,7 @@ WTABORT TC BAILOUT # NO ROOM IN THE INN
OCT40201 OCT 40201
# Page 1230
# THE ENTRY TC WTLST2 JUST PRECEDING OCT N IS FOR T LE TD LE T -1.
# THE ENTRY TO WTLST2 JUST PRECEDING OCT N IS FOR T LE TD LE T -1.
# N N+1
#
# (LE MEANS LESS THAN OR EQUAL TO). AT ENTRY, C(A) = -(TD - T + 1)
@ -351,8 +360,7 @@ OCT40201 OCT 40201
WTLST2 TS WAITTEMP # C(A) = -(TD - T + 1)
INDEX Q
# Was CAF --- RSB 2004.
CA 0
CAF 0
TS Q # INDEX VALUE INTO Q.
CAF ONE
@ -383,7 +391,7 @@ T3RUPT2 CAF NEG1/2 # DISPATCH WAITLIST TASK.
XCH LST1 +1 # INTERVAL 81.91 SEC FOR ENDTASK.
XCH LST1
AD POSMAX # 2. SET T3 = 1.0 - T2 - T USING LIST 1.
ADS TIME3 # SO T3 WON'T TICK DURING UPDATE.
ADS TIME3 # SO T3 WONT TICK DURING UPDATE.
TS RUPTAGN
CS ZERO
TS RUPTAGN # SETS RUPTAGN TO +1 ON OVERFLOW.
@ -431,42 +439,43 @@ NOQBRSM DXCH ARUPT
# Page 1233
# LONGCALL
# PROGRAM DESCRIPTION DATE -- 17 MARCH 1967
# PROGRAM WRITTEN BY W.H.VANDEVER LOG SECTION WAITLIST
# MOD BY -- R. MELANSON TO ADD DOCUMENTATION ASSEMBLY SUNDISK REV. 100
#
# FUNCTIONAL DESCRIPTION --
# PROGRAM DESCRIPTION DATE- 17 MARCH 1967
# PROGRAM WRITTEN BY W.H. VANDEVER LOG SECTION WAITLIST
# MOD BY- R. MELANSON TO ADD DOCUMENTATION ASSEMBLY SUNDISK REV. 100
#
# FUNCTIONAL DESCRIPTION-
# LONGCALL IS CALLED WITH THE DELTA TIME ARRIVING IN A,L SCALED AS TIME2,TIME1 WITH THE 2CADR OF THE TASK
# IMMEDIATELY FOLLOWING THE TC LONGCALL. FOR EXAMPLE, IT MIGHT BE DONE AS FOLLOWS WHERE TIMELOC IS THE NAME OF
# A DP REGISTER CONTAINING A DELTA TIME AND WHERE TASKTODO IS THE NAME OF THE LOCATION AT WHICH LONGCALL IS TO
# START.
# START
#
# CALLING SEQUENCE --
# CALLING SEQUENCE-
# EXTEND
# DCA TIMELOC
# TC LONGCALL
# 2CADR TASKTODO
#
# NORMAL EXIT MODE --
# 1) TC WAITLIST
# 2) DTCB (TC L+3 OF CALLING ROUTINE 1ST PASS THRU LONGCYCL)
# 3) DTCB (TO TASKOVER ON SUBSEQUENT PASSES THRU LONGCYCL)
# NORMAL EXIT MODE-
# 1). TC WAITLIST
# 2). DTCB (TC L+3 OF CALLING ROUTINE 1ST PASS THRU LONGCYCL)
# 3). DTCB (TO TASKOVER ON SUBSEQUENT PASSES THRU LONGCYCL)
#
# ALARM OR ABORT EXIT MODE --
# ALARM OR ABORT EXIT MODE-
# NONE
#
# OUTPUT --
# OUTPUT-
# LONGTIME AND LONGTIME+1 = DELTA TIME
# LONGEXIT AND LONGEXIT+1 = RETURN 2CADR
# LONGCADR AND LONGCADR+1 = TASK 2CADR
# A = SINGLE PRECISION TIME FOR WAITLIST
#
# ERASABLE INITIALIZATION --
# ERASABLE INITIALIZATION-
# A = MOST SIGNIFICANT PART OF DELTA TIME
# L = LEAST SIGNIFICANT PART OF DELTA TIME
# Q = ADDRESS OF 2CADR TASK VALUE
#
# DEBRIS --
# DEBRIS-
# A,Q,L
# LONGCADR AND LONGCADR+1
# LONGEXIT AND LONGEXIT+1
@ -484,7 +493,7 @@ LONGCALL DXCH LONGTIME # OBTAIN THE DELTA TIME
DCA 0
DXCH LONGCADR
EXTEND # NO GO TO THE APPROPRIATE SWITCHED BANK
EXTEND # NOW GO TO THE APPROPRIATE SWITCHED BANK
DCA LGCL2CDR # FOR THE REST OF LONGCALL
DTCB
@ -502,7 +511,6 @@ LNGCALL2 LXCH LONGEXIT +1 # SAVE THE CORRECT BB FOR RETURN
TS LONGEXIT
# *** WAITLIST TASK LONGCYCL ***
LONGCYCL EXTEND # CAN WE SUCCESFULLY TAKE ABOUT 1.25
DCS DPBIT14 # MINUTES OFF OF LONGTIME
DAS LONGTIME
@ -514,7 +522,7 @@ LONGCYCL EXTEND # CAN WE SUCCESFULLY TAKE ABOUT 1.25
# DO NOT SIGN CORRECT) AND THAT WE SUBTRAC-
# TED BIT14 (1 OVER HALF THE POS. VALUE
# REPRESENTABLE IN SINGLE WORD)
NOOP # CAN'T GET HERE *************
NOOP # CAN'T GET HERE **********
TCF +1
CCS LONGTIME
TCF MUCHTIME
@ -538,13 +546,11 @@ MUCHTIME CA BIT14 # WE HAVE OVER OUR ABOUT 1.25 MINUTES
EBANK= LST1
2CADR LONGCYCL
TCF LONGRTRN # NOW EXIT PROPERLY
# *** WAITLIST TASK GETCADR ***
GETCADR DXCH LONGCADR # GET THE LONGCALL THAT WE WISHED TO START
DTCB # AND TRANSFER CONTROL TO IT
TSKOVCDR GENADR TASKOVER