Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99e-bb - glxfil.c08
There are 2 other files named glxfil.c08 in the archive. Click here to see a list.
 REP 2/1	;08C1
	SUBTTL	Irwin L. Goverman - Larry Samberg/MLB/DC/PW/AWC	1-Jan-82
 WIT
	SUBTTL	Irwin L. Goverman - Larry Samberg/MLB/DC/PW/AWC/LWS/CTK 10-May-84
 REP 6/1	;08C2
	;        COPYRIGHT (c) 1975,1976,1977,1978,1979,1980,1981,1982,
	;			       1983, 1984
 WIT
	;        COPYRIGHT (c) 1975,1976,1977,1978,1979,1980,1981,1982
 REP 28/1	;08C3
		FILEDT==102			;EDIT LEVEL
 WIT
		FILEDT==110			;EDIT LEVEL
 INS 158/3	;08C4

	;**;Begin Galaxy 4.1 code maintenance

	0103		Fix illegal memory reference problem when using
			F%xOPN routines.
			SPR 10-33434,10-34187	25-SEP-83/CTK

	104		Make F%IBYT handle page marks in LSN file correctly.
			7-Nov-83 /LWS

	105		In OPNCOM the FILOP. uuo returns a 0 in the path
			block when the structure is NUL. This caused the SETFD
			routine to create FD blocks with 0 as the structure
			name. The final result was BATCON passing QUASAR
			bad information, leading to QUASAR CRL then RRF
			stopcodes.
			1-Mar-84/CTK	SPR 10-34431

	106		The F%REN routine always resets the file IO
			mode to zero/ASCII mode. This causes problems
			for /DISP:RENAME on plotter files because the
			file IO mode is used by SPROUT to control
			the plotter.
			15-Mar-84/CTK	SPR 10-34531

	107		Add code and revamp the F%REN routine so we
			do the FILOP RENAME correctly. Edit 106
			introduced a DATE-75 bug.
			17-Apr-84	SPR 10-34531

	110		Fix problem with F%REN found by the VEREDT tool.
			We could not rename from an SFD to an SFD and
			release channels after use.
			10-May-84/CTK	SPR 10-34690

 REP 50/14	;08C5
	OPNC.2:	MOVE	T1,FB$BUF(FB)		;GET ADDRESS OF BUFFER
 WIT
	OPNC.2:
	;**;[105]ADD 2 LINES AT OPNC.2:+0L	1-MAR-84/CTK
		MOVE	S1,FB$FUB+.FODEV(FB)	;[105]GET DEVICE, SETUP FILOP. 0 RETURN
		MOVEM	S1,FB$PTH+.PTFCN(FB)	;[105]STORE STRUCTURE NAME
		MOVE	T1,FB$BUF(FB)		;GET ADDRESS OF BUFFER
 REP 19/16	;08C6
		MOVEM	S2,FB$LEB+.RBEXT(FB)	;STORE IT
 WIT
	;**;[107]CHANGE 1 LINE AT LDLEB:+6L	10-APR-84/CTK
		HLLM	S2,FB$LEB+.RBEXT(FB)	;[107]STORE IT
 REP 27/17	;08C7
		CAILE	.FIMAX			; IT
 WIT
	;**;[103]CHANGE 1 LINE AT ATTR.1:+4L	25-SEP-83/CTK
		CAILE	S2,.FIMAX		;[103] IT
 REP 33/22	;08C8
	IBYT.4:	MOVE	S1,FB$BBP(FB)		;GET THE BUFFER BYTE POINTER
		IBP	S1			;NORMALIZE IT
		MOVE	S1,(S1)			;GET THE WORD
		TRNN	S1,1			;IS LSN BIT SET?
 WIT
	;**;[104] Redo code from IBYT.4 to end of F%IBYT. 3-Nov-83 /LWS
	;[104] Here to handle LSN strangeness.

	IBYT.4:	$SAVE	<T1>			;[104] SAVE T1
		MOVE	S1,FB$BBP(FB)		;GET THE BUFFER BYTE POINTER
		IBP	S1			;NORMALIZE IT
		MOVE	T1,(S1)			;[104] GET THE WORD
		TRNN	T1,1			;[104] IS LSN BIT SET?
 REP 40/22	;08C9
		AOS	FB$BBP(FB)		;INCREMENT BYTE-POINT BY ONE WORD
		MOVNI	S1,5-1			;ACCOUNT FOR BYTES BYPASSED BY AOS
						;FB$BIB WAS SOSGE'D ABOVE
		ADDM	S1,FB$BIB(FB)		;DECREMENT BYTES-IN-BUFFER
						;EVEN IF FB$BIB GOES NEGATIVE HERE
						;THE NEXT SOSGE IN IBYT WILL CATCH IT
		SETZM	FB$LSN(FB)		;CLEAR FLAG TO AVOID RECURSION
 WIT
		PUSHJ	P,IBYT.8		;[104] GO ADJUST BYTE COUNT AND POINTER
		CAME	T1,[EXP <<"     ">_1>!1];[104] BEGINNING OF LSN PAGE MARK?
		JRST	IBYT.7			;[104] NO,,MUST JUST BE LINE NUMBER
	IBYT.5:	SOSGE	FB$BIB(FB)		;[104] COULD BE,,BUFFER HAVE ANY MORE?
		JRST	IBYT.6			;[104] NO,,GO GET ANOTHER BUFFER

		MOVE	S1,FB$BBP(FB)		;[104] GET BYTE POINTER
		IBP	S1			;[104] NORMALIZE IT
		MOVE	T1,(S1)			;[104] GET WHOLE WORD
		CAME	T1,[BYTE (7) .CHCRT,.CHFFD,0,0,0] ;[104] SECOND WORD OF PAGE MARK?
		 JRST	IBYT.2			;[104] NO,,GIVE THE GUY THE NEXT BYTE
		PUSHJ	P,IBYT.8		;[104] YES,,GO ADJUST BYTE COUNT AND POINTER
		JRST	IBYT.1			;[104] GO GET THE NEXT BYTE

	IBYT.6:	PUSHJ	P,GETBUF		;[104] GET NEXT BUFFER
		JUMPF	.RETF			;[104] RETURN IF NO MORE
		JRST	IBYT.5			;[104] GO BACK AND GET NEXT BYTE

	IBYT.7:	SETZM	FB$LSN(FB)		;[104] CLEAR FLAG TO AVOID RECURSION
 REP 50/22	;08C10
		JRST	IBYT.1			;ELSE, GET NEXT BYTE
 WIT
		CAIN	S2,.CHTAB		;[104] WAS IT REALLY A TAB?
		JRST	IBYT.1			;[104] YES,,GET NEXT BYTE
		$RETT				;[104] NO,,DON'T KEEP IT FROM CALLER

	IBYT.8:	AOS	FB$BBP(FB)		;[104] INCREMENT BYTE-POINT BY ONE WORD
		MOVNI	S1,5-1			;[104] ACCOUNT FOR BYTES BYPASSED BY AOS
						;[104] FB$BIB WAS SOSGE'D ABOVE
		ADDM	S1,FB$BIB(FB)		;[104] DECREMENT BYTES-IN-BUFFER
						;[104] EVEN IF FB$BIB GOES NEGATIVE HERE
						;[104] THE NEXT SOSGE IN IBYT WILL CATCH IT
		POPJ	P,			;[104] RETURN
 REP 18/36	;08C11
	F%REN:	$SAVE	FB			;SAVE THE FB ADDRESS RESGISTER
 WIT
	F%REN:
	;**;[107]ADD AND REVAMP CODE AT F%REN:+0L	12-APR-84/CTK
		$SAVE	FB			;SAVE THE FB ADDRESS RESGISTER
 REP 45/36	;08C12
		MOVE	T2,.FDSTR(S1)		;GET SOURCE STRUCTURE
		MOVE	S2,FRB.DF(T1)		;GET FD FOR DESTINATION
		PUSHJ	P,LDLEB			;LOAD THE LOOKUP/ENTER BLOCK FROM FD
		PUSHJ	P,ALCIFN		;ALLOCATE ANOTHER IFN
		JUMPF	REN.21			;PASS ERROR AFTER RELEASING FIRST IFN

		JUMPE	P1,REN.X		;ANY ATTRIBUTES?
		MOVEM	P1,FB$PTR(FB)		;SET ATTRIBUTE BLOCK ADDR IN NEW FB
		HRRZ	P1,(P1)			;GET WORD COUNT
		MOVEM	P1,FB$CNT(FB)		;SET ATTRIBUTE BLOCK COUNT IN NEW FB

	REN.X:	MOVEI	S2,FB$LEB(FB)		;GET ADDRESS OF 2ND LEB
		HRLM	S2,FB$FUB+.FOLEB(T3)	;STORE AS LH OF 1ST .FOLEB POINTER
		MOVE	S1,FRB.DF(T1)		;NOW GET 2ND FD ADDRESS
		PUSHJ	P,LDLEB			;LOAD THE LOOKUP/ENTER AREA
		PUSHJ	P,ATTRIB		;SET FILE ATTRIBUTES
 WIT
	;**;[110]DELETE 2 LINES AT REN.1:+3L	10-MAY-84/CTK
		PUSHJ	P,LDLEB			;LOAD THE LOOKUP/ENTER BLOCK FROM FD
		PUSHJ	P,ALCIFN		;ALLOCATE ANOTHER IFN
		JUMPF	REN.5			;[107]PASS ERROR, RELEASING FIRST IFN
 REP 3/37	;08C13
		MOVX	S1,FO.ASC		;ASSIGN CHANNEL NUMBER
		IOR	S1,[FO.PRV+.FORNM]	;PRIVELEGES+ RENAME FUNCTION
 WIT
	;**;[110]ADD 1 LINES AT REN.1:+7	10-MAY-84/CTK
		MOVE	S2,FB$LEB+.RBPPN(T3)	;[110]SAVE THE PATH POINTER
		MOVE	S1,[FO.ASC+FO.PRV+.FORED] ;[107]PRIV'S, CHANNEL, READ-IN
		MOVEM	S1,FB$FUB+.FOFNC(T3)	;[107]STORE INTO FUNCTION WORD
		HRLI	S1,.FOMAX		;[107]SET LENGTH OF BLOCK
		HRRI	S1,FB$FUB(T3)		;[107]AND ITS ADDRESS
		FILOP.	S1,			;[107]DO THE LOOKUP
		  JRST	REN.4			;[107]PASS ERROR, RELEASING FIRST IFN
	;**;[110]ADD 7 LINES AT REN.1:+15	10-MAY-84/CTK
		MOVEM	S2,FB$LEB+.RBPPN(T3)	;[110]RESTORE THE PATH POINTER
		LOAD	S1,FB$FUB+.FOFNC(T3),FO.CHN	;[110]GET THE CHANNEL
		HRL	S2,S1			;[110]LOAD THE CHANNEL NUMBER
		HRRI	S2,.FOREL		;[110]GET RELEASE FUNCTION
		MOVE	S1,[1,,S2]		;[110]GET ARG POINTER
		FILOP.	S1,			;[110]RELEASE THE CHANNEL
		  JFCL				;[110]CAN'T CARE ABOUT ERRORS
		HRLI	S1,FB$LEB(T3)		;[107]POINT TO THE LOOKUP/ENTER BLOCK
		HRRI	S1,FB$LEB(FB)		;[107]POINT TO THE RENAME BLOCK
		MOVEI	S2,FB$LEB+.RBMAX-1(FB)	;[107]LET'S GET THE ENDING ADDRESS
		BLT	S1,(S2)			;[107]NOW FILL IN THE RENAME BLOCK
		JUMPE	P1,REN.2		;ANY ATTRIBUTES?
		MOVEM	P1,FB$PTR(FB)		;SET ATTRIBUTE BLOCK ADDR IN NEW FB
		HRRZ	P1,(P1)			;GET WORD COUNT
		MOVEM	P1,FB$CNT(FB)		;SET ATTRIBUTE BLOCK COUNT IN NEW FB
	REN.2:	MOVEI	S2,FB$LEB(FB)		;GET ADDRESS OF 2ND LEB
		HRLM	S2,FB$FUB+.FOLEB(T3)	;STORE AS LH OF 1ST .FOLEB POINTER
		MOVE	S1,FRB.DF(T1)		;NOW GET 2ND FD ADDRESS
		PUSHJ	P,LDLEB			;LOAD THE LOOKUP/ENTER AREA
		PUSHJ	P,ATTRIB		;SET FILE ATTRIBUTES
		MOVE	S1,[FO.ASC+FO.PRV+.FORNM] ;[107]PRIV'S, CHANNEL, RENAME FUNCTION
 REP 9/37	;08C14
		  JRST	REN.3			;FAILED...
	REN.2:	LOAD	S1,FB$FUB+.FOFNC(T3),FO.CHN ;GET THE CHANNEL
 WIT
		  JRST	REN.4			;FAILED...
	REN.3:	LOAD	S1,FB$FUB+.FOFNC(T3),FO.CHN ;GET THE CHANNEL
 REP 18/37	;08C15
	REN.3:	PUSH	P,S1			;SAVE ERROR CODE
		PUSHJ	P,REN.2			;RELEASE THE IFNS
 WIT
	REN.4:	PUSH	P,S1			;SAVE ERROR CODE
		PUSHJ	P,REN.3			;RELEASE THE IFNS
 REP 23/37	;08C16
	REN.21:	PUSH	P,S1                    ;SAVE ERROR CODE
 WIT
	REN.5:	PUSH	P,S1                    ;SAVE ERROR CODE
 SUM 31054