Trailing-Edge
-
PDP-10 Archives
-
-
There are no other files named in the archive.
COMMENT VALID 00035 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00003 00002 HISTORY
C00012 00003 Indices, Bits for IOSER
C00015 00004 Simio, Ioinst, Lpryer, Cserr
C00026 00005 Getchn
C00029 00006 Filnam
C00036 00007 Flscan
C00039 00008 Open
C00045 00009
C00051 00010 Release
C00056 00011 Lookup, Enter
C00060 00012
C00061 00013 Fileinfo
C00063 00014 Out
C00067 00015 Input
C00077 00016 IFN ALWAYS,<BEGIN NUMIN>
C00083 00017 NUMIN: SET UP TO READ FROM A CHANNEL
C00086 00018 LNUMIN NUMBER INPUT
C00089 00019 GETNUM GETNU1
C00092 00020 DFSC
C00096 00021 DMUL..
C00099 00022 DSCR DATA TABLES FOR REALIN, INTSCAN, ETC.
C00103 00023 Arryout, Wordout
C00108 00024 Arryin, Wordin
C00118 00025 Linout
C00120 00026 Breakset,setbreak,stdbrk fakes
C00121 00027 Close, Closin, Closo
C00123 00028 Mtape
C00125 00029 Useti, Useto, Rename
C00128 00030 where Usercon used to be
C00129 00031 Ttyuuo functions
C00147 00032 Ptyuuo functions
C00155 00033 TMPIN (input from a tmpcor file)
C00162 00034 TMPOUT (output to a tmpcor file)
C00170 00035
C00171 ENDMK
C;
COMMENT HISTORY
AUTHOR,REASON
021 102100000075 ;
COMMENT
VERSION 17-1(61) 10-18-74 BY rls check herefks
VERSION 17-1(60) 10-14-74 BY JFR FIX BUG IN INPUT
VERSION 17-1(59) 10-14-74 BY JFR REMOVE HACK'S
VERSION 17-1(58) 10-13-74 BY JFR %BS% BREAK TABLE BUGS
VERSION 17-1(57) 10-11-74 BY JFR FIS TYPOS %BS%
VERSION 17-1(56) 10-11-74 BY JFR MINOR FIX TO INPUT %BS%
VERSION 17-1(55) 10-11-74 BY RHT FEAT %BQ% MAKE CLOSE TAKE INHIBIT BITS AS ARG
VERSION 17-1(54) 10-11-74 BY JFR REMOVE HEREFK'S
VERSION 17-1(53) 10-11-74 BY JFR FEAT %BS% NEW WAY TO DO BREAK TABLES
VERSION 17-1(52) 10-10-74 BY JFR FEAT %BS% NEW WAY TO DO BREAK TABLES
VERSION 17-1(51) 9-27-74 BY JFR FIX AUTHOR REASON STUFF
VERSION 17-1(50) 8-8-74 BY LDE BUG #TB# TYPO IN INPUT PREVENTED SETPL PAGENUM TO WORK
VERSION 17-1(49) 5-24-74
VERSION 17-1(48) 5-24-74
VERSION 17-1(47) 5-24-74 BY rht mode saibrk & saiprn to strser
VERSION 17-1(46) 5-24-74
VERSION 17-1(45) 5-24-74
VERSION 17-1(44) 5-24-74
VERSION 17-1(43) 5-24-74
VERSION 17-1(42) 5-24-74
VERSION 17-1(41) 5-24-74
VERSION 17-1(40) 5-19-74
VERSION 17-1(39) 5-19-74
VERSION 17-1(38) 5-19-74
VERSION 17-1(37) 5-19-74
VERSION 17-1(36) 5-5-74 BY RHT ADD $PRINT
VERSION 17-1(35) 5-5-74
VERSION 17-1(34) 5-5-74
VERSION 17-1(33) 5-5-74 BY JRL BUG #RX# (CMU =B7=) LDE SAYS SOSNUM,LINNUM,PAGNUM S/B INITIALIZED
VERSION 17-1(32) 3-26-74 BY RHT FEAT %AX% FINISH UP SETPL (POLISH IT LATER!!!)
VERSION 17-1(31) 3-26-74 BY RHT SOMEONE (ON 12 MARCH 1974) RAN SOS ON THIS FILE!
IF ANY TIME BOMBS WERE PLANTED, WE WILL FIND OUT!
VERSION 17-1(30) 2-22-74 BY RHT FEAT %BG% ADD BREAKSET MODE "F"
VERSION 17-1(29) 2-1-74 BY RHT BUG #QY# USBSTS NEEDED PATCHING
VERSION 17-1(28) 2-1-74
VERSION 17-1(27) 1-12-74 BY RHT MAKE COUNT RIGHT IN INOUT
VERSION 17-1(26) 1-12-74
VERSION 17-1(25) 1-12-74 BY RHT FIX COMPIL FOR SAITTY
VERSION 17-1(24) 1-11-74 BY RHT TTYINL STUFF
VERSION 17-1(23) 1-11-74 BY RHT MERGE IN CMU CHANGES
VERSION 17-1(22) 1-11-74
VERSION 17-1(21) 1-11-74
VERSION 17-1(20) 1-11-74
VERSION 17-1(19) 1-11-74
VERSION 17-1(18) 12-15-73 BY RFS FIX BUGS QC,QD.
VERSION 17-1(17) 12-10-73 BY JRL REMOVE LAST REFERENCES TO PGNNO
VERSION 17-1(16) 12-10-73
VERSION 17-1(15) 12-10-73
VERSION 17-1(14) 12-8-73 BY JRL REMOVE SPECIAL STANFORD CHARACTERS(WHERE POSSIBLE)
VERSION 17-1(13) 12-8-73 BY RFS MAKE ALTMODE 33 FOR EXPORT SYSTEMS
VERSION 17-1(12) 12-5-73 BY RHT BUG #PO#
VERSION 17-1(11) 12-5-73
VERSION 17-1(10) 12-5-73
VERSION 17-1(9) 12-3-73 BY RFS REMOVE ALL III DISPLAY STUFF
VERSION 17-1(8) 12-2-73 BY RHT FIX INPUT
VERSION 17-1(7) 12-2-73 BY RLS EDIT
VERSION 17-1(6) 12-2-73 BY RHT ALSO SOME WRD SPARES
VERSION 17-1(5) 12-2-73 BY RHT FEAT %AV% CHNCDB. ALSO SPARES ADDED TO OPN & BRK
VERSION 17-1(4) 12-2-73
VERSION 17-1(3) 12-1-73 BY RLS BUG #PM# DONT LOSE A CHAR IN INPUT
VERSION 17-1(2) 12-1-73 BY RLS ADD SETPL FUNCTION
VERSION 17-1(1) 7-27-73 BY JRL CHANGE OPEN TO FACT THAT RELEASE NOW TAKES TWO ARGUMENTS
VERSION 17-1(0) 7-26-73 BY RHT **** VERSION 17 ****
VERSION 16-2(45) 5-7-73 BY JRL CHANGE PTYALL TO HANDLE LARGER BUFFERS
VERSION 16-2(44) 3-21-73 BY JRL ADD COMPIL(SAIDM3)
VERSION 16-2(43) 2-25-73 BY RHT BUG #LP# GO TO OUT OF PROCESS SHOULDNT LOOP!
VERSION 16-2(42) 2-14-73 BY RHT BUG #LM# TYPO IN PITBND
VERSION 16-2(41) 1-9-73 BY RHT REPAIR COMPIL FOR SAIPIT
VERSION 16-2(40) 12-2-72 BY RHT MODIFY PIT STUFF FOR NEW INFOTAB &DATAB
VERSION 16-2(39) 12-1-72 BY JRL CHANGE LEAP INDEX USED TO CALL FRELS WITHIN BEXIT
VERSION 16-2(38) 11-28-72 BY RHT ADD CLEANUPS TO BEXIT CODE
VERSION 16-2(37) 9-24-72 BY JRL LIBRARY REQUESTS
VERSION 16-2(36) 9-21-72 BY JRL ADD DADDY CURSCB ETC TO DUM
VERSION 16-2(35) 8-31-72 BY JRL RELEASE VALUE SETS CORRECTLY IN STKUWD
VERSION 16-2(34) 8-27-72 BY RHT CHANGE SPOT IN WHICH STKUWD SAVES RETN
VERSION 16-2(33) 8-23-72 BY JRL ADD FORGET CONTEXT CODE TO BEXIT
VERSION 16-2(32) 8-14-72 BY RHT EVAL NOW NAMED APPLY
VERSION 16-2(31) 7-22-72 BY RHT ADD KILL LIST TO BEXIT
VERSION 16-2(30) 7-12-72 BY DCS BUG #IN# PTYALL INVALID REMCHR PROBLEM
VERSION 16-2(29) 7-3-72 BY DCS MANY THINGS
VERSION 16-2(28) 6-7-72 BY DCS BUG #HO# RETURN BOTH ADDRESSES FROM ..ARCOP FOR .MES2
VERSION 16-2(27) 5-24-72 BY RHT CHANGE STKUWD TO LOOK AT PPDA
VERSION 16-2(26) 5-15-72 BY JRL ARRPDP BUG AGAIN
VERSION 16-2(24) 5-11-72 BY DCS BUG #HC# BETTER EXPO OUTSTR
VERSION 16-2(23) 5-11-72 BY DCS BUG #HA# IMPRV. ERR. ENB, FIX MUDDY FEET IN EXPO
VERSION 16-2(22) 5-11-72 BY DCS BUG #GT# ALLOW LARGE OCTAL PPNS
VERSION 15-6(17-21) 5-4-72
VERSION 15-6(17) 3-7-72 BY DCS FIX OUTSTR(NULL) GARBAGING
VERSION 15-6(7-16) 2-20-72
VERSION 15-6(6) 2-18-72 BY RHT CREATE THE NEW WORLD
VERSION 15-2(5) 2-6-72 BY DCS BUG #FQ# (WD-ARRY)(IN-OUT) WORD COUNT KEPT RIGHT, IOERR OK, DUMP MODE OK
VERSION 15-2(4) 2-5-72 BY DCS BUG #GI# REMOVE TOPSTR
VERSION 15-2(3) 2-1-72 BY DCS BUG #GF# INCHWL BREAKS ON MORE THINGS, TELLS WHAT THEY ARE
VERSION 15-2(2) 1-25-72 BY DCS BUG #GD# Fix non-standard buffer size setup in OPEN
VERSION 15-2(1) 12-2-71 BY DCS INSTALL VERSION NUMBER
;
COMMENT Indices, Bits for IOSER
LSTON (IOSER)
IFN ALWAYS,<BEGIN IOSER>
DSCR IOSER -- IOSER GENERAL DISCUSSION
;SEE GOGOL FOR MORE DETAILS
; FORMAT OF CDBs
DMODE __ 0 ;DATA MODE
DNAME __ 1 ;DEVICE
BFHED __ 2 ;HEADER POINTERS
OBPNT __ 3 ;OUTPUT BUFFER POINTER
OBP __ 4 ;OUTPUT BYTE POINTER
OCOWNT __ 5 ;OUTPUT BYTE COUNT
ONAME __ 6 ;OUTPUT FILE NAME -- FOR INFORMATION ONLY
OBUF __ 7 ;OUTPUT BUFFER LOCATION
IBPNT __10 ;SAME STUFF FOR INPUT
IBP __11
ICOWNT __12
INAME __13
IBUF __14
ICOUNT __15 ;INPUT DATA COUNT LIMIT ADDRESS
BRCHAR __16 ;XWD TTYDEV FLAG, INPUT BREAK CHAR ADDR
TTYDEV __16 ;LH -1 IF DEVICE IS A TTY -- USED BY OUT
ENDFL __17 ;INPUT END OF FILE FLAG ADDR
ERRTST __20 ;USER ERROR BITS SPECIFICATION WORD
LINNUM __21 ;ADDR OF LINE NUMBER WORD (SETPL FUNCTION)
PAGNUM __22 ;ADDR OF PAGE NUMBER WORD (SETPL FUNCTION)
SOSNUM __23 ;ADDR OF SOS NUMBER WORD (SETPL FUNCTION)
; SIMIO INDICES
?IOSTATUS __0
?IOIN __1 ;SEE EXPLANATIONS IN SIMIO ROUTINE
?IODIN __2
?IOOUT __3
?IODOUT __4
?IOCLOSE __5
?IORELEASE __6
?IOINBUF __7
?IOOUTBUF __10
?IOSETI __11
?IOSETO __12
;;%##% A NEW GOODIE
?SETIOSTS __13
?IOOPEN __14
?IOLOOKUP __15
?IOENTER __16
?IORENAME __17
COMPIL(SIM,,,,,,DUMMYFORSCISS)
TYMSHR <
COMPXX(SIM,<SIMIO,CHNIOV,CHNIOR,CSERR,LPRYER>,<GOGTAB,X22,.SKIP.,DDFINA,INTRPT>
,<SIMIO,CSERR,LPRYER -- SUPPORT ROUTINES>)
>;TYMSHR
NOTYMSHR <
COMPXX(SIM,<SIMIO,CSERR,LPRYER>,<GOGTAB>
,<SIMIO, CSERR, LPRYER -- SUPPORT ROUTINES>)
>;NOTYMSHR
COMMENT Simio, Ioinst, Lpryer, Cserr
DSCR SIMIO
CAL XCT INDEX,SIMIO
PAR AC field is index into instruction table (see below)
CHNL contains I/O channel number
other params can be gleaned from instruction table
RES an I/O instruction is executed. Routine skips if I/O instr did.
If the INDEX is LEQ 12, and if the instruction skips (error or EOF),
status is presented in LH of user's EOF vbl (@ENDFL(CDB)), so he
can test it, or an error message is provided (depending on user-
enabling). This simplifies many I/O routines.
SID NONE
DES This routine makes I/O instructions re-entrant. The problem is
that the channel cannot be referenced indirectly.
^^SIMIO: PUSHJ P,.+1 ;SAVE PC OF XCT
PUSH P,C ;SAVE C
MOVE C,-1(P) ;ASSUME SKIP RETURN
LDB C,[POINT 4,-1(C),12] ;INDEX OF XCT
JUMPE C,USTST ;WANT STATUS BITS ONLY
CAIL C,13 ;NOW SPLIT HIGH AND LOW INDICES
JRST ALTIO ;SKIP RETURN CHECK ONLY
;;%##% CHECK TO NOT SCREW STANDARD DEC LOSERS
EXPO <
CAIN C,IOIN ;
JRST ISIOU ;
CAIE C,IOOUT ;IN OR OUT ?
JRST NOTIOU ;NOPE
ISIOU: SKIPG @USBTST(C) ;CHECK FOR NO BUFFERS (& MORE AT CMU)
JRST USFUNY ;NO BUFFERS, ETC.
>;EXPO
NOTIOU:MOVE C,IOINST(C) ;GET INSTRUCTION
TYMSHR <HLL CHNL,C
XCT IOINS2(C)>;TYMSHR
NOTYMSHR <
DPB CHNL,[POINT 4,C,12] ;CHANNEL NUMBER
XCT C ;DO OPERATION>;NOTYMSHR
JRST USOUT ;ALL KOSHER, NO EOF OR ERR
USTST: NOTYMSHR < MOVE C,[GETSTS C] ;WHA-
DPB CHNL,[POINT 4,C,12] ; T HAPPEN-
XCT C ; ED?>;NOTYMSHR
TYMSHR <HRLI CHNL,CIOGST
CHANIO CHNL,C>;TYMSHR
;;%##% SAVE STATUS BITS
MOVEM C,FSTATS(USER)
CMU <
USERF:
>;CMU
TRZ C,10000 ;IOACT BIT, USER LOOKUP CHECK BIT
HRLZM C,@ENDFL(CDB) ;GIVE USER THE BITS
TDNN C,ERRTST(CDB) ;ANY HE CAN'T HANDLE?
JUMPA CHNL,USSKIP ;NOPE, JUST SKIP-RETURN
;;%CQ% JFR 7-29-75 more information, please
;; ERR <I-O DEVICE ERROR ON CHANNEL >,7 ;JUMPA TO PROVIDE CHANNEL AC
ERRSPL 1,[[ASCIZ /
I-O device error, channel @D status @B @F: @F @F/]
NOTYMSHR < PWORD CHNL ;CHANNEL #>;NOTYMSHR
TYMSHR < PRIGHT CHNL>;TYMSHR
PLEFT @ENDFL(CDB) ;STATUS BITS
PWORD DNAME(CDB) ;DEVICE
PWORD INAME(CDB) ;INPUT FILE NAME
PWORD ONAME(CDB)] ;OUTPUT FILE NAME
;;%CQ% ^
USSKIP: AOS -1(P) ;SKIP-RETURN
USOUT: POP P,C ;RESTORE C
POPJ P, ;DONE
ALTIO: MOVE C,IOINST(C) ;GET INSTR
TYMSHR < HLL CHNL,C
XCT IOINS2(C)>;TYMSHR
NOTYMSHR <
DPB CHNL,[POINT 4,C,12]
XCT C ;DO IT>;NOTYMSHR
JRST USOUT ;NO SKIP
JRST USSKIP ;SKIP
EXPO <
USFUNY:
CMU < SKIPE @USBTST(C) ;FUNNY DEVICE?
JRST REALTM ; YES.
>;CMU
JUMP CHNL, ;FOR THE ERR MSG
ERR <NO BUFFERS ASSIGNED FOR I-O CHAN >,7
JRST USSKIP
CMU,< COMMENT THIS NONSENSE IS A SPECIAL MODE FOR
THE CMU SPEECH DEVICES. ESSENTIALLY, IT DOES EVERTHING
AS NORMAL, EXCEPT THAT IT PICKS UP THE TIMING ERR AND
RUN-OUT-OF BUFFERS BIT OF THE
I/O STATUS FROM THE STATUS WORD IN THE BUFFER HEADER,
INSTEAD OF USING THE BIT FROM THE GETSTS.
TIMERR__100000 ;TIMING ERR BIT FOR SPEECH DEVICES
ROBERR__200000 ;RUN-OUT-OF-BUFFER ERR
REALTM: PUSH P,D ;NEED ANOTHER AC
CAIE C,IOIN ;INPUTTING?
JRST REALOT ; NO
MOVSI C,(<IN>)
DPB CHNL,[POINT 4,C,12] ;CHAN #
XCT C ;DO THE INPUT
JRST REALOK ;NO ERR, SO FAR
MOVE C,[GETSTS C]
DPB CHNL,[POINT 4,C,12] ;LOOKS FAMILIAR
XCT C
TRZA C,TIMERR!ROBERR ;TURN OFF THE ONES FROM THE GETSTS
REALOK: MOVEI C,0
HRRZ D,IBPNT(CDB) ;ADDRESS OF THE NEW BUFFER
IOR C,-1(D) ;THE BITS FROM THE BUFFER
REALRT: POP P,D ;RESTORE THE AC
TRNN C,760000 ;ERR OR EOF?
JRST USOUT ; NO
JRST USERF ; YES, GO LOOK AT IT
REALOT: MOVE C,[GETSTS C]
DPB CHNL,[POINT 4,C,12]
XCT C
TRNN C,ROBERR ;STOPPED FOR A ROB?
JRST REAL5 ; NO
HRRI D,(C) ;GET THE BITS
TRZ D,760000 ;TURN OFF THE ERRS
HRLI D,(<SETSTS>)
DPB CHNL,[POINT 4,D,12]
XCT D
REAL5: MOVSI D,(<OUT>)
DPB CHNL,[POINT 4,D,12]
XCT D
JRST REALRT
JRST REALRT ;IGNORE NOW, CATCH THE NEXT TIME THRU
>;CMU
USBTST_.-1
XWD CDB,IBUF ;1
;;#QY# ! RHT 2-1-74 NEEDED A DUMMY HERE.
777777 ;@ THRU THIS WILL BE ILL MEM REF
XWD CDB,OBUF ;3
>;EXPO
DSCR INSTRUCTION TABLE
IOINST_.-1 ;IOSTATUS __ 0 GET STATUS
NOTYMSHR <
IN ;IOIN __ 1 BUFFERED INPUT
IN D ;IODIN __ 2 DUMP MODE INPUT
OUT ;IOOUT __ 3 BUFFERED OUTPUT
OUT D ;IODOUT __ 4 DUMP MODE OUTPUT
CLOSE (D) ;IOCLOSE __ 5 CLOSE I,O, OR BOTH
;; ALLOW USE OF INHIBIT BITS IN RELEASE
RELEASE (D) ;IORELEASE__ 6
INBUF (A) ;IOINBUF __ 7
OUTBUF (A) ;IOOUTBUF __10
USETI (A) ;IOSETI __11
USETO (A) ;IOSETO __12
;;%##% A NEW GOODIE
SETSTS (A) ; SET IO STATUS
OPEN DMODE(CDB) ;IOOPEN __14
LOOKUP FNAME(USER);IOLOOKUP__15
ENTER FNAME(USER);IOENTER __16
RENAME FNAME(USER);IORENAME__17>;NOTYMSHR
TYMSHR <
XWD CIOIN,0
XWD CIOIN,1 ;INDECIS ARE SAME AS ABOVE
XWD CIOOUT,0
XWD CIOOUT,1
XWD CIOCLS,2
XWD CIORLS,2
XWD CIOIBF,3
XWD CIOOBF,3
XWD CIOUSI,3
XWD CIOUSO,3
XWD CIOSTS,3
XWD CIOOPN,4
XWD CIOLUK,5
XWD CIOENT,5
XWD CIOREN,5
IOINS2: CHANIO CHNL,
CHANIO CHNL,D
CHANIO CHNL,(D)
CHANIO CHNL,(A)
CHANIO CHNL,DMODE(CDB)
CHANIO CHNL,FNAME(USER)>;TYMSHR
HACK <
;; ****** these two routines are badly misplaced
;; they ought to be removed from this compil someday
;; check with Bob Smith first, though
>;HACK
HERE(CSERR) MOVE USER,GOGTAB
POP P,UUO1(USER) ;STANDARD PLACE
ERR <CASE INDEX OVERFLOW, VALUE IS >,13
JRST @UUO1(USER) ;RETURN OK
HERE (LPRYER) ERR <DATUM OF ARRAY NOT THERE>,1
POPJ P,
TYMSHR <
COMMENT !
CHNIOV(CHANNEL,ARG,FUNCTION NUMBER)
CHNIOR IS SAME BUT ARG IS REFERENCE
IF FUNCTION NUMBER HAS BITS IN LEFT HAF FOR CALL BY
VALUE, ITS FOR AN "IMMEDIATE" TYPE INSTR LIKE SETSTS
BOTH FUCNTIONS RETURN A VALUE BUT IT HAS MEANING ONLY
IN SOME CASES (DEPENDS ON FUNCTION).
SETS .SKIP.
!
HEREFK(CHNIOV,CHNCV.)
POP P,1 ;RETURN ADDRESS
EXCH 1,-1(P) ;NOW ITS ARGUMENT
MOVE 2,[CHANIO 3,1]
CHNCLC: POP P,3 ;FUNCTION
TLNE 3,-1
HRR 2,1 ;FOR IMMEDIATE
SETOM .SKIP.
HRL 3,-1(P) ;CHANNEL NUMBER
MOVSS 3 ;CHANNEL IS IN LEFT HALF
SKIPE INTRPT
XCT DDFINA
XCT 2
SETZM .SKIP.
SUB P,X22
JRST @2(P)
HEREFK(CHNIOR,CHNCR.)
POP P,2
EXCH 2,-1(P) ;NOW ITS PARAMETER ADDRESS
MOVE 1,2 ;IN CASE FUNCTION WITH BITS IN LH
HRLI 2,(<CHANIO 3,>)
JRST CHNCLC
>;TYMSHR
ENDCOM(SIM)
COMPIL(CHN,<GETCHN,NOTOPN,GETCHAN>,<GOGTAB>,<GETCHN, NOTOPN, GETCHAN>)
COMMENT Getchn
DSCR Getchn, Getchan
PAR A -- addr of ASCII for routine name
CHNL -- I/O channel number from SAIL call
RES -- CHNL contains actual I/O channel number (diff for shared TTY)
CDB contains ptr to actual CDB table for that channel
SID A(lh) is changed
DES normally just sets up CHNL and CDB
if error occurs (channel out of bounds, already open), a fatal message
is printed, using the address in A to get the routine name.
This routine is called by most I/O routines, having saved ACs and
fetched CHNL.
GETCHN:
HRLI A,(<PUUO 3,0>) ;PREPARE FOR ERR MESS
TRZE CHNL,777760 ;CHECK FOR VALID CHANNEL NO
JRST NOTVALID ;INVALID CHANNEL NUMBER
SKIPE CDB,@CDBLOC(USER) ;IS CHANNEL OPEN? (CDBLOC SET BY ALLOC)
POPJ P,
NOTOPN:
XCT A ;PRINT ROUTINE NAME
ERR <: CHANNEL OR FILE NOT OPEN>
NOTVALID:
XCT A ;ROUTINE NAME
ERR <: CHANNEL NUMBER INVALID>
DSCR INTEGER_GETCHAN;
CAL SAIL
HERE (GETCHAN)
MOVE USER,GOGTAB
ADD USER,[XWD A,CHANS] ;MAKE @ WORD
MOVEI A,1 ;START AT CHANNEL 1
CHLUP: SKIPN @USER ;IF CHANNEL IS FREE,
POPJ P, ; RETURN
CAIGE A,17 ;CYCLE TO 0?
AOJA A,CHLUP ;NO, TRY NEXT
MOVEI A,0 ;TRY 0
SKIPE @USER ;FREE?
HRROI A,-1 ;NOPE
POPJ P, ;DONE
ENDCOM(CHN)
COMPIL(FIL,<FILNAM>,<FLSCAN,X22>,<FILNAM SCANNING ROUTINE>)
COMMENT Filnam
DSCR FILNAM
CAL PUSHJ
PAR file name string on SP stack
of form FILENAME<.EXT><[PROJ,PROG]>
RES FNAME(USER) : SIXBIT /filename/
EXT(USER): SIXBIT /extension,,0/
0
PRPN(USER): SIXBIT /PRJ PRG/ (or zero)
SID uses D,X,Y (4-6), REMOVES STRING FROM STACK
***** SKIP RETURNS IF SUCCESSFUL *****
^^FILNAM:
SUB SP,X22 ;ADJUST STACK
FOR II_1,3 <
SETZM FNAME+II(USER)>
MOVEI X,FNAME(USER) ;WHERE TO PUT IT
PUSHJ P,FLSCAN ;GET FILE NAME
TYMSHR < CAIE Y,"("
JRST CHKEXT ;NOT USER NAME
SETZM FUSER(USER)
SETZM FUSER1(USER)
HRRZS 1(SP)
MOVEI D,12 ;12 CHRS MAX
MOVEI X,FUSER(USER)
PUSHJ P,FLSCAN+2
CAIE Y,")"
JRST FLERR ;NOT DELIMITED PROPERLY
MOVEI X,FUSER(USER)
HRRZM X,FNAME+3(USER) ;STORE POINTER
MOVEI X,FNAME(USER)
PUSHJ P,FLSCAN
CHKEXT:
>; TYMSHR
JUMPE Y,FLDUN ;FILE NAME ONLY
CAIE Y,"." ;EXTENSION?
JRST FLEXT ;NO, CHECK PPN
MOVEI X,FNAME+1(USER)
PUSHJ P,FLSCAN
FLEXT: JUMPE Y,FLDUN ;NO PPN SPECIFIED
CAIE Y,"["
JRST FLERR ;INVALID CHARACTER
CMU < ;HANDLE PPNS VIA UUO, MAYBE
HRRZS 1(SP) ;LENGTH PART
;SNEAK A LOOK AT FIRST CHAR
SKIPN 1(SP) ;IS THERE A FIRST CHAR?
JRST FLERR ; NO.
MOVE X,2(SP)
ILDB X,X
;;=C4= 1 of several LDE 28-Jun-74 allow null ppn within [].
CAIN X,"]" ;is it null?
JRST OCTPPN ; yes -- let the other guy handle it.
;;
CAIL X,"0"
CAILE X,"7"
SKIPA ; NOT OCTAL DIGIT
JRST OCTPPN
PUSH P,A ;NEED MORE ROOM
PUSH P,B
SETZM A ;CLEAR THE AREA
SETZM B
SETZM C
MOVEI D,=13+1 ;MAX #CHARS+1
MOVE X,[POINT 7,A] ;DUMP THEM THERE
FLN2: SOSGE 1(SP)
JRST FLERRC ;RAN OUT OF STRING
ILDB Y,2(SP) ;THE NEXT CHAR
;;=C4= 2 OF SEVERAL
JUMPE Y,FLN2 ;IGNORE NULLS
;;
CAIN Y,"]" ;THE END?
JRST GOTRB ; YES
JUMPLE D,FLERRC ;WE DON'T WANT ANY MORE CHARACTERS
IDPB Y,X ;STICK THE CHAR THERE
SOJA D,FLN2 ;GET ANOTHER
GOTRB: MOVEI X,A ;THATS WHERE THE UUO WILL FIND THEM
CALLI X,-2 ;CMUDEC UUO
JRST FLERRC ;SOMETHING WRONG
MOVEM X,FNAME+3(USER) ;SAVE IT
AOS -2(P) ;INDICATE SUCCESS
FLERRC: POP P,B
POP P,A
POPJ P,
OCTPPN:
>;CMU
TYMSHR < SKIPE FNAME+3(USER) ;IGNORE IF USER NAME
JRST FLDUN ;TREAT AS DONE
>;TYMSHR
PUSHJ P,[
RJUST: SETZM PROJ(USER)
MOVEI X,PROJ(USER)
PUSHJ P,FLSCAN ;GET PROJ OR PROG IN SIXBIT
IFN SIXSW,<
MOVE X,PROJ(USER)
IMULI D,-6 ;SHIFT FACTOR
LSH X,(D) ;RIGHT-JUSTIFY THE PROJ OR PROG
>;IF SIXSW (SET IN HEAD, USUALLY CONDITIONED ON NOEXPO)
IFE SIXSW,<
MOVEI X,0
;;#GT# DCS 5-11-72 ALLOW LARGE OCTAL NUMBERS AT STD DEC SYSTEMS
;;=C4= 3 OF several LE03 28-JUN-74 ALLOW NULL PPN
; MOVE D,PROJ(USER) ;WAS A HLLZ
SKIPN D,PROJ(USER)
POPJ P,
;;
;;
FBACK: MOVEI C,0
LSHC C,6 ;GET A SIXBIT CHAR
CAIL C,'0'
CAILE C,'7'
JRST FLERR ;INVALID OCTAL
LSH X,3
IORI X,-'0'(C)
JUMPN D,FBACK
>;NOT SIXSW (USUALLY CONDITIONED ON EXPO)
FPOP: POPJ P,]
HRLZM X,FNAME+3(USER)
CAIE Y,","
;;=C4 4 OF several
; JRST FLERR ;INVALID CHAR
JRST [JUMPE X,FLDUN1 ;ALLOW NULL PPN - CHECK FOR "]"
JRST FLERR] ;A REAL ERROR.
;;
DEC<
IFE ALWAYS,<EXTERN MYPPN>
;;=I09= FOR SFD, IF NULL ARG, TAKE FROM OUR PPN
JUMPN X,.+3 ;IF NULL FIRST HALF,
MOVE X,MYPPN ;USE OUR PPN INSTEAD
HLLM X,FNAME+3(USER)
>;DEC
PUSHJ P,RJUST ;JUSTIFY(AND CONVERT IF EXPORT) PROG #
DEC<
JUMPN X,.+2
MOVE X,MYPPN ;IF NULL SECOND HALF, USE OUR PPN
>;DEC
HRRM X,FNAME+3(USER)
;;=C4= 5 OF several.
FLDUN1:
;;
;;%DP% ! JFR 8-13-76 by popular demand, allows trailing ] to be omitted
;; CAIN Y,"]"
;;=I09= 3 OF MANY
SFDS<
CAIN Y,"]"
JRST FLDUN ;IF ], OK
CAIE Y,"," ;IF "," MUST BE SFD COMING
JRST FLERR ;IF NEITHER, ERROR
SETZM PATHBL(USER) ;INIT PATHBLOCK
SETZM PATHBL+1(USER)
MOVE C,PRPN(USER) ;GET PPN AND PUT IN PATH BLOCK
MOVEM C,PATHBL+2(USER)
MOVEI C,PATHBL(USER) ;AND PUT PTR TO PATH BLOCK IN PPN
MOVEM C,PRPN(USER)
MOVEI X,PATHBL+3(USER) ;FIRST SFD PLACE
MOVEI C,SFDLVL ;COUNTER - SFDLVL IS MAX NO. OF SFDS
FLSFD: PUSHJ P,FLSCAN ;GET SFD NAME
CAIN Y,"]" ;IF LAST ONE
JRST FLSFD1 ;FINISHED
MOVEI X,1(X) ;OTHERWISE LOOK AT NEXT
CAIN Y,","
SOJG C,FLSFD ;UNLESS TOO MANY
JRST FLERR ;WHICH IS ERROR
FLSFD1: SETZM 1(X) ;PUT ZERO AT END OF PATH BLOCK
> ;SFDS
FLDUN: AOS (P) ;SUCCESSFUL
FLERR: POPJ P, ;DONE, NOT NECESSARILY RIGHT
ENDCOM(FIL)
COMPIL(FLS,<FLSCAN>,,<FLSCAN ROUTINE>)
COMMENT Flscan
DSCR FLSCAN
CAL PUSHJ
PAR X -- addr of destination SIXBIT
1(SP), 2(SP) -- input string
RES sixbit for next filename, etc in word addressed by X
break (punctuation) char in Y (0 if string exhausted)
D,X, input string adjusted
SID only those AC changes listed above (Y, for instance)
^^FLSCAN:
HRRZS 1(SP) ;WANT ONLY LENGTH PART
MOVEI D,6 ;MAX NUMBER PICKED UP
SETZM (X) ;ZERO DESTINATION
HRLI X,440600 ;BYTE POINTER NOW
FLN1: MOVEI Y,0 ;ASSUME NO STRING LEFT
SOSGE 1(SP) ;TEST 0-LENGTH STRING
POPJ P,
ILDB Y,2(SP) ;GET BYTE
TYMSHR < CAIE Y,"("
CAIN Y,")"
POPJ P,
>;TYMSHR
CAIE Y,"." ;CHECK VALID BREAK CHAR
CAIN Y,"["
POPJ P,
CAIE Y,"]"
CAIN Y,","
POPJ P,
JUMPE D,FLN1 ;NEED NO MORE CHARS
;;=C4= 6 of several. IGNORE NULL CHARACTERS.
JUMPE Y,FLN2X
TYMSHR < CAIGE Y,40
JRST FLN2>;TYMSHR
;;
TRZN Y,100 ;MOVE 100 BIT TO 40 BIT
TRZA Y,40 ; TO CONVERT TO SIXBIT
TRO Y,40 ; (NO CHECKING)
IDPB Y,X ;PUT IT AWAY
;;=C4= 7 of several
FLN2X:
;;
SOJA D,FLN1 ;CONTINUE
TYMSHR< FLN2: MOVEI Y,0
SOSGE 1(SP)
FLN3: POPJ P,
ILDB Y,2(SP) ;JUST GET SOME CHRS
SOJL D,FLN3 ;RETURN IF DONE
TRZN Y,100
TRZA Y,40
TRO Y,40
IDPB Y,X
JRST FLN2>;TYMSHR
ENDCOM(FLS)
COMPIL(OPN,<OPEN,RELEASE,SETPL,CHNCDB>
,<GETCHN,SAVE,RESTR,CORGET,FLSCAN,SIMIO,X33,X22,X11,CORREL>
,<OPEN RELEASE AND SETPL FUNCTIONS>)
COMMENT Open
DSCR OPEN(CHAN,"DEV",MODE,IBFS,OBFS,@INCNT,@INBRCHR,@INEOF);
CAL SAIL
COMMENT
Allocate IBFS input and OBFS output buffers on channel CHAN for
device DEV(SAIL/GOGOL string). Store INCNT, and the INBCHR and INEOF
addresses in a newly allocated CDB (channel data block). Store
all necessary information to carry out I/O on this channel
in the CDB. Mark the channel open.
.OPN:
HERE (OPEN)
; FIRST RELEASE IF ALREADY OPEN
PUSH P,-7(P)
; RELEAS NOW TAKES TWO ARGS
PUSH P,[0]
PUSHJ P,RELEASE ;SIMPLE
; NEXT SAVE AC'S, SET UP USER REGISTER, OBTAIN A CDB
PUSHJ P,SAVE ;SAVE ACS
MOVEI C,IOTLEN ;SIZE
PUSHJ P,CORGET ;OBTAIN A BLOCK
JRST BADOPN ;CAN'T GET IT
MOVE CDB,B ;CDB ptr to CHANNEL TABLE
;;#WZ# JFR 6-17-76 ZERO OUT THE WHOLE THING. SUPERSEDES #RX# (CMU =B7=)
SETZB LPSA,(CDB) ;NOW GET READY IN CASE OF ERROR
MOVSI TEMP,(CDB)
HRRI TEMP,1(CDB)
BLT TEMP,IOTLEN-1(CDB)
;;#WZ# ^
SUB SP,X22
; FILL IT WITH NON-CONTROVERSIAL THINGS
POP P,TEMP ;RETURN ADDRESS
POP P,ENDFL(CDB) ;END OF FILE FLAG ADDRESS
POP P,BRCHAR(CDB) ;BREAK CHAR ADDRESS
POP P,ICOUNT(CDB) ;INPUT COUNT ADDRESS
POP P,OBUF(CDB) ;NUMBER OF OUTPUT BUFFERS
POP P,IBUF(CDB) ;NUMBER OF INPUT BUFFERS
POP P,Z ;DATA MODE
POP P,CHNL ;DATA CHANNEL
CHKCHN CHNL,<OPEN> ;ASSURE VALID
;;#HA# DCS 5-11-72 IMPROVE ERROR ENABLE. ALSO, IN EXPO SYSTEM,
;; AVOID REFERENCES TO PGNNO, WHICH IS same as ERRTST!
HRRZI X,750000 ;ERROR BITS POSSIBLY ENABLED -- WAS A HRROI
;;#HA#
ANDCM X,Z ;ERROR BITS ACTUALLY ENABLED ARE 0
MOVEM X,ERRTST(CDB) ;SAVE ENABLATIONS
TRZ Z,750000 ;REMOVE IRRELEVANT BITS
ILLMOD __ 777777
DEC<ILLMOD__007777
>;DEC
CMU <
ILLMOD __ 377776 ;BIT 400000 FOR SPECIAL DEVICE (CMU)
;BIT 000001 FOR KEEPING NULLS
TLZE Z,10000 ;IOACTIVE BIT TO BE SET ON OPEN ??? (LDE)
TRO Z,10000 ;YES
>;CMU
TLNE Z,ILLMOD ;CHECK VALIDITY SOMEWHAT
ERR <OPEN: INVALID DATA MODE>,1
MOVEM Z,DMODE(CDB) ;STORE MODE
; GET DEVICE NAME
MOVEI X,DNAME(CDB) ;WHERE SIXBIT'S TO GO
PUSHJ P,FLSCAN ;GET DEVICE NAME
;;%##% ONLY GIVE ERROR MESSAGE IF NOT ASKED NOT TO
JUMPN Y,[
SKIPN @ENDFL(CDB) ;FLAGGED??
ERR <INVALID DEVICE NAME FOR OPEN>,1
JRST .+1
]
;IF TTY, MARK TTYDEV FOR OUT
HLRZ TEMP,DNAME(CDB) ;GET LH DEVICE NAME
MOVSI Z,400000 ;BIT TO MARK WITH
;;%##% DO A DEVCHR NOW
;; CAIE TEMP,'TTY' ;IF TTY OR PTY,
CAIN TEMP,'PTY' ; ,
JRST MRKTYB ;MARK AS A TTY
MOVE TEMP,DNAME(CDB) ;PICK UP DEVICE AGAIN (FULL SIXBIT)
CALL6 (TEMP,DEVCHR) ;GET CHARACTERISTICS
TLNE TEMP,10 ;A TTY???
MRKTYB: IORM Z,TTYDEV(CDB); IT'S A TTY
;;%##%
; NOW SET HEADER PTRS IN CDB
HRRZI Z,-1 ;TO TEST RIGHT HALF
SETZM BFHED(CDB) ;CLEAR HEADER POINTER
LDB E,[POINT 4,DMODE(CDB),35] ;DATA MODE
CAIL E,15 ;DUMP MODE?
JRST AGNN ; YES, NO BUFFER HEADER WORD
MOVEI TEMP,OBPNT(CDB) ;IF OUTPUT, SET POINTER
TDNE Z,OBUF(CDB) ;ANY OUTPUT BUFFERS?
HRLM TEMP,BFHED(CDB)
MOVEI TEMP,IBPNT(CDB) ;SAME FOR INPUT
TDNE Z,IBUF(CDB) ;ANY INPUT BUFFERS?
HRRM TEMP,BFHED(CDB)
; NOW OPEN THE FILE, GET THE BUFFERS,ETC.
AGNN: XCT IOOPEN,SIMIO ; OPEN CHAN,MODE
JRST [SKIPE @ENDFL(CDB) ;DOES USER WANT TO KNOW?
JRST NORELO ;YES, RELEASE CDB, ERASE ALL OF ATTEMPT
JRST RTRY]
COMMENT
ERMAN'S IMPROVED BUFFER GETTER --- DEC. 1970
If a buffer size is specified (lh #buf word), allocate that size, else the
standard size (determined via a dummy XXXBUF, clever soul that LDE is).
"NOTICE WITH AWE THAT NO CORE IS EVER WASTED, AS IN THE INFERIOR OLD WAY" (sic).
MOVEI Z,0 ;FOR DUMMY (AND REAL) OUTBUF
PUSHJ P,GETBFS ;GET CORE, DO THE OUTBUFS (OR SIMULATIONS)
ADDI CDB,OBUF-OBPNT+1 ;RELOCATE FOR INPUT IN CDB
MOVEI Z,-1
PUSHJ P,GETBFS ;GET CORE, DO INBUFS
SUBI CDB,OBUF-OBPNT+1;RE-RELOCATE
CMU < ;FUNNY INPUT DEVICE
SKIPL DMODE(CDB) ;DID HE SPECIFY TO GET ERRS FROM
; BUFFER HEADER?
JRST STNIT ; NO.
HRLZI TEMP,400000
SKIPE IBUF(CDB) ;INPUT BUFFERS?
JRST [IORM TEMP,IBUF(CDB) ; YES
JRST STNIT]
SKIPE OBUF(CDB) ;OR OUTPUT BUFFERS?
JUMPA CHNL,[IORM TEMP,OBUF(CDB) ; YES
JRST STNIT]
ERR<OPEN: SPEECH DEV BUT NO BUFFERS, CHAN >,7
>;CMU
; FINISH OUT -- SET EOF FLAG IF DESIRED
STNIT: ;SETOM JOBFF ;ONE MUST KNOW WHAT HE IS DOING TO USE
MOVEM CDB,@CDBLOC(USER) ;STORE CDB ADDR IN CHANS TABLE
SETZM @ENDFL(CDB) ;MARK OPEN SUCCESSFUL
JRST RESTR ;RESTORE ACS, RETURN
BADOPN: HRRZ TEMP,JOBREN ;NEXT START WILL ASK ALLOC
HRRM TEMP,JOBSA ;QUESTION
ERR <TOO MANY CHANNELS OR I/O BUFFERS REQUESTED>,1,<(TEMP)>
RTRY: TERPRI <OPEN: DEVICE NOT AVAILABLE>
TERPRI <TYPE "R" TO RETRY, "X" TO GO ON WITHOUT>
PRINT <?>
PUUO TEMP
CAIE TEMP,"r"
CAIN TEMP,"R" ;TRY AGAIN?
JRST AGNN ;YES
;;%##%
SETOM @ENDFL(CDB) ;MARK A LOSER
JRST NORELO
;;%##%
GETBFS: SETZM ONAME(CDB) ;CLEAR FILE NAME
HRRZ Y,OBUF(CDB) ;NUMBER OF BUFFERS
HLRZ D,OBUF(CDB) ;SIZE
EXPO <
HRRZS OBUF(CDB) ;MARK FOR SPECIAL TEST
>;EXPO
JUMPE Y,GBUFRT ;NO BUFFERS
JUMPE D,GETDES ;WANTS DEFAULT SIZE
NOTYMSHR< ANDI D,7777 ;MAX BUFFER SIZE>;NOTYMSHR
TYMSHR<ANDI D,37777>;TYMSHR
HRLZ A,D ;SIZE IN LH
PUSHJ P,GETCOR ;GET THE CORE (SURPRISE!)
SETZM OCOWNT(CDB) ;IN CASE NO ACTUAL INBUF (OUTBUF) DONE
CAIL E,15 ;DUMP MODE?
JRST GBUFRT ; YES, DON'T ACTUALLY FUDGE UP BUFFERS
NOEXPO <;USE UINBF, UOUTBF
;;#GD# 01-25-72 DCS (1-2) set up JOBFF, Fix XCT, bad count
MOVEM B,JOBFF ;B FROM CORGET HAS BUFFER AREA ADDRESS
SUBI D,2 ;GETCOR INCREMENTED
;;#GD#
HRRZ C,Y
MOVE A,[UINBF C]
JUMPN Z,.+2
MOVE A,[UOUTBF C]
DPB CHNL,[POINT 4,A,12]
;;#GD# 01-25-72 DCS (2-2) (was XCT CHNL, clearly wrong)
XCT A ;DO THE ALLOCATIONS
;;#GD#
POPJ P,
>;NOEXPO
EXPO <
ADDI B,1 ;SECOND WORD
BUFC1: HRR A,B
SOJLE Y,BUFC2
ADD B,D ;NEXT ONE
MOVEM A,(B) ;MAKE POINT TO PREV
JRST BUFC1
BUFC2: MOVE B,OBUF(CDB) ;BACK TO FIRST
MOVEM A,1(B) ;LINK IT TOO
HRLI A,400000 ;RING-USE BIQ
MOVEM A,OBPNT(CDB) ;BUFFER PTR
POPJ P,
>;EXPO
GETCOR: ADDI D,2 ;+2 FOR ACCOUNTING
MOVE C,D
IMUL C,Y ;TOTAL CORE NEEDED
PUSHJ P,CORGET ;GRAB IT
ERR <OPEN: NOT ENUFF CORE FOR BUFFERS>
HRRZM B,OBUF(CDB) ;SAVE SO CAN RELEASE
POPJ P,
GETDES: MOVEI A,1 ;1 DUMMY BUFFER
CAIL E,15 ;GOOD OLD DUMP MODE?
JRST [MOVEI D,202 ;ASSUME THIS, SINCE INBUF/OUTBUF WON'T
JRST GDIT] ; WORK IN DUMP MODE
;;#VE# UGLY CODE REPLACED BY DIFFERENT UGLY CODE
; MOVEI TEMP,BRKDUM-1(USER)
; MOVEM TEMP,JOBFF
PUSH P,[0] ;
HRRZM P,JOBFF ;
PUSH P,[0] ;MOST LIKEYL ONLY ONE PUSH IS ENOUGH, BUT ...
PUSH P,[0] ;
PUSHJ P,GETIOB ;DUMMY IN/OUBUF
LDB D,[POINT 17,-1(P),17] ;GET THE SIZE
SUB P,X33 ;POP BACK
;;#VE# ^^
GDIT: PUSHJ P,GETCOR ;GET THE CORE
SETZM OCOWNT(CDB) ;CLEAR BYTE COUNT
CAIL E,15 ;DUMP MODE?
JRST GBUFRT ;YES, NO BUFFER STRUCTURE
MOVEM B,JOBFF
MOVE A,Y ;NUMBER OF BUFFERS
PUSHJ P,GETIOB ;NOW FOR REAL
GBUFRT: SETOM JOBFF ;FOR SPITE
POPJ P,
GETIOB: SKIPN Z
XCT IOOUTBUF,SIMIO ;DO OUTBUF
SKIPE Z
XCT IOINBUF,SIMIO ;INBUF
POPJ P,
SUBTTL RELEASE
COMMENT Release
DSCR RELEASE(CHANNEL NO,INHIBIT BITS);
CAL SAIL
DES THIS USES THE DEFAULT PARAMETER MECHANISM, 0 DEFAULT FOR INHIBIT BITS
COMMENT
Release channel, i/o buffers, channel table if channel is open
Adjust special TTY stuff to reflect lossage if TTY channel
HERE(RELEASE)
.RELS:
SETOM JOBFF ;MARK INVALID
PUSHJ P,SAVE ;SAVE REGS, GET USER, SAVE RETURN
;; FOLLOWING WAS MOVE LPSA,X22
MOVE LPSA,X33
;; FOLOWING WAS CHNL,-1(P)
MOVE CHNL,-2(P) ;CHANNEL #
CHKCHN CHNL,<RELEASE> ;VALIDATE
SKIPN CDB,@CDBLOC(USER) ;GET ADDR FROM CHANS TABLE-- CHANNEL OPEN?
JRST RESTR ;CHANNEL NOT OPEN, FORGET IT
SETZM @CDBLOC(USER) ;CLEAR CHANS TABLE ENTRY
;; INHIBIT BITS;
HRRZ D,-1(P) ;THE DEFAULT OR USER SPECIFIED INHIBIT BITS
XCT IORELEASE,SIMIO ;RELEASE CHAN,0
HRRZ B,IBUF(CDB) ;RELEASE ANY INPUT
PUSHJ P,BUFREL ; BUFFERS
HRRZ B,OBUF(CDB) ;ALSO OUTPUT
PUSHJ P,BUFREL ; BUFFERS
NORELO: HRRZ B,CDB ;WHERE TO RELEASE
PUSHJ P,CORREL ;GIVE CDB BACK
JRST RESTR ;RESTORE AND RETURN
BUFREL: JUMPN B,CORREL ;RELEASE IF ANY TO RELEASE
POPJ P, ;ELSE RETURN
DSCR SETPL(CHANNEL,@LINNUM,@PAGNUM,@SOSNUM)
CAL SAIL
HERE(SETPL)
PUSHJ P,SAVE
MOVE CHNL,-4(P) ;GET CHANNEL
PUSHJ P,GETCHN ;VALIDATE, LOAD CDB
POP P,TEMP ;RETURN ADDRESS (GET OUT OF WAY)
POP P,SOSNUM(CDB)
SETZM @SOSNUM(CDB)
POP P,PAGNUM(CDB)
SETZM @PAGNUM(CDB)
POP P,LINNUM(CDB) ;LINE NUMBER
SETZM @LINNUM(CDB)
MOVE LPSA,X11 ;REMOVE CHANNEL NUMBER FROM STACK
JRST RESTR
;;%AV% -- rht
DSCR CHNCDB(CHANNEL);
CAL SAIL
DES RETURNS INTEGER = INPHDR,,OUTHDR
(ACTUALLY COULD BE GOTTEN FROM CDB BY USER, BUT THIS
PROMISSES MORE STABILITY)
HERE(CHNCDB)
PUSHJ P,SAVE ;
MOVE CHNL,-1(P) ;GET CHANNEL NUMBER
PUSHJ P,GETCHN ;CHECK & LOAD CDB
MOVEI 1,DMODE(CDB) ;GET VALUE
MOVEM 1,RACS+1(USER) ;SO RESTR WINS
MOVE LPSA,X22 ;
JRST RESTR ;RETURN
HERE(OPNSP1) ;PERHAPS PUT GETSTS HERE
;;%##% GOBBLED DOWN TWO SPARE HERES HERE FOR STATUS ROUTINES THAT FOLLOW
ERR <DRYROT IN OPEN SPARES>
ENDCOM (OPN)
;;%##%
COMPIL(STS,<GETSTS,SETSTS>
,<SAVE,RESTR,SIMIO,GOGTAB,GETCHN,X11,X33,X22>
,<GETSTS AND SETSTS>)
COMMENT GETSTS,SETSTS
DSCR STATUS_GETSTS(CHANNEL);
CAL SAIL
.STS:
HERE(GETSTS)
PUSHJ P,SAVE
LOADI7 A,<GETSTS>
MOVE CHNL,-1(P) ;CHANNEL #
PUSHJ P,GETCHN
XCT IOSTATUS,SIMIO ;DO THE UUO
JFCL
MOVE A,FSTATS(USER) ;THE RESULT
MOVEM A,RACS+A(USER) ;SO RESTR WORKS
MOVE LPSA,X22
JRST RESTR
DSCR SETSTS(CHANNEL,STATURS);
CAL SAIL
HERE(SETSTS)
PUSHJ P,SAVE
LOADI7 A,<SETSTS>
MOVE CHNL,-2(P)
PUSHJ P,GETCHN
MOVE A,-1(P) ;INTENDED STATUS BITS
XCT SETIOSTS,SIMIO ;XECUTE THE INST
JFCL ;SHOULDN'T SKIP
MOVE LPSA,X33
JRST RESTR ;GO RESTORE
ENDCOM(STS)
COMPIL(LOK,<LOOKUP,ENTER,FILEINFO>
,<SAVE,RESTR,GETCHN,FILNAM,SIMIO,X33,X22,GOGTAB>
,<LOOKUP, ENTER, AND FILEINFO ROUTINES>)
COMMENT Lookup, Enter
DSCR LOOKUP(CHANNEL,"FILE NAME",@FAILURE FLAG);
CAL SAIL
Comment
LOOKUP or ENTER file FILENAME on channel CHANNEL, where FILENAME has
a format acceptable to FILNAM above. If successful,
FAILURE!FLAG (called by reference) is zeroed. It is
otherwise set to -1 in LH, error code in RH.
.LOK:
HERE (LOOKUP) PUSHJ P,SAVE
LOADI7 A,<LOOKUP>
PUSH P,[XCT IOLOOKUP,SIMIO] ;LOOKUP CH,FILE
MOVEI B,INAME ;TO STORE FILE NAME
JRST LOKENT ;DO THE OPERATION
DSCR ENTER(CHANNEL,"FILE NAME",@FAILURE FLAG);
CAL SAIL
HERE (ENTER)
PUSHJ P,SAVE
LOADI7 A,<ENTER>
PUSH P,[XCT IOENTER,SIMIO] ;ENTER CH,FILE
MOVEI B,ONAME ;TO STORE FILE NAME
LOKENT:
MOVE LPSA,X33 ;PARAM ADJUST FOR RESTR
MOVE CHNL,-3(P) ;GET CHANNEL #
PUSHJ P,GETCHN ;VALIDATE
SETZM @-2(P) ;ASSUME SUCCESS
PUSHJ P,FILNAM ;GET FILE
JRST BADSPC ; NO GOOD, REPORT ERROR
ADD B,CDB ;ADDR OF FILE NAME HOLDER
MOVEW (<(B)>,<FNAME(USER)>) ;STORE IT
TYMSHR < MOVEI X,5 ;SPECIAL LOOKUP HERE
EXCH X,FNAME(USER)
EXCH X,FNAME+2(USER)
MOVEM X,FNAME+4(USER)
MOVE X,FNAME+3(USER)
EXCH X,FNAME+1(USER)
MOVEM X,FNAME+3(USER)>;TYMSHR
POP P,X ;INSTRUCTION TO DO
MOVE Y,[JRST ELERR] ;FAILURE
NOTYMSHR < MOVE Z,[JRST RESTR] ;SUCCESS>;NOTYMSHR
TYMSHR < MOVE Z,[JRST LOKNT1] ;SUCCESS>;TYMSHR
ENF1: JRST X ;ENTER/LOOKUP
BADSPC: POP P,(P) ;REMOVE IO INSTRUCTION
HRRZ TEMP,ERRTST(CDB) ;GET USER-ENABLE BITS
TRNE TEMP,10000 ;ENABLED FOR HANDLING BAD FILE SPECS?
ERR <LOOKUP OR ENTER: INVALID FILE SPECIFICATION>,1 ;NO, TELL HIM
SKIPA TEMP,[=8] ;ALWAYS REPORT NO GOOD LOOKUP/ENTER
ELERR: TYMSHR <PUSHJ P,LOKNTC>;TYMSHR
NOTYMSHR< HRRZ TEMP,FNAME+1(USER) ;WHY DID IT BLOW?>;NOTYMSHR
HRROM TEMP,@-1(P) ;TELL THE USER
JRST RESTR
TYMSHR <
LOKNTC: MOVE TEMP,FNAME+4(USER)
EXCH TEMP,FNAME+2(USER) ;PUT THINGS BACK
MOVEM TEMP,FNAME(USER)
MOVE TEMP,FNAME+1(USER)
EXCH TEMP,FNAME+3(USER)
MOVEM TEMP,FNAME+1(USER)
POPJ P,
LOKNT1: PUSHJ P,LOKNTC
JRST RESTR>;TYMSHR