

; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 1

;

;	0001	MODULE SHFDIR (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'B0012'

;	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 routine either extends or compresses a directory file.

;	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:  15-Apr-1977  13:25

;	0043	!

;	0044	! REVISION HISTORY:

;	0045	!

;	0046	!   Andrew C. Goldstein, 11-Aug-1977  21:55

;	0047	!   X0002 - Rework error recovery, add size limit up front

;	0048	!

;	0049	!   Andrew C. Goldstein, 10-Oct-1977  16:35

;	0050	!   X0003 - Update HIBLK in record attributes after extend

;	0051	!

;	0052	!   Andrew C. Goldstein, 12-Nov-1977  21:18

;	0053	!   X0004 - Remove directory EOF update (done by INIFCB)

;	0054	!

;	0055	!   Andrew C. Goldstein, 12-Dec-1977  13:37



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 1-1

;

;	0056	!   X0005 - file ID interface changes

;	0057	!

;	0058	!   Andrew C. Goldstein, 19-Jan-1978  21:35

;	0059	!   X0006 - Fix arg in call to SYS$UNWIND

;	0060	!

;	0061	!   Andrew C. Goldstein, 21-Jan-1978  0:22

;	0062	!   X0007 - Rewrite from EXTDIR for structure level 2

;	0063	!

;	0064	!   Andrew C. Goldstein, 25-Jan-1978  17:02

;	0065	!   B0008 - Fix edge conditions in directory split

;	0066	!

;	0067	!   Andrew C. Goldstein, 3-Feb-1978  2:00

;	0068	!   B0009 - Fix up DIR_BUFFER before using NEXT_REC

;	0069	!

;	0070	!   Andrew C. Goldstein, 12-Feb-1978  14:30

;	0071	!   B0010 - Circumvent MOVC microcode bug

;	0072	!

;	0073	!   Andrew C. Goldstein, 2-May-78  11:12

;	0074	!   B0011 - Proceed after truncate failure even if write error

;	0075	!

;	0076	!   Andrew C. Goldstein, 10-Aug-78  14:26

;	0077	!   B0012 - Remove MOVC kluge

;	0078	!

;	0079	!**

;	0080	

;	0081	

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

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

;	0432	

;	0433	

;	0434	FORWARD ROUTINE

;	0435		SHUFFLE_DIR	: NOVALUE,	! extend or compress directory file

;	0436		FIX_HEADER	: NOVALUE,	! update directory file header & FCB

;	0437		HANDLER;			! local condition handler



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 2

;

;	0438	GLOBAL ROUTINE SHUFFLE_DIR (DIRECTION) : NOVALUE =

;	0439	

;	0440	!++

;	0441	!

;	0442	! FUNCTIONAL DESCRIPTION:

;	0443	!

;	0444	!	This routine extends or compresses a directory file. It is called

;	0445	!	to make free space in a block which is full or to squish out a block

;	0446	!	which is completely empty. If allocated but unused blocks are present

;	0447	!	at the end of the directory or if a squish is being done, the

;	0448	!	blocks are shuffled in place. Physically extending the directory

;	0449	!	requires reallocating and copying.

;	0450	!

;	0451	! CALLING SEQUENCE:

;	0452	!	SHUFFLE_DIR (ARG1)

;	0453	!

;	0454	! INPUT PARAMETERS:

;	0455	!	ARG1: +1 to extend the directory

;	0456	!	      -1 to squish

;	0457	!

;	0458	! IMPLICIT INPUTS:

;	0459	!	DIR_FCB: FCB of directory file

;	0460	!	DIR_VBN: current VBN of directory

;	0461	!	DIR_BUFFER: address of current directory block

;	0462	!	DIR_ENTRY: address of current directory record

;	0463	!	DIR_VERSION: address of version within record

;	0464	!

;	0465	! OUTPUT PARAMETERS:

;	0466	!	NONE

;	0467	!

;	0468	! IMPLICIT OUTPUTS:

;	0469	!	(for extension only)

;	0470	!	DIR_VBN: current VBN of directory, updated

;	0471	!	DIR_BUFFER: address of current directory block, updated

;	0472	!	DIR_ENTRY: address of current directory record, updated

;	0473	!	DIR_VERSION: address of version within record, updated

;	0474	!	DIR_END: address of end of data in dirrectory block, updated

;	0475	!	(for compression)

;	0476	!	DIR_ENTRY: 0

;	0477	!

;	0478	! ROUTINE VALUE:

;	0479	!	NONE

;	0480	!

;	0481	! SIDE EFFECTS:

;	0482	!	directory extended, storage map altered, directory FCB altered

;	0483	!

;	0484	!--

;	0485	

;	0486	BEGIN

;	0487	

;	0488	LINKAGE

;	0489		L_MAKE_POINTER	= CALL :

;	0490				  GLOBAL (MAP_POINTER = 9);

;	0491	

;	0492	BUILTIN



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 2-1

;

;	0493		FP;

;	0494	

;	0495	LABEL

;	0496		COPY_BLOCK;			! directory block copy code

;	0497	

;	0498	GLOBAL REGISTER

;	0499		MAP_POINTER	= 9 : REF BBLOCK; ! pointer to current retrieval pointer

;	0500	

;	0501	LOCAL

;	0502		FIB		: REF BBLOCK,	! address of FIB for this operation

;	0503		FCB		: REF BBLOCK,	! address of FCB for directory

;	0504		HEADER		: REF BBLOCK,	! address of directory file header

;	0505		IN_PLACE,			! in place copy flag

;	0506		NEW_SIZE,			! size to extend directory to

;	0507		NEW_LBN,			! starting LBN of new space

;	0508		BUFFER,				! buffer address of current directory block

;	0509		COMP_BUFFER,			! buffer address used for compression

;	0510		NEW_BUFFER,			! address of newly read expanded block

;	0511		OFFSET,				! VBN offset in shuffle copy

;	0512		P1		: REF BBLOCK,	! directory record pointer

;	0513		END_POINT	: REF BBLOCK,	! pointer to end of data in block

;	0514		REC_OFFSET;			! block offset of current record

;	0515	

;	0516	EXTERNAL

;	0517		CONTEXT_START,			! start of context area

;	0518		CONTEXT_SAVE,			! start of context save area

;	0519		CURRENT_FIB	: REF BBLOCK,	! address of FIB in use

;	0520		LOCAL_FIB	: BBLOCK,	! FIB for main file operation

;	0521		SECOND_FIB	: BBLOCK,	! FIB for secondary operations

;	0522		DIR_FCB		: REF BBLOCK,	! address of directory FCB

;	0523		DIR_VBN,			! current VBN of directory

;	0524		DIR_BUFFER	: REF BBLOCK,	! address of current directory block

;	0525		DIR_ENTRY	: REF BBLOCK,	! address of current directory record

;	0526		DIR_VERSION	: REF BBLOCK,	! address of version within record

;	0527		DIR_END		: REF BBLOCK,	! address of end of data

;	0528		PRIMARY_FCB	: REF BBLOCK,	! FCB of file in process

;	0529		UNREC_COUNT,			! count of unrecorded blocks

;	0530		UNREC_LBN;			! starting LBN of unrecorded blocks

;	0531	

;	0532	EXTERNAL LITERAL

;	0533		CONTEXT_SIZE;			! length of context area

;	0534	

;	0535	EXTERNAL ROUTINE

;	0536		READ_HEADER,			! read file header

;	0537		ALLOC_BLOCKS,			! allocate blocks from storage map

;	0538		MAKE_POINTER	: L_MAKE_POINTER, ! build header map pointer

;	0539		READ_BLOCK,			! read a disk block

;	0540		RESET_LBN,			! assign new LBN to buffer

;	0541		WRITE_BLOCK,			! write block to disk

;	0542		CREATE_BLOCK,			! fabricate a block buffer

;	0543		INVALIDATE,			! invalidate a block buffer

;	0544		NEXT_REC,			! get next directory record

;	0545		TRUNCATE_HEADER,		! truncate file header

;	0546		ZERO_WINDOWS;			! invalidate related file windows

;	0547	



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 2-2

;

;	0548	

;	0549	! First save the current context, since this is a secondary file operation.

;	0550	! Set up the secondary context pointers. Then read the directory file header.

;	0551	!

;	0552	

;	0553	CH$MOVE (CONTEXT_SIZE, CONTEXT_START, CONTEXT_SAVE);

;	0554	CH$FILL (0, CONTEXT_SIZE, CONTEXT_START);

;	0555	

;	0556	PRIMARY_FCB = FCB = .DIR_FCB;

;	0557	CURRENT_FIB = FIB = SECOND_FIB;

;	0558	CH$FILL (0, FIB$C_LENGTH, .FIB);

;	0559	CH$MOVE (FIB$S_FID, LOCAL_FIB[FIB$W_DID], FIB[FIB$W_FID]);

;	0560	

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

;	0562	

;	0563	! If the directory is being expanded, see if space is available. If not,

;	0564	! allocate a new larger area. The next VBN to use is the current directory

;	0565	! EOF block number. If the block is not present in the file, the directory

;	0566	! must be physically extended.

;	0567	!

;	0568	

;	0569	COPY_BLOCK: BEGIN

;	0570	IN_PLACE = 1;				! assume in place shuffle

;	0571	IF .DIRECTION GTR 0

;	0572	THEN

;	0573	    BEGIN

;	0574	    IF .FCB[FCB$L_EFBLK] + 1 GTRU .FCB[FCB$L_FILESIZE]

;	0575	    THEN

;	0576		BEGIN

;	0577	

;	0578	! Compute the number of blocks needed (50% of the current directory size)

;	0579	! and allocate the new space contiguously. Limit the number of blocks

;	0580	! allocated to what will fit in the map area of the header.

;	0581	!

;	0582	

;	0583		IN_PLACE = 0;

;	0584		NEW_SIZE = .FCB[FCB$L_FILESIZE] + MAXU (.FCB[FCB$L_FILESIZE]/2, 1);

;	0585		IF .FCB[FCB$L_FILESIZE] GEQU 1024 THEN ERR_EXIT (SS$_DIRFULL);

;	0586		IF .NEW_SIZE GTRU 1024 THEN NEW_SIZE = 1024;

;	0587	

;	0588		FIB[FIB$V_ALCON] = 1;

;	0589		FIB[FIB$V_FILCON] = 1;

;	0590		ALLOC_BLOCKS (.FIB, .NEW_SIZE, NEW_LBN, NEW_SIZE);

;	0591		UNREC_COUNT = .NEW_SIZE;

;	0592		UNREC_LBN = .NEW_LBN;

;	0593		END

;	0594	    ELSE

;	0595		NEW_LBN = .FCB[FCB$L_STLBN];	! use existing space

;	0596	

;	0597	! Now copy the directory blocks (following code is for expansion). For

;	0598	! maximum safety, we copy in reverse order, so that if the operation fails

;	0599	! or the system crashes, we have duplicate, rather than missing, directory

;	0600	! entries. We update the file header after the first block has been

;	0601	! written in an in place copy for the same reason.

;	0602	!



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 2-3

;

;	0603	

;	0604	    OFFSET = 0;				! shuffle offset

;	0605	    DECR VBN FROM .FCB[FCB$L_EFBLK] TO 1 DO

;	0606		BEGIN

;	0607		BUFFER = READ_BLOCK (.VBN+.FCB[FCB$L_STLBN]-1, 1, DIRECTORY_TYPE);

;	0608	

;	0609	! When we reach the VBN at which the shuffler was called, we split the

;	0610	! block. We find the first record past the midpoint (past the 3/4 mark if

;	0611	! this is the last block) and split into two buffers. Note that this logic

;	0612	! depends on the availability from the buffer manager two blocks of

;	0613	! adjacent LBN's referenced in direct sequence.

;	0614	!

;	0615	

;	0616		IF .VBN EQL .DIR_VBN

;	0617		THEN

;	0618		    BEGIN

;	0619		    LOCAL P2, BUFFER2, LIMIT;

;	0620		    P1 = .BUFFER;

;	0621		    LIMIT = .BUFFER + 256;

;	0622		    IF .DIR_VBN EQL .FCB[FCB$L_EFBLK]

;	0623		    THEN LIMIT = .LIMIT + 128;

;	0624		    REC_OFFSET = .DIR_ENTRY - .DIR_BUFFER;

;	0625		    DIR_BUFFER = .BUFFER;

;	0626	

;	0627		    UNTIL .P1 GEQA .LIMIT DO

;	0628			BEGIN

;	0629			P2 = .P1;

;	0630			P1 = NEXT_REC (.P1);

;	0631			END;

;	0632	

;	0633	! The point at which we split depends on the the relation between the location

;	0634	! of the new entry and the two split pointers. If the new entry precedes the

;	0635	! first point, we split there and the entry goes into the former block.

;	0636	! If the new entry follows the first point, we split at the latter point

;	0637	! and the entry goes into the latter block. If the entry is a new version

;	0638	! of the record at the split point, we split after the record unless the

;	0639	! record is already the last in its block, in which case we split before it.

;	0640	! Got it?

;	0641	!

;	0642	

;	0643		    IF .REC_OFFSET + .BUFFER GTRA .P2

;	0644		    THEN

;	0645			BEGIN

;	0646			P2 = .P1;

;	0647			REC_OFFSET = .REC_OFFSET + .BUFFER - .P2;

;	0648			DIR_VBN = .DIR_VBN + 1;

;	0649			END

;	0650	

;	0651		    ELSE IF .REC_OFFSET + .BUFFER EQL .P2

;	0652		    AND .DIR_VERSION NEQ 0

;	0653		    THEN

;	0654			BEGIN

;	0655			IF .P1[DIR$W_SIZE] EQL 65535

;	0656			THEN

;	0657			    BEGIN



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 2-4

;

;	0658			    IF .P2 EQL .BUFFER

;	0659			    THEN ERR_EXIT (SS$_DIRFULL);

;	0660			    REC_OFFSET = .REC_OFFSET + .BUFFER - .P2;

;	0661			    DIR_VBN = .DIR_VBN + 1;

;	0662			    END

;	0663			ELSE

;	0664			    P2 = .P1;

;	0665			END;

;	0666	

;	0667		    P1 = .P2 - .BUFFER;		! save split offset point

;	0668		    BUFFER2 = CREATE_BLOCK (.VBN+.FCB[FCB$L_STLBN], 1, DIRECTORY_TYPE);

;	0669		    CH$MOVE (512-.P1, .P2, .BUFFER2);

;	0670		    CH$COPY (2, UPLIT WORD (-1), 0, 512-.P1, .P2);

;	0671	

;	0672	! Set the higher block to its new LBN and write it. Bump the offset so

;	0673	! that subsequent file to file copies now go to corresponding VBN's.

;	0674	! If this is an in place copy and fix up the header now.

;	0675	!

;	0676	

;	0677		    RESET_LBN (.BUFFER2, .VBN+.NEW_LBN);

;	0678		    OFFSET = -1;

;	0679		    WRITE_BLOCK (.BUFFER2);

;	0680		    IF .IN_PLACE AND .VBN EQL .FCB[FCB$L_EFBLK]

;	0681		    THEN FIX_HEADER (.HEADER, 1);

;	0682		    END;			! end of block split condition

;	0683	

;	0684	! For the rest of the copy loop, assign the output LBN to the buffer and

;	0685	! write it. On an in place copy, kick out of the loop after we have done

;	0686	! the block split. Otherwise, fix the header after the first write.

;	0687	!

;	0688	

;	0689		RESET_LBN (.BUFFER, .VBN+.NEW_LBN+.OFFSET);

;	0690		WRITE_BLOCK (.BUFFER);

;	0691		IF .IN_PLACE

;	0692		THEN

;	0693		    BEGIN

;	0694		    IF .OFFSET NEQ 0

;	0695		    THEN LEAVE COPY_BLOCK

;	0696		    ELSE IF .VBN EQL .FCB[FCB$L_EFBLK]

;	0697		    THEN FIX_HEADER (.HEADER, 1);

;	0698		    END;

;	0699		END;				! of in place copy loop

;	0700	

;	0701	! Now deallocate the old directory blocks. Then build retrieval pointers

;	0702	! for the new blocks in the file header. Do the truncation with a local

;	0703	! condition handler enabled for special error recovery.

;	0704	!

;	0705	

;	0706	    .FP = HANDLER;

;	0707	    TRUNCATE_HEADER (.FIB, .HEADER, DEALLOC_BLOCKS);

;	0708	    .FP = 0;

;	0709	

;	0710	    MAP_POINTER = .HEADER + .HEADER[FH2$B_MPOFFSET]*2;

;	0711	    MAKE_POINTER (.NEW_SIZE, .NEW_LBN, .HEADER);

;	0712	



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 2-5

;

;	0713	    UNREC_COUNT = 0;

;	0714	    KERNEL_CALL (ZERO_WINDOWS, .FCB);

;	0715	

;	0716	    END				! of expansion conditional

;	0717	

;	0718	! For an inplace compression, we copy the blocks in forward order, again

;	0719	! for maximum safety.

;	0720	!

;	0721	

;	0722	ELSE

;	0723	    BEGIN

;	0724	    DIR_ENTRY = 0;			! indicate no block resident

;	0725	    INVALIDATE (.DIR_BUFFER);		! punt the block being squished out

;	0726	    INCR VBN FROM .DIR_VBN+1 TO .FCB[FCB$L_EFBLK] DO

;	0727		BEGIN

;	0728		COMP_BUFFER = READ_BLOCK (.VBN+.FCB[FCB$L_STLBN]-1, 1, DIRECTORY_TYPE);

;	0729		RESET_LBN (.COMP_BUFFER, .VBN+.FCB[FCB$L_STLBN]-2);

;	0730		WRITE_BLOCK (.COMP_BUFFER);

;	0731		END;

;	0732	    END;

;	0733	

;	0734	! Now, for an extension copy or a compression, update the file header.

;	0735	!

;	0736	

;	0737	FIX_HEADER (.HEADER, .DIRECTION);

;	0738	

;	0739	END;					! end of block COPY_BLOCK

;	0740	

;	0741	! For an extension, read back the block where the new entry will go

;	0742	! and update the lookup pointers. For a compression, save the pointer

;	0743	! in offset form so it can be used by the remove cleanup in case of error.

;	0744	!

;	0745	

;	0746	IF .DIRECTION GTR 0

;	0747	THEN

;	0748	    BEGIN

;	0749	    NEW_BUFFER = READ_BLOCK (.DIR_VBN+.FCB[FCB$L_STLBN]-1, 1, DIRECTORY_TYPE);

;	0750	    REC_OFFSET = .REC_OFFSET + .NEW_BUFFER;

;	0751	    IF .DIR_VERSION NEQ 0

;	0752	    THEN DIR_VERSION = .DIR_VERSION - .DIR_ENTRY + .REC_OFFSET;

;	0753	    DIR_BUFFER = .NEW_BUFFER;

;	0754	    DIR_ENTRY = .REC_OFFSET;

;	0755	

;	0756	    END_POINT = .NEW_BUFFER;

;	0757	    UNTIL .END_POINT[DIR$W_SIZE] EQL 65535 DO

;	0758	    END_POINT = NEXT_REC (.END_POINT);

;	0759	    DIR_END = .END_POINT + 2;

;	0760	    END;

;	0761	

;	0762	! Finally switch back to primary context.

;	0763	!

;	0764	

;	0765	CH$MOVE (CONTEXT_SIZE, CONTEXT_SAVE, CONTEXT_START);

;	0766	CONTEXT_SAVE = 0;

;	0767	



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 2-6

;

;	0768	END;					! end of routine EXTEND_DIR





							    .TITLE  SHFDIR

							    .IDENT  \B0012\



							    .PSECT  $CODE$,NOWRT,2



					FFFF  00000 P.AAA:  .WORD   -1							      ;

					      00002	    .BLKB   2



							    .EXTRN  CONTEXT_START, CONTEXT_SAVE, CURRENT_FIB, LOCAL_FIB

							    .EXTRN  SECOND_FIB, DIR_FCB, DIR_VBN, DIR_BUFFER, DIR_ENTRY

							    .EXTRN  DIR_VERSION, DIR_END, PRIMARY_FCB, UNREC_COUNT

							    .EXTRN  UNREC_LBN, CONTEXT_SIZE, READ_HEADER, ALLOC_BLOCKS

							    .EXTRN  MAKE_POINTER, READ_BLOCK, RESET_LBN, WRITE_BLOCK

							    .EXTRN  CREATE_BLOCK, INVALIDATE, NEXT_REC, TRUNCATE_HEADER

							    .EXTRN  ZERO_WINDOWS, SYS$CMKRNL



					 0FFC 00004 	    .ENTRY  SHUFFLE_DIR, Save R2,R3,R4,R5,R6,R7,R8,R9,R10,R11	      ; 0438

		         5E 	       20  C2 00006 	    SUBL2   #32, SP						      ;

    0000G  CF	  0000G  CF	0000G  8F  28 00009 	    MOVC3   #CONTEXT_SIZE, CONTEXT_START, CONTEXT_SAVE		      ; 0553

	   00 	         6E 	       00  2C 00013 	    MOVC5   #0, (SP), #0, #CONTEXT_SIZE, CONTEXT_START		      ; 0554

		  0000G  CF	0000G  8F     00017									      ;

		         56 	0000G  CF  D0 0001D 	    MOVL    DIR_FCB, FCB					      ; 0556

		  0000G  CF	       56  D0 00022 	    MOVL    FCB, PRIMARY_FCB					      ;

		    08   AE	0000G  CF  9E 00027 	    MOVAB   SECOND_FIB, FIB					      ; 0557

		  0000G  CF	  08   AE  D0 0002D 	    MOVL    FIB, CURRENT_FIB					      ;

	   00 	         6E 	       00  2C 00033 	    MOVC5   #0, (SP), #0, #44, @FIB				      ; 0558

		    08   BE	       2C     00037									      ;

	   57 	    08   AE	       04  C1 0003A 	    ADDL3   #4, FIB, R7						      ; 0559

	   67 	  0000G  CF	       06  28 0003F 	    MOVC3   #6, LOCAL_FIB+10, (R7)				      ;

				       56  DD 00045 	    PUSHL   FCB							      ; 0561

				       7E  D4 00047 	    CLRL    -(SP)						      ;

		  0000G  CF	       02  FB 00049 	    CALLS   #2, READ_HEADER					      ;

		    04   AE	       50  D0 0004E 	    MOVL    R0, HEADER						      ;

		         6E 	       01  D0 00052 	    MOVL    #1, IN_PLACE					      ; 0570

				  04   AC  D5 00055 	    TSTL    DIRECTION						      ; 0571

				       03  14 00058 	    BGTR    1$							      ;

				     01E4  31 0005A 	    BRW     23$							      ;

	   50 	    40   A6	       01  C1 0005D 1$:     ADDL3   #1, 64(FCB), R0					      ; 0574

		    34   A6	       50  D1 00062 	    CMPL    R0, 52(FCB)						      ;

				       61  1B 00066 	    BLEQU   5$							      ;

				       6E  D4 00068 	    CLRL    IN_PLACE						      ; 0583

	   50 	    34   A6	       02  C7 0006A 	    DIVL3   #2, 52(FCB), R0					      ; 0584

		         01 	       50  D1 0006F 	    CMPL    R0, #1						      ;

				       03  1E 00072 	    BGEQU   2$							      ;

		         50 	       01  D0 00074 	    MOVL    #1, R0						      ;

		    1C   AE	  34 B640  9E 00077 2$:     MOVAB   @52(FCB)[R0], NEW_SIZE				      ;

	      00000400   8F	  34   A6  D1 0007D 	    CMPL    52(FCB), #1024					      ; 0585

				       03  1F 00085 	    BLSSU   3$							      ;

				     00CA  31 00087 	    BRW     13$							      ;

	      00000400   8F	  1C   AE  D1 0008A 3$:     CMPL    NEW_SIZE, #1024					      ; 0586

				       06  1B 00092 	    BLEQU   4$							      ;

		    1C   AE	0400   8F  3C 00094 	    MOVZWL  #1024, NEW_SIZE					      ;



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 2-7

;

	   50 	    08   AE	       16  C1 0009A 4$:     ADDL3   #22, FIB, R0					      ; 0588

		         60 	       01  88 0009F 	    BISB2   #1, (R0)						      ;

	   50 	    08   AE	       16  C1 000A2 	    ADDL3   #22, FIB, R0					      ; 0589

		         60 	       04  88 000A7 	    BISB2   #4, (R0)						      ;

				  1C   AE  9F 000AA 	    PUSHAB  NEW_SIZE						      ; 0590

				  1C   AE  9F 000AD 	    PUSHAB  NEW_LBN						      ;

				  24   AE  DD 000B0 	    PUSHL   NEW_SIZE						      ;

				  14   AE  DD 000B3 	    PUSHL   FIB							      ;

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

		  0000G  CF	  1C   AE  D0 000BB 	    MOVL    NEW_SIZE, UNREC_COUNT				      ; 0591

		  0000G  CF	  18   AE  D0 000C1 	    MOVL    NEW_LBN, UNREC_LBN					      ; 0592

				       05  11 000C7 	    BRB     6$							      ; 0574

		    18   AE	  2C   A6  D0 000C9 5$:     MOVL    44(FCB), NEW_LBN					      ; 0595

				  14   AE  D4 000CE 6$:     CLRL    OFFSET						      ; 0604

	   59 	    40   A6	       01  C1 000D1 	    ADDL3   #1, 64(FCB), VBN					      ; 0605

				     011A  31 000D6 	    BRW     20$							      ;

				       02  DD 000D9 7$:     PUSHL   #2							      ; 0607

				       01  DD 000DB 	    PUSHL   #1							      ;

	   50 	         59 	  2C   A6  C1 000DD 	    ADDL3   44(FCB), VBN, R0					      ;

				  FF   A0  9F 000E2 	    PUSHAB  -1(R0)						      ;

		  0000G  CF	       03  FB 000E5 	    CALLS   #3, READ_BLOCK					      ;

		         5A 	       50  D0 000EA 	    MOVL    R0, BUFFER						      ;

		  0000G  CF	       59  D1 000ED 	    CMPL    VBN, DIR_VBN					      ; 0616

				       03  13 000F2 	    BEQL    8$							      ;

				     00CA  31 000F4 	    BRW     18$							      ;

		         5B 	       5A  D0 000F7 8$:     MOVL    BUFFER, P1						      ; 0620

		         52 	0100   CA  9E 000FA 	    MOVAB   256(R10), LIMIT					      ; 0621

		    40   A6	0000G  CF  D1 000FF 	    CMPL    DIR_VBN, 64(FCB)					      ; 0622

				       05  12 00105 	    BNEQ    9$							      ;

		         52 	0080   C2  9E 00107 	    MOVAB   128(R2), LIMIT					      ; 0623

      10   AE	  0000G  CF	0000G  CF  C3 0010C 9$:     SUBL3   DIR_BUFFER, DIR_ENTRY, REC_OFFSET			      ; 0624

		  0000G  CF	       5A  D0 00115 	    MOVL    BUFFER, DIR_BUFFER					      ; 0625

		         52 	       5B  D1 0011A 10$:    CMPL    P1, LIMIT						      ; 0627

				       0F  1E 0011D 	    BGEQU   11$							      ;

		         57 	       5B  D0 0011F 	    MOVL    P1, P2						      ; 0629

				       5B  DD 00122 	    PUSHL   P1							      ; 0630

		  0000G  CF	       01  FB 00124 	    CALLS   #1, NEXT_REC					      ;

		         5B 	       50  D0 00129 	    MOVL    R0, P1						      ;

				       EC  11 0012C 	    BRB     10$							      ; 0627

	   50 	         5A 	  10   AE  C1 0012E 11$:    ADDL3   REC_OFFSET, BUFFER, R0				      ; 0643

		         57 	       50  D1 00133 	    CMPL    R0, P2						      ;

				       05  1B 00136 	    BLEQU   12$							      ;

		         57 	       5B  D0 00138 	    MOVL    P1, P2						      ; 0646

				       21  11 0013B 	    BRB     15$							      ; 0647

		         57 	       50  D1 0013D 12$:    CMPL    R0, P2						      ; 0651

				       2A  12 00140 	    BNEQ    17$							      ;

				0000G  CF  D5 00142 	    TSTL    DIR_VERSION						      ; 0652

				       24  13 00146 	    BEQL    17$							      ;

		  FFFF   8F	       6B  B1 00148 	    CMPW    (P1), #65535					      ; 0655

				       1A  12 0014D 	    BNEQ    16$							      ;

		         5A 	       57  D1 0014F 	    CMPL    P2, BUFFER						      ; 0658

				       05  12 00152 	    BNEQ    14$							      ;

				0860   8F  BF 00154 13$:    CHMU    #2144						      ; 0659

					   04 00158 	    RET     							      ;

	   50 	         5A 	  10   AE  C1 00159 14$:    ADDL3   16(REC_OFFSET), BUFFER, R0				      ; 0660



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 2-8

;

      10   AE	         50 	       57  C3 0015E 15$:    SUBL3   P2, R0, REC_OFFSET					      ;

				0000G  CF  D6 00163 	    INCL    DIR_VBN						      ; 0661

				       03  11 00167 	    BRB     17$							      ; 0655

		         57 	       5B  D0 00169 16$:    MOVL    P1, P2						      ; 0664

	   5B 	         57 	       5A  C3 0016C 17$:    SUBL3   BUFFER, P2, P1					      ; 0667

				       02  DD 00170 	    PUSHL   #2							      ; 0668

				       01  DD 00172 	    PUSHL   #1							      ;

				  2C B649  9F 00174 	    PUSHAB  @44(FCB)[VBN]					      ;

		  0000G  CF	       03  FB 00178 	    CALLS   #3, CREATE_BLOCK					      ;

		    0C   AE	       50  D0 0017D 	    MOVL    R0, BUFFER2						      ;

	   58 00000200   8F	       5B  C3 00181 	    SUBL3   P1, #512, R8					      ; 0669

      0C   BE	         67 	       58  28 00189 	    MOVC3   R8, (P2), @BUFFER2					      ;

	   00 	  FE6D   CF	       02  2C 0018E 	    MOVC5   #2, P.AAA, #0, R8, (P2)				      ; 0670

		         67 	       58     00194									      ;

				  18 BE49  9F 00196 	    PUSHAB  @NEW_LBN[VBN]					      ; 0677

				  10   AE  DD 0019A 	    PUSHL   BUFFER2						      ;

		  0000G  CF	       02  FB 0019D 	    CALLS   #2, RESET_LBN					      ;

		    14   AE	       01  CE 001A2 	    MNEGL   #1, OFFSET						      ; 0678

				  0C   AE  DD 001A6 	    PUSHL   BUFFER2						      ; 0679

		  0000G  CF	       01  FB 001A9 	    CALLS   #1, WRITE_BLOCK					      ;

		         10 	       6E  E9 001AE 	    BLBC    IN_PLACE, 18$					      ; 0680

		    40   A6	       59  D1 001B1 	    CMPL    VBN, 64(FCB)					      ;

				       0A  12 001B5 	    BNEQ    18$							      ;

				       01  DD 001B7 	    PUSHL   #1							      ; 0681

				  08   AE  DD 001B9 	    PUSHL   HEADER						      ;

		  0000V  CF	       02  FB 001BC 	    CALLS   #2, FIX_HEADER					      ;

	   50 	         59 	  18   AE  C1 001C1 18$:    ADDL3   NEW_LBN, VBN, R0					      ; 0689

				  14 BE40  9F 001C6 	    PUSHAB  @OFFSET[R0]						      ;

				       5A  DD 001CA 	    PUSHL   BUFFER						      ;

		  0000G  CF	       02  FB 001CC 	    CALLS   #2, RESET_LBN					      ;

				       5A  DD 001D1 	    PUSHL   BUFFER						      ; 0690

		  0000G  CF	       01  FB 001D3 	    CALLS   #1, WRITE_BLOCK					      ;

		         18 	       6E  E9 001D8 	    BLBC    IN_PLACE, 20$					      ; 0691

				  14   AE  D5 001DB 	    TSTL    OFFSET						      ; 0694

				       03  13 001DE 	    BEQL    19$							      ;

				     00A7  31 001E0 	    BRW     27$							      ;

		    40   A6	       59  D1 001E3 19$:    CMPL    VBN, 64(FCB)					      ; 0696

				       0A  12 001E7 	    BNEQ    20$							      ;

				       01  DD 001E9 	    PUSHL   #1							      ; 0697

				  08   AE  DD 001EB 	    PUSHL   HEADER						      ;

		  0000V  CF	       02  FB 001EE 	    CALLS   #2, FIX_HEADER					      ;

		         02 	       59  F5 001F3 20$:    SOBGTR  VBN, 21$						      ; 0605

				       03  11 001F6 	    BRB     22$							      ;

				     FEDE  31 001F8 21$:    BRW     7$							      ;

		         6D 	0000V  CF  9E 001FB 22$:    MOVAB   HANDLER, (FP)					      ; 0706

				       01  DD 00200 	    PUSHL   #1							      ; 0707

				  08   AE  DD 00202 	    PUSHL   HEADER						      ;

				  10   AE  DD 00205 	    PUSHL   FIB							      ;

		  0000G  CF	       03  FB 00208 	    CALLS   #3, TRUNCATE_HEADER					      ;

				       6D  D4 0020D 	    CLRL    (FP)						      ; 0708

	   51 	    04   AE	       01  C1 0020F 	    ADDL3   #1, HEADER, R1					      ; 0710

		         50 	       61  9A 00214 	    MOVZBL  (R1), R0						      ;

		         59 	  04 BE40  3E 00217 	    MOVAW   @HEADER[R0], MAP_POINTER				      ;

				  04   AE  DD 0021C 	    PUSHL   HEADER						      ; 0711

				  1C   AE  DD 0021F 	    PUSHL   NEW_LBN						      ;



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 2-9

;

				  24   AE  DD 00222 	    PUSHL   NEW_SIZE						      ;

		  0000G  CF	       03  FB 00225 	    CALLS   #3, MAKE_POINTER					      ;

				0000G  CF  D4 0022A 	    CLRL    UNREC_COUNT						      ; 0713

				       56  DD 0022E 	    PUSHL   FCB							      ; 0714

				       01  DD 00230 	    PUSHL   #1							      ;

				       5E  DD 00232 	    PUSHL   SP							      ;

				0000G  CF  9F 00234 	    PUSHAB  ZERO_WINDOWS					      ;

	      00000000G  9F	       04  FB 00238 	    CALLS   #4, @#SYS$CMKRNL					      ;

				       3E  11 0023F 	    BRB     26$							      ; 0571

				0000G  CF  D4 00241 23$:    CLRL    DIR_ENTRY						      ; 0724

				0000G  CF  DD 00245 	    PUSHL   DIR_BUFFER						      ; 0725

		  0000G  CF	       01  FB 00249 	    CALLS   #1, INVALIDATE					      ;

		         53 	0000G  CF  D0 0024E 	    MOVL    DIR_VBN, VBN					      ; 0726

				       25  11 00253 	    BRB     25$							      ;

				       02  DD 00255 24$:    PUSHL   #2							      ; 0728

				       01  DD 00257 	    PUSHL   #1							      ;

	   52 	         53 	  2C   A6  C1 00259 	    ADDL3   44(FCB), VBN, R2					      ;

				  FF   A2  9F 0025E 	    PUSHAB  -1(R2)						      ;

		  0000G  CF	       03  FB 00261 	    CALLS   #3, READ_BLOCK					      ;

		         54 	       50  D0 00266 	    MOVL    R0, COMP_BUFFER					      ;

				  FE   A2  9F 00269 	    PUSHAB  -2(R2)						      ; 0729

				       54  DD 0026C 	    PUSHL   COMP_BUFFER						      ;

		  0000G  CF	       02  FB 0026E 	    CALLS   #2, RESET_LBN					      ;

				       54  DD 00273 	    PUSHL   COMP_BUFFER						      ; 0730

		  0000G  CF	       01  FB 00275 	    CALLS   #1, WRITE_BLOCK					      ;

	   D6 	         53 	  40   A6  F3 0027A 25$:    AOBLEQ  64(FCB), VBN, 24$					      ; 0726

				  04   AC  DD 0027F 26$:    PUSHL   DIRECTION						      ; 0737

				  08   AE  DD 00282 	    PUSHL   HEADER						      ;

		  0000V  CF	       02  FB 00285 	    CALLS   #2, FIX_HEADER					      ;

				  04   AC  D5 0028A 27$:    TSTL    DIRECTION						      ; 0746

				       54  15 0028D 	    BLEQ    31$							      ;

				       02  DD 0028F 	    PUSHL   #2							      ; 0749

				       01  DD 00291 	    PUSHL   #1							      ;

	   50 	  0000G  CF	  2C   A6  C1 00293 	    ADDL3   44(FCB), DIR_VBN, R0				      ;

				  FF   A0  9F 0029A 	    PUSHAB  -1(R0)						      ;

		  0000G  CF	       03  FB 0029D 	    CALLS   #3, READ_BLOCK					      ;

		         51 	       50  D0 002A2 	    MOVL    R0, NEW_BUFFER					      ;

		    10   AE	       51  C0 002A5 	    ADDL2   NEW_BUFFER, REC_OFFSET				      ; 0750

		         50 	0000G  CF  D0 002A9 	    MOVL    DIR_VERSION, R0					      ; 0751

				       0C  13 002AE 	    BEQL    28$							      ;

		         50 	0000G  CF  C2 002B0 	    SUBL2   DIR_ENTRY, R0					      ; 0752

		  0000G  CF	  10 BE40  9E 002B5 	    MOVAB   @REC_OFFSET[R0], DIR_VERSION			      ;

		  0000G  CF	       51  D0 002BC 28$:    MOVL    NEW_BUFFER, DIR_BUFFER				      ; 0753

		  0000G  CF	  10   AE  D0 002C1 	    MOVL    REC_OFFSET, DIR_ENTRY				      ; 0754

		         52 	       51  D0 002C7 	    MOVL    NEW_BUFFER, END_POINT				      ; 0756

		  FFFF   8F	       62  B1 002CA 29$:    CMPW    (END_POINT), #65535					      ; 0757

				       0C  13 002CF 	    BEQL    30$							      ;

				       52  DD 002D1 	    PUSHL   END_POINT						      ; 0758

		  0000G  CF	       01  FB 002D3 	    CALLS   #1, NEXT_REC					      ;

		         52 	       50  D0 002D8 	    MOVL    R0, END_POINT					      ;

				       ED  11 002DB 	    BRB     29$							      ; 0757

		  0000G  CF	  02   A2  9E 002DD 30$:    MOVAB   2(R2), DIR_END					      ; 0759

    0000G  CF	  0000G  CF	0000G  8F  28 002E3 31$:    MOVC3   #CONTEXT_SIZE, CONTEXT_SAVE, CONTEXT_START		      ; 0765

				0000G  CF  D4 002ED 	    CLRL    CONTEXT_SAVE					      ; 0766

					   04 002F1 	    RET     							      ; 0438



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 2-10

;



; Routine Size:  750 bytes







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 3

;

;	0769	ROUTINE FIX_HEADER (HEADER, DIRECTION) : NOVALUE =

;	0770	

;	0771	!++

;	0772	!

;	0773	! FUNCTIONAL DESCRIPTION:

;	0774	!

;	0775	!	This routine updates the file header of the directory being

;	0776	!	extended or compressed, and also updates the directory FCB.

;	0777	!

;	0778	!

;	0779	! CALLING SEQUENCE:

;	0780	!	FIX_HEADER (ARG1, ARG2)

;	0781	!

;	0782	! INPUT PARAMETERS:

;	0783	!	ARG1: address of file header

;	0784	!	ARG2: +1 for extension

;	0785	!	      -1 for compression

;	0786	!

;	0787	! IMPLICIT INPUTS:

;	0788	!	DIR_VBN: VBN of directory being split or compressed out

;	0789	!	DIR_FCB: address of directory FCB

;	0790	!

;	0791	! OUTPUT PARAMETERS:

;	0792	!	NONE

;	0793	!

;	0794	! IMPLICIT OUTPUTS:

;	0795	!	NONE

;	0796	!

;	0797	! ROUTINE VALUE:

;	0798	!	NONE

;	0799	!

;	0800	! SIDE EFFECTS:

;	0801	!	file header updated, FCB updated

;	0802	!

;	0803	!--

;	0804	

;	0805	BEGIN

;	0806	

;	0807	MAP

;	0808		HEADER		: REF BBLOCK;	! file header arg

;	0809	

;	0810	EXTERNAL

;	0811		DIR_VBN,			! VBN of directory affected

;	0812		DIR_FCB		: REF BBLOCK;	! directory FCB

;	0813	

;	0814	EXTERNAL ROUTINE

;	0815		INIT_FCB2,			! initialize FCB

;	0816		ZERO_IDX,			! initialize directory index

;	0817		CHECKSUM,			! compute file header checksum

;	0818		WRITE_HEADER;			! write file header

;	0819	

;	0820	

;	0821	! Update the end of file mark in the header and the FCB. Then adjust the

;	0822	! directory index in the FCB. Finally checksum and write the file header.

;	0823	!



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 3-1

;

;	0824	

;	0825	BBLOCK [HEADER[FH2$W_RECATTR], FAT$W_EFBLKL] = 

;	0826		.BBLOCK [HEADER[FH2$W_RECATTR], FAT$W_EFBLKL] + .DIRECTION;

;	0827	KERNEL_CALL (INIT_FCB2, .DIR_FCB, .HEADER);

;	0828	BBLOCK [HEADER[FH2$W_RECATTR], FAT$W_HIBLKL] = .DIR_FCB[FCB$L_FILESIZE];

;	0829	KERNEL_CALL (ZERO_IDX);

;	0830	

;	0831	CHECKSUM (.HEADER);

;	0832	WRITE_HEADER ();

;	0833	

;	0834	END;					! end of routine FIX_HEADER







							    .EXTRN  INIT_FCB2, ZERO_IDX, CHECKSUM, WRITE_HEADER



					 000C 002F2 FIX_HEADER:

							    .WORD   Save R2,R3						      ; 0769

		         53 00000000G  9F  9E 002F4 	    MOVAB   @#SYS$CMKRNL, R3					      ;

		         52 	  04   AC  D0 002FB 	    MOVL    HEADER, R2						      ; 0825

		    1E   A2	  08   AC  A0 002FF 	    ADDW2   DIRECTION, 30(R2)					      ; 0826

				  04   AC  DD 00304 	    PUSHL   HEADER						      ; 0827

				0000G  CF  DD 00307 	    PUSHL   DIR_FCB						      ;

				       02  DD 0030B 	    PUSHL   #2							      ;

				       5E  DD 0030D 	    PUSHL   SP							      ;

				0000G  CF  9F 0030F 	    PUSHAB  INIT_FCB2						      ;

		         63 	       05  FB 00313 	    CALLS   #5, SYS$CMKRNL					      ;

		         50 	0000G  CF  D0 00316 	    MOVL    DIR_FCB, R0						      ; 0828

		    1A   A2	  34   A0  B0 0031B 	    MOVW    52(R0), 26(R2)					      ;

				       7E  D4 00320 	    CLRL    -(SP)						      ; 0829

				       5E  DD 00322 	    PUSHL   SP							      ;

				0000G  CF  9F 00324 	    PUSHAB  ZERO_IDX						      ;

		         63 	       03  FB 00328 	    CALLS   #3, SYS$CMKRNL					      ;

				  04   AC  DD 0032B 	    PUSHL   HEADER						      ; 0831

		  0000G  CF	       01  FB 0032E 	    CALLS   #1, CHECKSUM					      ;

		  0000G  CF	       00  FB 00333 	    CALLS   #0, WRITE_HEADER					      ; 0832

					   04 00338 	    RET     							      ; 0769



; Routine Size:  71 bytes







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 4

;

;	0835	ROUTINE HANDLER (SIGNAL, MECHANISM) =

;	0836	

;	0837	!++

;	0838	!

;	0839	! FUNCTIONAL DESCRIPTION:

;	0840	!

;	0841	!	This routine is the condition handler for directory extension. It is

;	0842	!	enabled only during the truncate call (deallocating the old directory

;	0843	!	blocks). Normal error handling would cause the entire directory to

;	0844	!	be dropped on the floor. Since we already have a new good copy, we

;	0845	!	should forge ahead. Note that no error status is returned to the user,

;	0846	!	although we will log a system error.

;	0847	!

;	0848	!

;	0849	! CALLING SEQUENCE:

;	0850	!	HANDLER (ARG1, ARG2)

;	0851	!

;	0852	! INPUT PARAMETERS:

;	0853	!	ARG1: address of signal array

;	0854	!	ARG2: address of mechanism array

;	0855	!

;	0856	! IMPLICIT INPUTS:

;	0857	!	FILE_HEADER: address of directory file header

;	0858	!

;	0859	! OUTPUT PARAMETERS:

;	0860	!	NONE

;	0861	!

;	0862	! IMPLICIT OUTPUTS:

;	0863	!	NONE

;	0864	!

;	0865	! ROUTINE VALUE:

;	0866	!	SS$_RESIGNAL or none if unwind

;	0867	!

;	0868	! SIDE EFFECTS:

;	0869	!	file header map area cleaned out

;	0870	!

;	0871	!--

;	0872	

;	0873	BEGIN

;	0874	

;	0875	MAP

;	0876		SIGNAL		: REF BBLOCK,	! signal array arg

;	0877		MECHANISM	: REF BBLOCK;	! mechanism array arg

;	0878	

;	0879	LOCAL

;	0880		MAP_AREA	: REF BBLOCK;	! address of header map area

;	0881	

;	0882	EXTERNAL

;	0883		FILE_HEADER	: REF BBLOCK;	! address of directory file header

;	0884	

;	0885	EXTERNAL ROUTINE

;	0886		SYS$UNWIND	: ADDRESSING_MODE (ABSOLUTE);

;	0887						! system unwind service

;	0888	

;	0889	



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 4-1

;

;	0890	! Check the condition code for FCP error exit. Then initialize the header's

;	0891	! map area and unwind. On other signals we simply resignal.

;	0892	!

;	0893	

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

;	0895	THEN

;	0896	    BEGIN

;	0897	    MAP_AREA = .FILE_HEADER + .FILE_HEADER[FH1$B_MPOFFSET]*2;

;	0898	    MAP_AREA[FM1$B_INUSE] = 0;

;	0899	    CH$FILL (0, .MAP_AREA[FM1$B_AVAIL]*2, .MAP_AREA + FM1$C_POINTERS);

;	0900	

;	0901	    SYS$UNWIND (MECHANISM[CHF$L_MCH_DEPTH], 0);

;	0902	    END;

;	0903	

;	0904	RETURN SS$_RESIGNAL;			! status is irrelevant if unwind

;	0905	

;	0906	END;					! end of routine handler







							    .EXTRN  FILE_HEADER, SYS$UNWIND



					 003C 00339 HANDLER:.WORD   Save R2,R3,R4,R5					      ; 0835

		         50 	  04   AC  D0 0033B 	    MOVL    SIGNAL, R0						      ; 0894

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

				       2C  12 00347 	    BNEQ    1$							      ;

		         51 	0000G  CF  D0 00349 	    MOVL    FILE_HEADER, R1					      ; 0897

		         50 	  01   A1  9A 0034E 	    MOVZBL  1(R1), R0						      ;

		         50 	     6140  3E 00352 	    MOVAW   (R1)[R0], MAP_AREA					      ;

				  08   A0  94 00356 	    CLRB    8(MAP_AREA)						      ; 0898

		         51 	  09   A0  9A 00359 	    MOVZBL  9(MAP_AREA), R1					      ; 0899

		         51 	       02  C4 0035D 	    MULL2   #2, R1						      ;

	   00 	         6E 	       00  2C 00360 	    MOVC5   #0, (SP), #0, R1, 10(MAP_AREA)			      ;

		    0A   A0	       51     00364									      ;

				       7E  D4 00367 	    CLRL    -(SP)						      ; 0901

	   7E 	    08   AC	       08  C1 00369 	    ADDL3   #8, MECHANISM, -(SP)				      ;

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

		         50 	0918   8F  3C 00375 1$:     MOVZWL  #2328, R0						      ; 0904

					   04 0037A 	    RET     							      ; 0835



; Routine Size:  66 bytes





;	0907	

;	0908	END

;	0909	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:21:30	DBB3:[F11B.SRC]SHFDIR.B32;8					Page 4-2

;

;

;  $CODE$         	   891  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       242











; Size:		887 code + 4 data bytes

; Run Time:	00:17.2

; Elapsed Time:	00:30.3

; Memory Used:	426 pages

; Compilation Complete

