

; Bliss-32 10.1-416	Monday 21-AUG-1978 23:04:33	DBB3:[F11A.SRC]SCHFCB.B32;9					Page 1

;

;	0001	MODULE SCHFCB (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'A0004'

;	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 searches the current volume's FCB list for the

;	0033	!	FCB representing the desired file number.

;	0034	!

;	0035	! ENVIRONMENT:

;	0036	!

;	0037	!	STARLET operating system, including privileged system services

;	0038	!	and internal exec routines.

;	0039	!

;	0040	!--

;	0041	!

;	0042	!

;	0043	! AUTHOR:  Andrew C. Goldstein,	 CREATION DATE:  13-Dec-1976  15:41

;	0044	!

;	0045	! REVISION HISTORY:

;	0046	!

;	0047	!   Andrew C. Goldstein, 12-Dec-1977  14:27

;	0048	!   X0002 - file ID interface changes

;	0049	!

;	0050	!   Andrew C. Goldstein, 17-Feb-1978  14:49

;	0051	!   X0003 - Use new bug check

;	0052	!

;	0053	!   Andrew C. Goldstein, 15-May-78  14:56

;	0054	!   A0004 - Check RVN; speed up loop

;	0055	!



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:04:33	DBB3:[F11A.SRC]SCHFCB.B32;9					Page 1-1

;

;	0056	!**

;	0057	

;	0058	

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

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



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:04:33	DBB3:[F11A.SRC]SCHFCB.B32;9					Page 2

;

;	0379	GLOBAL ROUTINE SEARCH_FCB (FILE_ID) =

;	0380	

;	0381	!++

;	0382	!

;	0383	! FUNCTIONAL DESCRIPTION:

;	0384	!

;	0385	!	This routine searches the current volume's FCB list for the

;	0386	!	FCB representing the desired file number.

;	0387	!

;	0388	!

;	0389	! CALLING SEQUENCE:

;	0390	!	SEARCH_FCB (ARG1)

;	0391	!

;	0392	! INPUT PARAMETERS:

;	0393	!	ARG1: address of desired file ID

;	0394	!

;	0395	! IMPLICIT INPUTS:

;	0396	!	CURRENT_VCB: VCB address of volume

;	0397	!

;	0398	! OUTPUT PARAMETERS:

;	0399	!	NONE

;	0400	!

;	0401	! IMPLICIT OUTPUTS:

;	0402	!	NONE

;	0403	!

;	0404	! ROUTINE VALUE:

;	0405	!	FCB address if found

;	0406	!	zero if not

;	0407	!

;	0408	! SIDE EFFECTS:

;	0409	!	NONE

;	0410	!

;	0411	!--

;	0412	

;	0413	BEGIN

;	0414	

;	0415	MAP

;	0416		FILE_ID		: REF BBLOCK;	! file ID arg

;	0417	

;	0418	LOCAL

;	0419		FCB		: REF BBLOCK,	! current FCB being looked at

;	0420		PREV_FCB	: REF BBLOCK;	! previous FCB in list

;	0421	

;	0422	EXTERNAL

;	0423		CURRENT_VCB	: REF BBLOCK;	! VCB of volume in process

;	0424	

;	0425	! Init the pointers and start scanning the FCB list, which is a double

;	0426	! linked list. Check for consistency of pointers and the block ID for each

;	0427	! FCB. We win when the FCB containing the desired file number is found;

;	0428	! we lose at end of list (pointing back to the VCB).

;	0429	!

;	0430	

;	0431	PREV_FCB = .CURRENT_VCB;

;	0432	FCB = .CURRENT_VCB[VCB$L_FCBFL];

;	0433	



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:04:33	DBB3:[F11A.SRC]SCHFCB.B32;9					Page 2-1

;

;	0434	IF

;	0435	    BEGIN

;	0436	    UNTIL .FCB EQL .CURRENT_VCB DO

;	0437		BEGIN

;	0438		IF .FCB[FCB$B_TYPE] EQL DYN$C_FCB

;	0439		AND .FCB[FCB$L_FCBBL] EQL .PREV_FCB

;	0440		THEN

;	0441		    BEGIN

;	0442		    IF  .FILE_ID[FID$W_NUM] EQL .FCB[FCB$W_FID_NUM]

;	0443		    AND .FILE_ID[FID$W_RVN] EQL .FCB[FCB$W_FID_RVN]

;	0444		    THEN EXITLOOP .FCB;

;	0445	

;	0446		    PREV_FCB = .FCB;		! link to next FCB

;	0447		    FCB = .FCB[FCB$L_FCBFL];

;	0448		    END

;	0449		ELSE

;	0450		    BUG_CHECK (NOTFCBFCB, FATAL, 'FCB linkage broken');

;	0451		END				! end of loop

;	0452	    END

;	0453	

;	0454	    EQL -1

;	0455	THEN 0					! return 0 if loop failed

;	0456	ELSE .FCB				! else FCB address

;	0457	

;	0458	END;					! end of routine SEARCH_FCB





							    .TITLE  SCHFCB

							    .IDENT  \A0004\



							    .PSECT  $LOCKEDC2$,NOWRT,2



				  FEFF  0000  00000 P.AAA:  .WORD   0, -257						      ;

					0000* 00004 	    .WORD   <BUG$_NOTFCBFCB!4>					      ;

					      00006	    .BLKB   2



							    .EXTRN  CURRENT_VCB, BUG$_NOTFCBFCB



							    .PSECT  $CODE$,NOWRT,2



					 000C 00000 	    .ENTRY  SEARCH_FCB, Save R2,R3				      ; 0379

		         53 	0000G  CF  D0 00002 	    MOVL    CURRENT_VCB, PREV_FCB				      ; 0431

		         52 	0000G  DF  D0 00007 	    MOVL    @CURRENT_VCB, FCB					      ; 0432

		  0000G  CF	       52  D1 0000C 1$:     CMPL    FCB, CURRENT_VCB					      ; 0436

				       31  13 00011 	    BEQL    4$							      ;

		         07 	  0A   A2  91 00013 	    CMPB    10(FCB), #7						      ; 0438

				       24  12 00017 	    BNEQ    3$							      ;

		         53 	  04   A2  D1 00019 	    CMPL    4(FCB), PREV_FCB					      ; 0439

				       1E  12 0001D 	    BNEQ    3$							      ;

		         50 	  04   AC  D0 0001F 	    MOVL    FILE_ID, R0						      ; 0442

		    20   A2	       60  B1 00023 	    CMPW    (R0), 32(FCB)					      ;

				       0C  12 00027 	    BNEQ    2$							      ;

		    24   A2	  04   A0  B1 00029 	    CMPW    4(R0), 36(FCB)					      ; 0443

				       05  12 0002E 	    BNEQ    2$							      ;

		         50 	       52  D0 00030 	    MOVL    FCB, R0						      ; 0444



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:04:33	DBB3:[F11A.SRC]SCHFCB.B32;9					Page 2-2

;

				       12  11 00033 	    BRB     5$							      ;

		         53 	       52  D0 00035 2$:     MOVL    FCB, PREV_FCB					      ; 0446

		         52 	       62  D0 00038 	    MOVL    (FCB), FCB						      ; 0447

				       CF  11 0003B 	    BRB     1$							      ; 0438

		  0000'  CF	       00  FB 0003D 3$:     CALLS   #0, P.AAA						      ; 0450

				       C8  11 00042 	    BRB     1$							      ; 0436

		         50 	       01  CE 00044 4$:     MNEGL   #1, R0						      ; 0435

	      FFFFFFFF   8F	       50  D1 00047 5$:     CMPL    R0, #-1						      ; 0454

				       03  12 0004E 	    BNEQ    6$							      ;

				       50  D4 00050 	    CLRL    R0							      ; 0434

					   04 00052 	    RET     							      ;

		         50 	       52  D0 00053 6$:     MOVL    FCB, R0						      ;

					   04 00056 	    RET     							      ; 0379



; Routine Size:  87 bytes





;	0459	

;	0460	END

;	0461	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $LOCKEDC2$     	     8  NOWRT,  RD ,  EXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)

;  $CODE$         	    87  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        10         0       231











; Size:		87 code + 8 data bytes

; Run Time:	00:04.3

; Elapsed Time:	00:10.7

; Memory Used:	256 pages

; Compilation Complete

