

; Bliss-32 7.352	Saturday 21-AUG-1978 23:31:52	DBB3:[MTAACP.SRC]FIND.B32;8					Page 1

; Digital Equipment Corporation

;

;	0001	MODULE FIND (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'A0003'

;	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:  MTAACP

;	0029	!

;	0030	! ABSTRACT:

;	0031	!	THIS MODULE FINDS A FILE BY FILE NAME STRING

;	0032	

;	0033	!

;	0034	! ENVIRONMENT:

;	0035	!

;	0036	!	STARLET OPERATING SYSTEM, INCLUDING PRIVILEGED SYSTEM SERVICES

;	0037	!	AND INTERNAL EXEC ROUTINES.

;	0038	!

;	0039	!--

;	0040	!

;	0041	!

;	0042	! AUTHOR:  D. H. GILLESPIE,	 CREATION DATE:  25-MAY-77 15:20  

;	0043	!

;	0044	! REVISION HISTORY:

;	0045	!

;	0046	!   D. H. Gillespie, 12-May-78  13:14

;	0047	!   A0001 - change CURRENT_VCB to a register

;	0048	!

;	0049	!   D. H. Gillespie, 23-May-78  9:47

;	0050	!   A0002 - eliminate READ_NXTHDR_WA

;	0051	!

;	0052	!   D. H. Gillespie, 23-May-78  13:29

;	0053	!   A0003 - change linkage to GET_START_HDR

;	0054	!

;	0055	!**



; Bliss-32 7.352	Saturday 21-AUG-1978 23:31:52	DBB3:[MTAACP.SRC]FIND.B32;8					Page 1-1

; Digital Equipment Corporation

;

;	0056	

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

;	0058	REQUIRE 'SRC$:MTADEF.B32';

;	0354	

;	0355	FORWARD ROUTINE

;	0356		FIND_FILE		: COMMON_CALL NOVALUE,		!FIND FILE BY FILE NAME STRING

;	0357		CLEAR_ST_SEARCH		: COMMON_CALL NOVALUE,		!CLEAR START OF SEARCH

;	0358		RETURN_FNS		: COMMON_CALL;			!WRITE BACK FILE NAME INFORMATION



; Bliss-32 7.352	Saturday 21-AUG-1978 23:31:52	DBB3:[MTAACP.SRC]FIND.B32;8					Page 2

; Digital Equipment Corporation

;

;	0359	GLOBAL ROUTINE FIND_FILE : COMMON_CALL NOVALUE  =

;	0360	

;	0361	!++

;	0362	!

;	0363	! FUNCTIONAL DESCRIPTION:

;	0364	!	THIS ROUTINE FINDS A FILE BY FILE NAME STRING

;	0365	!

;	0366	! CALLING SEQUENCE:

;	0367	!	FIND()

;	0368	!

;	0369	! INPUT PARAMETERS:

;	0370	!	NONE	

;	0371	!

;	0372	! IMPLICIT INPUTS:

;	0373	!	LOCAL_FIB,CURRENT_VCB

;	0374	!

;	0375	! OUTPUT PARAMETERS:

;	0376	!	NONE

;	0377	!

;	0378	! IMPLICIT OUTPUTS:

;	0379	!	NONE

;	0380	!

;	0381	! ROUTINE VALUE:

;	0382	!	NONE

;	0383	!

;	0384	! SIDE EFFECTS:

;	0385	!	IF FILE FOUND, HDR1 AND HDR2 WILL BE READ IN OR DEFAULTED

;	0386	!	RESULT FILE NAME STRING AND LENGTH RETURNED TO USER

;	0387	!

;	0388	! USER ERRORS:

;	0389	!	SS$_NOSUCHFILE - FILE NOT FOUND

;	0390	!	SS$_RESULTOVF - RESULT STRING OVERFLOW

;	0391	!--

;	0392	

;	0393	BEGIN

;	0394	

;	0395	EXTERNAL REGISTER

;	0396		COMMON_REG;

;	0397	

;	0398	EXTERNAL

;	0399		LOCAL_FIB:	BBLOCK;			!COPY OF USER'S FIB

;	0400	

;	0401	EXTERNAL ROUTINE

;	0402		FORMAT_FID,				!FORMAT FID

;	0403		GET_START_HDR	: L$GET_START_HDR,	!GET HEADERS TO START SEARCH ON

;	0404		WRAP_AROUND	: L$WRAP_AROUND,	!WRAP AROUND TO BEGINNING OF 

;	0405							!VOLUME SET UNLESS START OF SEARCH

;	0406							!WAS BEGINNING

;	0407		PARSE_TRANS_FNS,			!PARSE AND TRANSLATE FILE NAME STRING

;	0408		PARSE_TRANS_FID,			!PARSE AND TRANSLATE FILE IDENTIFIER

;	0409		READ_HDR,				!READ HEADERS

;	0410		REWIND_VOL_SET,				!REWIND VOLUME SET

;	0411		SPACE_EOF,				!SPACE TO END OF FILE

;	0412		SYS$FAO:	ADDRESSING_MODE(ABSOLUTE);!FORMAT ASCII OUTPUT

;	0413	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:31:52	DBB3:[MTAACP.SRC]FIND.B32;8					Page 2-1

; Digital Equipment Corporation

;

;	0414		

;	0415	LOCAL

;	0416		FIB:		REF BBLOCK,		!ADDRESS OF COPY OF USER'S FIB

;	0417		FIDSTR:		BLOCK [MAX_FILESTR_LEN],!HOLDS TRANSLATED FILE ID STRING

;	0418		FIDFND:		VECTOR [2],		!DESCRIPTOR OF FID FILE NAME

;	0419		FIDFTD:		VECTOR [2],		!DESCRIPTOR OF FID FILE TYPE

;	0420	

;	0421		FNSSTR:		BLOCK [MAX_FILESTR_LEN],!HOLDS TRANSLATED FILE NAME STRING

;	0422		FNSFND:		VECTOR [2],		!DESCRIPTOR OF FNS FILE NAME

;	0423		FNSFTD:		VECTOR [2],		!DESCRIPTOR OF FNS FILE TYPE

;	0424		FNSVER:		WORD,			!DESCRIPTOR OF FNS BINARY VERSION

;	0425		FIDVER:		WORD;			!BINARY FID VERSION

;	0426	

;	0427	BIND

;	0428		CVTFNM 	=	DESCRIPTOR ('!AS.!AS;!SW');

;	0429	

;	0430	! SETUP POINTER TO COPY OF USER'S FIB

;	0431	FIB = LOCAL_FIB;

;	0432	

;	0433	! IF THIS IS NOT A WILD CARD LOOKUP THEN ZERO CONTEXT

;	0434	IF NOT .FIB[FIB$V_WILD] THEN FIB[FIB$L_WCC] = 0;

;	0435	

;	0436	! IF BEGINNING OF SEARCH CHECK FOR REWIND SWITCH

;	0437	IF .FIB[FIB$L_WCC] EQL 0 THEN

;	0438	    BEGIN

;	0439	    IF .FIB[FIB$V_REWIND] EQL 1  THEN REWIND_VOL_SET();

;	0440	    KERNEL_CALL(CLEAR_ST_SEARCH);			!CLEAR START OF SEARCH FILE ID

;	0441	    END

;	0442	

;	0443	ELSE

;	0444	    BEGIN

;	0445	

;	0446	! IF EITHER OF THESE TWO VALUES ARE ZERO THEN THE USER HAS NOT PRECEDED THIS

;	0447	! CALL WITH A FIRST TIME THRU LOOKUP.

;	0448	    IF .CURRENT_VCB[VCB$L_CUR_FID] EQL 0 OR .CURRENT_VCB[VCB$L_START_FID] EQL 0 THEN ERR_EXIT(SS$_BADPARAM);

;	0449	

;	0450	! IF NOT FIRST TIME THROUGH , THEN DON'T INCLUDE CURRENT FILE IN SEARCH

;	0451	    IF NOT .CURRENT_VCB[VCB$V_LOGICEOVS] THEN SPACE_EOF();

;	0452	    END;

;	0453	

;	0454	! POSITION TO FIRST FILE

;	0455	IF NOT GET_START_HDR()				!TM, SO AT LOGICAL END OF VOL SET

;	0456	THEN

;	0457	

;	0458	! CONTINUE SEARCH AT BEGINNING OF TAPE UNLESS THE START OF SEARCH WAS THE BEGINNING

;	0459	

;	0460	    IF NOT WRAP_AROUND() THEN ERR_EXIT (SS$_NOSUCHFILE);

;	0461	

;	0462	! IF DUMMY FILE, DENY ITS EXISTENCE

;	0463	IF .CURRENT_VCB[VCB$W_CUR_NUM] EQLU 0 THEN ERR_EXIT(SS$_NOSUCHFILE);

;	0464	

;	0465	! IF FIRST TIME THROUGH SAVE START CONTEXT ELSE CHECK NOT AT BEGINNING OF SEARCH

;	0466	IF .FIB[FIB$L_WCC] EQL 0

;	0467	THEN KERNEL_CALL(FORMAT_FID,CURRENT_VCB[VCB$W_START_NUM])	!CONVERT FILE SEQ AND SECTION NUMBER

;	0468	ELSE



; Bliss-32 7.352	Saturday 21-AUG-1978 23:31:52	DBB3:[MTAACP.SRC]FIND.B32;8					Page 2-2

; Digital Equipment Corporation

;

;	0469	    IF .CURRENT_VCB[VCB$L_CUR_FID] EQL .CURRENT_VCB[VCB$L_START_FID] THEN ERR_EXIT(SS$_NOSUCHFILE);	!END OF SEARCH

;	0470	

;	0471	WHILE 1 DO

;	0472	    BEGIN

;	0473	    PARSE_TRANS_FID(FIDSTR,FIDFND,FIDFTD,FIDVER);

;	0474	    PARSE_TRANS_FNS(FNSSTR,FNSFND,FNSFTD,FNSVER);

;	0475	

;	0476	    IF

;	0477		(

;	0478		.FIB[FIB$V_ALLNAM]			!WILD CARD NAME

;	0479		OR CH$EQL(.FIDFND[0],.FIDFND[1],.FNSFND[0],.FNSFND[1],' ')

;	0480		)

;	0481		AND

;	0482		(

;	0483		.FIB[FIB$V_ALLTYP]			!WILD CARD TYPE

;	0484		OR CH$EQL(.FIDFTD[0],.FIDFTD[1],.FNSFTD[0],.FNSFTD[1],' ')

;	0485		)

;	0486		AND

;	0487		(

;	0488		.FIB[FIB$V_ALLVER]			!WILD CARD VERSION

;	0489		OR .FNSVER LEQU 0			!FIRST OR LAST VERSION

;	0490		OR .FNSVER EQLU .FIDVER			!SAME VERSION

;	0491		)

;	0492	    THEN EXITLOOP;

;	0493	    SPACE_EOF();

;	0494	    IF NOT READ_HDR() THEN

;	0495		IF NOT WRAP_AROUND() THEN ERR_EXIT(SS$_NOSUCHFILE);

;	0496		    IF .CURRENT_VCB[VCB$L_CUR_FID] EQL .CURRENT_VCB[VCB$L_START_FID] THEN ERR_EXIT(SS$_NOSUCHFILE);	!END OF SEARCH

;	0497	    END;					!END OF WHILE LOOP

;	0498	

;	0499	! HAVE FILE MATCH

;	0500	! SETUP TO WRITE BACK FID, RESULT STRING, RESULT STRING LENGTH

;	0501	FORMAT_FID(FIB[FIB$W_FID_NUM]);		!RETURN FID IN FIB

;	0502	FIB[FIB$W_FID_RVN] = .CURRENT_VCB[VCB$B_CUR_RVN];

;	0503	FIB[FIB$L_WCC] = (IF .FIB[FIB$V_WILD] THEN 1);	!NOTE THROUGH LOOKUP AT LEAST ONCE

;	0504	

;	0505	! MAKE FILE NAME STRING

;	0506	FNSFND[0] = MAX_FILESTR_LEN;

;	0507	FNSFND[1] = FNSSTR;

;	0508	SYS$FAO(CVTFNM,FNSFND[0],FNSFND,FIDFND,FIDFTD,.FIDVER);

;	0509	

;	0510	! AND RETURN IT TO THE USER

;	0511	IF NOT KERNEL_CALL(RETURN_FNS,FNSFND) THEN ERR_EXIT();

;	0512	END;						!END OF ROUTINE





							    .TITLE  FIND

							    .IDENT  \A0003\



							    .PSECT  $CODE$,NOWRT,2



					      00000 P.AAB:  .ASCII  \!AS.!AS;!SW\					      ;

					      0000B	    .BLKB   1

					      0000C P.AAA:  .LONG   11							      ;

					      00010 	    .ADDRESS  P.AAB						      ;



; Bliss-32 7.352	Saturday 21-AUG-1978 23:31:52	DBB3:[MTAACP.SRC]FIND.B32;8					Page 2-3

; Digital Equipment Corporation

;



						    CVTFNM=		P.AAA

							    .GLOBL  LOCAL_FIB, FORMAT_FID, GET_START_HDR, WRAP_AROUND

							    .GLOBL  PARSE_TRANS_FNS, PARSE_TRANS_FID, READ_HDR, REWIND_VOL_SET

							    .GLOBL  SPACE_EOF, SYS$FAO, SYS$CMKRNL



					 041C 00014 	    .ENTRY  FIND_FILE, Save R2,R3,R4,R10			      ; 0359

		         5A 00000000G  9F  9E 00016 	    MOVAB   @#SYS$CMKRNL, R10					      ;

		         5E	FED8   CE  9E 0001D 	    MOVAB   -296(SP), SP					      ;

		         54	0000G  CF  9E 00022 	    MOVAB   LOCAL_FIB, FIB					      ; 0431

		         03	  15   A4  E8 00027 	    BLBS    21(FIB), 1$						      ; 0434

				  10   A4  D4 0002B 	    CLRL    16(FIB)						      ;

				  10   A4  D5 0002E 1$:     TSTL    16(FIB)						      ; 0437

				       16  12 00031 	    BNEQ    3$							      ;

	   05	         64	       03  E1 00033 	    BBC     #3, (FIB), 2$					      ; 0439

		  0000G  CF	       00  FB 00037 	    CALLS   #0, REWIND_VOL_SET					      ;

				       7E  D4 0003C 2$:     CLRL    -(SP)						      ; 0440

				       5E  DD 0003E 	    PUSHL   SP							      ;

				0000V  CF  9F 00040 	    PUSHAB  CLEAR_ST_SEARCH					      ;

		         6A	       03  FB 00044 	    CALLS   #3, SYS$CMKRNL					      ;

				       16  11 00047 	    BRB     6$							      ; 0437

				  24   AB  D5 00049 3$:     TSTL    36(CURRENT_VCB)					      ; 0448

				       05  13 0004C 	    BEQL    4$							      ;

				  28   AB  D5 0004E 	    TSTL    40(CURRENT_VCB)					      ;

				       02  12 00051 	    BNEQ    5$							      ;

				       14  BF 00053 4$:     CHMU    #20							      ;

	   05	    0B   AB	       01  E0 00055 5$:     BBS     #1, 11(CURRENT_VCB), 6$				      ; 0451

		  0000G  CF	       00  FB 0005A 	    CALLS   #0, SPACE_EOF					      ;

				     0000  30 0005F 6$:     BSBW    GET_START_HDR					      ; 0455

		         0A	       50  E8 00062 	    BLBS    R0, 7$						      ;

				     0000  30 00065 	    BSBW    WRAP_AROUND						      ; 0460

		         04	       50  E8 00068 	    BLBS    R0, 7$						      ;

				0910   8F  BF 0006B 	    CHMU    #2320						      ;

				  24   AB  B5 0006F 7$:     TSTW    36(CURRENT_VCB)					      ; 0463

				       04  12 00072 	    BNEQ    8$							      ;

				0910   8F  BF 00074 	    CHMU    #2320						      ;

				  10   A4  D5 00078 8$:     TSTL    16(FIB)						      ; 0466

				       10  12 0007B 	    BNEQ    9$							      ;

				  28   AB  9F 0007D 	    PUSHAB  40(CURRENT_VCB)					      ; 0467

				       01  DD 00080 	    PUSHL   #1							      ;

				       5E  DD 00082 	    PUSHL   SP							      ;

				0000G  CF  9F 00084 	    PUSHAB  FORMAT_FID						      ;

		         6A	       04  FB 00088 	    CALLS   #4, SYS$CMKRNL					      ;

				       0B  11 0008B 	    BRB     10$							      ; 0466

		    28   AB	  24   AB  D1 0008D 9$:     CMPL    36(CURRENT_VCB), 40(CURRENT_VCB)			      ; 0469

				       04  12 00092 	    BNEQ    10$							      ;

				0910   8F  BF 00094 	    CHMU    #2320						      ;

				  04   AE  9F 00098 10$:    PUSHAB  FIDVER						      ; 0473

				FF70   CD  9F 0009B 	    PUSHAB  FIDFTD						      ;

				FF78   CD  9F 0009F 	    PUSHAB  FIDFND						      ;

				  80   AD  9F 000A3 	    PUSHAB  FIDSTR						      ;

		  0000G  CF	       04  FB 000A6 	    CALLS   #4, PARSE_TRANS_FID					      ;

				       5E  DD 000AB 	    PUSHL   SP							      ; 0474

				  0C   AE  9F 000AD 	    PUSHAB  FNSFTD						      ;

				  18   AE  9F 000B0 	    PUSHAB  FNSFND						      ;



; Bliss-32 7.352	Saturday 21-AUG-1978 23:31:52	DBB3:[MTAACP.SRC]FIND.B32;8					Page 2-4

; Digital Equipment Corporation

;

				  24   AE  9F 000B3 	    PUSHAB  FNSSTR						      ;

		  0000G  CF	       04  FB 000B6 	    CALLS   #4, PARSE_TRANS_FNS					      ;

	   0E	    14   A4	       05  E0 000BB 	    BBS     #5, 20(FIB), 11$					      ; 0478

	   20	  FF7C   DD	FF78   CD  2D 000C0 	    CMPC5   FIDFND, @FIDFND+4, #32, FNSFND, @FNSFND+4		      ; 0479

		    14   BE	  10   AE     000C8									      ;

				       22  12 000CC 	    BNEQ    13$							      ;

	   0E	    14   A4	       04  E0 000CE 11$:    BBS     #4, 20(FIB), 12$					      ; 0483

	   20	  FF74   DD	FF70   CD  2D 000D3 	    CMPC5   FIDFTD, @FIDFTD+4, #32, FNSFTD, @FNSFTD+4		      ; 0484

		    0C   BE	  08   AE     000DB									      ;

				       0F  12 000DF 	    BNEQ    13$							      ;

	   23	    14   A4	       03  E0 000E1 12$:    BBS     #3, 20(FIB), 14$					      ; 0488

				       6E  B5 000E6 	    TSTW    FNSVER						      ; 0489

				       1F  1B 000E8 	    BLEQU   14$							      ;

		    04   AE	       6E  B1 000EA 	    CMPW    FNSVER, FIDVER					      ; 0490

				       19  13 000EE 	    BEQL    14$							      ;

		  0000G  CF	       00  FB 000F0 13$:    CALLS   #0, SPACE_EOF					      ; 0493

		  0000G  CF	       00  FB 000F5 	    CALLS   #0, READ_HDR					      ; 0494

		         90	       50  E8 000FA 	    BLBS    R0, 9$						      ;

				     0000  30 000FD 	    BSBW    WRAP_AROUND						      ; 0495

		         8A	       50  E8 00100 	    BLBS    R0, 9$						      ;

				0910   8F  BF 00103 	    CHMU    #2320						      ;

				       84  11 00107 	    BRB     9$							      ; 0496

				  04   A4  9F 00109 14$:    PUSHAB  4(FIB)						      ; 0501

		  0000G  CF	       01  FB 0010C 	    CALLS   #1, FORMAT_FID					      ;

		    08   A4	  2F   AB  9B 00111 	    MOVZBW  47(CURRENT_VCB), 8(FIB)				      ; 0502

		         05	  15   A4  E9 00116 	    BLBC    21(FIB), 15$					      ; 0503

		         50	       01  D0 0011A 	    MOVL    #1, R0						      ;

				       02  11 0011D 	    BRB     16$							      ;

				       50  D4 0011F 15$:    CLRL    R0							      ;

		    10   A4	       50  D0 00121 16$:    MOVL    R0, 16(FIB)						      ;

		    10   AE	       20  D0 00125 	    MOVL    #32, FNSFND						      ; 0506

		    14   AE	  18   AE  9E 00129 	    MOVAB   FNSSTR, FNSFND+4					      ; 0507

		         7E	  04   AE  3C 0012E 	    MOVZWL  FIDVER, -(SP)					      ; 0508

				FF70   CD  9F 00132 	    PUSHAB  FIDFTD						      ;

				FF78   CD  9F 00136 	    PUSHAB  FIDFND						      ;

				  1C   AE  9F 0013A 	    PUSHAB  FNSFND						      ;

				  20   AE  9F 0013D 	    PUSHAB  FNSFND						      ;

				FEC8   CF  9F 00140 	    PUSHAB  CVTFNM						      ; 0359

	      00000000G  9F	       06  FB 00144 	    CALLS   #6, @#SYS$FAO					      ; 0508

				  10   AE  9F 0014B 	    PUSHAB  FNSFND						      ; 0511

				       01  DD 0014E 	    PUSHL   #1							      ;

				       5E  DD 00150 	    PUSHL   SP							      ;

				0000V  CF  9F 00152 	    PUSHAB  RETURN_FNS						      ;

		         6A	       04  FB 00156 	    CALLS   #4, SYS$CMKRNL					      ;

		         02	       50  E8 00159 	    BLBS    R0, 17$						      ;

				       00  BF 0015C 	    CHMU    #0							      ;

					   04 0015E 17$:    RET     							      ; 0359



; Routine Size:  331 bytes







; Bliss-32 7.352	Saturday 21-AUG-1978 23:31:52	DBB3:[MTAACP.SRC]FIND.B32;8					Page 3

; Digital Equipment Corporation

;

;	0513	GLOBAL ROUTINE RETURN_FNS(FNDESC) : COMMON_CALL  =

;	0514	

;	0515	!++

;	0516	!

;	0517	! FUNCTIONAL DESCRIPTION:

;	0518	!	THIS ROUTINES ENABLES THE WRITE-BACK OF THE RESULT FILE NAME STRING

;	0519	!

;	0520	! CALLING SEQUENCE:

;	0521	!	RETURN_FNS(ARG1)

;	0522	!

;	0523	! INPUT PARAMETERS:

;	0524	!	ARG1 - ADDRESS OF FILE NAME STRING DESCRIPTOR

;	0525	!

;	0526	! IMPLICIT INPUTS:

;	0527	!	IO_PACKET - ADDRESS OF CURRENT REQUEST PACKET

;	0528	!	MUST BE CALLED IN KERNEL ACCESS MODE

;	0529	!

;	0530	! OUTPUT PARAMETERS:

;	0531	!	NONE

;	0532	!

;	0533	! IMPLICIT OUTPUTS:

;	0534	!	NONE

;	0535	!

;	0536	! ROUTINE VALUE:

;	0537	!	0 - FAILURE

;	0538	!	1 - SUCCESS

;	0539	!

;	0540	! SIDE EFFECTS:

;	0541	!	ENABLES WRITE BACK

;	0542	!

;	0543	! USER ERRORS:

;	0544	!	SS$_RESULTOVF - FILE NAME STRING OVERFLOWS BUFFER

;	0545	!--

;	0546	

;	0547	BEGIN

;	0548	EXTERNAL REGISTER

;	0549		COMMON_REG;

;	0550	

;	0551	LOCAL

;	0552		SIZE,						!SIZE OF WRITE BACK DATA

;	0553	

;	0554		ABD:		REF BBLOCKVECTOR [,ABD$C_LENGTH];!ADDRESS OF BUFFER DESCRIPTORS

;	0555	

;	0556	MAP

;	0557		FNDESC:		REF VECTOR [2];			!DESCRIPTOR OF FILE NAME STRING

;	0558	

;	0559	EXTERNAL

;	0560		IO_PACKET:	REF BBLOCK;			!ADDRESS OF CURRENT IO REQUEST PACKET

;	0561	

;	0562	! GET BUFFER DESCRIPTOR ADDRESS

;	0563	ABD = .BBLOCK[.IO_PACKET[IRP$L_SVAPTE],AIB$L_DESCRIPT];	!ADDRESS OF BUFFER DESCRIPTORS	

;	0564	

;	0565	! RETURN LENGTH OF RESULT STRING

;	0566	SIZE = .FNDESC[0];

;	0567	IF .ABD[ABD$C_RESL,ABD$W_COUNT] GEQU 2



; Bliss-32 7.352	Saturday 21-AUG-1978 23:31:52	DBB3:[MTAACP.SRC]FIND.B32;8					Page 3-1

; Digital Equipment Corporation

;

;	0568	THEN

;	0569	    BEGIN

;	0570	    (.ABD[ABD$C_RESL,ABD$W_TEXT] + ABD[ABD$C_RESL,ABD$W_TEXT] + 1)

;	0571	    <0,16> = .SIZE<0,16>;

;	0572	    END;

;	0573	

;	0574	IF .ABD[ABD$C_RES,ABD$W_COUNT] NEQ 0

;	0575	THEN

;	0576	    BEGIN

;	0577	

;	0578	! IF RESULT STRING OVERFLOWS BUFFER, RETURN ERROR

;	0579	    IF .SIZE GTRU .ABD[ABD$C_RES,ABD$W_COUNT]

;	0580	    THEN

;	0581	        BEGIN

;	0582	        ERROR(SS$_RESULTOVF);

;	0583	        RETURN 0;

;	0584	        END;

;	0585	

;	0586	    CH$COPY(.SIZE,.FNDESC[1],0,.ABD[ABD$C_RES,ABD$W_COUNT],

;	0587	        (.ABD[ABD$C_RES,ABD$W_TEXT] + ABD[ABD$C_RES,ABD$W_TEXT] + 1));

;	0588	    END;

;	0589	

;	0590	RETURN 1;

;	0591	END;						!END OF ROUTINE







							    .GLOBL  IO_PACKET, USER_STATUS



					 003C 0015F 	    .ENTRY  RETURN_FNS, Save R2,R3,R4,R5			      ; 0513

		         50	0000G  CF  D0 00161 	    MOVL    IO_PACKET, R0					      ; 0563

		         50	  2C   B0  D0 00166 	    MOVL    @44(R0), ABD					      ;

		         52	  04   AC  D0 0016A 	    MOVL    FNDESC, R2						      ; 0566

		         53	       62  D0 0016E 	    MOVL    (R2), SIZE						      ;

		         02	  1A   A0  B1 00171 	    CMPW    26(ABD), #2						      ; 0567

				       0E  1F 00175 	    BLSSU   1$							      ;

		         51	  18   A0  9E 00177 	    MOVAB   24(ABD), R1						      ; 0570

		         54	       61  3C 0017B 	    MOVZWL  (R1), R4						      ;

		         51	       54  C0 0017E 	    ADDL2   R4, R1						      ;

		    01   A1	       53  B0 00181 	    MOVW    SIZE, 1(R1)						      ; 0571

				  22   A0  B5 00185 1$:     TSTW    34(ABD)						      ; 0574

				       24  13 00188 	    BEQL    3$							      ;

      22   A0	         10	       00  ED 0018A 	    CMPZV   #0, #16, 34(ABD), SIZE				      ; 0579

				       53     0018F									      ;

				       09  1E 00190 	    BGEQU   2$							      ;

		  0000G  CF	0214   8F  B0 00192 	    MOVW    #532, USER_STATUS					      ; 0582

				       17  11 00199 	    BRB     4$							      ; 0583

		         51	  20   A0  9E 0019B 2$:     MOVAB   32(ABD), R1						      ; 0587

		         54	       61  3C 0019F 	    MOVZWL  (R1), R4						      ;

		         51	       54  C0 001A2 	    ADDL2   R4, R1						      ;

	   00	    04   B2	       53  2C 001A5 	    MOVC5   SIZE, @4(R2), #0, 34(ABD), 1(R1)			      ; 0586

		    01   A1	  22   A0     001AA									      ;

		         50	       01  D0 001AE 3$:     MOVL    #1, R0						      ; 0590

					   04 001B1 	    RET     							      ;

				       50  D4 001B2 4$:     CLRL    R0							      ; 0513



; Bliss-32 7.352	Saturday 21-AUG-1978 23:31:52	DBB3:[MTAACP.SRC]FIND.B32;8					Page 3-2

; Digital Equipment Corporation

;

					   04 001B4 	    RET     							      ;



; Routine Size:  86 bytes





;	0592	

;	0593	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:31:52	DBB3:[MTAACP.SRC]FIND.B32;8					Page 4

; Digital Equipment Corporation

;

;	0594	ROUTINE CLEAR_ST_SEARCH : COMMON_CALL NOVALUE  =

;	0595	

;	0596	!++

;	0597	!

;	0598	! FUNCTIONAL DESCRIPTION:

;	0599	!	THIS ROUTINE CLEARS THE FILE ID INDICATING THE START OF THIS SEARCH.

;	0600	!

;	0601	! CALLING SEQUENCE:

;	0602	!	CLEAR_ST_SEARCH(), CALLED IN KERNEL MODE

;	0603	!

;	0604	! INPUT PARAMETERS:

;	0605	!	NONE

;	0606	!

;	0607	! IMPLICIT INPUTS:

;	0608	!	CURRENT_VCB - ADDRESS OF CURRENT VOLUME CONTROL BLOCK

;	0609	!

;	0610	! OUTPUT PARAMETERS:

;	0611	!	NONE

;	0612	!

;	0613	! IMPLICIT OUTPUTS:

;	0614	!	CURRENT_VCB[VCB$L_START_FID] CLEARED

;	0615	!

;	0616	! ROUTINE VALUE:

;	0617	!	NONE

;	0618	!

;	0619	! SIDE EFFECTS:

;	0620	!	NONE

;	0621	!

;	0622	! USER ERRORS:

;	0623	!	NONE

;	0624	!

;	0625	!--

;	0626	

;	0627	BEGIN

;	0628	

;	0629	EXTERNAL REGISTER

;	0630		COMMON_REG;

;	0631	

;	0632	

;	0633	

;	0634	CURRENT_VCB[VCB$L_START_FID] = 0;

;	0635	END;











					 0000 001B5 CLEAR_ST_SEARCH:

							    .WORD   Save nothing					      ; 0594

				  28   AB  D4 001B7 	    CLRL    40(CURRENT_VCB)					      ; 0634

					   04 001BA 	    RET     							      ; 0594



; Routine Size:  6 bytes







; Bliss-32 7.352	Saturday 21-AUG-1978 23:31:52	DBB3:[MTAACP.SRC]FIND.B32;8					Page 4-1

; Digital Equipment Corporation

;

;	0636	END

;	0637	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $CODE$         	   443  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        30         0       238











;	0638	

; Size:		423 code + 20 data bytes

; Run Time:	00:13.6

; Elapsed Time:	00:34.5

; Memory Used:	329 pages

; Compilation Complete

