

; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 1

;

;	0001	MODULE CLENUP (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'B0030'

;	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 module performs the necessary cleanup after an operation.

;	0033	!

;	0034	! ENVIRONMENT:

;	0035	!

;	0036	!	STARLET operating system, including privileged system services

;	0037	!	and internal exec routines.

;	0038	!

;	0039	!--

;	0040	!

;	0041	!

;	0042	! AUTHOR:  Andrew C. Goldstein,	 CREATION DATE:  6-Jan-1977  23:53

;	0043	!

;	0044	! REVISION HISTORY:

;	0045	!

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

;	0047	!   X0002 - Modify for condition handling

;	0048	!

;	0049	!   Andrew C. Goldstein, 25-Feb-1977  15:59

;	0050	!   X0003 - Add extend cleanup logic

;	0051	!

;	0052	!   Andrew C. Goldstein, 3-Mar-1977  13:39

;	0053	!   X0004 - Modify to run in exec mode

;	0054	!

;	0055	!   Andrew C. Goldstein, 23-Mar-1977  14:55



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 1-1

;

;	0056	!   X0005 - Add extend and truncate error logic

;	0057	!

;	0058	!   Andrew C. Goldstein, 4-Apr-1977  17:05

;	0059	!   X0006 - Add create cleanup and deletion logic

;	0060	!

;	0061	!   Andrew C. Goldstein, 6-Apr-1977  13:18

;	0062	!   X0007 - Add directory operation cleanups

;	0063	!

;	0064	!   Andrew C. Goldstein, 7-Apr-1977  13:11

;	0065	!   X0008 - Add create-enter-supersede cleanup logic

;	0066	!

;	0067	!   Andrew C. Goldstein, 14-Apr-1977  10:36

;	0068	!   X0009 - Repeat error cleanup for primary and secondary context

;	0069	!

;	0070	!   Andrew C. Goldstein, 19-Apr-1977  11:38

;	0071	!   X0010 - Globalize ZERO_WINDOWS, add header invalidation

;	0072	!

;	0073	!   Andrew C. Goldstein, 20-Apr-1977  13:17

;	0074	!   X0011 - Add buffer pool interlock logic

;	0075	!

;	0076	!   Andrew C. Goldstein, 22-Apr-1977  13:33

;	0077	!   X0012 - Update process file quota on DEACCESS

;	0078	!

;	0079	!   Andrew C. Goldstein, 23-May-1977  15:47

;	0080	!   X0013 - Read original file header for create cleanup

;	0081	!

;	0082	!   Andrew C. Goldstein, 10-Aug-1977  18:08

;	0083	!   X0014 - Rework deallocation of window

;	0084	!

;	0085	!   Andrew C. Goldstein, 13-Jul-1977  15:16

;	0086	!   X0015 - Checksum file header when necessary

;	0087	!

;	0088	!   Andrew C. Goldstein, 11-Aug-1977  14:39

;	0089	!   X0016 - Add multi-header file support

;	0090	!

;	0091	!   Andrew C. Goldstein, 26-Aug-1977  10:29

;	0092	!   X0017 - Add performance metering

;	0093	!

;	0094	!   Andrew C. Goldstein, 12-Dec-1977  13:11

;	0095	!   X0018 - file ID interface changes

;	0096	!

;	0097	!   Andrew C. Goldstein, 14-Dec-1977  12:50

;	0098	!   X0019 - Maintain open file count in system data base

;	0099	!

;	0100	!   Andrew C. Goldstein, 14-Dec-1977  14:07

;	0101	!   X0020 - Modify for structure level 2

;	0102	!

;	0103	!   Andrew C. Goldstein, 6-Jan-1978  22:15

;	0104	!   B0021 - Fix EOF in multi-header FCB cleanup

;	0105	!

;	0106	!   Andrew C. Goldstein, 16-Jan-1978  14:22

;	0107	!   B0022 - New directory cleanup

;	0108	!

;	0109	!   Andrew C. Goldstein, 20-Jan-1978  0:21

;	0110	!   B0023 - Re-read directory block before re-enter if necessary



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 1-2

;

;	0111	!

;	0112	!   Andrew C. Goldstein, 21-Jan-1978  19:29

;	0113	!   B0024 - Add ZERO_IDX routine

;	0114	!

;	0115	!   Andrew C. Goldstein, 12-Feb-1978  18:25

;	0116	!   B0025 - Fix supersede cleanup

;	0117	!

;	0118	!   Andrew C. Goldstein, 12-Feb-1978  18:25

;	0119	!   B0026 - Circumvent MOVC microcode bug

;	0120	!

;	0121	!   Andrew C. Goldstein, 23-May-78  21:25

;	0122	!   B0027 - Close internal file if open

;	0123	!

;	0124	!   Andrew C. Goldstein, 12-Jun-78  21:07

;	0125	!   B0028 - PCB vector name change

;	0126	!

;	0127	!   Andrew C. Goldstein, 21-Jun-78  16:59

;	0128	!   B0029 - Add truncate & directory interlocks, move storage of superseded FID

;	0129	!

;	0130	!   Andrew C. Goldstein, 10-Aug-78  14:24

;	0131	!   B0030 - Remove MOVC kluge

;	0132	!

;	0133	!**

;	0134	

;	0135	

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

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

;	0486	

;	0487	

;	0488	FORWARD ROUTINE

;	0489		CLEANUP,			! normal cleanup

;	0490		ZERO_WINDOWS,			! invalidate all windows of file

;	0491		ZERO_IDX,			! initialize directory index

;	0492		ERR_CLEANUP,			! cleanup after error

;	0493		MAKE_DEACCESS,			! deaccess the file

;	0494		DEL_EXTFCB,			! deallocate extension FCB's

;	0495		ZERO_CHANNEL;			! zero user channel pointer



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 2

;

;	0496	GLOBAL ROUTINE CLEANUP =

;	0497	

;	0498	!++

;	0499	!

;	0500	! FUNCTIONAL DESCRIPTION:

;	0501	!

;	0502	!	This routine performs the cleanup needed after a successfully

;	0503	!	completed file operation.

;	0504	!

;	0505	! CALLING SEQUENCE:

;	0506	!	CLEANUP ()

;	0507	!

;	0508	! INPUT PARAMETERS:

;	0509	!	NONE

;	0510	!

;	0511	! IMPLICIT INPUTS:

;	0512	!	CLEANUP_FLAGS: indicate specific actions to do

;	0513	!	PRIMARY_FCB: FCB of file

;	0514	!	CURRENT_WINDOW: window of file

;	0515	!	DIR_FCB: FCB of directory

;	0516	!	CURRENT_VCB: VCB of volume in process

;	0517	!	IO_PACKET: I/O packet of request

;	0518	!

;	0519	! OUTPUT PARAMETERS:

;	0520	!	NONE

;	0521	!

;	0522	! IMPLICIT OUTPUTS:

;	0523	!	NONE

;	0524	!

;	0525	! ROUTINE VALUE:

;	0526	!	NONE

;	0527	!

;	0528	! SIDE EFFECTS:

;	0529	!	FCB's and windows deleted when appropriate

;	0530	!	header written

;	0531	!	FCB updated

;	0532	!

;	0533	!--

;	0534	

;	0535	BEGIN

;	0536	

;	0537	LOCAL

;	0538		HEADER		: REF BBLOCK;	! file header

;	0539	

;	0540	EXTERNAL

;	0541		CONTEXT_START,			! start of cleanup context area

;	0542		CONTEXT_SAVE,			! start of context save area

;	0543		CLEANUP_FLAGS	: BITVECTOR,	! cleanup action flags

;	0544		FILE_HEADER	: REF BBLOCK,	! address of last file header read

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

;	0546		PRIMARY_FCB	: REF BBLOCK,	! FCB of file

;	0547		CURRENT_WINDOW	: REF BBLOCK,	! window of file

;	0548		DIR_FCB		: REF BBLOCK,	! FCB of directory

;	0549		CURRENT_VCB	: REF BBLOCK,	! VCB of volume

;	0550		IO_PACKET	: REF BBLOCK;	! I/O packet in process



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 2-1

;

;	0551	

;	0552	EXTERNAL LITERAL

;	0553		CONTEXT_SIZE;			! length of context area

;	0554	

;	0555	EXTERNAL ROUTINE

;	0556		FLUSH_BUFFERS,			! write all dirty buffers

;	0557		FLUSH_FID,			! flush a file from buffer pool

;	0558		READ_HEADER,			! read file header

;	0559		INIT_FCB2,			! initialize FCB

;	0560		DEALLOCATE;			! deallocate dynamic memory

;	0561	

;	0562	

;	0563	! Switch back to the primary context area if necessary (no normal cleanup

;	0564	! is ever necessary on secondary context).

;	0565	!

;	0566	

;	0567	IF .CONTEXT_SAVE NEQ 0

;	0568	THEN

;	0569	    BEGIN

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

;	0571	    CONTEXT_SAVE = 0;

;	0572	    END;

;	0573	

;	0574	! ***** Note: The primary header of the current file is not necessarily

;	0575	! resident at this point.

;	0576	!

;	0577	! If an FCB is left about with no use, dispose of it.

;	0578	!

;	0579	

;	0580	IF .PRIMARY_FCB NEQ 0

;	0581	THEN

;	0582	    BEGIN

;	0583	    IF .PRIMARY_FCB[FCB$W_ACNT] EQL 0

;	0584	    AND NOT .PRIMARY_FCB[FCB$V_DIR]

;	0585	    THEN

;	0586		BEGIN

;	0587		KERNEL_CALL (DEALLOCATE, .PRIMARY_FCB);

;	0588		PRIMARY_FCB = 0;

;	0589		END;

;	0590	    END;

;	0591	

;	0592	! If the directory file is write accessed, flush the buffer pool of any

;	0593	! blocks that might be resident. Also flush the directory index.

;	0594	!

;	0595	

;	0596	IF .DIR_FCB NEQ 0

;	0597	THEN

;	0598	    IF .DIR_FCB[FCB$W_WCNT] NEQ 0

;	0599	    THEN

;	0600		BEGIN

;	0601		FLUSH_FID (DIR_FCB[FCB$W_FID]);

;	0602		KERNEL_CALL (ZERO_IDX);

;	0603		END;

;	0604	

;	0605	! Invalidate any windows on the file, if requested.



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 2-2

;

;	0606	!

;	0607	

;	0608	IF TESTBITSC (CLEANUP_FLAGS[CLF_INVWINDOW])

;	0609	AND .PRIMARY_FCB NEQ 0

;	0610	THEN KERNEL_CALL (ZERO_WINDOWS, .PRIMARY_FCB);

;	0611	

;	0612	! If the index file or storage map is write accessed, flush the buffer pool

;	0613	! of any of their blocks.

;	0614	!

;	0615	

;	0616	IF .CURRENT_VCB[VCB$V_WRITE_IF]

;	0617	THEN FLUSH_FID (UPLIT WORD (1, 1, 0));

;	0618	IF .CURRENT_VCB[VCB$V_WRITE_SM]

;	0619	THEN FLUSH_FID (UPLIT WORD (2, 2, 0));

;	0620	

;	0621	! Flush all dirty buffers.

;	0622	!

;	0623	

;	0624	FLUSH_BUFFERS ();

;	0625	

;	0626	RETURN 1;

;	0627	

;	0628	END;					! end of routine CLEANUP





							    .TITLE  CLENUP

							    .IDENT  \B0030\



							    .PSECT  $CODE$,NOWRT,2



			    0000  0001  0001  00000 P.AAA:  .WORD   1, 1, 0						      ;

					      00006	    .BLKB   2

			    0000  0002  0002  00008 P.AAB:  .WORD   2, 2, 0						      ;

					      0000E	    .BLKB   2



							    .EXTRN  CONTEXT_START, CONTEXT_SAVE, CLEANUP_FLAGS, FILE_HEADER

							    .EXTRN  CURRENT_FIB, PRIMARY_FCB, CURRENT_WINDOW, DIR_FCB

							    .EXTRN  CURRENT_VCB, IO_PACKET, CONTEXT_SIZE, FLUSH_BUFFERS

							    .EXTRN  FLUSH_FID, READ_HEADER, INIT_FCB2, DEALLOCATE

							    .EXTRN  SYS$CMKRNL



					 03FC 00010 	    .ENTRY  CLEANUP, Save R2,R3,R4,R5,R6,R7,R8,R9		      ; 0496

		         59 	0000G  CF  9E 00012 	    MOVAB   CONTEXT_SAVE, R9					      ;

		         58 	0000G  CF  9E 00017 	    MOVAB   FLUSH_FID, R8					      ;

		         57 	0000G  CF  9E 0001C 	    MOVAB   PRIMARY_FCB, R7					      ;

		         56 00000000G  9F  9E 00021 	    MOVAB   @#SYS$CMKRNL, R6					      ;

				       69  D5 00028 	    TSTL    CONTEXT_SAVE					      ; 0567

				       0A  13 0002A 	    BEQL    1$							      ;

    0000G  CF	         69 	0000G  8F  28 0002C 	    MOVC3   #CONTEXT_SIZE, CONTEXT_SAVE, CONTEXT_START		      ; 0570

				       69  D4 00034 	    CLRL    CONTEXT_SAVE					      ; 0571

		         50 	       67  D0 00036 1$:     MOVL    PRIMARY_FCB, R0					      ; 0580

				       18  13 00039 	    BEQL    2$							      ;

				  18   A0  B5 0003B 	    TSTW    24(R0)						      ; 0583

				       13  12 0003E 	    BNEQ    2$							      ;

		         0F 	  1E   A0  E8 00040 	    BLBS    30(R0), 2$						      ; 0584



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 2-3

;

				       50  DD 00044 	    PUSHL   R0							      ; 0587

				       01  DD 00046 	    PUSHL   #1							      ;

				       5E  DD 00048 	    PUSHL   SP							      ;

				0000G  CF  9F 0004A 	    PUSHAB  DEALLOCATE						      ;

		         66 	       04  FB 0004E 	    CALLS   #4, SYS$CMKRNL					      ;

				       67  D4 00051 	    CLRL    PRIMARY_FCB						      ; 0588

		         50 	0000G  CF  D0 00053 2$:     MOVL    DIR_FCB, R0						      ; 0596

				       16  13 00058 	    BEQL    3$							      ;

				  1C   A0  B5 0005A 	    TSTW    28(R0)						      ; 0598

				       11  13 0005D 	    BEQL    3$							      ;

				  20   A0  9F 0005F 	    PUSHAB  32(R0)						      ; 0601

		         68 	       01  FB 00062 	    CALLS   #1, FLUSH_FID					      ;

				       7E  D4 00065 	    CLRL    -(SP)						      ; 0602

				       5E  DD 00067 	    PUSHL   SP							      ;

				0000V  CF  9F 00069 	    PUSHAB  ZERO_IDX						      ;

		         66 	       03  FB 0006D 	    CALLS   #3, SYS$CMKRNL					      ;

	   11 	  0000G  CF	       04  E5 00070 3$:     BBCC    #4, CLEANUP_FLAGS, 4$				      ; 0608

				       67  D5 00076 	    TSTL    PRIMARY_FCB						      ; 0609

				       0D  13 00078 	    BEQL    4$							      ;

				       67  DD 0007A 	    PUSHL   PRIMARY_FCB						      ; 0610

				       01  DD 0007C 	    PUSHL   #1							      ;

				       5E  DD 0007E 	    PUSHL   SP							      ;

				0000V  CF  9F 00080 	    PUSHAB  ZERO_WINDOWS					      ;

		         66 	       04  FB 00084 	    CALLS   #4, SYS$CMKRNL					      ;

		         50 	0000G  CF  D0 00087 4$:     MOVL    CURRENT_VCB, R0					      ; 0616

		         07 	  0B   A0  E9 0008C 	    BLBC    11(R0), 5$						      ;

				FF6C   CF  9F 00090 	    PUSHAB  P.AAA						      ; 0617

		         68 	       01  FB 00094 	    CALLS   #1, FLUSH_FID					      ;

		         50 	0000G  CF  D0 00097 5$:     MOVL    CURRENT_VCB, R0					      ; 0618

	   07 	    0B   A0	       01  E1 0009C 	    BBC     #1, 11(R0), 6$					      ;

				FF63   CF  9F 000A1 	    PUSHAB  P.AAB						      ; 0619

		         68 	       01  FB 000A5 	    CALLS   #1, FLUSH_FID					      ;

		  0000G  CF	       00  FB 000A8 6$:     CALLS   #0, FLUSH_BUFFERS					      ; 0624

		         50 	       01  D0 000AD 	    MOVL    #1, R0						      ; 0626

					   04 000B0 	    RET     							      ; 0496



; Routine Size:  161 bytes







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 3

;

;	0629	GLOBAL ROUTINE ZERO_WINDOWS (FCB) =

;	0630	

;	0631	!++

;	0632	!

;	0633	! FUNCTIONAL DESCRIPTION:

;	0634	!

;	0635	!	This routine invalidates all windows currently in use on the

;	0636	!	indicated FCB. This routine must be executed in kernel mode.

;	0637	!

;	0638	! CALLING SEQUENCE:

;	0639	!	ZERO_WINDOWS (ARG1)

;	0640	!

;	0641	! INPUT PARAMETERS:

;	0642	!	ARG1: address of FCB

;	0643	!

;	0644	! IMPLICIT INPUTS:

;	0645	!	CURRENT_WINDOW: address of caller's window, if any

;	0646	!

;	0647	! OUTPUT PARAMETERS:

;	0648	!	NONE

;	0649	!

;	0650	! IMPLICIT OUTPUTS:

;	0651	!	NONE

;	0652	!

;	0653	! ROUTINE VALUE:

;	0654	!	NONE

;	0655	!

;	0656	! SIDE EFFECTS:

;	0657	!	all windows marked empty, caller's turned

;	0658	!

;	0659	!--

;	0660	

;	0661	BEGIN

;	0662	

;	0663	MAP

;	0664		FCB		: REF BBLOCK;

;	0665	

;	0666	LOCAL

;	0667		P		: REF BBLOCK;	! window pointer

;	0668	

;	0669	

;	0670	! Loop through the window list off the FCB, zeroing all the retrieval pointer

;	0671	! counts. Then turn the user's window to VBN 1 if it exists.

;	0672	!

;	0673	

;	0674	P = .FCB[FCB$L_WLFL];

;	0675	

;	0676	UNTIL .P EQL FCB[FCB$L_WLFL] DO

;	0677	    BEGIN

;	0678	    P[WCB$W_NMAP] = 0;

;	0679	    P = .P[WCB$L_WLFL];

;	0680	    END;

;	0681	

;	0682	! ***** Note: When handling of window misses goes into its final form,

;	0683	! this routine must also scan the I/O queue on the UCB and look for I/O



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 3-1

;

;	0684	! into the blocks just deallocated. All such requests must be yanked out

;	0685	! of the queue and routed to the ACP for error processing.

;	0686	

;	0687	RETURN 1;

;	0688	

;	0689	END;					! end of routine ZERO_WINDOWS











					 0004 000B1 	    .ENTRY  ZERO_WINDOWS, Save R2				      ; 0629

		         51 	  04   AC  D0 000B3 	    MOVL    FCB, R1						      ; 0674

		         50 	  10   A1  D0 000B7 	    MOVL    16(R1), P						      ;

		         52 	  10   A1  9E 000BB 1$:     MOVAB   16(R1), R2						      ; 0676

		         52 	       50  D1 000BF 	    CMPL    P, R2						      ;

				       08  13 000C2 	    BEQL    2$							      ;

				  16   A0  B4 000C4 	    CLRW    22(P)						      ; 0678

		         50 	       60  D0 000C7 	    MOVL    (P), P						      ; 0679

				       EF  11 000CA 	    BRB     1$							      ; 0676

		         50 	       01  D0 000CC 2$:     MOVL    #1, R0						      ; 0687

					   04 000CF 	    RET     							      ; 0629



; Routine Size:  31 bytes







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 4

;

;	0690	GLOBAL ROUTINE ZERO_IDX =

;	0691	

;	0692	!++

;	0693	!

;	0694	! FUNCTIONAL DESCRIPTION:

;	0695	!

;	0696	!	This routine initializes the index in a directory FCB to an unknown

;	0697	!	state. It will be rebuilt with the next several lookups.

;	0698	!	It also bumps the sequence count to indicate a change in contents.

;	0699	!

;	0700	!

;	0701	! CALLING SEQUENCE:

;	0702	!	ZERO_IDX ()

;	0703	!

;	0704	! INPUT PARAMETERS:

;	0705	!	NONE

;	0706	!

;	0707	! IMPLICIT INPUTS:

;	0708	!	DIR_FCB: directory FCB to init

;	0709	!

;	0710	! OUTPUT PARAMETERS:

;	0711	!	NONE

;	0712	!

;	0713	! IMPLICIT OUTPUTS:

;	0714	!	NONE

;	0715	!

;	0716	! ROUTINE VALUE:

;	0717	!	1

;	0718	!

;	0719	! SIDE EFFECTS:

;	0720	!	directory index zeroed

;	0721	!

;	0722	!--

;	0723	

;	0724	BEGIN

;	0725	

;	0726	EXTERNAL

;	0727		DIR_FCB		: REF BBLOCK;	! address of directory FCB

;	0728	

;	0729	

;	0730	DIR_FCB[FCB$W_DIRSEQ] = .DIR_FCB[FCB$W_DIRSEQ] + 1;

;	0731	IF .DIR_FCB[FCB$V_DIR]

;	0732	THEN CH$FILL (-1, FCB$S_DIRIDX, DIR_FCB[FCB$B_DIRIDX]);

;	0733	

;	0734	RETURN 1;

;	0735	

;	0736	END;					! end of routine ZERO_IDX











					 003C 000D0 	    .ENTRY  ZERO_IDX, Save R2,R3,R4,R5				      ; 0690

		         50 	0000G  CF  D0 000D2 	    MOVL    DIR_FCB, R0						      ; 0730

				  44   A0  B6 000D7 	    INCW    68(R0)						      ;



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 4-1

;

		         08 	  1E   A0  E9 000DA 	    BLBC    30(R0), 1$						      ; 0731

      FF   8F	         6E 	       00  2C 000DE 	    MOVC5   #0, (SP), #-1, #16, 72(R0)				      ; 0732

		    48   A0	       10     000E3									      ;

		         50 	       01  D0 000E6 1$:     MOVL    #1, R0						      ; 0734

					   04 000E9 	    RET     							      ; 0690



; Routine Size:  26 bytes







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 5

;

;	0737	GLOBAL ROUTINE ERR_CLEANUP =

;	0738	

;	0739	!++

;	0740	!

;	0741	! FUNCTIONAL DESCRIPTION:

;	0742	!

;	0743	!	This routine performs the cleanup needed after a file

;	0744	!	operation that has terminated in an error.

;	0745	!

;	0746	! CALLING SEQUENCE:

;	0747	!	ERR_CLEANUP ()

;	0748	!

;	0749	! INPUT PARAMETERS:

;	0750	!	NONE

;	0751	!

;	0752	! IMPLICIT INPUTS:

;	0753	!	CLEANUP_FLAGS: indicate specific actions to do

;	0754	!

;	0755	! OUTPUT PARAMETERS:

;	0756	!	NONE

;	0757	!

;	0758	! IMPLICIT OUTPUTS:

;	0759	!	NONE

;	0760	!

;	0761	! ROUTINE VALUE:

;	0762	!	NONE

;	0763	!

;	0764	! SIDE EFFECTS:

;	0765	!	file deaccessed if necessary

;	0766	!	channel window pointer cleared

;	0767	!

;	0768	!--

;	0769	

;	0770	BEGIN

;	0771	

;	0772	EXTERNAL

;	0773		PMS_SUB_NEST,			! depth count on subfunction metering

;	0774		CONTEXT_START,			! start of active context area

;	0775		CONTEXT_SAVE,			! start of context save area

;	0776		CLEANUP_FLAGS	: BITVECTOR,	! cleanup action flags

;	0777		UNREC_COUNT,			! count of unrecorded but allocated blocks

;	0778		UNREC_LBN,			! LBN of above

;	0779		NEW_FID,			! file number of unrecorded file ID

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

;	0781		SUPER_FID	: BBLOCK,	! FID of superseded file

;	0782		SECOND_FIB	: BBLOCK,	! FIB for secondary file operation

;	0783		CURRENT_FIB	: REF BBLOCK,	! pointer to FIB currently in use

;	0784		FILE_HEADER	: REF BBLOCK,	! current file header

;	0785		PRIMARY_FCB	: REF BBLOCK,	! FCB of this file

;	0786		DIR_FCB		: REF BBLOCK,	! FCB of directory file

;	0787		CURRENT_WINDOW	: REF BBLOCK,	! window for this file

;	0788		DIR_VBN,			! VBN of current directory block

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

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

;	0791		DIR_VERSION	: REF BBLOCK,	! address of current directory version



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 5-1

;

;	0792		DIR_END		: REF BBLOCK,	! end of interesting part of directory

;	0793		PREV_VERSION,			! version number of removed entry

;	0794		PREV_NAME	: VECTOR [,BYTE]; ! file name of removed entry

;	0795	

;	0796	EXTERNAL LITERAL

;	0797		CONTEXT_SIZE;			! length of context area

;	0798	

;	0799	EXTERNAL ROUTINE

;	0800		PMS_END_SUB,			! end metering of current subfunction

;	0801		CLOSE_FILE,			! close internal file

;	0802		DEALLOCATE,			! deallocate dynamic memory

;	0803		MAKE_ENTRY,			! create new directory entry

;	0804		REMOVE,				! remove a directory entry

;	0805		READ_BLOCK,			! read a disk block

;	0806		WRITE_BLOCK,			! write a disk block

;	0807		DELETE_FILE,			! delete a file

;	0808		DELETE_FID,			! delete a file number

;	0809		RETURN_BLOCKS,			! return blocks to storage map

;	0810		TRUNCATE,			! file truncate routine

;	0811		INVALIDATE,			! invalidate a buffer

;	0812		READ_HEADER,			! read file header

;	0813		INIT_FCB2,			! initialize FCB

;	0814		UPDATE_FCB,			! update FCB contents

;	0815		NEXT_HEADER,			! read next extension file header

;	0816		MAKE_EXTFCB,			! create extension FCB

;	0817		CHECKSUM;			! checksum file header

;	0818	

;	0819	

;	0820	! If a subfunction was being executed, turn off metering now.

;	0821	!

;	0822	

;	0823	IF .PMS_SUB_NEST NEQ 0

;	0824	THEN

;	0825	    BEGIN

;	0826	    PMS_SUB_NEST = 1;

;	0827	    PMS_END_SUB ();

;	0828	    END;

;	0829	

;	0830	! We repeat the entire procedure twice if a secondary file operation was

;	0831	! in progress (indicated by non-zero saved context).

;	0832	!

;	0833	

;	0834	WHILE 1 DO

;	0835	BEGIN

;	0836	

;	0837	! Locals are declared here to prevent their scope from extending around the

;	0838	! entire main loop and raising havoc with register assignment.

;	0839	!

;	0840	

;	0841	LOCAL

;	0842		NAME_DESC	: BBLOCK [FND_LENGTH], ! file name descriptor block

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

;	0844		FCB		: REF BBLOCK,	! FCB pointer

;	0845		RECADDR		: REF BBLOCK,	! address of directory record

;	0846		T1,				! random temps



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 5-2

;

;	0847		T2,

;	0848		T3;

;	0849	

;	0850	! If an internal file is open, close it first.

;	0851	!

;	0852	

;	0853	IF TESTBITSC (CLEANUP_FLAGS[CLF_CLOSEFILE])

;	0854	THEN CLOSE_FILE (.CURRENT_WINDOW);

;	0855	

;	0856	! Deaccess the file if requested.

;	0857	!

;	0858	

;	0859	IF TESTBITSC (CLEANUP_FLAGS[CLF_DEACCESS])

;	0860	THEN KERNEL_CALL (MAKE_DEACCESS);

;	0861	

;	0862	! Deallocate the window block if called for.

;	0863	!

;	0864	

;	0865	IF TESTBITSC (CLEANUP_FLAGS[CLF_DELWINDOW])

;	0866	THEN

;	0867	    IF .CURRENT_WINDOW NEQ 0

;	0868	    THEN

;	0869		BEGIN

;	0870		KERNEL_CALL (DEALLOCATE, .CURRENT_WINDOW);

;	0871		CURRENT_WINDOW = 0;

;	0872		END;

;	0873	

;	0874	! Clean out the window pointer in the user's channel if necessary.

;	0875	!

;	0876	

;	0877	IF TESTBITSC (CLEANUP_FLAGS[CLF_ZCHANNEL])

;	0878	THEN KERNEL_CALL (ZERO_CHANNEL);

;	0879	

;	0880	! If there is a file header resident, it probably needs to be checksummed,

;	0881	! except in the case of a failed truncate, where we discard the header.

;	0882	! Then read back the primary file header.

;	0883	!

;	0884	

;	0885	IF .FILE_HEADER NEQ 0

;	0886	THEN

;	0887	    BEGIN

;	0888	    IF .CLEANUP_FLAGS[CLF_CLEANTRUNC]

;	0889	    THEN INVALIDATE (.FILE_HEADER)

;	0890	    ELSE CHECKSUM (.FILE_HEADER);

;	0891	    HEADER = READ_HEADER (CURRENT_FIB[FIB$W_FID], .PRIMARY_FCB);

;	0892	    END;

;	0893	

;	0894	! Do directory operation cleanups. We could have entered a new file, removed

;	0895	! an old one, or both (supersede). A supersede is either a replacement of

;	0896	! the FID for the same name, type, and version, or dropping off the oldest

;	0897	! version where a higher one was added due to the version limit. In either

;	0898	! case, DIR_VERSION points to the new version entered and DIR_END points

;	0899	! to the one removed. In the former case, the two are identical.

;	0900	!

;	0901	



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 5-3

;

;	0902	IF TESTBITSC (CLEANUP_FLAGS[CLF_SUPERSEDE])

;	0903	THEN

;	0904	    BEGIN

;	0905	    CH$MOVE (.DIR_END-.DIR_VERSION, .DIR_VERSION+DIR$C_VERSION, .DIR_VERSION);

;	0906	    DIR_END[DIR$W_VERSION] = .PREV_VERSION;

;	0907	    CH$MOVE (FIB$S_FID, SUPER_FID, DIR_END[DIR$W_FID]);

;	0908	    CLEANUP_FLAGS[CLF_REENTER] = 0;

;	0909	    CLEANUP_FLAGS[CLF_REMOVE] = 0;

;	0910	    WRITE_BLOCK (.DIR_BUFFER);

;	0911	    END;

;	0912	

;	0913	! If a directory entry needs to be re-entered, do so. REMOVE has left

;	0914	! the suitable pointers. Construct a name descriptor from the saved name

;	0915	! and version and call the enter routine. If a block was compressed,

;	0916	! then we must read in the next one and reset the pointer.

;	0917	!

;	0918	

;	0919	IF TESTBITSC (CLEANUP_FLAGS[CLF_REENTER])

;	0920	THEN

;	0921	    BEGIN

;	0922	    IF .DIR_ENTRY EQL 0

;	0923	    THEN

;	0924		BEGIN

;	0925		DIR_ENTRY = DIR_BUFFER = READ_BLOCK (.DIR_VBN+.DIR_FCB[FCB$L_STLBN]-1,

;	0926						     1, DIRECTORY_TYPE);

;	0927		END;

;	0928	

;	0929	    CH$FILL (0, FND_LENGTH, NAME_DESC);

;	0930	    NAME_DESC[FND_COUNT] = .PREV_NAME[0];

;	0931	    NAME_DESC[FND_STRING] = PREV_NAME[1];

;	0932	    NAME_DESC[FND_VERSION] = .PREV_VERSION;

;	0933	    MAKE_ENTRY (NAME_DESC, .CURRENT_FIB);

;	0934	    WRITE_BLOCK (.DIR_BUFFER);

;	0935	    CLEANUP_FLAGS[CLF_REMOVE] = 0;

;	0936	    END;

;	0937	

;	0938	! If a directory entry needs to be removed, do so. Pointers are all set

;	0939	! up for the REMOVE routine.

;	0940	!

;	0941	

;	0942	IF TESTBITSC (CLEANUP_FLAGS[CLF_REMOVE])

;	0943	THEN

;	0944	    BEGIN

;	0945	    REMOVE ();

;	0946	    CLEANUP_FLAGS[CLF_REENTER] = 0;

;	0947	    END;

;	0948	

;	0949	! If there are unrecorded blocks allocated from the storage map, return them.

;	0950	!

;	0951	

;	0952	IF .UNREC_COUNT NEQ 0

;	0953	THEN

;	0954	    BEGIN

;	0955	    RETURN_BLOCKS (.UNREC_LBN, .UNREC_COUNT);

;	0956	    UNREC_COUNT = 0;



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 5-4

;

;	0957	    END;

;	0958	

;	0959	! If a file deletion is called for, do it. This is either a create that

;	0960	! failed later on, or a real delete.

;	0961	!

;	0962	

;	0963	IF TESTBITSC (CLEANUP_FLAGS[CLF_DELFILE])

;	0964	THEN

;	0965	    BEGIN

;	0966	    CLEANUP_FLAGS[CLF_TRUNCATE] = 0;	! no truncate necessary after a delete

;	0967	    DELETE_FILE (.CURRENT_FIB, .HEADER);

;	0968	    END;

;	0969	

;	0970	! If an extend operation failed, truncate the file.

;	0971	!

;	0972	

;	0973	IF TESTBITSC (CLEANUP_FLAGS[CLF_TRUNCATE])

;	0974	THEN

;	0975	    BEGIN

;	0976	    T1 = .CURRENT_FIB[FIB$L_EXSZ];	! save the data returned by EXTEND

;	0977	    T2 = .CURRENT_FIB[FIB$L_EXVBN];	! so it won't be smashed by TRUNCATE

;	0978	    T3 = .USER_STATUS[1];

;	0979	    CURRENT_FIB[FIB$L_EXSZ] = 0;

;	0980	    TRUNCATE (.CURRENT_FIB, .HEADER, DEALLOC_BLOCKS);

;	0981	    HEADER = .FILE_HEADER;			! follow buffer shuffling

;	0982	    CURRENT_FIB[FIB$L_EXSZ] = .T1;

;	0983	    CURRENT_FIB[FIB$L_EXVBN] = .T2;

;	0984	    USER_STATUS[1] = .T3;

;	0985	    CLEANUP_FLAGS[CLF_INVWINDOW] = 0;	! windows were never extended, so no need

;	0986	    CLEANUP_FLAGS[CLF_CLEANTRUNC] = 0;

;	0987	    CHECKSUM (.HEADER);

;	0988	    END;

;	0989	

;	0990	! If a truncate has failed, redo the operation to produce a correct file

;	0991	! header, but don't return blocks to the storage map. We assume the header

;	0992	! was nfg and contained bogus retrieval pointers.

;	0993	!

;	0994	

;	0995	IF TESTBITSC (CLEANUP_FLAGS[CLF_CLEANTRUNC])

;	0996	THEN

;	0997	    BEGIN

;	0998	    CURRENT_FIB[FIB$L_EXSZ] = 0;

;	0999	    TRUNCATE (.CURRENT_FIB, .HEADER, 0);

;	1000	    HEADER = .FILE_HEADER;			! follow buffer shuffling

;	1001	    END;

;	1002	

;	1003	! Various errors leave the file control block screwed up. If needed,

;	1004	! rebuild it and its extensions from scratch.

;	1005	!

;	1006	

;	1007	IF TESTBITSC (CLEANUP_FLAGS[CLF_FIXFCB])

;	1008	AND .PRIMARY_FCB NEQ 0

;	1009	THEN

;	1010	    IF .PRIMARY_FCB[FCB$V_DIR]

;	1011	    OR .PRIMARY_FCB[FCB$W_ACNT] NEQ 0



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 5-5

;

;	1012	    THEN

;	1013		BEGIN

;	1014		FCB = .PRIMARY_FCB;

;	1015		KERNEL_CALL (DEL_EXTFCB, .FCB);

;	1016		KERNEL_CALL (INIT_FCB2, .FCB, .HEADER);

;	1017		WHILE 1 DO

;	1018		    BEGIN

;	1019		    HEADER = NEXT_HEADER (.HEADER, .FCB);

;	1020		    IF .HEADER EQL 0 THEN EXITLOOP;

;	1021		    FCB = KERNEL_CALL (MAKE_EXTFCB, .HEADER, .FCB, 1);

;	1022		    END;

;	1023		IF .FCB NEQ .PRIMARY_FCB

;	1024		THEN

;	1025		    BEGIN

;	1026		    HEADER = READ_HEADER (0, .PRIMARY_FCB);

;	1027		    KERNEL_CALL (UPDATE_FCB, .HEADER);

;	1028		    END;

;	1029		END;

;	1030	

;	1031	! If there is a dangling file ID (from a partial create or header extension),

;	1032	! dispose of it.

;	1033	!

;	1034	

;	1035	IF .NEW_FID NEQ 0

;	1036	THEN DELETE_FID (.NEW_FID);

;	1037	

;	1038	! Copy the saved context, if any back into the primary context and repeat

;	1039	! the cleanup.

;	1040	!

;	1041	

;	1042	IF .CONTEXT_SAVE EQL 0 THEN EXITLOOP;

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

;	1044	CONTEXT_SAVE = 0;

;	1045	

;	1046	END;					! end of major loop

;	1047	

;	1048	RETURN 1;

;	1049	

;	1050	END;					! end of routine ERR_CLEANUP







							    .EXTRN  PMS_SUB_NEST, UNREC_COUNT, UNREC_LBN, NEW_FID

							    .EXTRN  USER_STATUS, SUPER_FID, SECOND_FIB, DIR_VBN, DIR_BUFFER

							    .EXTRN  DIR_ENTRY, DIR_VERSION, DIR_END, PREV_VERSION

							    .EXTRN  PREV_NAME, PMS_END_SUB, CLOSE_FILE, MAKE_ENTRY

							    .EXTRN  REMOVE, READ_BLOCK, WRITE_BLOCK, DELETE_FILE, DELETE_FID

							    .EXTRN  RETURN_BLOCKS, TRUNCATE, INVALIDATE, UPDATE_FCB

							    .EXTRN  NEXT_HEADER, MAKE_EXTFCB, CHECKSUM



					 0FFC 000EA 	    .ENTRY  ERR_CLEANUP, Save R2,R3,R4,R5,R6,R7,R8,R9,R10,R11	      ; 0737

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

		         5A 	0000G  CF  9E 000F1 	    MOVAB   CURRENT_FIB, R10					      ;

		         59 00000000G  9F  9E 000F6 	    MOVAB   @#SYS$CMKRNL, R9					      ;

		         58 	0000G  CF  9E 000FD 	    MOVAB   CLEANUP_FLAGS, R8					      ;



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 5-6

;

		         5E 	       10  C2 00102 	    SUBL2   #16, SP						      ;

				0000G  CF  D5 00105 	    TSTL    PMS_SUB_NEST					      ; 0823

				       0A  13 00109 	    BEQL    1$							      ;

		  0000G  CF	       01  D0 0010B 	    MOVL    #1, PMS_SUB_NEST					      ; 0826

		  0000G  CF	       00  FB 00110 	    CALLS   #0, PMS_END_SUB					      ; 0827

	   09 	         68 	       18  E5 00115 1$:     BBCC    #24, CLEANUP_FLAGS, 2$				      ; 0853

				0000G  CF  DD 00119 	    PUSHL   CURRENT_WINDOW					      ; 0854

		  0000G  CF	       01  FB 0011D 	    CALLS   #1, CLOSE_FILE					      ;

	   0B 	         68 	       10  E5 00122 2$:     BBCC    #16, CLEANUP_FLAGS, 3$				      ; 0859

				       7E  D4 00126 	    CLRL    -(SP)						      ; 0860

				       5E  DD 00128 	    PUSHL   SP							      ;

				0000V  CF  9F 0012A 	    PUSHAB  MAKE_DEACCESS					      ;

		         69 	       03  FB 0012E 	    CALLS   #3, SYS$CMKRNL					      ;

	   18 	         68 	       1A  E5 00131 3$:     BBCC    #26, CLEANUP_FLAGS, 4$				      ; 0865

		         50 	0000G  CF  D0 00135 	    MOVL    CURRENT_WINDOW, R0					      ; 0867

				       11  13 0013A 	    BEQL    4$							      ;

				       50  DD 0013C 	    PUSHL   R0							      ; 0870

				       01  DD 0013E 	    PUSHL   #1							      ;

				       5E  DD 00140 	    PUSHL   SP							      ;

				0000G  CF  9F 00142 	    PUSHAB  DEALLOCATE						      ;

		         69 	       04  FB 00146 	    CALLS   #4, SYS$CMKRNL					      ;

				0000G  CF  D4 00149 	    CLRL    CURRENT_WINDOW					      ; 0871

	   0B 	         68 	       11  E5 0014D 4$:     BBCC    #17, CLEANUP_FLAGS, 5$				      ; 0877

				       7E  D4 00151 	    CLRL    -(SP)						      ; 0878

				       5E  DD 00153 	    PUSHL   SP							      ;

				0000V  CF  9F 00155 	    PUSHAB  ZERO_CHANNEL					      ;

		         69 	       03  FB 00159 	    CALLS   #3, SYS$CMKRNL					      ;

		         50 	0000G  CF  D0 0015C 5$:     MOVL    FILE_HEADER, R0					      ; 0885

				       23  13 00161 	    BEQL    8$							      ;

	   09 	    02   A8	       03  E1 00163 	    BBC     #3, CLEANUP_FLAGS+2, 6$				      ; 0888

				       50  DD 00168 	    PUSHL   R0							      ; 0889

		  0000G  CF	       01  FB 0016A 	    CALLS   #1, INVALIDATE					      ;

				       07  11 0016F 	    BRB     7$							      ; 0888

				       50  DD 00171 6$:     PUSHL   R0							      ; 0890

		  0000G  CF	       01  FB 00173 	    CALLS   #1, CHECKSUM					      ;

				       6B  DD 00178 7$:     PUSHL   PRIMARY_FCB						      ; 0891

	   7E 	         6A 	       04  C1 0017A 	    ADDL3   #4, CURRENT_FIB, -(SP)				      ;

		  0000G  CF	       02  FB 0017E 	    CALLS   #2, READ_HEADER					      ;

		         57 	       50  D0 00183 	    MOVL    R0, HEADER						      ;

	   2D 	         68 	       05  E5 00186 8$:     BBCC    #5, CLEANUP_FLAGS, 9$				      ; 0902

		         56 	0000G  CF  D0 0018A 	    MOVL    DIR_END, R6						      ; 0905

		         50 	0000G  CF  D0 0018F 	    MOVL    DIR_VERSION, R0					      ;

	   51 	         56 	       50  C3 00194 	    SUBL3   R0, R6, R1						      ;

	   60 	    08   A0	       51  28 00198 	    MOVC3   R1, 8(R0), (R0)					      ;

		         66 	0000G  CF  B0 0019D 	    MOVW    PREV_VERSION, (R6)					      ; 0906

      02   A6	  0000G  CF	       06  28 001A2 	    MOVC3   #6, SUPER_FID, 2(R6)				      ; 0907

		    02   A8	  C0   8F  8A 001A9 	    BICB2   #192, CLEANUP_FLAGS+2				      ; 0909

				0000G  CF  DD 001AE 	    PUSHL   DIR_BUFFER						      ; 0910

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

	   58 	         68 	       17  E5 001B7 9$:     BBCC    #23, CLEANUP_FLAGS, 11$				      ; 0919

				0000G  CF  D5 001BB 	    TSTL    DIR_ENTRY						      ; 0922

				       22  12 001BF 	    BNEQ    10$							      ;

				       02  DD 001C1 	    PUSHL   #2							      ; 0925

				       01  DD 001C3 	    PUSHL   #1							      ;

		         50 	0000G  CF  D0 001C5 	    MOVL    DIR_FCB, R0						      ;



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 5-7

;

	   50 	  0000G  CF	  2C   A0  C1 001CA 	    ADDL3   44(R0), DIR_VBN, R0					      ;

				  FF   A0  9F 001D1 	    PUSHAB  -1(R0)						      ;

		  0000G  CF	       03  FB 001D4 	    CALLS   #3, READ_BLOCK					      ;

		  0000G  CF	       50  D0 001D9 	    MOVL    R0, DIR_BUFFER					      ;

		  0000G  CF	       50  D0 001DE 	    MOVL    R0, DIR_ENTRY					      ;

	   00 	         6E 	       00  2C 001E3 10$:    MOVC5   #0, (SP), #0, #16, NAME_DESC			      ; 0929

		         6E 	       10     001E7									      ;

		    04   AE	0000G  CF  9A 001E9 	    MOVZBL  PREV_NAME, NAME_DESC+4				      ; 0930

		    08   AE	0000G  CF  9E 001EF 	    MOVAB   PREV_NAME+1, NAME_DESC+8				      ; 0931

		    0C   AE	0000G  CF  B0 001F5 	    MOVW    PREV_VERSION, NAME_DESC+12				      ; 0932

				       6A  DD 001FB 	    PUSHL   CURRENT_FIB						      ; 0933

				  04   AE  9F 001FD 	    PUSHAB  NAME_DESC						      ;

		  0000G  CF	       02  FB 00200 	    CALLS   #2, MAKE_ENTRY					      ;

				0000G  CF  DD 00205 	    PUSHL   DIR_BUFFER						      ; 0934

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

		    02   A8	  40   8F  8A 0020E 	    BICB2   #64, CLEANUP_FLAGS+2				      ; 0935

	   0A 	         68 	       16  E5 00213 11$:    BBCC    #22, CLEANUP_FLAGS, 12$				      ; 0942

		  0000G  CF	       00  FB 00217 	    CALLS   #0, REMOVE						      ; 0945

		    02   A8	  80   8F  8A 0021C 	    BICB2   #128, CLEANUP_FLAGS+2				      ; 0946

		         50 	0000G  CF  D0 00221 12$:    MOVL    UNREC_COUNT, R0					      ; 0952

				       0F  13 00226 	    BEQL    13$							      ;

				       50  DD 00228 	    PUSHL   R0							      ; 0955

				0000G  CF  DD 0022A 	    PUSHL   UNREC_LBN						      ;

		  0000G  CF	       02  FB 0022E 	    CALLS   #2, RETURN_BLOCKS					      ;

				0000G  CF  D4 00233 	    CLRL    UNREC_COUNT						      ; 0956

	   0D 	         68 	       15  E5 00237 13$:    BBCC    #21, CLEANUP_FLAGS, 14$				      ; 0963

		    02   A8	       04  8A 0023B 	    BICB2   #4, CLEANUP_FLAGS+2					      ; 0966

				       57  DD 0023F 	    PUSHL   HEADER						      ; 0967

				       6A  DD 00241 	    PUSHL   CURRENT_FIB						      ;

		  0000G  CF	       02  FB 00243 	    CALLS   #2, DELETE_FILE					      ;

	   39 	         68 	       12  E5 00248 14$:    BBCC    #18, CLEANUP_FLAGS, 15$				      ; 0973

		         50 	       6A  D0 0024C 	    MOVL    CURRENT_FIB, R0					      ; 0976

		         52 	  18   A0  7D 0024F 	    MOVQ    24(R0), T1						      ;

		         54 	0000G  CF  D0 00253 	    MOVL    USER_STATUS+4, T3					      ; 0978

				  18   A0  D4 00258 	    CLRL    24(R0)						      ; 0979

				       01  DD 0025B 	    PUSHL   #1							      ; 0980

				0081   8F  BB 0025D 	    PUSHR   #^M<R0,R7>						      ;

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

		         57 	0000G  CF  D0 00266 	    MOVL    FILE_HEADER, HEADER					      ; 0981

		         50 	       6A  D0 0026B 	    MOVL    CURRENT_FIB, R0					      ; 0982

		    18   A0	       52  7D 0026E 	    MOVQ    T1, 24(R0)						      ;

		  0000G  CF	       54  D0 00272 	    MOVL    T3, USER_STATUS+4					      ; 0984

		         68 00080010   8F  CA 00277 	    BICL2   #524304, CLEANUP_FLAGS				      ; 0986

				       57  DD 0027E 	    PUSHL   HEADER						      ; 0987

		  0000G  CF	       01  FB 00280 	    CALLS   #1, CHECKSUM					      ;

	   16 	         68 	       13  E5 00285 15$:    BBCC    #19, CLEANUP_FLAGS, 16$				      ; 0995

		         50 	       6A  D0 00289 	    MOVL    CURRENT_FIB, R0					      ; 0998

				  18   A0  D4 0028C 	    CLRL    24(R0)						      ;

				       7E  D4 0028F 	    CLRL    -(SP)						      ; 0999

				0081   8F  BB 00291 	    PUSHR   #^M<R0,R7>						      ;

		  0000G  CF	       03  FB 00295 	    CALLS   #3, TRUNCATE					      ;

		         57 	0000G  CF  D0 0029A 	    MOVL    FILE_HEADER, HEADER					      ; 1000

	   71 	         68 	       01  E5 0029F 16$:    BBCC    #1, CLEANUP_FLAGS, 20$				      ; 1007

				       6B  D5 002A3 	    TSTL    PRIMARY_FCB						      ; 1008

				       6D  13 002A5 	    BEQL    20$							      ;



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 5-8

;

		         50 	       6B  D0 002A7 	    MOVL    PRIMARY_FCB, R0					      ; 1010

		         05 	  1E   A0  E8 002AA 	    BLBS    30(R0), 17$						      ;

				  18   A0  B5 002AE 	    TSTW    24(R0)						      ; 1011

				       61  13 002B1 	    BEQL    20$							      ;

		         52 	       50  D0 002B3 17$:    MOVL    R0, FCB						      ; 1014

				       52  DD 002B6 	    PUSHL   FCB							      ; 1015

				       01  DD 002B8 	    PUSHL   #1							      ;

				       5E  DD 002BA 	    PUSHL   SP							      ;

				0000V  CF  9F 002BC 	    PUSHAB  DEL_EXTFCB						      ;

		         69 	       04  FB 002C0 	    CALLS   #4, SYS$CMKRNL					      ;

				0084   8F  BB 002C3 	    PUSHR   #^M<R2,R7>						      ; 1016

				       02  DD 002C7 	    PUSHL   #2							      ;

				       5E  DD 002C9 	    PUSHL   SP							      ;

				0000G  CF  9F 002CB 	    PUSHAB  INIT_FCB2						      ;

		         69 	       05  FB 002CF 	    CALLS   #5, SYS$CMKRNL					      ;

				       52  DD 002D2 18$:    PUSHL   FCB							      ; 1019

				       57  DD 002D4 	    PUSHL   HEADER						      ;

		  0000G  CF	       02  FB 002D6 	    CALLS   #2, NEXT_HEADER					      ;

		         57 	       50  D0 002DB 	    MOVL    R0, HEADER						      ;

				       16  13 002DE 	    BEQL    19$							      ; 1020

				       01  DD 002E0 	    PUSHL   #1							      ; 1021

				       52  DD 002E2 	    PUSHL   FCB							      ;

				       57  DD 002E4 	    PUSHL   HEADER						      ;

				       03  DD 002E6 	    PUSHL   #3							      ;

				       5E  DD 002E8 	    PUSHL   SP							      ;

				0000G  CF  9F 002EA 	    PUSHAB  MAKE_EXTFCB						      ;

		         69 	       06  FB 002EE 	    CALLS   #6, SYS$CMKRNL					      ;

		         52 	       50  D0 002F1 	    MOVL    R0, FCB						      ;

				       DC  11 002F4 	    BRB     18$							      ; 1017

		         6B 	       52  D1 002F6 19$:    CMPL    FCB, PRIMARY_FCB					      ; 1023

				       19  13 002F9 	    BEQL    20$							      ;

				       6B  DD 002FB 	    PUSHL   PRIMARY_FCB						      ; 1026

				       7E  D4 002FD 	    CLRL    -(SP)						      ;

		  0000G  CF	       02  FB 002FF 	    CALLS   #2, READ_HEADER					      ;

		         57 	       50  D0 00304 	    MOVL    R0, HEADER						      ;

				       57  DD 00307 	    PUSHL   HEADER						      ; 1027

				       01  DD 00309 	    PUSHL   #1							      ;

				       5E  DD 0030B 	    PUSHL   SP							      ;

				0000G  CF  9F 0030D 	    PUSHAB  UPDATE_FCB						      ;

		         69 	       04  FB 00311 	    CALLS   #4, SYS$CMKRNL					      ;

		         50 	0000G  CF  D0 00314 20$:    MOVL    NEW_FID, R0						      ; 1035

				       07  13 00319 	    BEQL    21$							      ;

				       50  DD 0031B 	    PUSHL   R0							      ; 1036

		  0000G  CF	       01  FB 0031D 	    CALLS   #1, DELETE_FID					      ;

				0000G  CF  D5 00322 21$:    TSTL    CONTEXT_SAVE					      ; 1042

				       11  13 00326 	    BEQL    22$							      ;

    0000G  CF	  0000G  CF	0000G  8F  28 00328 	    MOVC3   #CONTEXT_SIZE, CONTEXT_SAVE, CONTEXT_START		      ; 1043

				0000G  CF  D4 00332 	    CLRL    CONTEXT_SAVE					      ; 1044

				     FDDC  31 00336 	    BRW     1$							      ; 0834

		         50 	       01  D0 00339 22$:    MOVL    #1, R0						      ; 1048

					   04 0033C 	    RET     							      ; 0737



; Routine Size:  595 bytes







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 5-9

;



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 6

;

;	1051	ROUTINE MAKE_DEACCESS =

;	1052	

;	1053	!++

;	1054	!

;	1055	! FUNCTIONAL DESCRIPTION:

;	1056	!

;	1057	!	This routine performs the machinery for deaccessing a file.

;	1058	!

;	1059	! CALLING SEQUENCE:

;	1060	!	MAKE_DEACCESS ()

;	1061	!

;	1062	! INPUT PARAMETERS:

;	1063	!	NONE

;	1064	!

;	1065	! IMPLICIT INPUTS:

;	1066	!	PRIMARY_FCB: FCB of file

;	1067	!	CURRENT_WINDOW: window of file

;	1068	!	CURRENT_VCB: VCB of volume in process

;	1069	!

;	1070	! OUTPUT PARAMETERS:

;	1071	!	NONE

;	1072	!

;	1073	! IMPLICIT OUTPUTS:

;	1074	!	NONE

;	1075	!

;	1076	! ROUTINE VALUE:

;	1077	!	NONE

;	1078	!

;	1079	! SIDE EFFECTS:

;	1080	!	file deaccessed

;	1081	!

;	1082	!--

;	1083	

;	1084	BEGIN

;	1085	

;	1086	LOCAL

;	1087		DUMMY;				! dummy local to receive REMQUE

;	1088	

;	1089	EXTERNAL

;	1090		PRIMARY_FCB	: REF BBLOCK,	! FCB of file

;	1091		CURRENT_WINDOW	: REF BBLOCK,	! window of file

;	1092		CURRENT_VCB	: REF BBLOCK,	! VCB of volume

;	1093		PMS$GL_OPEN	: ADDRESSING_MODE (ABSOLUTE);

;	1094						! system count of currently open files

;	1095	

;	1096	

;	1097	! Unlink the window from the FCB. Clear the applicable access conditions

;	1098	! in the FCB.

;	1099	!

;	1100	

;	1101	REMQUE (.CURRENT_WINDOW, DUMMY);

;	1102	

;	1103	IF .CURRENT_WINDOW[WCB$V_NOREAD]

;	1104	THEN PRIMARY_FCB[FCB$V_EXCL] = 0;

;	1105	



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 6-1

;

;	1106	IF .CURRENT_WINDOW[WCB$V_NOTRUNC]

;	1107	THEN PRIMARY_FCB[FCB$W_TCNT] = .PRIMARY_FCB[FCB$W_TCNT] - 1;

;	1108	

;	1109	IF .CURRENT_WINDOW[WCB$V_NOWRITE]

;	1110	THEN PRIMARY_FCB[FCB$W_LCNT] = .PRIMARY_FCB[FCB$W_LCNT] - 1;

;	1111	

;	1112	! For a write access, bump down the writer count. If this is the

;	1113	! last write, and the file is the index file or the storage map, clear

;	1114	! the appropriate flag in the VCB.

;	1115	!

;	1116	

;	1117	IF .CURRENT_WINDOW[WCB$V_WRITE]

;	1118	THEN

;	1119	    BEGIN

;	1120	    PRIMARY_FCB[FCB$W_WCNT] = .PRIMARY_FCB[FCB$W_WCNT] - 1;

;	1121	    IF .PRIMARY_FCB[FCB$W_WCNT] EQL 0

;	1122	    THEN

;	1123		BEGIN

;	1124		IF .PRIMARY_FCB[FCB$W_FID_NUM] EQL 1

;	1125		    THEN CURRENT_VCB[VCB$V_WRITE_IF] = 0;

;	1126		IF .PRIMARY_FCB[FCB$W_FID_NUM] EQL 2

;	1127		    THEN CURRENT_VCB[VCB$V_WRITE_SM] = 0;

;	1128		END;

;	1129	    END;

;	1130	

;	1131	PRIMARY_FCB[FCB$W_ACNT] = .PRIMARY_FCB[FCB$W_ACNT] - 1;

;	1132	

;	1133	! If this was the last access, yank the FCB out of the FCB list and dump its

;	1134	! extensions, if any.

;	1135	!

;	1136	

;	1137	IF .PRIMARY_FCB[FCB$W_ACNT] EQL 0

;	1138	THEN

;	1139	    BEGIN

;	1140	    REMQUE (.PRIMARY_FCB, DUMMY);

;	1141	    DEL_EXTFCB (.PRIMARY_FCB);

;	1142	    END;

;	1143	

;	1144	PMS$GL_OPEN = .PMS$GL_OPEN - 1;		! bump down count of open files

;	1145	CURRENT_VCB[VCB$W_TRANS] = .CURRENT_VCB[VCB$W_TRANS] - 1;

;	1146	

;	1147	RETURN 1;

;	1148	

;	1149	END;					! end of routine MAKE_DEACCESS







							    .EXTRN  PMS$GL_OPEN



					 001C 0033D MAKE_DEACCESS:

							    .WORD   Save R2,R3,R4					      ; 1051

		         54 	0000G  CF  9E 0033F 	    MOVAB   CURRENT_VCB, R4					      ;

		         53 	0000G  CF  9E 00344 	    MOVAB   PRIMARY_FCB, R3					      ;

		         52 	0000G  DF  0F 00349 	    REMQUE  @CURRENT_WINDOW, DUMMY				      ; 1101

		         51 	0000G  CF  D0 0034E 	    MOVL    CURRENT_WINDOW, R1					      ; 1103



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 6-2

;

	   07 	    15   A1	       02  E1 00353 	    BBC     #2, 21(R1), 1$					      ;

		         50 	       63  D0 00358 	    MOVL    PRIMARY_FCB, R0					      ; 1104

		    1E   A0	       08  8A 0035B 	    BICB2   #8, 30(R0)						      ;

	   06 	    15   A1	       03  E1 0035F 1$:     BBC     #3, 21(R1), 2$					      ; 1106

		         50 	       63  D0 00364 	    MOVL    PRIMARY_FCB, R0					      ; 1107

				  46   A0  B7 00367 	    DECW    70(R0)						      ;

		         06 	  14   A1  E9 0036A 2$:     BLBC    20(R1), 3$						      ; 1109

		         50 	       63  D0 0036E 	    MOVL    PRIMARY_FCB, R0					      ; 1110

				  1A   A0  B7 00371 	    DECW    26(R0)						      ;

	   22 	    0B   A1	       01  E1 00374 3$:     BBC     #1, 11(R1), 5$					      ; 1117

		         50 	       63  D0 00379 	    MOVL    PRIMARY_FCB, R0					      ; 1120

				  1C   A0  B7 0037C 	    DECW    28(R0)						      ;

				       1A  12 0037F 	    BNEQ    5$							      ; 1121

		         01 	  20   A0  B1 00381 	    CMPW    32(R0), #1						      ; 1124

				       07  12 00385 	    BNEQ    4$							      ;

		         51 	       64  D0 00387 	    MOVL    CURRENT_VCB, R1					      ; 1125

		    0B   A1	       01  8A 0038A 	    BICB2   #1, 11(R1)						      ;

		         02 	  20   A0  B1 0038E 4$:     CMPW    32(R0), #2						      ; 1126

				       07  12 00392 	    BNEQ    5$							      ;

		         50 	       64  D0 00394 	    MOVL    CURRENT_VCB, R0					      ; 1127

		    0B   A0	       02  8A 00397 	    BICB2   #2, 11(R0)						      ;

		         50 	       63  D0 0039B 5$:     MOVL    PRIMARY_FCB, R0					      ; 1131

				  18   A0  B7 0039E 	    DECW    24(R0)						      ;

				       0A  12 003A1 	    BNEQ    6$							      ; 1137

		         52 	       60  0F 003A3 	    REMQUE  (R0), DUMMY						      ; 1140

				       63  DD 003A6 	    PUSHL   PRIMARY_FCB						      ; 1141

		  0000V  CF	       01  FB 003A8 	    CALLS   #1, DEL_EXTFCB					      ;

			    00000000G  9F  D7 003AD 6$:     DECL    @#PMS$GL_OPEN					      ; 1144

		         50 	       64  D0 003B3 	    MOVL    CURRENT_VCB, R0					      ; 1145

				  0C   A0  B7 003B6 	    DECW    12(R0)						      ;

		         50 	       01  D0 003B9 	    MOVL    #1, R0						      ; 1147

					   04 003BC 	    RET     							      ; 1051



; Routine Size:  128 bytes







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 7

;

;	1150	GLOBAL ROUTINE DEL_EXTFCB (START_FCB) =

;	1151	

;	1152	!++

;	1153	!

;	1154	! FUNCTIONAL DESCRIPTION:

;	1155	!

;	1156	!	This routine removes and deallocates all extension FCB's, if any,

;	1157	!	linked to the indicated FCB.

;	1158	!

;	1159	! CALLING SEQUENCE:

;	1160	!	DEL_EXTFCB (ARG1)

;	1161	!

;	1162	! INPUT PARAMETERS:

;	1163	!	ARG1: address of primary FCB or 0

;	1164	!

;	1165	! IMPLICIT INPUTS:

;	1166	!	NONE

;	1167	!

;	1168	! OUTPUT PARAMETERS:

;	1169	!	NONE

;	1170	!

;	1171	! IMPLICIT OUTPUTS:

;	1172	!	NONE

;	1173	!

;	1174	! ROUTINE VALUE:

;	1175	!	NONE

;	1176	!

;	1177	! SIDE EFFECTS:

;	1178	!	FCB's deallocated

;	1179	!

;	1180	!--

;	1181	

;	1182	BEGIN

;	1183	

;	1184	MAP

;	1185		START_FCB	: REF BBLOCK;	! FCB argument

;	1186	

;	1187	LOCAL

;	1188		FCB		: REF BBLOCK,	! running FCB pointer

;	1189		NEXT_FCB	: REF BBLOCK,	! next extension FCB

;	1190		DUMMY;				! dummy local to receive REMQUE

;	1191	

;	1192	EXTERNAL ROUTINE

;	1193		DEALLOCATE;			! deallocate dynamic memory

;	1194	

;	1195	! Checking for null pointers, find the first extension FCB. Follow the extension

;	1196	! list and remove and deallocate the extension FCB's, cleaning out the pointers

;	1197	! on the way.

;	1198	!

;	1199	

;	1200	IF .START_FCB EQL 0 THEN RETURN;

;	1201	FCB = .START_FCB[FCB$L_EXFCB];

;	1202	START_FCB[FCB$L_EXFCB] = 0;

;	1203	UNTIL .FCB EQL 0 DO

;	1204	    BEGIN



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 7-1

;

;	1205	    NEXT_FCB = .FCB[FCB$L_EXFCB];

;	1206	    FCB[FCB$L_EXFCB] = 0;

;	1207	    REMQUE (.FCB, DUMMY);

;	1208	    DEALLOCATE (.FCB);

;	1209	    FCB = .NEXT_FCB;

;	1210	    END;

;	1211	

;	1212	RETURN 1;

;	1213	

;	1214	END;					! end of routine DEL_EXTFCB











					 001C 003BD 	    .ENTRY  DEL_EXTFCB, Save R2,R3,R4				      ; 1150

		         50 	  04   AC  D0 003BF 	    MOVL    START_FCB, R0					      ; 1200

				       25  13 003C3 	    BEQL    3$							      ;

		         52 	  0C   A0  D0 003C5 	    MOVL    12(R0), FCB						      ; 1201

				  0C   A0  D4 003C9 	    CLRL    12(R0)						      ; 1202

				       52  D5 003CC 1$:     TSTL    FCB							      ; 1203

				       16  13 003CE 	    BEQL    2$							      ;

		         53 	  0C   A2  D0 003D0 	    MOVL    12(FCB), NEXT_FCB					      ; 1205

				  0C   A2  D4 003D4 	    CLRL    12(FCB)						      ; 1206

		         54 	       62  0F 003D7 	    REMQUE  (FCB), DUMMY					      ; 1207

				       52  DD 003DA 	    PUSHL   FCB							      ; 1208

		  0000G  CF	       01  FB 003DC 	    CALLS   #1, DEALLOCATE					      ;

		         52 	       53  D0 003E1 	    MOVL    NEXT_FCB, FCB					      ; 1209

				       E6  11 003E4 	    BRB     1$							      ; 1203

		         50 	       01  D0 003E6 2$:     MOVL    #1, R0						      ; 1212

					   04 003E9 	    RET     							      ;

				       50  D4 003EA 3$:     CLRL    R0							      ; 1150

					   04 003EC 	    RET     							      ;



; Routine Size:  48 bytes







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 8

;

;	1215	ROUTINE ZERO_CHANNEL =

;	1216	

;	1217	!++

;	1218	!

;	1219	! FUNCTIONAL DESCRIPTION:

;	1220	!

;	1221	!	This routine zeroes out the window pointer being returned to

;	1222	!	the user for his channel control block. It also credits one to the

;	1223	!	user's open file quota.

;	1224	!	This routine must be executed in kernel mode.

;	1225	!

;	1226	! CALLING SEQUENCE:

;	1227	!	ZERO_CHANNEL ()

;	1228	!

;	1229	! INPUT PARAMETERS:

;	1230	!	NONE

;	1231	!

;	1232	! IMPLICIT INPUTS:

;	1233	!	IO_PACKET: I/O packet of request

;	1234	!

;	1235	! OUTPUT PARAMETERS:

;	1236	!	NONE

;	1237	!

;	1238	! IMPLICIT OUTPUTS:

;	1239	!	NONE

;	1240	!

;	1241	! ROUTINE VALUE:

;	1242	!	NONE

;	1243	!

;	1244	! SIDE EFFECTS:

;	1245	!	channel window pointer cleared, file quota bumped

;	1246	!

;	1247	!--

;	1248	

;	1249	BEGIN

;	1250	

;	1251	LOCAL

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

;	1253						! buffer descriptors

;	1254		PCB		: REF BBLOCK;	! address of user process control block

;	1255	

;	1256	EXTERNAL

;	1257		IO_PACKET	: REF BBLOCK,	! I/O packet in process

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

;	1259						! system PCB vector

;	1260	

;	1261	

;	1262						! pointer to buffer descriptors

;	1263	ABD = .BBLOCK [.IO_PACKET[IRP$L_SVAPTE], AIB$L_DESCRIPT];

;	1264	ABD[ABD$C_WINDOW, ABD$W_COUNT] = 4;

;	1265	.ABD[ABD$C_WINDOW, ABD$W_TEXT] + ABD[ABD$C_WINDOW, ABD$W_TEXT] + 1 = 0;

;	1266	

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

;	1268	PCB[PCB$W_FILCNT] = .PCB[PCB$W_FILCNT] + 1;

;	1269	



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:08:31	DBB3:[F11B.SRC]CLENUP.B32;10					Page 8-1

;

;	1270	RETURN 1;

;	1271	

;	1272	END;					! end of routine ZERO_CHANNEL







							    .EXTRN  SCH$GL_PCBVEC



					 0004 003ED ZERO_CHANNEL:

							    .WORD   Save R2						      ; 1215

		         52 	0000G  CF  D0 003EF 	    MOVL    IO_PACKET, R2					      ; 1263

		         51 	  2C   B2  D0 003F4 	    MOVL    @44(R2), ABD					      ;

		    02   A1	       04  B0 003F8 	    MOVW    #4, 2(ABD)						      ; 1264

		         50 	       61  3C 003FC 	    MOVZWL  (ABD), R0						      ; 1265

				  01 A140  9F 003FF 	    PUSHAB  1(ABD)[R0]						      ;

				       9E  D4 00403 	    CLRL    @(SP)+						      ;

		         51 00000000G  9F  D0 00405 	    MOVL    @#SCH$GL_PCBVEC, R1					      ; 1267

		         50 	  0C   A2  3C 0040C 	    MOVZWL  12(R2), R0						      ;

		         50 	     6140  D0 00410 	    MOVL    (R1)[R0], PCB					      ;

				  48   A0  B6 00414 	    INCW    72(PCB)						      ; 1268

		         50 	       01  D0 00417 	    MOVL    #1, R0						      ; 1270

					   04 0041A 	    RET     							      ; 1215



; Routine Size:  46 bytes





;	1273	

;	1274	END

;	1275	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $CODE$         	  1051  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        45         0       253













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

;

; Size:		1035 code + 16 data bytes

; Run Time:	00:22.4

; Elapsed Time:	00:46.4

; Memory Used:	391 pages

; Compilation Complete

