

; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 1

;

;	0001	MODULE ACCESS (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'B0024'

;	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 2

;	0029	!

;	0030	! ABSTRACT:

;	0031	!

;	0032	!	This is the main processing routine for the ACCESS function.

;	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:  20-Dec-1976  15:43

;	0043	!

;	0044	! REVISION HISTORY:

;	0045	!

;	0046	!   Andrew C. Goldstein, 16-Feb-1977  14:48

;	0047	!   X0002 - Modify for condition handling

;	0048	!

;	0049	!   Andrew C. Goldstein, 23-Mar-1977  14:46

;	0050	!   X0003 - Key directory search off DID; reject extend control parameters.

;	0051	!

;	0052	!   Andrew C. Goldstein, 1-Apr-1977  13:38

;	0053	!   X0004 - Change call to FIND

;	0054	!

;	0055	!   Andrew C. Goldstein, 1-Apr-1977  16:57



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 1-1

;

;	0056	!   X0005 - Move GET_FIB out of kernel mode

;	0057	!

;	0058	!   Andrew C. Goldstein, 20-Apr-1977  13:38

;	0059	!   X0006 - Add buffer pool interlock

;	0060	!

;	0061	!   Andrew C. Goldstein, 3-May-1977  14:58

;	0062	!   X0007 - Add file protection check

;	0063	!

;	0064	!   Andrew C. Goldstein, 9-May-1977  15:53

;	0065	!   X0008 - Remove check on extend control

;	0066	!

;	0067	!   Andrew C. Goldstein, 23-Jun-1977  11:18

;	0068	!   X0009 - Set CLF_DELWINDOW bit

;	0069	!

;	0070	!   Andrew C. Goldstein, 22-Jul-1977  16:41

;	0071	!   X0010 - Add multi-header support

;	0072	!

;	0073	!   Andrew C. Goldstein, 9-Aug-1977  10:52

;	0074	!   X0011 - Add create subfunction

;	0075	!

;	0076	!   Andrew C. Goldstein, 26-Sep-1977  14:04

;	0077	!   X0012 - Allow multiple writers; add FID check after directory lookup.

;	0078	!

;	0079	!   Andrew C. Goldstein, 2-Nov-1977  13:24

;	0080	!   X0013 - Check window size parameter

;	0081	!

;	0082	!   Andrew C. Goldstein, 12-Nov-1977  13:45

;	0083	!   X0014 - Do final fixup on FCB of multi-header file

;	0084	!

;	0085	!   Andrew C. Goldstein, 12-Dec-1977  13:01

;	0086	!   X0015 - file ID interface changes

;	0087	!

;	0088	!   Andrew C. Goldstein, 14-Dec-1977  13:39

;	0089	!   X0016 - Modify for structure level 2

;	0090	!

;	0091	!   Andrew C. Goldstein, 6-Jan-1978  22:02

;	0092	!   B0017 - Add up size of multi-header file only on first access

;	0093	!

;	0094	!   Andrew C. Goldstein, 9-Jan-1978  11:26

;	0095	!   B0018 - Allow read attributes if file is open

;	0096	!

;	0097	!   Andrew C. Goldstein, 4-May-78  22:11

;	0098	!   B0019 - Remove window size restriction

;	0099	!

;	0100	!   Andrew C. Goldstein, 22-May-78  17:38

;	0101	!   B0020 - Require write privilege for exclusive access

;	0102	!

;	0103	!   Andrew C. Goldstein, 29-May-78  19:54

;	0104	!   B0021 - Allow system to access files marked for delete or close checked

;	0105	!

;	0106	!   Andrew C. Goldstein, 12-Jun-78  21:05

;	0107	!   B0022 - PCB vector name change

;	0108	!

;	0109	!   Andrew C. Goldstein, 6-Jul-78  14:27

;	0110	!   B0023 - Add execute protection



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 1-2

;

;	0111	!

;	0112	!   Andrew C. Goldstein, 10-Jul-78  15:33

;	0113	!   B0024 - Fix conditional create for spooled devices

;	0114	!

;	0115	!**

;	0116	

;	0117	

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

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

;	0468	

;	0469	

;	0470	FORWARD ROUTINE

;	0471		ACCESS,				! main access function processing

;	0472		CHECK_FIND,			! conditional directory search

;	0473		HANDLER;			! conditional handler to catch error exit



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 2

;

;	0474	GLOBAL ROUTINE ACCESS =

;	0475	

;	0476	!++

;	0477	!

;	0478	! FUNCTIONAL DESCRIPTION:

;	0479	!

;	0480	!	This is the main processing routine for the ACCESS function.

;	0481	!

;	0482	! CALLING SEQUENCE:

;	0483	!	ACCESS ()

;	0484	!

;	0485	! INPUT PARAMETERS:

;	0486	!	NONE

;	0487	!

;	0488	! IMPLICIT INPUTS:

;	0489	!	CURRENT_VCB: VCB of volume

;	0490	!	IO_PACKET: address of I/O request packet

;	0491	!

;	0492	! OUTPUT PARAMETERS:

;	0493	!	NONE

;	0494	!

;	0495	! IMPLICIT OUTPUTS:

;	0496	!	PRIMARY_FCB: FCB of file

;	0497	!	CURRENT_WINDOW: address of file window

;	0498	!	USER_STATUS: I/O status block to return to user

;	0499	!

;	0500	! ROUTINE VALUE:

;	0501	!	NONE

;	0502	!

;	0503	! SIDE EFFECTS:

;	0504	!	FCB & window created

;	0505	!

;	0506	!--

;	0507	

;	0508	BEGIN

;	0509	

;	0510	LOCAL

;	0511		FCB_CREATED,				! flag indicating new FCB created

;	0512		PCB		: REF BBLOCK,		! address of caller's PCB

;	0513		PACKET		: REF BBLOCK,		! address of I/O packet

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

;	0515							! buffer descriptors

;	0516		FIB		: REF BBLOCK,		! file identification block

;	0517		FCB		: REF BBLOCK,		! FCB address

;	0518		HEADER		: REF BBLOCK,		! address of file header

;	0519		NEW_HEADER	: REF BBLOCK,		! address of extension header

;	0520		FUNCTION	: BLOCK [1];		! function code qualifiers

;	0521	

;	0522	EXTERNAL

;	0523		USER_STATUS	: VECTOR,		! I/O status block for user

;	0524		CURRENT_VCB	: REF BBLOCK,		! VCB of volume

;	0525		PRIMARY_FCB	: REF BBLOCK,		! FCB of file

;	0526		CURRENT_WINDOW	: REF BBLOCK,		! window for file

;	0527		IO_PACKET	: REF BBLOCK,		! I/O request packet

;	0528		CLEANUP_FLAGS	: BITVECTOR,		! cleanup action flags



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 2-1

;

;	0529		SCH$GL_PCBVEC	: REF VECTOR ADDRESSING_MODE (ABSOLUTE);

;	0530							! system PCB vector

;	0531	

;	0532	EXTERNAL ROUTINE

;	0533		GET_FIB,				! get FIB for operation

;	0534		FIND,					! find file in directory

;	0535		CREATE,					! create file

;	0536		SEARCH_FCB,				! search FCB list

;	0537		READ_HEADER,				! read file header

;	0538		NEXT_HEADER,				! read extension file header

;	0539		CREATE_FCB,				! create an FCB

;	0540		CHECK_PROTECT,				! check file protection

;	0541		CREATE_WINDOW,				! create a window

;	0542		MAKE_ACCESS,				! complete the access

;	0543		MAKE_EXTFCB,				! create and link extension FCB

;	0544		FLUSH_FID,				! flush a file from the buffer pool

;	0545		UPDATE_FCB,				! update attributes in FCB

;	0546		READ_ATTRIB;				! read file attributes

;	0547	

;	0548	

;	0549	! Enable the deaccess cleanup if an access is taking place.

;	0550	!

;	0551	

;	0552	PACKET = .IO_PACKET;

;	0553	FUNCTION = .PACKET[IRP$W_FUNC];

;	0554	IF .FUNCTION[IO$V_ACCESS]

;	0555	THEN

;	0556	    BEGIN

;	0557	    CLEANUP_FLAGS[CLF_ZCHANNEL] = 1;

;	0558	    CLEANUP_FLAGS[CLF_DELWINDOW] = 1;

;	0559	    END;

;	0560	

;	0561	! Set up pointers to interesting control blocks.

;	0562	!

;	0563	

;	0564						! pointer to buffer descriptors

;	0565	ABD = .BBLOCK [.PACKET[IRP$L_SVAPTE], AIB$L_DESCRIPT];

;	0566	FIB = GET_FIB (.ABD);				! pointer to FIB

;	0567	

;	0568	! Do directory processing, if any. For a normal access, do the directory

;	0569	! lookup if a directory ID is present. If this is a conditional create, do

;	0570	! the lookup and turn the function into a create if the lookup fails

;	0571	! with a file not found. Conditional create on spool devices always become

;	0572	! creates.

;	0573	!

;	0574	

;	0575	IF .FUNCTION[IO$V_CREATE]

;	0576	THEN

;	0577	    BEGIN

;	0578	    IF .CLEANUP_FLAGS[CLF_SPOOLFILE]

;	0579	    OR (

;	0580		IF .CLEANUP_FLAGS[CLF_DIRECTORY]

;	0581		THEN NOT CHECK_FIND (.ABD, .FIB)

;	0582		ELSE 1

;	0583		)



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 2-2

;

;	0584	    THEN

;	0585		BEGIN

;	0586		USER_STATUS[0] = SS$_CREATED;

;	0587		RETURN CREATE ();

;	0588		END;

;	0589	    END

;	0590	

;	0591	ELSE

;	0592	    IF .CLEANUP_FLAGS[CLF_DIRECTORY]

;	0593	    THEN FIND (.ABD, .FIB, 0);

;	0594	

;	0595	! If there is a file open on the channel, check the file ID returned by the

;	0596	! FIND against the file ID that is open. If they are different, drop the FCB

;	0597	! and window addresses on the floor.

;	0598	!

;	0599	

;	0600	IF .PRIMARY_FCB NEQ 0

;	0601	THEN

;	0602	    IF .PRIMARY_FCB[FCB$W_FID_NUM] NEQ .FIB[FIB$W_FID_NUM]

;	0603	    OR .PRIMARY_FCB[FCB$W_FID_RVN] NEQ .FIB[FIB$W_FID_RVN]

;	0604	    THEN

;	0605		BEGIN

;	0606		PRIMARY_FCB = 0;

;	0607		CURRENT_WINDOW = 0;

;	0608		END;

;	0609	

;	0610	! If this is a find only, exit now to avoid an extraneous read of the

;	0611	! file header.

;	0612	!

;	0613	

;	0614	IF NOT .FUNCTION[IO$V_ACCESS]		! if no access

;	0615	AND .PACKET[IRP$W_BCNT] LEQ ABD$C_ATTRIB ! and no attribute list

;	0616	THEN RETURN 1;				! all done

;	0617	

;	0618	! Find the FCB of the file, if one exists. then read the file

;	0619	! header. If there is no FCB, create one.

;	0620	!

;	0621	

;	0622	FCB = SEARCH_FCB (FIB[FIB$W_FID]);

;	0623	HEADER = READ_HEADER (FIB[FIB$W_FID], .FCB);

;	0624	

;	0625	! If the file is marked for delete and is not accessed by this user, and

;	0626	! the accessor is not the system, deny its existence.

;	0627	!

;	0628	

;	0629	PCB = .SCH$GL_PCBVEC[.(PACKET[IRP$L_PID])<0,16>];

;	0630	IF .CURRENT_WINDOW EQL 0 AND .HEADER[FH2$V_MARKDEL]

;	0631	AND .PCB[PCB$W_GRP] GTRU SYSTEM_UIC

;	0632	AND NOT .PACKET[IRP$V_PRIVIO]

;	0633	THEN ERR_EXIT (SS$_NOSUCHFILE);

;	0634	

;	0635	FCB_CREATED = 0;

;	0636	IF .FCB EQL 0

;	0637	THEN

;	0638	    BEGIN



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 2-3

;

;	0639	    FCB_CREATED = 1;

;	0640	    FCB = KERNEL_CALL (CREATE_FCB, .HEADER);

;	0641	    END;

;	0642	PRIMARY_FCB = .FCB;			! record FCB for external use

;	0643	

;	0644	! If access is requested, check for conflicts and file protection.

;	0645	! then create a window and link everything up.

;	0646	!

;	0647	

;	0648	IF .FUNCTION[IO$V_ACCESS]

;	0649	THEN

;	0650	    BEGIN

;	0651	    CHECK_PROTECT (

;	0652			IF .FIB[FIB$V_EXECUTE]

;	0653			AND NOT .FIB[FIB$V_WRITE]

;	0654			AND NOT .FIB[FIB$V_NOREAD]

;	0655			AND .PACKET[IRP$V_MODE] LEQU 2

;	0656			THEN EXEC_ACCESS

;	0657			ELSE .FIB[FIB$V_WRITE] OR .FIB[FIB$V_NOREAD],

;	0658			.HEADER,

;	0659			.FCB);

;	0660	

;	0661	    IF (.HEADER[FH2$V_LOCKED])

;	0662	    AND .PCB[PCB$W_GRP] GTRU SYSTEM_UIC

;	0663	    AND NOT .PACKET[IRP$V_PRIVIO]

;	0664	    THEN ERR_EXIT (SS$_FILELOCKED);		! file is deaccess locked

;	0665	    IF (.FCB[FCB$V_EXCL])

;	0666	    OR (.FIB[FIB$V_NOREAD] AND .FCB[FCB$W_ACNT] NEQ 0)

;	0667	    OR (.FIB[FIB$V_NOWRITE] AND .FCB[FCB$W_WCNT] NEQ 0)

;	0668	    OR (.FIB[FIB$V_WRITE] AND .FCB[FCB$W_LCNT] NEQ 0)

;	0669	    THEN ERR_EXIT (SS$_ACCONFLICT);		! one of above access conflicts

;	0670	

;	0671	

;	0672	    CURRENT_WINDOW = KERNEL_CALL (CREATE_WINDOW, .FIB[FIB$L_ACCTL],

;     P 0673		.FIB[FIB$B_WSIZE], .HEADER, .PACKET[IRP$L_PID], .FCB);

;	0674	    KERNEL_CALL (MAKE_ACCESS, .FCB, .CURRENT_WINDOW, .ABD);

;	0675	

;	0676	! If the file is a directory file and it is being write accessed,

;	0677	! flush it from the buffer pool to avoid retaining stale directory data.

;	0678	!

;	0679	

;	0680	    IF .FIB[FIB$V_WRITE]

;	0681	    AND .HEADER[FH2$V_DIRECTORY]

;	0682	    THEN FLUSH_FID (FIB[FIB$W_FID]);

;	0683	

;	0684	    END;					! end of access processing

;	0685	

;	0686	! If the file is multi-header, read the extension headers and create

;	0687	! extension FCB's as necessary. Finally read back the primary header.

;	0688	!

;	0689	

;	0690	IF .FCB_CREATED

;	0691	THEN

;	0692	    BEGIN

;	0693	    WHILE 1 DO



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 2-4

;

;	0694		BEGIN

;	0695		NEW_HEADER = NEXT_HEADER (.HEADER, .FCB);

;	0696		IF .NEW_HEADER EQL 0 THEN EXITLOOP;

;	0697		HEADER = .NEW_HEADER;

;	0698		FCB = KERNEL_CALL (MAKE_EXTFCB, .HEADER, .FCB, .FUNCTION[IO$V_ACCESS]);

;	0699		END;

;	0700	

;	0701	    IF .FCB NEQ .PRIMARY_FCB

;	0702	    THEN

;	0703		BEGIN

;	0704		FCB = .PRIMARY_FCB;

;	0705		HEADER = READ_HEADER (0, .FCB);

;	0706		KERNEL_CALL (UPDATE_FCB, .HEADER);

;	0707		END;

;	0708	    END;

;	0709	

;	0710	! Do read attributes if requested.

;	0711	!

;	0712	

;	0713	IF .PACKET[IRP$W_BCNT] GTR ABD$C_ATTRIB

;	0714	THEN

;	0715	    BEGIN

;	0716	    IF .CURRENT_WINDOW EQL 0

;	0717	    THEN CHECK_PROTECT (RDATT_ACCESS, .HEADER, .FCB);

;	0718	    IF NOT KERNEL_CALL (READ_ATTRIB, .HEADER, .ABD) THEN ERR_EXIT ();

;	0719	    END;

;	0720	

;	0721	RETURN 1;

;	0722	

;	0723	END;						! end of routine ACCESS





							    .TITLE  ACCESS

							    .IDENT  \B0024\



							    .EXTRN  USER_STATUS, CURRENT_VCB, PRIMARY_FCB, CURRENT_WINDOW

							    .EXTRN  IO_PACKET, CLEANUP_FLAGS, SCH$GL_PCBVEC, GET_FIB

							    .EXTRN  FIND, CREATE, SEARCH_FCB, READ_HEADER, NEXT_HEADER

							    .EXTRN  CREATE_FCB, CHECK_PROTECT, CREATE_WINDOW, MAKE_ACCESS

							    .EXTRN  MAKE_EXTFCB, FLUSH_FID, UPDATE_FCB, READ_ATTRIB

							    .EXTRN  SYS$CMKRNL



							    .PSECT  $CODE$,NOWRT,2



					 0FFC 00000 	    .ENTRY  ACCESS, Save R2,R3,R4,R5,R6,R7,R8,R9,R10,R11	      ; 0474

		         5B 	0000G  CF  9E 00002 	    MOVAB   PRIMARY_FCB, R11					      ;

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

		         52 	0000G  CF  D0 0000E 	    MOVL    IO_PACKET, PACKET					      ; 0552

		         59 	  20   A2  3C 00013 	    MOVZWL  32(PACKET), FUNCTION				      ; 0553

	   07 	         59 	       06  E1 00017 	    BBC     #6, FUNCTION, 1$					      ; 0554

		  0000G  CF	0402   8F  A8 0001B 	    BISW2   #1026, CLEANUP_FLAGS+2				      ; 0558

		         58 	  2C   B2  D0 00022 1$:     MOVL    @44(PACKET), ABD					      ; 0565

				       58  DD 00026 	    PUSHL   ABD							      ; 0566

		  0000G  CF	       01  FB 00028 	    CALLS   #1, GET_FIB						      ;

		         53 	       50  D0 0002D 	    MOVL    R0, FIB						      ;



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 2-5

;

	   25 	         59 	       07  E1 00030 	    BBC     #7, FUNCTION, 3$					      ; 0575

	   12 	  0000G  CF	       07  E0 00034 	    BBS     #7, CLEANUP_FLAGS, 2$				      ; 0578

	   0C 	  0000G  CF	       06  E1 0003A 	    BBC     #6, CLEANUP_FLAGS, 2$				      ; 0580

				       53  DD 00040 	    PUSHL   FIB							      ; 0581

				       58  DD 00042 	    PUSHL   ABD							      ;

		  0000V  CF	       02  FB 00044 	    CALLS   #2, CHECK_FIND					      ;

		         1E 	       50  E8 00049 	    BLBS    R0, 4$						      ;

		  0000G  CF	0619   8F  3C 0004C 2$:     MOVZWL  #1561, USER_STATUS					      ; 0586

		  0000G  CF	       00  FB 00053 	    CALLS   #0, CREATE						      ; 0587

					   04 00058 	    RET     							      ;

	   0B 	  0000G  CF	       06  E1 00059 3$:     BBC     #6, CLEANUP_FLAGS, 4$				      ; 0592

				       7E  D4 0005F 	    CLRL    -(SP)						      ; 0593

				       53  DD 00061 	    PUSHL   FIB							      ;

				       58  DD 00063 	    PUSHL   ABD							      ;

		  0000G  CF	       03  FB 00065 	    CALLS   #3, FIND						      ;

		         50 	       6B  D0 0006A 4$:     MOVL    PRIMARY_FCB, R0					      ; 0600

				       14  13 0006D 	    BEQL    6$							      ;

		    04   A3	  20   A0  B1 0006F 	    CMPW    32(R0), 4(FIB)					      ; 0602

				       07  12 00074 	    BNEQ    5$							      ;

		    08   A3	  24   A0  B1 00076 	    CMPW    36(R0), 8(FIB)					      ; 0603

				       06  13 0007B 	    BEQL    6$							      ;

				       6B  D4 0007D 5$:     CLRL    PRIMARY_FCB						      ; 0606

				0000G  CF  D4 0007F 	    CLRL    CURRENT_WINDOW					      ; 0607

	   09 	         59 	       06  E0 00083 6$:     BBS     #6, FUNCTION, 7$					      ; 0614

		         05 	  32   A2  B1 00087 	    CMPW    50(PACKET), #5					      ; 0615

				       03  1A 0008B 	    BGTRU   7$							      ;

				     018F  31 0008D 	    BRW     25$							      ;

				  04   A3  9F 00090 7$:     PUSHAB  4(FIB)						      ; 0622

		  0000G  CF	       01  FB 00093 	    CALLS   #1, SEARCH_FCB					      ;

		         54 	       50  D0 00098 	    MOVL    R0, FCB						      ;

				       54  DD 0009B 	    PUSHL   FCB							      ; 0623

				  04   A3  9F 0009D 	    PUSHAB  4(FIB)						      ;

		  0000G  CF	       02  FB 000A0 	    CALLS   #2, READ_HEADER					      ;

		         56 	       50  D0 000A5 	    MOVL    R0, HEADER						      ;

		         51 00000000G  9F  D0 000A8 	    MOVL    @#SCH$GL_PCBVEC, R1					      ; 0629

		         50 	  0C   A2  3C 000AF 	    MOVZWL  12(PACKET), R0					      ;

		         55 	     6140  D0 000B3 	    MOVL    (R1)[R0], PCB					      ;

				0000G  CF  D5 000B7 	    TSTL    CURRENT_WINDOW					      ; 0630

				       16  12 000BB 	    BNEQ    8$							      ;

	   11 	    35   A6	       07  E1 000BD 	    BBC     #7, 53(HEADER), 8$					      ;

		         08 	  22   A5  B1 000C2 	    CMPW    34(PCB), #8						      ; 0631

				       0B  1B 000C6 	    BLEQU   8$							      ;

	   06 	    2B   A2	       01  E0 000C8 	    BBS     #1, 43(PACKET), 8$					      ; 0632

				0910   8F  BF 000CD 	    CHMU    #2320						      ; 0633

				       68  11 000D1 	    BRB     13$							      ;

				       57  D4 000D3 8$:     CLRL    FCB_CREATED						      ; 0635

				       54  D5 000D5 	    TSTL    FCB							      ; 0636

				       13  12 000D7 	    BNEQ    9$							      ;

		         57 	       01  D0 000D9 	    MOVL    #1, FCB_CREATED					      ; 0639

				       56  DD 000DC 	    PUSHL   HEADER						      ; 0640

				       01  DD 000DE 	    PUSHL   #1							      ;

				       5E  DD 000E0 	    PUSHL   SP							      ;

				0000G  CF  9F 000E2 	    PUSHAB  CREATE_FCB						      ;

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

		         54 	       50  D0 000E9 	    MOVL    R0, FCB						      ;



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 2-6

;

		         6B 	       54  D0 000EC 9$:     MOVL    FCB, PRIMARY_FCB					      ; 0642

	   03 	         59 	       06  E0 000EF 	    BBS     #6, FUNCTION, 10$					      ; 0648

				     00AE  31 000F3 	    BRW     20$							      ;

				       54  DD 000F6 10$:    PUSHL   FCB							      ; 0651

				       56  DD 000F8 	    PUSHL   HEADER						      ;

		         14 	  02   A3  E9 000FA 	    BLBC    2(FIB), 11$						      ; 0652

		         10 	  01   A3  E8 000FE 	    BLBS    1(FIB), 11$						      ; 0653

	   0C 	         63 	       0A  E0 00102 	    BBS     #10, (FIB), 11$					      ; 0654

      0B   A2	         02 	       00  ED 00106 	    CMPZV   #0, #2, 11(PACKET), #2				      ; 0655

				       02     0010B									      ;

				       04  1A 0010C 	    BGTRU   11$							      ;

				       06  DD 0010E 	    PUSHL   #6							      ; 0652

				       10  11 00110 	    BRB     12$							      ;

      01   A3	         01 	       00  EF 00112 11$:    EXTZV   #0, #1, 1(FIB), R0					      ; 0657

				       50     00117									      ;

	   63 	         01 	       0A  EF 00118 	    EXTZV   #10, #1, (FIB), R1					      ;

				       51     0011C									      ;

		         50 	       51  C8 0011D 	    BISL2   R1, R0						      ;

				       50  DD 00120 	    PUSHL   R0							      ; 0652

		  0000G  CF	       03  FB 00122 12$:    CALLS   #3, CHECK_PROTECT					      ; 0651

	   11 	    34   A6	       06  E1 00127 	    BBC     #6, 52(HEADER), 14$					      ; 0661

		         08 	  22   A5  B1 0012C 	    CMPW    34(PCB), #8						      ; 0662

				       0B  1B 00130 	    BLEQU   14$							      ;

	   06 	    2B   A2	       01  E0 00132 	    BBS     #1, 43(PACKET), 14$					      ; 0663

				08A8   8F  BF 00137 	    CHMU    #2216						      ; 0664

				       23  11 0013B 13$:    BRB     18$							      ;

	   1A 	    1E   A4	       03  E0 0013D 14$:    BBS     #3, 30(FCB), 17$					      ; 0665

	   05 	         63 	       0A  E1 00142 	    BBC     #10, (FIB), 15$					      ; 0666

				  18   A4  B5 00146 	    TSTW    24(FCB)						      ;

				       11  12 00149 	    BNEQ    17$							      ;

		         05 	       63  E9 0014B 15$:    BLBC    (FIB), 16$						      ; 0667

				  1C   A4  B5 0014E 	    TSTW    28(FCB)						      ;

				       09  12 00151 	    BNEQ    17$							      ;

		         0C 	  01   A3  E9 00153 16$:    BLBC    1(FIB), 19$						      ; 0668

				  1A   A4  B5 00157 	    TSTW    26(FCB)						      ;

				       07  13 0015A 	    BEQL    19$							      ;

				0800   8F  BF 0015C 17$:    CHMU    #2048						      ; 0669

				     00C0  31 00160 18$:    BRW     26$							      ;

				       54  DD 00163 19$:    PUSHL   FCB							      ; 0673

				  0C   A2  DD 00165 	    PUSHL   12(PACKET)						      ;

				       56  DD 00168 	    PUSHL   HEADER						      ;

		         7E 	  03   A3  98 0016A 	    CVTBL   3(FIB), -(SP)					      ;

				       63  DD 0016E 	    PUSHL   (FIB)						      ;

				       05  DD 00170 	    PUSHL   #5							      ;

				       5E  DD 00172 	    PUSHL   SP							      ;

				0000G  CF  9F 00174 	    PUSHAB  CREATE_WINDOW					      ;

		         6A 	       08  FB 00178 	    CALLS   #8, SYS$CMKRNL					      ;

		  0000G  CF	       50  D0 0017B 	    MOVL    R0, CURRENT_WINDOW					      ;

				       58  DD 00180 	    PUSHL   ABD							      ; 0674

				0000G  CF  DD 00182 	    PUSHL   CURRENT_WINDOW					      ;

				       54  DD 00186 	    PUSHL   FCB							      ;

				       03  DD 00188 	    PUSHL   #3							      ;

				       5E  DD 0018A 	    PUSHL   SP							      ;

				0000G  CF  9F 0018C 	    PUSHAB  MAKE_ACCESS						      ;

		         6A 	       06  FB 00190 	    CALLS   #6, SYS$CMKRNL					      ;



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 2-7

;

		         0D 	  01   A3  E9 00193 	    BLBC    1(FIB), 20$						      ; 0680

	   08 	    35   A6	       05  E1 00197 	    BBC     #5, 53(HEADER), 20$					      ; 0681

				  04   A3  9F 0019C 	    PUSHAB  4(FIB)						      ; 0682

		  0000G  CF	       01  FB 0019F 	    CALLS   #1, FLUSH_FID					      ;

		         4B 	       57  E9 001A4 20$:    BLBC    FCB_CREATED, 23$					      ; 0690

				       54  DD 001A7 21$:    PUSHL   FCB							      ; 0695

				       56  DD 001A9 	    PUSHL   HEADER						      ;

		  0000G  CF	       02  FB 001AB 	    CALLS   #2, NEXT_HEADER					      ;

		         53 	       50  D0 001B0 	    MOVL    R0, NEW_HEADER					      ;

				       1C  13 001B3 	    BEQL    22$							      ; 0696

		         56 	       53  D0 001B5 	    MOVL    NEW_HEADER, HEADER					      ; 0697

	   59 	         01 	       06  EF 001B8 	    EXTZV   #6, #1, FUNCTION, -(SP)				      ; 0698

				       7E     001BC									      ;

				       54  DD 001BD 	    PUSHL   FCB							      ;

				       56  DD 001BF 	    PUSHL   HEADER						      ;

				       03  DD 001C1 	    PUSHL   #3							      ;

				       5E  DD 001C3 	    PUSHL   SP							      ;

				0000G  CF  9F 001C5 	    PUSHAB  MAKE_EXTFCB						      ;

		         6A 	       06  FB 001C9 	    CALLS   #6, SYS$CMKRNL					      ;

		         54 	       50  D0 001CC 	    MOVL    R0, FCB						      ;

				       D6  11 001CF 	    BRB     21$							      ; 0693

		         6B 	       54  D1 001D1 22$:    CMPL    FCB, PRIMARY_FCB					      ; 0701

				       1C  13 001D4 	    BEQL    23$							      ;

		         54 	       6B  D0 001D6 	    MOVL    PRIMARY_FCB, FCB					      ; 0704

				       54  DD 001D9 	    PUSHL   FCB							      ; 0705

				       7E  D4 001DB 	    CLRL    -(SP)						      ;

		  0000G  CF	       02  FB 001DD 	    CALLS   #2, READ_HEADER					      ;

		         56 	       50  D0 001E2 	    MOVL    R0, HEADER						      ;

				       56  DD 001E5 	    PUSHL   HEADER						      ; 0706

				       01  DD 001E7 	    PUSHL   #1							      ;

				       5E  DD 001E9 	    PUSHL   SP							      ;

				0000G  CF  9F 001EB 	    PUSHAB  UPDATE_FCB						      ;

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

		         05 	  32   A2  B1 001F2 23$:    CMPW    50(PACKET), #5					      ; 0713

				       27  1B 001F6 	    BLEQU   25$							      ;

				0000G  CF  D5 001F8 	    TSTL    CURRENT_WINDOW					      ; 0716

				       0B  12 001FC 	    BNEQ    24$							      ;

				       54  DD 001FE 	    PUSHL   FCB							      ; 0717

				       56  DD 00200 	    PUSHL   HEADER						      ;

				       04  DD 00202 	    PUSHL   #4							      ;

		  0000G  CF	       03  FB 00204 	    CALLS   #3, CHECK_PROTECT					      ;

				0140   8F  BB 00209 24$:    PUSHR   #^M<R6,R8>						      ; 0718

				       02  DD 0020D 	    PUSHL   #2							      ;

				       5E  DD 0020F 	    PUSHL   SP							      ;

				0000G  CF  9F 00211 	    PUSHAB  READ_ATTRIB						      ;

		         6A 	       05  FB 00215 	    CALLS   #5, SYS$CMKRNL					      ;

		         04 	       50  E8 00218 	    BLBS    R0, 25$						      ;

				       00  BF 0021B 	    CHMU    #0							      ;

				       04  11 0021D 	    BRB     26$							      ;

		         50 	       01  D0 0021F 25$:    MOVL    #1, R0						      ; 0721

					   04 00222 	    RET     							      ;

				       50  D4 00223 26$:    CLRL    R0							      ; 0474

					   04 00225 	    RET     							      ;



; Routine Size:  550 bytes



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 2-8

;







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 3

;

;	0724	ROUTINE CHECK_FIND (ABD, FIB) =

;	0725	

;	0726	!++

;	0727	!

;	0728	! FUNCTIONAL DESCRIPTION:

;	0729	!

;	0730	!	This routine calls the directory search and intercepts any error

;	0731	!	exits to handle the create if non-existent function. If the search

;	0732	!	is successful, the routine returns success; if the search fails with

;	0733	!	no such file and the create subfunction bit is set, it returns failure;

;	0734	!	all other errors are resignaled.

;	0735	!

;	0736	!

;	0737	! CALLING SEQUENCE:

;	0738	!	CHECK_FIND (ARG1, ARG2)

;	0739	!

;	0740	! INPUT PARAMETERS:

;	0741	!	ARG1: address of buffer descriptor packet

;	0742	!	ARG2: address of FIB

;	0743	!

;	0744	! IMPLICIT INPUTS:

;	0745	!	NONE

;	0746	!

;	0747	! OUTPUT PARAMETERS:

;	0748	!	NONE

;	0749	!

;	0750	! IMPLICIT OUTPUTS:

;	0751	!	NONE

;	0752	!

;	0753	! ROUTINE VALUE:

;	0754	!	1 if find is successful

;	0755	!	0 if file is to be created

;	0756	!

;	0757	! SIDE EFFECTS:

;	0758	!	NONE

;	0759	!

;	0760	!--

;	0761	

;	0762	BEGIN

;	0763	

;	0764	MAP

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

;	0766		FIB		: REF BBLOCK;

;	0767	

;	0768	BUILTIN

;	0769		FP;

;	0770	

;	0771	EXTERNAL ROUTINE

;	0772		FIND;				! find file in directory

;	0773	

;	0774	

;	0775	! Establish the condition handler and call FIND. If we hear from it we

;	0776	! return true. Any signals cause either unwind or resignal.

;	0777	!

;	0778	



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 3-1

;

;	0779	.FP = HANDLER;

;	0780	

;	0781	FIND (.ABD, .FIB, 0);

;	0782	RETURN 1;

;	0783	

;	0784	END;					! end of routine CHECK_FIND











					 0000 00226 CHECK_FIND:

							    .WORD   Save nothing					      ; 0724

		         6D 	0000V  CF  9E 00228 	    MOVAB   HANDLER, (FP)					      ; 0779

				       7E  D4 0022D 	    CLRL    -(SP)						      ; 0781

		         7E 	  04   AC  7D 0022F 	    MOVQ    ABD, -(SP)						      ;

		  0000G  CF	       03  FB 00233 	    CALLS   #3, FIND						      ;

		         50 	       01  D0 00238 	    MOVL    #1, R0						      ; 0782

					   04 0023B 	    RET     							      ; 0724



; Routine Size:  22 bytes







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 4

;

;	0785	ROUTINE HANDLER (SIGNAL, MECHANISM) =

;	0786	

;	0787	!++

;	0788	!

;	0789	! FUNCTIONAL DESCRIPTION:

;	0790	!

;	0791	!	This routine is the condition handler for the conditional find call.

;	0792	!	It intercepts the error exit from FIND and unwinds to CHECK_FIND's

;	0793	!	caller when appropriate.

;	0794	!

;	0795	!

;	0796	! CALLING SEQUENCE:

;	0797	!	HANDLER (ARG1, ARG2)

;	0798	!

;	0799	! INPUT PARAMETERS:

;	0800	!	ARG1: address of signal array

;	0801	!	ARG2: address of mechanism array

;	0802	!

;	0803	! IMPLICIT INPUTS:

;	0804	!	NONE

;	0805	!

;	0806	! OUTPUT PARAMETERS:

;	0807	!	NONE

;	0808	!

;	0809	! IMPLICIT OUTPUTS:

;	0810	!	NONE

;	0811	!

;	0812	! ROUTINE VALUE:

;	0813	!	SS$_RESIGNAL or none if unwind

;	0814	!

;	0815	! SIDE EFFECTS:

;	0816	!	NONE

;	0817	!

;	0818	!--

;	0819	

;	0820	

;	0821	BEGIN

;	0822	

;	0823	MAP

;	0824		SIGNAL		: REF BBLOCK,	! signal arg array

;	0825		MECHANISM	: REF BBLOCK;	! mechanism arg array

;	0826	

;	0827	EXTERNAL ROUTINE

;	0828		SYS$UNWIND	: ADDRESSING_MODE (ABSOLUTE);

;	0829						! system unwind service

;	0830	

;	0831	

;	0832	! If the condition is change mode to user (error exit) and the status is

;	0833	! no such file, cause an unwind to return 0 to the access main line.

;	0834	! Otherwise, just resignal the condition.

;	0835	!

;	0836	

;	0837	IF .SIGNAL[CHF$L_SIG_NAME] EQL SS$_CMODUSER

;	0838	AND .SIGNAL[CHF$L_SIG_ARG1] EQL SS$_NOSUCHFILE

;	0839	THEN



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 4-1

;

;	0840	    BEGIN

;	0841	    MECHANISM[CHF$L_MCH_SAVR0] = 0;

;	0842	    SYS$UNWIND (0, 0);

;	0843	    END;

;	0844	

;	0845	RETURN SS$_RESIGNAL;			! status is irrelevant if unwinding

;	0846	

;	0847	END;					! end of routine HANDLER







							    .EXTRN  SYS$UNWIND



					 0000 0023C HANDLER:.WORD   Save nothing					      ; 0785

		         50 	  04   AC  D0 0023E 	    MOVL    SIGNAL, R0						      ; 0837

	      00000424   8F	  04   A0  D1 00242 	    CMPL    4(R0), #1060					      ;

				       1A  12 0024A 	    BNEQ    1$							      ;

	      00000910   8F	  08   A0  D1 0024C 	    CMPL    8(R0), #2320					      ; 0838

				       10  12 00254 	    BNEQ    1$							      ;

		         50 	  08   AC  D0 00256 	    MOVL    MECHANISM, R0					      ; 0841

				  0C   A0  D4 0025A 	    CLRL    12(R0)						      ;

				       7E  7C 0025D 	    CLRQ    -(SP)						      ; 0842

	      00000000G  9F	       02  FB 0025F 	    CALLS   #2, @#SYS$UNWIND					      ;

		         50 	0918   8F  3C 00266 1$:     MOVZWL  #2328, R0						      ; 0845

					   04 0026B 	    RET     							      ; 0785



; Routine Size:  48 bytes





;	0848	

;	0849	END

;	0850	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $CODE$         	   620  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        46         0       259







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:07:02	DBB3:[F11B.SRC]ACCESS.B32;14					Page 4-2

;







; Size:		620 code + 0 data bytes

; Run Time:	00:14.8

; Elapsed Time:	00:30.5

; Memory Used:	386 pages

; Compilation Complete

