Trailing-Edge
-
PDP-10 Archives
-
decuslib20-01
-
decus/20-0002/uset.sai
There is 1 other file named uset.sai in the archive. Click here to see a list.
COMMENT VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 ENTRY USETIN,USETOUT
C00005 ENDMK
C;
ENTRY USETIN,USETOUT;
REQUIRE "[][]" DELIMITERS;
DEFINE #=[COMMENT];
# These routines make buffered-mode USETI and USETO work like they ought
to under TOPS-10 5.07/6.02. That is, USETIN/USETOUT flush the buffer ring
and insure that the next I/O operation uses the disk block specified.
Stanford A.I. Lab monitor does this automatically.;
INTERNAL SIMPLE PROCEDURE USETOUT(INTEGER CHAN,BLOCK); BEGIN
START!CODE
HRLZ 1,CHAN;
LSH 1,5;
TLO 1,'067000; # MAKE AN "OUTPUT" INSTRUCTION;
XCT 1; # FORCE OUT PARTIAL BUFFER;
END;
USETO(CHAN,BLOCK); END;
INTERNAL SIMPLE PROCEDURE USETIN(INTEGER CHAN,BLOCK); BEGIN
# THIS IS MORE COMPLICATED, SINCE WE MAY HAVE TO FLUSH SEVERAL BUFFERS;
START!CODE
DEFINE ICOWNT=['12],BUFHED=[2]; LABEL TOPP,NOBUF;
EXTERNAL INTEGER CHNCDB;
HRLZ 1,CHAN;
LSH 1,5;
IOR 1,['10+('047 LSH 27)]; # CALLI 10, WAIT;
XCT 1; # WAIT TILL DISK STOPS;
PUSH P,CHAN;
PUSHJ P,CHNCDB; # AC! GETS ADDR OF CHAN DATA BLOCK;
SETZM ICOWNT(1); # SO SAIL WILL DO AN IN NEXT TIME;
HRRZ 3,BUFHED(1); # ADDR OF INPUT BUFFER HEADER;
JUMPE 3,NOBUF;
HRRZ 2,(3); # AC2=BUFFER POINTED TO BY HEADER;
MOVEI 3,(2); # AC3=BUFFER IN WHICH TO CLEAR USE BIT;
MOVSI 4,'400000; # BIT TO CLEAR;
TOPP: ANDCAM 4,(3); # CLEAR BIT;
HRRZ 3,(3); # NEXT BUFFER;
CAIE 2,(3); # SAME AS FIRST?;
JRST TOPP; # NO;
NOBUF: END;
USETI(CHAN,BLOCK); END;
# ALL THIS IS NECESSARY BECAUSE THE DEC UUOs DO NOT FLUSH THE BUFFER,
WHILE STANFORD IS NICE AND DOES;
REQUIRE UNSTACK!DELIMITERS;