

; Bliss-32 10.1-416	Monday 21-AUG-1978 22:57:54	DBB3:[F11A.SRC]GETFIB.B32;7					Page 1

;

;	0001	MODULE GETFIB (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'A0007'

;	0004			) =

;	0005	BEGIN

;	0006	

;	0007	!

;	0008	! Copyright (c) 1977

;	0009	! Digital Equipment Corporation, Maynard, Massachusetts 01754

;	0010	!

;	0011	! This software is furnished  under a license for use only on a single

;	0012	! computer  system and  may be  copied only with  the inclusion of the

;	0013	! above copyright notice.  This software, or any other copies thereof,

;	0014	! may not be provided or  otherwise made available to any other person

;	0015	! except for use on such system and to one who agrees to these license

;	0016	! terms.  Title to and  ownership of the  software  shall at all times

;	0017	! remain in DEC.

;	0018	!

;	0019	! The information in this software is subject to change without notice

;	0020	! and should  not be construed  as a commitment  by Digital  Equipment

;	0021	! Corporation.

;	0022	!

;	0023	! DEC assumes  no  responsibility  for  the use or  reliability of its

;	0024	! software on equipment which is not supplied by DEC.

;	0025	

;	0026	!++

;	0027	!

;	0028	! FACILITY:  F11ACP Structure Level 1

;	0029	!

;	0030	! ABSTRACT:

;	0031	!

;	0032	!	This routine obtains the address of the FIB for this operation.

;	0033	!

;	0034	! ENVIRONMENT:

;	0035	!

;	0036	!	STARLET operating system, including privileged system services

;	0037	!	and internal exec routines.

;	0038	!

;	0039	!--

;	0040	!

;	0041	!

;	0042	! AUTHOR:  Andrew C. Goldstein,	 CREATION DATE:  7-Jan-1977  01:02

;	0043	!

;	0044	! REVISION HISTORY:

;	0045	!

;	0046	!   Andrew C. Goldstein, 25-Feb-1977  16:33

;	0047	!   X0002 - Always copy FIB to local storage

;	0048	!

;	0049	!   Andrew C. Goldstein, 30-Mar-1977  17:51

;	0050	!   X0003 - Zero out result string data

;	0051	!

;	0052	!   Andrew C. Goldstein, 1-Apr-1977  16:42

;	0053	!   X0004 - Move buffer descriptor initialization to GETREQ and add -1,-1 DID kluge

;	0054	!

;	0055	!   Andrew C. Goldstein, 7-Apr-1977  14:31



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:57:54	DBB3:[F11A.SRC]GETFIB.B32;7					Page 1-1

;

;	0056	!   X0005 - Move local FIB to common module

;	0057	!

;	0058	!   Andrew C. Goldstein, 26-Sep-1977  15:07

;	0059	!   X0006 - Allow operations on file other than that open on channel

;	0060	!

;	0061	!   Andrew C. Goldstein, 17-Nov-1977  8:56

;	0062	!   X0007 - Special case check for DEACCESS in file ID validation

;	0063	!

;	0064	!**

;	0065	

;	0066	

;	0067	LIBRARY 'SYS$LIBRARY:LIB.L32';

;	0068	REQUIRE 'SRC$:FCPDEF.B32';



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:57:54	DBB3:[F11A.SRC]GETFIB.B32;7					Page 2

;

;	0387	GLOBAL ROUTINE GET_FIB (ABD) =

;	0388	

;	0389	!++

;	0390	!

;	0391	! FUNCTIONAL DESCRIPTION:

;	0392	!

;	0393	!	This routine obtains the address of the FIB for this operation.

;	0394	!	It copies the FIB from the buffer packet into local storage

;	0395	!	and zero extends it to maximum length.

;	0396	!

;	0397	! CALLING SEQUENCE:

;	0398	!	GET_FIB (ARG1)

;	0399	!

;	0400	! INPUT PARAMETERS:

;	0401	!	ARG1: buffer descriptor list

;	0402	!

;	0403	! IMPLICIT INPUTS:

;	0404	!	CURRENT_WINDOW: address of user's window or 0

;	0405	!	IO_PACKET: address of user's I/O packet

;	0406	!

;	0407	! OUTPUT PARAMETERS:

;	0408	!	NONE

;	0409	!

;	0410	! IMPLICIT OUTPUTS:

;	0411	!	NONE

;	0412	!

;	0413	! ROUTINE VALUE:

;	0414	!	address of FIB

;	0415	!

;	0416	! SIDE EFFECTS:

;	0417	!	file ID may be written into FIB

;	0418	!	channel window pointer write-back inhibited

;	0419	!	result string buffers zeroed

;	0420	!

;	0421	!--

;	0422	

;	0423	BEGIN

;	0424	

;	0425	MAP

;	0426		ABD		: REF BBLOCKVECTOR [,ABD$C_LENGTH];

;	0427						! buffer descriptors

;	0428	

;	0429	LOCAL

;	0430		FCB		: REF BBLOCK,	! FCB of file

;	0431		FIBL;				! length of user FIB

;	0432	

;	0433	EXTERNAL

;	0434		LOCAL_FIB	: BBLOCK,	! internal copy of user FIB

;	0435		IO_PACKET	: REF BBLOCK,	! I/O packet of this operation

;	0436		PRIMARY_FCB	: REF BBLOCK,	! FCB of current file

;	0437		CURRENT_FIB	: REF BBLOCK,	! pointer to current FIB in use

;	0438		CURRENT_WINDOW	: REF BBLOCK;	! user's window

;	0439	

;	0440	

;	0441	! Get the length of the user-supplied FIB. If there is a window,



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:57:54	DBB3:[F11A.SRC]GETFIB.B32;7					Page 2-1

;

;	0442	! and there is no user FIB, use the file ID from

;	0443	! the window's FCB. Also use the FCB's file ID if the file number

;	0444	! in the user FIB is zero.

;	0445	!

;	0446	

;	0447	FIBL = .ABD[ABD$C_FIB, ABD$W_COUNT];

;	0448	

;	0449	CH$COPY (.FIBL,

;	0450		.ABD[ABD$C_FIB, ABD$W_TEXT] + ABD[ABD$C_FIB, ABD$W_TEXT] + 1,

;	0451		0,

;	0452		FIB$C_LENGTH,

;	0453		LOCAL_FIB);

;	0454	CURRENT_FIB = LOCAL_FIB;

;	0455	

;	0456	IF .CURRENT_WINDOW NEQ 0

;	0457	THEN

;	0458	    BEGIN

;	0459	    FCB = .CURRENT_WINDOW[WCB$L_FCB];

;	0460	    IF .LOCAL_FIB[FIB$W_FID_NUM] EQL 0

;	0461	    THEN CH$MOVE (FIB$S_FID, FCB[FCB$W_FID], LOCAL_FIB[FIB$W_FID]);

;	0462	

;	0463	! If the file ID in the FIB does not match that in the FCB, this operation

;	0464	! is not on the open file; clear the FCB and window addresses (except in

;	0465	! the case of a DEACCESS, in which we force the file ID to that of the open

;	0466	! file and signal an error).

;	0467	!

;	0468	

;	0469	    IF .LOCAL_FIB[FIB$W_FID_NUM] NEQ .FCB[FCB$W_FID_NUM]

;	0470	    OR .LOCAL_FIB[FIB$W_FID_RVN] NEQ .FCB[FCB$W_FID_RVN]

;	0471	    THEN

;	0472		BEGIN

;	0473		IF .IO_PACKET[IRP$V_FCODE] EQL IO$_DEACCESS

;	0474		THEN

;	0475		    BEGIN

;	0476		    CH$MOVE (FIB$S_FID, FCB[FCB$W_FID], LOCAL_FIB[FIB$W_FID]);

;	0477		    ERR_STATUS (SS$_BADPARAM);

;	0478		    END

;	0479		ELSE

;	0480		    BEGIN

;	0481		    CURRENT_WINDOW = 0;

;	0482		    PRIMARY_FCB = 0;

;	0483		    END;

;	0484		END;

;	0485	    END

;	0486	

;	0487	! If there is no file open, there must be a minimum FIB.

;	0488	!

;	0489	

;	0490	ELSE

;	0491	    BEGIN

;	0492	    IF .FIBL LSS FIB$C_ACCDATA

;	0493	    THEN ERR_EXIT (SS$_INSFARG);

;	0494	    END;

;	0495	

;	0496	! If the directory ID is -1,-1, convert it to 4,4,0 to be compatible with



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:57:54	DBB3:[F11A.SRC]GETFIB.B32;7					Page 2-2

;

;	0497	! the old RSX MFD kluge.

;	0498	!

;	0499	

;	0500	IF .LOCAL_FIB[FIB$W_DID_NUM] EQL 65535

;	0501	AND .LOCAL_FIB[FIB$W_DID_SEQ] EQL 65535

;	0502	THEN

;	0503	    BEGIN

;	0504	    LOCAL_FIB[FIB$W_DID_NUM] = 4;

;	0505	    LOCAL_FIB[FIB$W_DID_SEQ] = 4;

;	0506	    LOCAL_FIB[FIB$W_DID_RVN] = 0;

;	0507	    END;

;	0508	

;	0509	RETURN LOCAL_FIB;

;	0510	

;	0511	END;					! end of routine GET_FIB





							    .TITLE  GETFIB

							    .IDENT  \A0007\



							    .EXTRN  LOCAL_FIB, IO_PACKET, PRIMARY_FCB, CURRENT_FIB

							    .EXTRN  CURRENT_WINDOW, USER_STATUS



							    .PSECT  $CODE$,NOWRT,2



					 00FC 00000 	    .ENTRY  GET_FIB, Save R2,R3,R4,R5,R6,R7			      ; 0387

		         57 	0000G  CF  9E 00002 	    MOVAB   LOCAL_FIB+4, R7					      ;

		         50 	  04   AC  D0 00007 	    MOVL    ABD, R0						      ; 0447

		         56 	  0A   A0  3C 0000B 	    MOVZWL  10(R0), FIBL					      ;

		         51 	  08   A0  9E 0000F 	    MOVAB   8(R0), R1						      ; 0450

		         50 	       61  3C 00013 	    MOVZWL  (R1), R0						      ;

	   00 	    01 A140	       56  2C 00016 	    MOVC5   FIBL, 1(R1)[R0], #0, #44, LOCAL_FIB			      ; 0449

		    FC   A7	       2C     0001C									      ;

		  0000G  CF	  FC   A7  9E 0001F 	    MOVAB   LOCAL_FIB, CURRENT_FIB				      ; 0454

		         50 	0000G  CF  D0 00025 	    MOVL    CURRENT_WINDOW, R0					      ; 0456

				       3D  13 0002A 	    BEQL    4$							      ;

		         56 	  18   A0  D0 0002C 	    MOVL    24(R0), FCB						      ; 0459

				       67  B5 00030 	    TSTW    LOCAL_FIB+4						      ; 0460

				       05  12 00032 	    BNEQ    1$							      ;

	   67 	    20   A6	       06  28 00034 	    MOVC3   #6, 32(FCB), LOCAL_FIB+4				      ; 0461

		    20   A6	       67  B1 00039 1$:     CMPW    LOCAL_FIB+4, 32(FCB)				      ; 0469

				       07  12 0003D 	    BNEQ    2$							      ;

		    24   A6	  04   A7  B1 0003F 	    CMPW    LOCAL_FIB+8, 36(FCB)				      ; 0470

				       2C  13 00044 	    BEQL    5$							      ;

		         50 	0000G  CF  D0 00046 2$:     MOVL    IO_PACKET, R0					      ; 0473

      20   A0	         06 	       00  ED 0004B 	    CMPZV   #0, #6, 32(R0), #52					      ;

				       34     00050									      ;

				       0C  12 00051 	    BNEQ    3$							      ;

	   67 	    20   A6	       06  28 00053 	    MOVC3   #6, 32(FCB), LOCAL_FIB+4				      ; 0476

		  0000G  CF	       14  B0 00058 	    MOVW    #20, USER_STATUS					      ; 0477

				       13  11 0005D 	    BRB     5$							      ; 0473

				0000G  CF  D4 0005F 3$:     CLRL    CURRENT_WINDOW					      ; 0481

				0000G  CF  D4 00063 	    CLRL    PRIMARY_FCB						      ; 0482

				       09  11 00067 	    BRB     5$							      ; 0469

		         0A 	       56  D1 00069 4$:     CMPL    FIBL, #10						      ; 0492



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:57:54	DBB3:[F11A.SRC]GETFIB.B32;7					Page 2-3

;

				       04  18 0006C 	    BGEQ    5$							      ;

				0114   8F  BF 0006E 	    CHMU    #276						      ; 0493

		  FFFF   8F	  06   A7  B1 00072 5$:     CMPW    LOCAL_FIB+10, #65535				      ; 0500

				       13  12 00078 	    BNEQ    6$							      ;

		  FFFF   8F	  08   A7  B1 0007A 	    CMPW    LOCAL_FIB+12, #65535				      ; 0501

				       0B  12 00080 	    BNEQ    6$							      ;

		    06   A7 00040004   8F  D0 00082 	    MOVL    #262148, LOCAL_FIB+10				      ; 0504

				  0A   A7  B4 0008A 	    CLRW    LOCAL_FIB+14					      ; 0506

		         50 	  FC   A7  9E 0008D 6$:     MOVAB   LOCAL_FIB, R0					      ; 0509

					   04 00091 	    RET     							      ; 0387



; Routine Size:  146 bytes





;	0512	

;	0513	END

;	0514	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $CODE$         	   146  NOWRT,  RD ,  EXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)









;				LIBRARY STATISTICS

;

;					     -------- Symbols --------    Blocks

;	File				     Total    Loaded   Percent      Read

;

;  DBA4:[SYSLIB]LIB.L32;1		      5582        22         0       237











; Size:		146 code + 0 data bytes

; Run Time:	00:05.6

; Elapsed Time:	00:12.4

; Memory Used:	275 pages

; Compilation Complete

