

; Bliss-32 10.1-416	Monday 21-AUG-1978 23:15:04	DBB3:[F11B.SRC]EXTFCB.B32;6					Page 1

;

;	0001	MODULE EXTFCB (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'B0004'

;	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 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, 14-Dec-1977  17:45

;	0050	!   X0002 - Modify for structure level 2

;	0051	!

;	0052	!   Andrew C. Goldstein, 6-Jan-1978  22:26

;	0053	!   B0003 - Unconditionally create extension FCB for accessed file

;	0054	!

;	0055	!   Andrew C. Goldstein, 1-Feb-1978  18:54



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:15:04	DBB3:[F11B.SRC]EXTFCB.B32;6					Page 1-1

;

;	0056	!   B0004 - Use extend size in FIB for new FCB start VBN

;	0057	!

;	0058	!**

;	0059	

;	0060	

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

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



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:15:04	DBB3:[F11B.SRC]EXTFCB.B32;6					Page 2

;

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

;	0412	

;	0413	!++

;	0414	!

;	0415	! FUNCTIONAL DESCRIPTION:

;	0416	!

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

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

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

;	0420	!

;	0421	!

;	0422	! CALLING SEQUENCE:

;	0423	!	MAKE_EXTFCB (ARG1, ARG2, ARG3)

;	0424	!

;	0425	! INPUT PARAMETERS:

;	0426	!	ARG1: address of extension file header

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

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

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

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

;	0431	!

;	0432	! IMPLICIT INPUTS:

;	0433	!	PRIMARY_FCB: address of primary FCB of file

;	0434	!	CURRENT_WINDOW: address of file window or 0

;	0435	!	UNREC_COUNT: count of allocated but unrecorded blocks

;	0436	!

;	0437	! OUTPUT PARAMETERS:

;	0438	!	NONE

;	0439	!

;	0440	! IMPLICIT OUTPUTS:

;	0441	!	NONE

;	0442	!

;	0443	! ROUTINE VALUE:

;	0444	!	address of new FCB created or 0

;	0445	!

;	0446	! SIDE EFFECTS:

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

;	0448	!

;	0449	!--

;	0450	

;	0451	BEGIN

;	0452	

;	0453	MAP

;	0454		HEADER		: REF BBLOCK,	! file header arg

;	0455		FCB		: REF BBLOCK;	! FCB arg

;	0456	

;	0457	LOCAL

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

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

;	0460	

;	0461	EXTERNAL

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

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

;	0464		CURRENT_FIB	: REF BBLOCK,	! FIB of operation

;	0465		UNREC_COUNT;			! count of allocated but unrecorded blocks



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:15:04	DBB3:[F11B.SRC]EXTFCB.B32;6					Page 2-1

;

;	0466	

;	0467	EXTERNAL ROUTINE

;	0468		CREATE_FCB,			! create a new FCB

;	0469		INIT_FCB2;			! initialize existing FCB

;	0470	

;	0471	

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

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

;	0474	! it into the primary FCB.

;	0475	!

;	0476	

;	0477	IF .MODE EQL 0

;	0478	THEN

;	0479	    BEGIN

;	0480	    INIT_FCB2 (DUMMY_FCB, .HEADER);	! get file size in dummy FCB

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

;	0482	    RETURN 0;

;	0483	    END

;	0484	

;	0485	! If the file is accessed, we create a new FCB and link it in. On an extend

;	0486	! we must compute the new FCB starting VBN from the extend data lying around,

;	0487	! since the primary FCB isn't updated until the very end.

;	0488	!

;	0489	

;	0490	ELSE

;	0491	    BEGIN

;	0492	    NEW_FCB = CREATE_FCB (.HEADER);

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

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

;	0495	    IF .MODE

;	0496	    THEN

;	0497		BEGIN

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

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

;	0500		END

;	0501	    ELSE

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

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

;	0504	

;	0505	    RETURN .NEW_FCB;

;	0506	    END;

;	0507	

;	0508	END;					! end of routine MAKE_EXTFCB





							    .TITLE  EXTFCB

							    .IDENT  \B0004\



							    .EXTRN  PRIMARY_FCB, CURRENT_WINDOW, CURRENT_FIB, UNREC_COUNT

							    .EXTRN  CREATE_FCB, INIT_FCB2



							    .PSECT  $CODE$,NOWRT,2



					 0004 00000 	    .ENTRY  MAKE_EXTFCB, Save R2				      ; 0411

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



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:15:04	DBB3:[F11B.SRC]EXTFCB.B32;6					Page 2-2

;

				  0C   AC  D5 00006 	    TSTL    MODE						      ; 0477

				       17  12 00009 	    BNEQ    1$							      ;

				  04   AC  DD 0000B 	    PUSHL   HEADER						      ; 0480

				  04   AE  9F 0000E 	    PUSHAB  DUMMY_FCB						      ;

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

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

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

				       3C  11 00020 	    BRB     3$							      ; 0482

				  04   AC  DD 00022 1$:     PUSHL   HEADER						      ; 0492

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

		         51 	  08   AC  D0 0002A 	    MOVL    FCB, R1						      ; 0493

		    0C   A1	       50  D0 0002E 	    MOVL    NEW_FCB, 12(R1)					      ;

		         61 	       60  0E 00032 	    INSQUE  (NEW_FCB), (R1)					      ; 0494

	   51 	  0000G  CF	       34  C1 00035 	    ADDL3   #52, PRIMARY_FCB, R1				      ; 0498

		         09 	  0C   AC  E9 0003B 	    BLBC    MODE, 2$						      ; 0495

		    28   A0	       61  C0 0003F 	    ADDL2   (R1), 40(NEW_FCB)					      ; 0498

		         61 	  34   A0  C0 00043 	    ADDL2   52(NEW_FCB), (R1)					      ; 0499

					   04 00047 	    RET     							      ; 0495

	   52 	    28   A0	       61  C1 00048 2$:     ADDL3   (R1), 40(NEW_FCB), R2				      ; 0502

		         51 	0000G  CF  D0 0004D 	    MOVL    CURRENT_FIB, R1					      ; 0503

		         52 	  18   A1  C0 00052 	    ADDL2   24(R1), R2						      ;

      28   A0	         52 	0000G  CF  C3 00056 	    SUBL3   UNREC_COUNT, R2, 40(NEW_FCB)			      ;

					   04 0005D 	    RET     							      ; 0505

				       50  D4 0005E 3$:     CLRL    R0							      ; 0411

					   04 00060 	    RET     							      ;



; Routine Size:  97 bytes





;	0509	

;	0510	END

;	0511	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $CODE$         	    97  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        13         0       228







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:15:04	DBB3:[F11B.SRC]EXTFCB.B32;6					Page 2-3

;







; Size:		97 code + 0 data bytes

; Run Time:	00:04.9

; Elapsed Time:	00:10.5

; Memory Used:	270 pages

; Compilation Complete

