Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99e-bb - filio.c11
There is 1 other file named filio.c11 in the archive. Click here to see a list.
 REP 23/12	;11C1
		SE1ENT
		PUSHJ	P,UPDA		;GET DA RESOURCE
 WIT
		PUSHJ	P,UPDA		;GET DA RESOURCE
		SE1ENT
 REP 20/28	;11C2
		DSKOFF		;CANT ALLOW DISK INTERRUPTS WHILE FIDDLING
 WIT
		MOVSI	T1,U2PNRM##	;CAN'T EXCHANGE NON-REMOVABLE MEDIA
		TDNN	T1,UNIDS2##(P1)	;...
		TDNE	T1,UNIDS2##(U)	;...
		JRST	UPOPJ##		;GIVE ERROR
	IFN FTDUAL,<
		SKIPL	UNI2ND##(P1)	;DON'T ALLOW EXCHANGE OF ALTERNATE PORT
		SKIPGE	UNI2ND##(U)	;...
		JRST	UPOPJ##		;GIVE ERROR
	>; END IFN FTDUAL
		DSKOFF			;CANT ALLOW DISK INTERRUPTS WHILE FIDDLING
 REP 24/28	;11C3
		JRST	XCHUN2		;NO, CANT EXCHANGE
		CAIGE	T1,OWCOD##	;2ND UNIT IDLE OR IN OPR WAIT?
		JUMPN	T1,XCHUN2	;CANT EXCHANGE IF NOT
		MOVEI	T1,O2COD##	;IF UNITS ARENT IN OPR WAK
 WIT
		JRST	UPOPJ##		;NO, CANT EXCHANGE
		CAIGE	T1,OWCOD##	;2ND UNIT IDLE OR IN OPR WAIT?
		JUMPN	T1,UPOPJ##	;CANT EXCHANGE IF NOT
		MOVEI	T1,O2COD##	;IF UNITS ARENT IN OPR WAIT
 REP 1/29	;11C4
	IFN FTDUAL,<
 WIT
		MOVEI	T1,UNIHCT##(U)	;MAKE THE ERROR STATE
		MOVEI	T2,UNIHCT##(P1)	; STAY WITH THE DRIVE
		HRLI	T1,-3		; EXCHANGE UNIHCT,SCT,MCT
	XCHUN1:	MOVE	T3,(T1)
		EXCH	T3,(T2)
		MOVEM	T3,(T1)
		ADDI	T2,1
		AOBJN	T1,XCHUN1
	IFN FTDUAL,<
		MOVE	T1,UNISER##(U)	;CHANGE UNIT SERIAL NUMBERS
		EXCH	T1,UNISER##(P1)	;...
		MOVEM	T1,UNISER##(U)	;...
 REP 10/29	;11C5
		MOVE	T3,UNISTR##(U)	;SWITCH UNISTR'S
		SKIPE	T2
		HRRM	T3,UNISTR##(T2)
		MOVE	T3,UNISTR##(P1)
		SKIPE	T1
		HRRM	T3,UNISTR##(T1)
	>

		MOVEI	T1,UNIHCT##(U)	;MAKE THE ERROR STATE
		MOVEI	T2,UNIHCT##(P1)	; STAY WITH THE DRIVE
		HRLI	T1,-3		; EXCHANGE UNIHCT,SCT,MCT
	XCHUN1:	MOVE	T3,(T1)
		EXCH	T3,(T2)
		MOVEM	T3,(T1)
		ADDI	T2,1
		AOBJN	T1,XCHUN1
 WIT
		SKIPE	T2,UNI2ND##(U)	;IF SECOND UNIT NOW DUAL-PORTED,
		PUSHJ	P,CPYUD		; COPY NECESSARY DATA TO SECOND PORT
		EXCH	P1,U		;POINT AT FIRST UNIT
		SKIPE	T2,UNI2ND##(U)	;IF FIRST UNIT NOW DUAL-PORTED,
		PUSHJ	P,CPYUD		; COPY NECESSARY DATA TO SECOND PORT
		EXCH	P1,U		;AS YOU WERE
	>; END IFN FTDUAL
 INS 22/46	;11C6
		TLNE	F,ENTRB+LOOKB	;FILE OPEN?
		JRST	SETIMP##	;YES, GIVE HIM AN ERROR
 REP 16/211	;11C7
		JUMPL	T1,CPOPJ##		;DEVDMP IS FUNNY DURING FORMATTING
 WIT
		JUMPL	T1,CPOPJ##		;DEVDMP IS FUNNY DURING FORMATING
 SUM 18407