

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

;

;	0001	MODULE INIFC2 (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'B0008'

;	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	!	These routines create and initialize a file control block

;	0033	!	from the given file header.

;	0034	!

;	0035	! ENVIRONMENT:

;	0036	!

;	0037	!	STARLET operating system, including privileged system services

;	0038	!	and internal exec routines. These routines must be called in

;	0039	!	kernel mode.

;	0040	

;	0041	!

;	0042	!--

;	0043	!

;	0044	!

;	0045	! AUTHOR:  Andrew C. Goldstein,	 CREATION DATE:  14-Dec-1976  16:48

;	0046	!

;	0047	! REVISION HISTORY:

;	0048	!

;	0049	!   Andrew C. Goldstein, 16-Feb-1977  15:02

;	0050	!   X0002 - Modify for condition handling

;	0051	!

;	0052	!   Andrew C. Goldstein, 9-Aug-1977  14:23

;	0053	!   X0003 - Add UPDATE_FCB routine

;	0054	!

;	0055	!   Andrew C. Goldstein, 1-Nov-1977  15:11



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

;

;	0056	!   X0004 - Break out CREATE_FCB and UPDATE_FCB

;	0057	!

;	0058	!   Andrew C. Goldstein, 14-Nov-1977  9:01

;	0059	!   X0005 - Set end of file block in FCB

;	0060	!

;	0061	!   Andrew C. Goldstein, 22-Nov-1977  20:16

;	0062	!   X0006 - Modify for structure level 2

;	0063	!

;	0064	!   Andrew C. Goldstein, 6-Mar-1978  15:35

;	0065	!   B0007 - Zero starting LBN if not contiguous

;	0066	!

;	0067	!   Andrew C. Goldstein, 6-Jun-78  1:00

;	0068	!   B0008 - Add implicit spooling support

;	0069	!

;	0070	!**

;	0071	

;	0072	

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

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



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:17:10	DBB3:[F11B.SRC]INIFC2.B32;7					Page 2

;

;	0423	GLOBAL ROUTINE INIT_FCB2 (FCB, HEADER) : NOVALUE =

;	0424	

;	0425	!++

;	0426	!

;	0427	! FUNCTIONAL DESCRIPTION:

;	0428	!

;	0429	!	This routine initializes the given FCB according to the given

;	0430	!	file header.

;	0431	!

;	0432	! CALLING SEQUENCE:

;	0433	!	INIT_FCB (ARG1, ARG2)

;	0434	!

;	0435	! INPUT PARAMETERS:

;	0436	!	ARG1: FCB address

;	0437	!	ARG2: header address

;	0438	!

;	0439	! IMPLICIT INPUTS:

;	0440	!	HEADER_LBN contains LBN of header block

;	0441	!

;	0442	! OUTPUT PARAMETERS:

;	0443	!	NONE

;	0444	!

;	0445	! IMPLICIT OUTPUTS:

;	0446	!	NONE

;	0447	!

;	0448	! ROUTINE VALUE:

;	0449	!	NONE

;	0450	!

;	0451	! SIDE EFFECTS:

;	0452	!	FCB initialized

;	0453	!

;	0454	!--

;	0455	

;	0456	BEGIN

;	0457	

;	0458	MAP

;	0459		FCB		: REF BBLOCK,	! FCB argument

;	0460		HEADER		: REF BBLOCK;	! file header arg

;	0461	

;	0462	LINKAGE

;	0463		L_MAP_POINTER	= JSB :

;	0464				  GLOBAL (COUNT = 6, LBN = 7, MAP_POINTER = 8);

;	0465	

;	0466	GLOBAL REGISTER

;	0467		COUNT		= 6,		! retrieval pointer count

;	0468		LBN		= 7,		! retrieval pointer LBN

;	0469		MAP_POINTER	= 8;		! pointer to scan map area

;	0470	

;	0471	EXTERNAL

;	0472		HEADER_LBN;			! LBN of file header

;	0473	

;	0474	EXTERNAL ROUTINE

;	0475		GET_MAP_POINTER	: L_MAP_POINTER; ! get value of file map pointer

;	0476	

;	0477	! Get the known constants and the simple stuff from the file header



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:17:10	DBB3:[F11B.SRC]INIFC2.B32;7					Page 2-1

;

;	0478	! (i.e., header LBN, file ID, starting VBN, file owner and file protection).

;	0479	!

;	0480	

;	0481	FCB[FCB$L_HDLBN]	= .HEADER_LBN;

;	0482	FCB[FCB$W_FID_NUM]	= .HEADER[FH2$W_FID_NUM];

;	0483	FCB[FCB$W_FID_SEQ]	= .HEADER[FH2$W_FID_SEQ];

;	0484	FCB[FCB$W_FID_RVN]	= .HEADER[FH2$W_FID_RVN];

;	0485	FCB[FCB$L_FILEOWNER]	= .HEADER[FH2$L_FILEOWNER];

;	0486	FCB[FCB$W_FILEPROT]	= .HEADER[FH2$W_FILEPROT];

;	0487	IF .HEADER[FH2$V_SPOOL] THEN FCB[FCB$V_SPOOL] = 1;

;	0488	FCB[FCB$L_EFBLK]	= ROT (.BBLOCK[HEADER[FH2$W_RECATTR], FAT$L_EFBLK], 16);

;	0489	IF  .FCB[FCB$L_EFBLK] NEQ 0

;	0490	AND .BBLOCK[HEADER[FH2$W_RECATTR], FAT$W_FFBYTE] EQL 0

;	0491	THEN FCB[FCB$L_EFBLK] = .FCB[FCB$L_EFBLK] - 1;

;	0492	

;	0493	! Now scan the map area. Get the starting LBN if the file is contiguous

;	0494	! and count up the file size from the retrieval pointers.

;	0495	!

;	0496	

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

;	0498	GET_MAP_POINTER ();

;	0499	FCB[FCB$L_FILESIZE] = .COUNT;

;	0500	FCB[FCB$L_STLBN] = 0;

;	0501	IF .HEADER[FH2$V_CONTIG]

;	0502	THEN FCB[FCB$L_STLBN] = .LBN;

;	0503	

;	0504	UNTIL .MAP_POINTER GEQA .HEADER + (.HEADER[FH2$B_MPOFFSET] + .HEADER[FH2$B_MAP_INUSE]) * 2

;	0505	DO

;	0506	    BEGIN

;	0507	    GET_MAP_POINTER ();

;	0508	    FCB[FCB$L_FILESIZE] = .FCB[FCB$L_FILESIZE] + .COUNT;

;	0509	    END;

;	0510	

;	0511	IF .FCB[FCB$L_EFBLK] GTR .FCB[FCB$L_FILESIZE]

;	0512	THEN FCB[FCB$L_EFBLK] = .FCB[FCB$L_FILESIZE];

;	0513	

;	0514	END;					! end of routine INIT_FCB





							    .TITLE  INIFC2

							    .IDENT  \B0008\



							    .EXTRN  HEADER_LBN, GET_MAP_POINTER



							    .PSECT  $CODE$,NOWRT,2



					 0FFC 00000 	    .ENTRY  INIT_FCB2, Save R2,R3,R4,R5,R6,R7,R8,R9,R10,R11	      ; 0423

		         53 	  04   AC  D0 00002 	    MOVL    FCB, R3						      ; 0481

		    30   A3	0000G  CF  D0 00006 	    MOVL    HEADER_LBN, 48(R3)					      ;

		         52 	  08   AC  D0 0000C 	    MOVL    HEADER, R2						      ; 0482

		    20   A3	  08   A2  D0 00010 	    MOVL    8(R2), 32(R3)					      ;

		    24   A3	  0C   A2  B0 00015 	    MOVW    12(R2), 36(R3)					      ; 0484

		    38   A3	  3C   A2  D0 0001A 	    MOVL    60(R2), 56(R3)					      ; 0485

		    3C   A3	  40   A2  B0 0001F 	    MOVW    64(R2), 60(R3)					      ; 0486

	   04 	    35   A2	       04  E1 00024 	    BBC     #4, 53(R2), 1$					      ; 0487



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:17:10	DBB3:[F11B.SRC]INIFC2.B32;7					Page 2-2

;

		    1E   A3	       10  88 00029 	    BISB2   #16, 30(R3)						      ;

		         55 	  40   A3  9E 0002D 1$:     MOVAB   64(R3), R5						      ; 0488

	   65 	    1C   A2	       10  9C 00031 	    ROTL    #16, 28(R2), (R5)					      ;

				       07  13 00036 	    BEQL    2$							      ; 0489

				  20   A2  B5 00038 	    TSTW    32(R2)						      ; 0490

				       02  12 0003B 	    BNEQ    2$							      ;

				       65  D7 0003D 	    DECL    (R5)						      ; 0491

		         54 	  01   A2  9A 0003F 2$:     MOVZBL  1(R2), R4						      ; 0497

		         58 	     6244  3E 00043 	    MOVAW   (R2)[R4], MAP_POINTER				      ;

				     0000G 30 00047 	    BSBW    GET_MAP_POINTER					      ; 0498

		    34   A3	       56  D0 0004A 	    MOVL    COUNT, 52(R3)					      ; 0499

				  2C   A3  D4 0004E 	    CLRL    44(R3)						      ; 0500

	   04 	    34   A2	       07  E1 00051 	    BBC     #7, 52(R2), 3$					      ; 0501

		    2C   A3	       57  D0 00056 	    MOVL    LBN, 44(R3)						      ; 0502

		         50 	  3A   A2  9A 0005A 3$:     MOVZBL  58(R2), R0						      ; 0504

		         50 	       54  C0 0005E 	    ADDL2   R4, R0						      ;

		         50 	     6240  3E 00061 	    MOVAW   (R2)[R0], R0					      ;

		         50 	       58  D1 00065 	    CMPL    MAP_POINTER, R0					      ;

				       09  1E 00068 	    BGEQU   4$							      ;

				     0000G 30 0006A 	    BSBW    GET_MAP_POINTER					      ; 0507

		    34   A3	       56  C0 0006D 	    ADDL2   COUNT, 52(R3)					      ; 0508

				       E7  11 00071 	    BRB     3$							      ; 0504

		    34   A3	       65  D1 00073 4$:     CMPL    (R5), 52(R3)					      ; 0511

				       04  15 00077 	    BLEQ    5$							      ;

		         65 	  34   A3  D0 00079 	    MOVL    52(R3), (R5)					      ; 0512

					   04 0007D 5$:     RET     							      ; 0423



; Routine Size:  126 bytes





;	0515	

;	0516	END

;	0517	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $CODE$         	   126  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        29         0       241





; Bliss-32 10.1-416	Monday 21-AUG-1978 23:17:10	DBB3:[F11B.SRC]INIFC2.B32;7					Page 2-3

;









; Size:		126 code + 0 data bytes

; Run Time:	00:06.6

; Elapsed Time:	00:17.0

; Memory Used:	293 pages

; Compilation Complete

