

; Bliss-32 10.1-416	Monday 21-AUG-1978 22:56:41	DBB3:[F11A.SRC]EXTFCB.B32;7					Page 1

;

;	0001	MODULE EXTFCB (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'A0003'

;	0004			) =

;	0005	BEGIN

;	0006	

;	0007	!

;	0008	! Copyright (c) 1977

;	0009	! Digital Equipment Corporation, Maynard, Massachusetts 01754

;	0010	!

;	0011	! This software is furnished  under a license for use only on a single

;	0012	! computer  system and  may be  copied only with  the inclusion of the

;	0013	! above copyright notice.  This software, or any other copies thereof,

;	0014	! may not be provided or  otherwise made available to any other person

;	0015	! except for use on such system and to one who agrees to these license

;	0016	! terms.  Title to and  ownership of the  software  shall at all times

;	0017	! remain in DEC.

;	0018	!

;	0019	! The information in this software is subject to change without notice

;	0020	! and should  not be construed  as a commitment  by Digital  Equipment

;	0021	! Corporation.

;	0022	!

;	0023	! DEC assumes  no  responsibility  for  the use or  reliability of its

;	0024	! software on equipment which is not supplied by DEC.

;	0025	

;	0026	!++

;	0027	!

;	0028	! FACILITY:  F11ACP Structure Level 1

;	0029	!

;	0030	! ABSTRACT:

;	0031	!

;	0032	!	This routine updates an FCB for one extension header of the file.

;	0033	!	If the file is accessed, it creates an extension FCB. Regardless,

;	0034	!	it updates the file size in the primary FCB.

;	0035	!

;	0036	! ENVIRONMENT:

;	0037	!

;	0038	!	STARLET operating system, including privileged system services

;	0039	!	and internal exec routines. This routine must be called in

;	0040	!	kernel mode.

;	0041	!

;	0042	!--

;	0043	!

;	0044	!

;	0045	! AUTHOR:  Andrew C. Goldstein,	 CREATION DATE:  25-Jul-1977  10:55

;	0046	!

;	0047	! REVISION HISTORY:

;	0048	!

;	0049	!   Andrew C. Goldstein, 6-Jan-1978  22:18

;	0050	!   X0002 - Unconditionally create extension FCB for accessed file

;	0051	!

;	0052	!   Andrew C. Goldstein, 1-Feb-1978  18:52

;	0053	!   X0003 - Use extend size in FIB for new FCB start VBN

;	0054	!

;	0055	!**



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:56:41	DBB3:[F11A.SRC]EXTFCB.B32;7					Page 1-1

;

;	0056	

;	0057	

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

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



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:56:41	DBB3:[F11A.SRC]EXTFCB.B32;7					Page 2

;

;	0378	GLOBAL ROUTINE MAKE_EXTFCB (HEADER, FCB, MODE) =

;	0379	

;	0380	!++

;	0381	!

;	0382	! FUNCTIONAL DESCRIPTION:

;	0383	!

;	0384	!	This routine updates an FCB for one extension header of the file.

;	0385	!	If the file is accessed, it creates an extension FCB. Regardless,

;	0386	!	it updates the file size in the primary FCB.

;	0387	!

;	0388	!

;	0389	! CALLING SEQUENCE:

;	0390	!	MAKE_EXTFCB (ARG1, ARG2, ARG3)

;	0391	!

;	0392	! INPUT PARAMETERS:

;	0393	!	ARG1: address of extension file header

;	0394	!	ARG2: address of last file FCB or 0

;	0395	!	ARG3: 0 if just building primary FCB for read attributes

;	0396	!	      1 if file is being accessed (to create new FCB)

;	0397	!	      2 if file is being extended (creating new header)

;	0398	!

;	0399	! IMPLICIT INPUTS:

;	0400	!	PRIMARY_FCB: address of primary FCB of file

;	0401	!	CURRENT_WINDOW: address of file window or 0

;	0402	!	UNREC_COUNT: count of allocated but unrecorded blocks

;	0403	!

;	0404	! OUTPUT PARAMETERS:

;	0405	!	NONE

;	0406	!

;	0407	! IMPLICIT OUTPUTS:

;	0408	!	NONE

;	0409	!

;	0410	! ROUTINE VALUE:

;	0411	!	address of new FCB created or 0

;	0412	!

;	0413	! SIDE EFFECTS:

;	0414	!	new FCB created, primary FCB modified, window modified

;	0415	!

;	0416	!--

;	0417	

;	0418	BEGIN

;	0419	

;	0420	MAP

;	0421		HEADER		: REF BBLOCK,	! file header arg

;	0422		FCB		: REF BBLOCK;	! FCB arg

;	0423	

;	0424	LOCAL

;	0425		DUMMY_FCB	: BBLOCK [FCB$C_LENGTH], ! dummy FCB to compute file size

;	0426		NEW_FCB		: REF BBLOCK;	! address of new FCB created

;	0427	

;	0428	EXTERNAL

;	0429		PRIMARY_FCB	: REF BBLOCK,	! address of primary FCB of file

;	0430		CURRENT_WINDOW	: REF BBLOCK,	! address of file window if any

;	0431		CURRENT_FIB	: REF BBLOCK,	! FIB of operation

;	0432		UNREC_COUNT;			! count of allocated but unrecorded blocks



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:56:41	DBB3:[F11A.SRC]EXTFCB.B32;7					Page 2-1

;

;	0433	

;	0434	EXTERNAL ROUTINE

;	0435		CREATE_FCB,			! create a new FCB

;	0436		INIT_FCB,			! initialize existing FCB

;	0437		TURN_WINDOW;			! update the window

;	0438	

;	0439	

;	0440	! If the file is not accessed, this is for a read attributes which just needs

;	0441	! a primary FCB. All we do is compute the file size of the header and add

;	0442	! it into the primary FCB.

;	0443	!

;	0444	

;	0445	IF .MODE EQL 0

;	0446	THEN

;	0447	    BEGIN

;	0448	    INIT_FCB (DUMMY_FCB, .HEADER);	! get file size in dummy FCB

;	0449	    PRIMARY_FCB[FCB$L_FILESIZE] = .PRIMARY_FCB[FCB$L_FILESIZE] + .DUMMY_FCB[FCB$L_FILESIZE];

;	0450	    RETURN 0;

;	0451	    END

;	0452	

;	0453	! If the file is accessed, we create a new FCB if there isn't one already

;	0454	! and link it in. On an access we attempt a window turn to VBN 1 in case

;	0455	! this is a large contiguous file. On an extend we must compute the new FCB

;	0456	! starting VBN from the extend data lying around, since the primary FCB isn't

;	0457	! updated until the very end.

;	0458	!

;	0459	

;	0460	ELSE

;	0461	    BEGIN

;	0462	    NEW_FCB = CREATE_FCB (.HEADER);

;	0463	    FCB[FCB$L_EXFCB] = .NEW_FCB;

;	0464	    INSQUE (.NEW_FCB, FCB[FCB$L_FCBFL]);

;	0465	    IF .MODE

;	0466	    THEN

;	0467		BEGIN

;	0468		NEW_FCB[FCB$L_STVBN] = .NEW_FCB[FCB$L_STVBN] + .PRIMARY_FCB[FCB$L_FILESIZE];

;	0469		PRIMARY_FCB[FCB$L_FILESIZE] = .PRIMARY_FCB[FCB$L_FILESIZE] + .NEW_FCB[FCB$L_FILESIZE];

;	0470		TURN_WINDOW (.CURRENT_WINDOW, .HEADER, 1, .NEW_FCB[FCB$L_STVBN]);

;	0471		END

;	0472	    ELSE

;	0473		NEW_FCB[FCB$L_STVBN] = .NEW_FCB[FCB$L_STVBN] + .PRIMARY_FCB[FCB$L_FILESIZE]

;	0474				     + .CURRENT_FIB[FIB$L_EXSZ] - .UNREC_COUNT;

;	0475	

;	0476	    RETURN .NEW_FCB;

;	0477	    END;

;	0478	

;	0479	END;					! end of routine MAKE_EXTFCB





							    .TITLE  EXTFCB

							    .IDENT  \A0003\



							    .EXTRN  PRIMARY_FCB, CURRENT_WINDOW, CURRENT_FIB, UNREC_COUNT

							    .EXTRN  CREATE_FCB, INIT_FCB, TURN_WINDOW





; Bliss-32 10.1-416	Monday 21-AUG-1978 22:56:41	DBB3:[F11A.SRC]EXTFCB.B32;7					Page 2-2

;

							    .PSECT  $CODE$,NOWRT,2



					 000C 00000 	    .ENTRY  MAKE_EXTFCB, Save R2,R3				      ; 0378

		         5E 	  B8   AE  9E 00002 	    MOVAB   -72(SP), SP						      ;

				  0C   AC  D5 00006 	    TSTL    MODE						      ; 0445

				       17  12 00009 	    BNEQ    1$							      ;

				  04   AC  DD 0000B 	    PUSHL   HEADER						      ; 0448

				  04   AE  9F 0000E 	    PUSHAB  DUMMY_FCB						      ;

		  0000G  CF	       02  FB 00011 	    CALLS   #2, INIT_FCB					      ;

		         50 	0000G  CF  D0 00016 	    MOVL    PRIMARY_FCB, R0					      ; 0449

		    34   A0	  34   AE  C0 0001B 	    ADDL2   DUMMY_FCB+52, 52(R0)				      ;

				       54  11 00020 	    BRB     4$							      ; 0450

				  04   AC  DD 00022 1$:     PUSHL   HEADER						      ; 0462

		  0000G  CF	       01  FB 00025 	    CALLS   #1, CREATE_FCB					      ;

		         52 	       50  D0 0002A 	    MOVL    R0, NEW_FCB						      ;

		         50 	  08   AC  D0 0002D 	    MOVL    FCB, R0						      ; 0463

		    0C   A0	       52  D0 00031 	    MOVL    NEW_FCB, 12(R0)					      ;

		         60 	       62  0E 00035 	    INSQUE  (NEW_FCB), (R0)					      ; 0464

	   50 	  0000G  CF	       34  C1 00038 	    ADDL3   #52, PRIMARY_FCB, R0				      ; 0468

		         51 	  28   A2  9E 0003E 	    MOVAB   40(NEW_FCB), R1					      ;

		         19 	  0C   AC  E9 00042 	    BLBC    MODE, 2$						      ; 0465

		         61 	       60  C0 00046 	    ADDL2   (R0), (R1)						      ; 0468

		         60 	  34   A2  C0 00049 	    ADDL2   52(NEW_FCB), (R0)					      ; 0469

				       61  DD 0004D 	    PUSHL   (R1)						      ; 0470

				       01  DD 0004F 	    PUSHL   #1							      ;

				  04   AC  DD 00051 	    PUSHL   HEADER						      ;

				0000G  CF  DD 00054 	    PUSHL   CURRENT_WINDOW					      ;

		  0000G  CF	       04  FB 00058 	    CALLS   #4, TURN_WINDOW					      ;

				       13  11 0005D 	    BRB     3$							      ; 0465

	   53 	         61 	       60  C1 0005F 2$:     ADDL3   (R0), (R1), R3					      ; 0473

		         50 	0000G  CF  D0 00063 	    MOVL    CURRENT_FIB, R0					      ; 0474

		         53 	  18   A0  C0 00068 	    ADDL2   24(R0), R3						      ;

	   61 	         53 	0000G  CF  C3 0006C 	    SUBL3   UNREC_COUNT, R3, (R1)				      ;

		         50 	       52  D0 00072 3$:     MOVL    NEW_FCB, R0						      ; 0476

					   04 00075 	    RET     							      ;

				       50  D4 00076 4$:     CLRL    R0							      ; 0378

					   04 00078 	    RET     							      ;



; Routine Size:  121 bytes





;	0480	

;	0481	END

;	0482	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $CODE$         	   121  NOWRT,  RD ,  EXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:56:41	DBB3:[F11A.SRC]EXTFCB.B32;7					Page 2-3

;









;				LIBRARY STATISTICS

;

;					     -------- Symbols --------    Blocks

;	File				     Total    Loaded   Percent      Read

;

;  DBA4:[SYSLIB]LIB.L32;1		      5582         7         0       226











; Size:		121 code + 0 data bytes

; Run Time:	00:04.9

; Elapsed Time:	00:10.9

; Memory Used:	274 pages

; Compilation Complete

