

; Bliss-32 7.352	Saturday 21-AUG-1978 23:42:28	DBB3:[MTAACP.SRC]POSFID.B32;6					Page 1

; Digital Equipment Corporation

;

;	0001	MODULE POSFID (

;	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:  MTAACP

;	0029	!

;	0030	! ABSTRACT:

;	0031	!	THIS MODULE POSITION THE TAPE

;	0032	!

;	0033	! ENVIRONMENT:

;	0034	!

;	0035	!	STARLET OPERATING SYSTEM, INCLUDING PRIVILEGED SYSTEM SERVICES

;	0036	!	AND INTERNAL EXEC ROUTINES.

;	0037	!

;	0038	!--

;	0039	!

;	0040	!

;	0041	! AUTHOR:  D. H. GILLESPIE,	 CREATION DATE:  31-MAY-77  11:30  

;	0042	!

;	0043	! REVISION HISTORY:

;	0044	!

;	0045	!   D. H. Gillespie, 12-May-78  14:48

;	0046	!   A0001 - change CURRENT_VCB to a register

;	0047	!

;	0048	!   D. H. Gillespie, 23-May-78  9:50

;	0049	!   A0002 -  remove READ_NXTHDR

;	0050	!

;	0051	!   D. H. Gillespie, 25-May-78  11:27

;	0052	!   A0003 - change interface to MOUNT_VOL

;	0053	!

;	0054	!**

;	0055	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:42:28	DBB3:[MTAACP.SRC]POSFID.B32;6					Page 1-1

; Digital Equipment Corporation

;

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

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



; Bliss-32 7.352	Saturday 21-AUG-1978 23:42:28	DBB3:[MTAACP.SRC]POSFID.B32;6					Page 2

; Digital Equipment Corporation

;

;	0353	GLOBAL ROUTINE POSITION_BY_FID(FID_WANTED,RVN_WANTED) : COMMON_CALL NOVALUE  =

;	0354	

;	0355	!++

;	0356	!

;	0357	! FUNCTIONAL DESCRIPTION:

;	0358	!	THIS ROUTINE POSITIONS THE TAPE JUST PASSED THE HEADERS OF THE FILE SPECIFIED

;	0359	!	BY FID

;	0360	!

;	0361	! CALLING SEQUENCE:

;	0362	!	POSITION_BY_FID(ARG1,ARG2)

;	0363	!

;	0364	! INPUT PARAMETERS:

;	0365	!	ARG1 - FILE IDENTIFIER

;	0366	!	ARG2 - RVN ON WHICH FILE RESIDES

;	0367	!

;	0368	! IMPLICIT INPUTS:

;	0369	!	CURRENT_VCB - ADDRESS OF CURRENT VCB

;	0370	!	CURRENT_UCB - ADDRESS OF CURRENT UNIT CONTROL BLOCK

;	0371	!

;	0372	! OUTPUT PARAMETERS:

;	0373	!	NONE

;	0374	!

;	0375	! IMPLICIT OUTPUTS:

;	0376	!	NONE

;	0377	!

;	0378	! ROUTINE VALUE:

;	0379	!	NONE

;	0380	!

;	0381	! SIDE EFFECTS:

;	0382	!	TAPE POSITIONED PASSED HDR1 AND HDR2 (IF IT EXISTS)

;	0383	!	THESE LABELS ARE READ IN

;	0384	!	IF FILE DOESN'T EXIST, ERROR EXIT TAKEN

;	0385	!

;	0386	! USER ERRORS:

;	0387	!	SS$_NOSUCHFILE - NO FILE EXISTS THAT MATCHES FID

;	0388	!--

;	0389	

;	0390	BEGIN

;	0391	

;	0392	EXTERNAL REGISTER

;	0393		COMMON_REG;

;	0394	

;	0395	

;	0396	EXTERNAL LITERAL

;	0397		UCB$L_MT_RECORD;		!GLOBAL DISPLACEMENT INTO UCB

;	0398	EXTERNAL

;	0399		CURRENT_UCB:	REF BBLOCK,		!ADDRESS OF CURRENT UNIT CONTROL BLOCK

;	0400		HDR1:		REF BBLOCK;		!ADDRESS OF HDR1(EOF1) LABEL

;	0401	

;	0402	EXTERNAL ROUTINE

;	0403		READ_HDR,				!READ HEADERS

;	0404		MOUNT_VOL,				!MOUNT RELATIVE VOLUME

;	0405		SPACE_EOF;				!SPACE TO END OF FILE

;	0406	

;	0407	BIND



; Bliss-32 7.352	Saturday 21-AUG-1978 23:42:28	DBB3:[MTAACP.SRC]POSFID.B32;6					Page 2-1

; Digital Equipment Corporation

;

;	0408		CUR_FID	= CURRENT_VCB[VCB$W_CUR_NUM];

;	0409	

;	0410	LOCAL

;	0411		TM;					!NUMBER OF TM'S PAST IN FILE

;	0412	

;	0413	! IF THE FILE ID IS ZERO, THEN THE USER HAS INPUT AN INVALID FILE ID OR

;	0414	! THE ACP HAS A BUG.

;	0415	IF .FID_WANTED EQL 0 THEN ERR_EXIT(SS$_BADPARAM);

;	0416	

;	0417	IF .CUR_FID EQLU .FID_WANTED

;	0418	AND (.CURRENT_VCB[VCB$B_TM] EQLU 0

;	0419	    OR (.CURRENT_VCB[VCB$B_TM] EQLU 1

;	0420	    AND (.CURRENT_VCB[VCB$L_ST_RECORD] - .(.CURRENT_UCB + UCB$L_MT_RECORD)<0,32>) EQLU 0

;	0421	    AND .HDR1[HD1$L_HD1LID] EQL 'HDR1'))

;	0422	THEN RETURN;

;	0423	

;	0424	MOUNT_VOL( IF .RVN_WANTED EQL 0 THEN 1 ELSE .RVN_WANTED,

;	0425			$FIELDMASK(MOU$V_LBLCHECK) OR $FIELDMASK(MOU$V_REWIND));

;	0426	READ_HDR();

;	0427	

;	0428	WHILE 1 DO

;	0429	    BEGIN

;	0430	    IF .CUR_FID EQLU .FID_WANTED THEN  EXITLOOP;

;	0431	    SPACE_EOF();

;	0432	    IF NOT READ_HDR() THEN ERR_EXIT(SS$_NOSUCHFILE);

;	0433	    END;					!END OF WHILE LOOP

;	0434	END;						!END OF ROUTINE





							    .TITLE  POSFID

							    .IDENT  \A0003\



							    .GLOBL  UCB$L_MT_RECORD, CURRENT_UCB, HDR1, READ_HDR, MOUNT_VOL

							    .GLOBL  SPACE_EOF



							    .PSECT  $CODE$,NOWRT,2



					 0004 00000 	    .ENTRY  POSITION_BY_FID, Save R2				      ; 0353

	   52	         5B	       24  C1 00002 	    ADDL3   #36, CURRENT_VCB, R2				      ; 0408

				  04   AC  D5 00006 	    TSTL    FID_WANTED						      ; 0415

				       02  12 00009 	    BNEQ    1$							      ;

				       14  BF 0000B 	    CHMU    #20							      ;

		    04   AC	       62  D1 0000D 1$:     CMPL    (R2), FID_WANTED					      ; 0417

				       27  12 00011 	    BNEQ    2$							      ;

				  2E   AB  95 00013 	    TSTB    46(CURRENT_VCB)					      ; 0418

				       53  13 00016 	    BEQL    6$							      ;

		         01	  2E   AB  91 00018 	    CMPB    46(CURRENT_VCB), #1					      ; 0419

				       1C  12 0001C 	    BNEQ    2$							      ;

	   50	  0000G  CF 00000000G  8F  C1 0001E 	    ADDL3   #UCB$L_MT_RECORD, CURRENT_UCB, R0			      ; 0420

	   50	    30   AB	       60  C3 00028 	    SUBL3   (R0), 48(CURRENT_VCB), R0				      ;

				       0B  12 0002D 	    BNEQ    2$							      ;

	      31524448   8F	0000G  DF  D1 0002F 	    CMPL    @HDR1, #827475016					      ; 0421

				       31  13 00038 	    BEQL    6$							      ;

				       03  DD 0003A 2$:     PUSHL   #3							      ; 0424

				  08   AC  D5 0003C 	    TSTL    RVN_WANTED						      ;



; Bliss-32 7.352	Saturday 21-AUG-1978 23:42:28	DBB3:[MTAACP.SRC]POSFID.B32;6					Page 2-2

; Digital Equipment Corporation

;

				       04  12 0003F 	    BNEQ    3$							      ;

				       01  DD 00041 	    PUSHL   #1							      ;

				       03  11 00043 	    BRB     4$							      ;

				  08   AC  DD 00045 3$:     PUSHL   RVN_WANTED						      ;

		  0000G  CF	       02  FB 00048 4$:     CALLS   #2, MOUNT_VOL					      ;

		  0000G  CF	       00  FB 0004D 	    CALLS   #0, READ_HDR					      ; 0426

		    04   AC	       62  D1 00052 5$:     CMPL    (R2), FID_WANTED					      ; 0430

				       13  13 00056 	    BEQL    6$							      ;

		  0000G  CF	       00  FB 00058 	    CALLS   #0, SPACE_EOF					      ; 0431

		  0000G  CF	       00  FB 0005D 	    CALLS   #0, READ_HDR					      ; 0432

		         ED	       50  E8 00062 	    BLBS    R0, 5$						      ;

				0910   8F  BF 00065 	    CHMU    #2320						      ;

				       E7  11 00069 	    BRB     5$							      ; 0428

					   04 0006B 6$:     RET     							      ; 0353



; Routine Size:  108 bytes





;	0435	

;	0436	END

;	0437	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $CODE$         	   108  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       230











; Size:		108 code + 0 data bytes

; Run Time:	00:05.7

; Elapsed Time:	00:14.3

; Memory Used:	264 pages

; Compilation Complete

