

; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:36	DBB3:[MTAACP.SRC]CLOSFL.B32;5					Page 1

; Digital Equipment Corporation

;

;	0001	MODULE CLOSFL (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'A0002'

;	0004			) =

;	0005	BEGIN

;	0006	

;	0007	!

;	0008	! COPYRIGHT (C) 1977

;	0009	! DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS 01754

;	0010	!

;	0011	! THIS SOFTWARE IS FURNISHED  UNDER A LICENSE FOR USE ONLY ON A SINGLE

;	0012	! COMPUTER  SYSTEM AND  MAY BE  COPIED ONLY WITH  THE INCLUSION OF THE

;	0013	! ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE, OR ANY OTHER COPIES THEREOF,

;	0014	! MAY NOT BE PROVIDED OR  OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON

;	0015	! EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE

;	0016	! TERMS.  TITLE TO AND  OWNERSHIP OF THE  SOFTWARE  SHALL AT ALL TIMES

;	0017	! REMAIN IN DEC.

;	0018	!

;	0019	! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE

;	0020	! AND SHOULD  NOT BE CONSTRUED  AS A COMMITMENT  BY DIGITAL  EQUIPMENT

;	0021	! CORPORATION.

;	0022	!

;	0023	! DEC ASSUMES  NO  RESPONSIBILITY  FOR  THE USE OR  RELIABILITY OF ITS

;	0024	! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

;	0025	

;	0026	!++

;	0027	!

;	0028	! FACILITY:  MTAACP

;	0029	!

;	0030	! ABSTRACT:

;	0031	!	CLOSE OUT CURRENT FILE

;	0032	!

;	0033	! ENVIRONMENT:

;	0034	!

;	0035	!	STARLET OPERATING SYSTEM, INCLUDING PRIVILEGED SYSTEM SERVICES

;	0036	!	AND INTERNAL EXEC ROUTINES.

;	0037	!

;	0038	!--

;	0039	!

;	0040	!

;	0041	! AUTHOR:  D. H. GILLESPIE,	 CREATION DATE:	19-MAY-77 12:00  

;	0042	!

;	0043	! REVISION HISTORY:

;	0044	!

;	0045	!   D. H. Gillespie, 16-Jan-1978  17:31

;	0046	!   X0002 - CHANGE TM CHECK LOGIC

;	0047	!

;	0048	!   D. H. Gillespie, 12-May-78  9:03

;	0049	!   A0001 - change CURRENT_VCB to a register

;	0050	!

;	0051	!   D. H. Gillespie, 22-May-78  16:33

;	0052	!   A0002 - add NOTUSED

;	0053	!

;	0054	!**

;	0055	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:36	DBB3:[MTAACP.SRC]CLOSFL.B32;5					Page 1-1

; Digital Equipment Corporation

;

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

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

;	0353	

;	0354	FORWARD ROUTINE

;	0355		CLOSE_FILE	: L$CLOSE_FILE NOVALUE,	!CLOSE A FILE

;	0356		UPDVCB_STATUS	: COMMON_CALL NOVALUE,	!UPDATE VCB STATUS BITS

;	0357		WRITE_TRAILERS	: L$WRITE_TRAILER NOVALUE;!WRITE TRAILER LABEL SET

;	0358	

;	0359	EXTERNAL

;	0360		CURRENT_UCB	: REF BBLOCK,	!ADDRESS OF CURRENT UNIT CONTROL BLOCK

;	0361		HDR1		: REF BBLOCK,	!ADDRESS OF HDR1(EOF1) LABEL

;	0362		HDR2		: REF BBLOCK;	!ADDRESS OF HDR2(EOF2) LABEL

;	0363	

;	0364	EXTERNAL ROUTINE

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

;	0366		WRITE_TM	: L$WRITE_TM,	!WRITE ONE TM

;	0367		WRITE_BLOCK;			!WRITE BLOCK

;	0368	

;	0369	EXTERNAL LITERAL

;	0370		UCB$L_MT_RECORD;		!NOW A GLOBAL DISPLACEMENT, NOT A STRUCTURE DEFINITION



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:36	DBB3:[MTAACP.SRC]CLOSFL.B32;5					Page 2

; Digital Equipment Corporation

;

;	0371	GLOBAL ROUTINE CLOSE_FILE : L$CLOSE_FILE NOVALUE =

;	0372	

;	0373	!++

;	0374	!

;	0375	! FUNCTIONAL DESCRIPTION:

;	0376	!	THIS ROUTINE CLOSES OUT CURRENT FILE

;	0377	!

;	0378	! CALLING SEQUENCE:

;	0379	!	CLOSE_FILE()

;	0380	!

;	0381	! INPUT PARAMETERS:

;	0382	!	NONE

;	0383	!

;	0384	! IMPLICIT INPUTS:

;	0385	!	CURRENT_UCB	- ADDRESS OF CURRENT UCB

;	0386	!	CURRENT_VCB	- ADDRESS OF CURRENT VCB

;	0387	!

;	0388	! OUTPUT PARAMETERS:

;	0389	!	NONE

;	0390	!

;	0391	! IMPLICIT OUTPUTS:

;	0392	!	NONE

;	0393	!

;	0394	! ROUTINE VALUE:

;	0395	!	NONE

;	0396	!

;	0397	! SIDE EFFECTS:

;	0398	!	FILE CLOSED ON MAGNETIC TAPE, LOGICAL END_OF_TAPE SET

;	0399	!	PARTIAL FILE CLEARED

;	0400	!

;	0401	!--

;	0402	

;	0403	BEGIN

;	0404	

;	0405	EXTERNAL REGISTER

;	0406		COMMON_REG;

;	0407	

;	0408	

;	0409	

;	0410	

;	0411	! IF ONLY THE HEADERS HAVE BEEN WRITTEN WITHOUT THE TM BEFORE THE DATA

;	0412	! THEN WRITE THIS TM FIRST

;	0413	IF .CURRENT_VCB[VCB$B_TM] EQL 0

;	0414	THEN WRITE_TM();

;	0415	

;	0416	IF .CURRENT_VCB[VCB$B_TM] EQL 1 THEN WRITE_TRAILERS('F');

;	0417	WRITE_TM();

;	0418	WRITE_TM();

;	0419	KERNEL_CALL(UPDVCB_STATUS);

;	0420	END;





							    .TITLE  CLOSFL

							    .IDENT  \A0002\





; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:36	DBB3:[MTAACP.SRC]CLOSFL.B32;5					Page 2-1

; Digital Equipment Corporation

;

							    .GLOBL  CURRENT_UCB, HDR1, HDR2, SYS$FAO, WRITE_TM, WRITE_BLOCK

							    .GLOBL  UCB$L_MT_RECORD, SYS$CMKRNL



							    .PSECT  $CODE$,NOWRT,2



				  2E   AB  95 00000 CLOSE_FILE::

							    TSTB    46(CURRENT_VCB)					      ; 0413

				       03  12 00003 	    BNEQ    1$							      ;

				     0000  30 00005 	    BSBW    WRITE_TM						      ; 0414

		         01	  2E   AB  91 00008 1$:     CMPB    46(CURRENT_VCB), #1					      ; 0416

				       0A  12 0000C 	    BNEQ    2$							      ;

		         7E	  46   8F  9A 0000E 	    MOVZBL  #70, -(SP)						      ;

				     0000  30 00012 	    BSBW    WRITE_TRAILERS					      ;

		         5E	       04  C0 00015 	    ADDL2   #4, SP						      ;

				     0000  30 00018 2$:     BSBW    WRITE_TM						      ; 0417

				     0000  30 0001B 	    BSBW    WRITE_TM						      ; 0418

				       7E  D4 0001E 	    CLRL    -(SP)						      ; 0419

				       5E  DD 00020 	    PUSHL   SP							      ;

				0000V  CF  9F 00022 	    PUSHAB  UPDVCB_STATUS					      ;

	      00000000G  9F	       03  FB 00026 	    CALLS   #3, @#SYS$CMKRNL					      ;

					   05 0002D 	    RSB     							      ; 0371



; Routine Size:  46 bytes







; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:36	DBB3:[MTAACP.SRC]CLOSFL.B32;5					Page 3

; Digital Equipment Corporation

;

;	0421	GLOBAL ROUTINE WRITE_TRAILERS(END_FLAG) : L$WRITE_TRAILER NOVALUE  =

;	0422	

;	0423	!++

;	0424	!

;	0425	! FUNCTIONAL DESCRIPTION:

;	0426	!	THIS ROUTINE WRITES OUT EOF(V)1 AND EOF(V)2 SYSTEM LABELS

;	0427	!

;	0428	! CALLING SEQUENCE:

;	0429	!	WRITE_TRAILER(ARG1)

;	0430	!

;	0431	! INPUT PARAMETERS:

;	0432	!	ARG1 - 'V' FOR END OF VOLUME

;	0433	!	       'F' FOR END OF FILE

;	0434	!

;	0435	! IMPLICIT INPUTS:

;	0436	!	NONE

;	0437	!

;	0438	! OUTPUT PARAMETERS:

;	0439	!	NONE

;	0440	!

;	0441	! IMPLICIT OUTPUTS:

;	0442	!	SYSTEM TRAILER LABEL WRITTEN TO TAPE

;	0443	!

;	0444	! ROUTINE VALUE:

;	0445	!	NONE

;	0446	!

;	0447	! SIDE EFFECTS:

;	0448	!	NONE

;	0449	!

;	0450	!--

;	0451	

;	0452	BEGIN

;	0453	

;	0454	EXTERNAL REGISTER

;	0455		COMMON_REG;

;	0456	

;	0457	

;	0458	

;	0459	LOCAL

;	0460		BLCNT_DESC	: VECTOR [2];

;	0461	

;	0462	! CALCULATE BLOCK COUNT BY SUBTRACTING THE BLOCK COUNT AFTER THE TAPE MARK

;	0463	! AT THE START OF THE DATA AREA FROM THE CURRENT BLOCK COUNT

;	0464	BLCNT_DESC[0] = EO1$S_BLOCKCNT;

;	0465	BLCNT_DESC[1] = HDR1[EO1$T_BLOCKCNT];

;	0466	SYS$FAO(DESCRIPTOR('!6ZL'),,BLCNT_DESC,

;	0467	    .(.CURRENT_UCB + UCB$L_MT_RECORD)<0,32> - .CURRENT_VCB[VCB$L_ST_RECORD]);

;	0468	

;	0469	! FORMAT EOF1 TRAILER

;	0470	HDR1[EO1$L_EO1LID] = 'EOF1';

;	0471	(.HDR1)<16,8> = .END_FLAG<0,8>;		!EITHER F OR V

;	0472	

;	0473	! WRITE TM PLUS EOF1

;	0474	WRITE_TM();

;	0475	WRITE_BLOCK(.HDR1,80);



; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:36	DBB3:[MTAACP.SRC]CLOSFL.B32;5					Page 3-1

; Digital Equipment Corporation

;

;	0476	

;	0477	! FORMAT AND WRITE EOF2

;	0478	HDR2[EO2$L_EO2LID] = 'EOF2';

;	0479	(.HDR2)<16,8> = .END_FLAG<0,8>;

;	0480	WRITE_BLOCK(.HDR2, 80);

;	0481	

;	0482	END;					!END OF ROUTINE







					      0002E	    .BLKB   2

					      00030 P.AAB:  .ASCII  \!6ZL\						      ;

					      00034 P.AAA:  .LONG   4							      ;

					      00038 	    .ADDRESS  P.AAB						      ;







		         5E	       04  C2 0003C WRITE_TRAILERS::

							    SUBL2   #4, SP						      ; 0421

				       06  DD 0003F 	    PUSHL   #6							      ; 0464

      04   AE	  0000G  CF	       36  C1 00041 	    ADDL3   #54, HDR1, BLCNT_DESC+4				      ; 0465

	   50	  0000G  CF 00000000G  8F  C1 00048 	    ADDL3   #UCB$L_MT_RECORD, CURRENT_UCB, R0			      ; 0467

	   7E	         60	  30   AB  C3 00052 	    SUBL3   48(CURRENT_VCB), (R0), -(SP)			      ;

				  04   AE  9F 00057 	    PUSHAB  BLCNT_DESC						      ; 0466

				       7E  D4 0005A 	    CLRL    -(SP)						      ;

				  D5   AF  9F 0005C 	    PUSHAB  P.AAA						      ;

	      00000000G  9F	       04  FB 0005F 	    CALLS   #4, @#SYS$FAO					      ;

		  0000G  DF 31464F45   8F  D0 00066 	    MOVL    #826691397, @HDR1					      ; 0470

	   08	         10	  0C   AE  F0 0006F 	    INSV    END_FLAG, #16, #8, @HDR1				      ; 0471

				0000G  DF     00074									      ;

				     0000  30 00077 	    BSBW    WRITE_TM						      ; 0474

		         7E	  50   8F  9A 0007A 	    MOVZBL  #80, -(SP)						      ; 0475

				0000G  CF  DD 0007E 	    PUSHL   HDR1						      ;

		  0000G  CF	       02  FB 00082 	    CALLS   #2, WRITE_BLOCK					      ;

		         50	0000G  CF  D0 00087 	    MOVL    HDR2, R0						      ; 0478

		         60 32464F45   8F  D0 0008C 	    MOVL    #843468613, (R0)					      ;

		    02   A0	  0C   AE  90 00093 	    MOVB    END_FLAG, 2(R0)					      ; 0479

		         7E	  50   8F  9A 00098 	    MOVZBL  #80, -(SP)						      ; 0480

				       50  DD 0009C 	    PUSHL   R0							      ;

		  0000G  CF	       02  FB 0009E 	    CALLS   #2, WRITE_BLOCK					      ;

		         5E	       08  C0 000A3 	    ADDL2   #8, SP						      ; 0421

					   05 000A6 	    RSB     							      ;



; Routine Size:  107 bytes







; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:36	DBB3:[MTAACP.SRC]CLOSFL.B32;5					Page 4

; Digital Equipment Corporation

;

;	0483	ROUTINE UPDVCB_STATUS : COMMON_CALL NOVALUE  =

;	0484	

;	0485	!++

;	0486	!

;	0487	! FUNCTIONAL DESCRIPTION:

;	0488	!	THIS ROUTINE UPDATES THE STATUS BITS IN THE CURRENT VCB

;	0489	!

;	0490	! CALLING SEQUENCE:

;	0491	!	UPDVCB_STATUS(), CALLED IN KERNEL MODE

;	0492	!

;	0493	! INPUT PARAMETERS:

;	0494	!	NONE

;	0495	!

;	0496	! IMPLICIT INPUTS:

;	0497	!	CURRENT_VCB - ADDRESS OF CURRENT VOLUME CONTROL BLOCK

;	0498	!

;	0499	! OUTPUT PARAMETERS:

;	0500	!	NONE

;	0501	!

;	0502	! IMPLICIT OUTPUTS:

;	0503	!	STATUS SET TO AT LOGICAL END OF TAPE WITH NO PARTIAL FILE

;	0504	!

;	0505	! ROUTINE VALUE:

;	0506	!	NONE

;	0507	!

;	0508	! SIDE EFFECTS:

;	0509	!	NONE

;	0510	!

;	0511	!--

;	0512	

;	0513	BEGIN

;	0514	

;	0515	EXTERNAL REGISTER

;	0516		COMMON_REG;

;	0517	

;	0518	

;	0519	

;	0520	CURRENT_VCB[VCB$V_LOGICEOVS] = 1;

;	0521	CURRENT_VCB[VCB$V_MUSTCLOSE] = 0;

;	0522	CURRENT_VCB[VCB$V_PARTFILE] = 0;

;	0523	END;				!END OF ROUTINE











					 0000 000A7 UPDVCB_STATUS:

							    .WORD   Save nothing					      ; 0483

		    0B   AB	       02  88 000A9 	    BISB2   #2, 11(CURRENT_VCB)					      ; 0520

		    0B   AB	  41   8F  8A 000AD 	    BICB2   #65, 11(CURRENT_VCB)				      ; 0522

					   04 000B2 	    RET     							      ; 0483



; Routine Size:  12 bytes







; Bliss-32 7.352	Saturday 21-AUG-1978 23:28:36	DBB3:[MTAACP.SRC]CLOSFL.B32;5					Page 4-1

; Digital Equipment Corporation

;

;	0524	

;	0525	END

;	0526	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $CODE$         	   179  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        15         0       229











;	0527	

; Size:		165 code + 14 data bytes

; Run Time:	00:06.8

; Elapsed Time:	00:17.5

; Memory Used:	263 pages

; Compilation Complete

