

; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:48	DBB3:[F11A.SRC]INIFCB.B32;8					Page 1

;

;	0001	MODULE INIFCB (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'A0006'

;	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	!	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 22:58:48	DBB3:[F11A.SRC]INIFCB.B32;8					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, 6-Jun-78  0:58

;	0062	!   A0006 - Add implicit spooling support

;	0063	!

;	0064	!**

;	0065	

;	0066	

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

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



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:48	DBB3:[F11A.SRC]INIFCB.B32;8					Page 2

;

;	0387	GLOBAL ROUTINE INIT_FCB (FCB, HEADER) : NOVALUE =

;	0388	

;	0389	!++

;	0390	!

;	0391	! FUNCTIONAL DESCRIPTION:

;	0392	!

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

;	0394	!	file header.

;	0395	!

;	0396	! CALLING SEQUENCE:

;	0397	!	INIT_FCB (ARG1, ARG2)

;	0398	!

;	0399	! INPUT PARAMETERS:

;	0400	!	ARG1: FCB address

;	0401	!	ARG2: header address

;	0402	!

;	0403	! IMPLICIT INPUTS:

;	0404	!	HEADER_LBN contains LBN of header block

;	0405	!

;	0406	! OUTPUT PARAMETERS:

;	0407	!	NONE

;	0408	!

;	0409	! IMPLICIT OUTPUTS:

;	0410	!	NONE

;	0411	!

;	0412	! ROUTINE VALUE:

;	0413	!	NONE

;	0414	!

;	0415	! SIDE EFFECTS:

;	0416	!	FCB initialized

;	0417	!

;	0418	!--

;	0419	

;	0420	BEGIN

;	0421	

;	0422	MAP

;	0423		FCB		: REF BBLOCK,	! FCB argument

;	0424		HEADER		: REF BBLOCK;	! file header arg

;	0425	

;	0426	LOCAL

;	0427		MAP_AREA	: REF BBLOCK,	! pointer to header map area

;	0428		MAP_COUNT,			! count of map pointers

;	0429		MAP_POINTER	: REF BBLOCK,	! pointer to scan map

;	0430		FILESIZE;			! size of file in blocks

;	0431	

;	0432	EXTERNAL

;	0433		HEADER_LBN;			! LBN of file header

;	0434	

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

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

;	0437	!

;	0438	

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

;	0440	FCB[FCB$W_FID_NUM]	= .HEADER[FH1$W_FID_NUM];

;	0441	FCB[FCB$W_FID_SEQ]	= .HEADER[FH1$W_FID_SEQ];



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:48	DBB3:[F11A.SRC]INIFCB.B32;8					Page 2-1

;

;	0442	FCB[FCB$W_UICMEMBER]	= .HEADER[FH1$B_UICMEMBER];

;	0443	FCB[FCB$W_UICGROUP]	= .HEADER[FH1$B_UICGROUP];

;	0444	FCB[FCB$W_FILEPROT]	= .HEADER[FH1$W_FILEPROT];

;	0445	IF .HEADER[FH1$V_SPOOL] THEN FCB[FCB$V_SPOOL] = 1;

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

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

;	0448	AND .BBLOCK[HEADER[FH1$W_RECATTR], FAT$W_FFBYTE] EQL 0

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

;	0450	

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

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

;	0453	!

;	0454	

;	0455	MAP_AREA = .HEADER + .HEADER[FH1$B_MPOFFSET]*2;

;	0456	MAP_POINTER = .MAP_AREA + FM1$C_POINTERS;

;	0457	FCB[FCB$W_SEGN] = .MAP_AREA[FM1$B_EX_SEGNUM];

;	0458	

;	0459	FCB[FCB$L_STLBN] = 0;			! assume non-contiguous file

;	0460	IF .HEADER[FH1$V_CONTIG]

;	0461	THEN

;	0462	    BEGIN

;	0463	    FCB[FCB$L_STLBN] = .MAP_POINTER[FM1$W_LOWLBN]; ! get low order LBN

;	0464	    (FCB[FCB$L_STLBN])<16,8> = .MAP_POINTER[FM1$B_HIGHLBN]; ! and high order

;	0465	    END;

;	0466	

;	0467	FILESIZE = 0;

;	0468	DECR MAP_COUNT FROM .MAP_AREA[FM1$B_INUSE]/2 TO 1 DO

;	0469	    BEGIN

;	0470	    FILESIZE = .FILESIZE + .MAP_POINTER[FM1$B_COUNT] + 1;

;	0471	    MAP_POINTER = .MAP_POINTER + 4;

;	0472	    END;

;	0473	FCB[FCB$L_FILESIZE] = .FILESIZE;

;	0474	

;	0475	IF .FCB[FCB$L_EFBLK] GTR .FILESIZE

;	0476	THEN FCB[FCB$L_EFBLK] = .FILESIZE;

;	0477	

;	0478	END;					! end of routine INIT_FCB





							    .TITLE  INIFCB

							    .IDENT  \A0006\



							    .EXTRN  HEADER_LBN



							    .PSECT  $CODE$,NOWRT,2



					 003C 00000 	    .ENTRY  INIT_FCB, Save R2,R3,R4,R5				      ; 0387

		         51 	  04   AC  D0 00002 	    MOVL    FCB, R1						      ; 0439

		    30   A1	0000G  CF  D0 00006 	    MOVL    HEADER_LBN, 48(R1)					      ;

		         50 	  08   AC  D0 0000C 	    MOVL    HEADER, R0						      ; 0440

		    20   A1	  02   A0  D0 00010 	    MOVL    2(R0), 32(R1)					      ;

		    38   A1	  08   A0  9B 00015 	    MOVZBW  8(R0), 56(R1)					      ; 0442

		    3A   A1	  09   A0  9B 0001A 	    MOVZBW  9(R0), 58(R1)					      ; 0443

		    3C   A1	  0A   A0  B0 0001F 	    MOVW    10(R0), 60(R1)					      ; 0444

	   04 	    0D   A0	       04  E1 00024 	    BBC     #4, 13(R0), 1$					      ; 0445



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:48	DBB3:[F11A.SRC]INIFCB.B32;8					Page 2-2

;

		    1E   A1	       10  88 00029 	    BISB2   #16, 30(R1)						      ;

		         54 	  40   A1  9E 0002D 1$:     MOVAB   64(R1), R4						      ; 0446

	   64 	    16   A0	       10  9C 00031 	    ROTL    #16, 22(R0), (R4)					      ;

				       07  13 00036 	    BEQL    2$							      ; 0447

				  1A   A0  B5 00038 	    TSTW    26(R0)						      ; 0448

				       02  12 0003B 	    BNEQ    2$							      ;

				       64  D7 0003D 	    DECL    (R4)						      ; 0449

		         52 	  01   A0  9A 0003F 2$:     MOVZBL  1(R0), R2						      ; 0455

		         52 	     6042  3E 00043 	    MOVAW   (R0)[R2], MAP_AREA					      ;

		         53 	  0A   A2  9E 00047 	    MOVAB   10(R2), MAP_POINTER					      ; 0456

		    26   A1	       62  9B 0004B 	    MOVZBW  (MAP_AREA), 38(R1)					      ; 0457

				  2C   A1  D4 0004F 	    CLRL    44(R1)						      ; 0459

	   09 	    0C   A0	       07  E1 00052 	    BBC     #7, 12(R0), 3$					      ; 0460

		    2C   A1	  02   A3  3C 00057 	    MOVZWL  2(MAP_POINTER), 44(R1)				      ; 0463

		    2E   A1	       63  90 0005C 	    MOVB    (MAP_POINTER), 46(R1)				      ; 0464

				       50  D4 00060 3$:     CLRL    FILESIZE						      ; 0467

		         55 	  08   A2  9A 00062 	    MOVZBL  8(MAP_AREA), R5					      ; 0468

		         55 	       02  C6 00066 	    DIVL2   #2, R5						      ;

				       55  D6 00069 	    INCL    MAP_COUNT						      ;

				       0C  11 0006B 	    BRB     5$							      ;

		         52 	  01   A3  9A 0006D 4$:     MOVZBL  1(MAP_POINTER), R2					      ; 0470

		         50 	  01 A240  9E 00071 	    MOVAB   1(R2)[FILESIZE], FILESIZE				      ;

		         53 	       04  C0 00076 	    ADDL2   #4, MAP_POINTER					      ; 0471

		         F1 	       55  F5 00079 5$:     SOBGTR  MAP_COUNT, 4$					      ; 0468

		    34   A1	       50  D0 0007C 	    MOVL    FILESIZE, 52(R1)					      ; 0473

		         50 	       64  D1 00080 	    CMPL    (R4), FILESIZE					      ; 0475

				       03  15 00083 	    BLEQ    6$							      ;

		         64 	       50  D0 00085 	    MOVL    FILESIZE, (R4)					      ; 0476

					   04 00088 6$:     RET     							      ; 0387



; Routine Size:  137 bytes





;	0479	

;	0480	END

;	0481	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

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









;				LIBRARY STATISTICS

;

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

;	File				     Total    Loaded   Percent      Read



; Bliss-32 10.1-416	Monday 21-AUG-1978 22:58:48	DBB3:[F11A.SRC]INIFCB.B32;8					Page 2-3

;

;

;  DBA4:[SYSLIB]LIB.L32;1		      5582        29         0       244











; Size:		137 code + 0 data bytes

; Run Time:	00:06.2

; Elapsed Time:	00:15.5

; Memory Used:	294 pages

; Compilation Complete

