

; Bliss-32 10.1-416	Monday 21-AUG-1978 23:18:39	DBB3:[F11B.SRC]NXTHDR.B32;6					Page 1

;

;	0001	MODULE NXTHDR (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'B0003'

;	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 reads the next extension header, if any, of the

;	0033	!	given file.

;	0034	!

;	0035	! ENVIRONMENT:

;	0036	!

;	0037	!	STARLET operating system, including privileged system services

;	0038	!	and internal exec routines.

;	0039	!

;	0040	!--

;	0041	!

;	0042	!

;	0043	! AUTHOR:  Andrew C. Goldstein,	 CREATION DATE:  22-Jul-1977  17:40

;	0044	!

;	0045	! REVISION HISTORY:

;	0046	!

;	0047	!   Andrew C. Goldstein, 12-Dec-1977  13:51

;	0048	!   X0002 - file ID interface changes

;	0049	!

;	0050	!   Andrew C. Goldstein, 14-Dec-1977  15:18

;	0051	!   X0003 - Modify for structure level 2

;	0052	!

;	0053	!**

;	0054	

;	0055	



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:18:39	DBB3:[F11B.SRC]NXTHDR.B32;6					Page 1-1

;

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

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



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:18:39	DBB3:[F11B.SRC]NXTHDR.B32;6					Page 2

;

;	0406	GLOBAL ROUTINE NEXT_HEADER (HEADER, FCB, EXT_FID, SEGNUM) =

;	0407	

;	0408	!++

;	0409	!

;	0410	! FUNCTIONAL DESCRIPTION:

;	0411	!

;	0412	!	This routine reads the next extension header, if any, of the

;	0413	!	indicated file. Extension data is taked from either the indicated

;	0414	!	file header or the arguments.

;	0415	!

;	0416	!

;	0417	! CALLING SEQUENCE:

;	0418	!	NEXT_HEADER (ARG1, ARG2, ARG3, ARG4)

;	0419	!

;	0420	! INPUT PARAMETERS:

;	0421	!	ARG1: address of current file header or 0

;	0422	!	ARG2: address of corresponding FCB or zero

;	0423	!	ARG3: extension file ID, if present

;	0424	!	ARG4: extension segment number, if present

;	0425	!

;	0426	! IMPLICIT INPUTS:

;	0427	!	NONE

;	0428	!

;	0429	! OUTPUT PARAMETERS:

;	0430	!	NONE

;	0431	!

;	0432	! IMPLICIT OUTPUTS:

;	0433	!	NONE

;	0434	!

;	0435	! ROUTINE VALUE:

;	0436	!	Address of header read or 0 if none

;	0437	!

;	0438	! SIDE EFFECTS:

;	0439	!	File header may be read

;	0440	!

;	0441	!--

;	0442	

;	0443	BEGIN

;	0444	

;	0445	MAP

;	0446		HEADER		: REF BBLOCK,	! file header arg

;	0447		FCB		: REF BBLOCK,	! FCB arg

;	0448		EXT_FID		: REF BBLOCK;	! extension file ID arg

;	0449	

;	0450	LOCAL

;	0451		NEW_HEADER	: REF BBLOCK,	! address of extension file header read

;	0452		EXT_FCB		: REF BBLOCK,	! address of extension FCB

;	0453		FILE_ID		: BBLOCK [FID$C_LENGTH], ! file ID of extension header

;	0454		SEG_NUMBER	: WORD;		! segment number of file header

;	0455	

;	0456	EXTERNAL

;	0457		CURRENT_VCB	: REF BBLOCK;	! VCB of this volume

;	0458	

;	0459	EXTERNAL ROUTINE

;	0460		READ_HEADER;			! read a file header



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:18:39	DBB3:[F11B.SRC]NXTHDR.B32;6					Page 2-1

;

;	0461	

;	0462	

;	0463	! Get the extension file number of the file header. If it is zero, then

;	0464	! there is no extension header. If it is non-zero, read the header, using

;	0465	! the extension FCB if one exists.

;	0466	!

;	0467	

;	0468	IF ACTUALCOUNT LSS 4

;	0469	THEN

;	0470	    BEGIN

;	0471	    CH$MOVE (FID$C_LENGTH, HEADER[FH2$W_EXT_FID], FILE_ID);

;	0472	    SEG_NUMBER = .HEADER[FH2$W_SEG_NUM] + 1;

;	0473	    END

;	0474	ELSE

;	0475	    BEGIN

;	0476	    CH$MOVE (FID$C_LENGTH, .EXT_FID, FILE_ID);

;	0477	    SEG_NUMBER = .SEGNUM;

;	0478	    END;

;	0479	

;	0480	IF .FILE_ID[FID$W_NUM] EQL 0

;	0481	AND (

;	0482	    IF .CURRENT_VCB[VCB$V_EXTFID]

;	0483	    THEN .FILE_ID[FID$B_NMX] EQL 0

;	0484	    ELSE 1

;	0485	    )

;	0486	THEN RETURN 0;

;	0487	EXT_FCB =

;	0488	    (IF .FCB NEQ 0

;	0489	     THEN .FCB[FCB$L_EXFCB]

;	0490	     ELSE 0

;	0491	    );

;	0492	NEW_HEADER = READ_HEADER (FILE_ID, .EXT_FCB);

;	0493	

;	0494	! Check the segment number of the header read for consistency.

;	0495	!

;	0496	

;	0497	IF .SEG_NUMBER NEQ .NEW_HEADER[FH2$W_SEG_NUM]

;	0498	THEN ERR_EXIT (SS$_BADFILEHDR);

;	0499	

;	0500	RETURN .NEW_HEADER;

;	0501	

;	0502	END;					! end of routine NEXT_HEADER





							    .TITLE  NXTHDR

							    .IDENT  \B0003\



							    .EXTRN  CURRENT_VCB, READ_HEADER



							    .PSECT  $CODE$,NOWRT,2



					 007C 00000 	    .ENTRY  NEXT_HEADER, Save R2,R3,R4,R5,R6			      ; 0406

		         5E 	       08  C2 00002 	    SUBL2   #8, SP						      ;

		         04 	       6C  91 00005 	    CMPB    (AP), #4						      ; 0468

				       10  1E 00008 	    BGEQU   1$							      ;



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:18:39	DBB3:[F11B.SRC]NXTHDR.B32;6					Page 2-2

;

		         56 	  04   AC  D0 0000A 	    MOVL    HEADER, R6						      ; 0471

	   6E 	    0E   A6	       06  28 0000E 	    MOVC3   #6, 14(R6), FILE_ID					      ;

	   52 	    04   A6	       01  A1 00013 	    ADDW3   #1, 4(R6), SEG_NUMBER				      ; 0472

				       09  11 00018 	    BRB     2$							      ; 0468

	   6E 	    0C   BC	       06  28 0001A 1$:     MOVC3   #6, @EXT_FID, FILE_ID				      ; 0476

		         52 	  10   AC  B0 0001F 	    MOVW    SEGNUM, SEG_NUMBER					      ; 0477

				       6E  B5 00023 2$:     TSTW    FILE_ID						      ; 0480

				       0F  12 00025 	    BNEQ    3$							      ;

		         50 	0000G  CF  D0 00027 	    MOVL    CURRENT_VCB, R0					      ; 0482

	   27 	    0B   A0	       05  E1 0002C 	    BBC     #5, 11(R0), 6$					      ;

				  05   AE  95 00031 	    TSTB    FILE_ID+5						      ; 0483

				       22  13 00034 	    BEQL    6$							      ;

		         50 	  08   AC  D0 00036 3$:     MOVL    FCB, R0						      ; 0488

				       06  13 0003A 	    BEQL    4$							      ;

		         50 	  0C   A0  D0 0003C 	    MOVL    12(R0), EXT_FCB					      ;

				       02  11 00040 	    BRB     5$							      ;

				       50  D4 00042 4$:     CLRL    EXT_FCB						      ;

				       50  DD 00044 5$:     PUSHL   EXT_FCB						      ; 0492

				  04   AE  9F 00046 	    PUSHAB  FILE_ID						      ;

		  0000G  CF	       02  FB 00049 	    CALLS   #2, READ_HEADER					      ;

		    04   A0	       52  B1 0004E 	    CMPW    SEG_NUMBER, 4(NEW_HEADER)				      ; 0497

				       06  13 00052 	    BEQL    7$							      ;

				0810   8F  BF 00054 	    CHMU    #2064						      ; 0498

				       50  D4 00058 6$:     CLRL    R0							      ; 0406

					   04 0005A 7$:     RET     							      ;



; Routine Size:  91 bytes





;	0503	

;	0504	END

;	0505	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $CODE$         	    91  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       232







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:18:39	DBB3:[F11B.SRC]NXTHDR.B32;6					Page 2-3

;







; Size:		91 code + 0 data bytes

; Run Time:	00:04.8

; Elapsed Time:	00:13.2

; Memory Used:	269 pages

; Compilation Complete

