

; Bliss-32 7.352	Saturday 21-AUG-1978 23:29:30	DBB3:[MTAACP.SRC]CREATE.B32;13					Page 1

; Digital Equipment Corporation

;

;	0001	MODULE CREATE (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'A0004'

;	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	!

;	0032	!	THIS MODULE EXECUTES THE CREATE FUNCTION

;	0033	!

;	0034	! ENVIRONMENT:

;	0035	!

;	0036	!	STARLET OPERATING SYSTEM, INCLUDING PRIVILEGED SYSTEM SERVICES

;	0037	!	AND INTERNAL EXEC ROUTINES.

;	0038	!

;	0039	!--

;	0040	!

;	0041	!

;	0042	! AUTHOR:  D. H. GILLESPIE,	 CREATION DATE:  3-JUN-77  

;	0043	!

;	0044	! REVISION HISTORY:

;	0045	!

;	0046	!   D. H. Gillespie, 12-May-78  10:01

;	0047	!   A0001 - change CURRENT_VCB to a register

;	0048	!

;	0049	!   D. H. Gillespie, 22-May-78  16:38

;	0050	!   A0002 - add NOTUSED

;	0051	!

;	0052	!   D. H. Gillespie, 23-May-78  13:28

;	0053	!   A0003 - change linkage to GET_START_HDR

;	0054	!

;	0055	!   D. H. Gillespie, 25-May-78  11:07



; Bliss-32 7.352	Saturday 21-AUG-1978 23:29:30	DBB3:[MTAACP.SRC]CREATE.B32;13					Page 1-1

; Digital Equipment Corporation

;

;	0056	!   A0004 - change interface to MOUNT_VOL

;	0057	!

;	0058	!**

;	0059	

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

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

;	0357	

;	0358	FORWARD ROUTINE

;	0359		MTA_CREATE	: NOPRES NOVALUE,	!MAIN ROUTINE TO CREATE A FILE

;	0360		ACCESS_NEW_FILE	: COMMON_CALL NOVALUE,	!ACCESS A NEWLY CREATED FILE

;	0361		INIT_NEW_FILE	: COMMON_CALL NOVALUE,	!INITIALIZE NEW FILE

;	0362		WRITE_HEADERS	: NOVALUE L$WRITE_HEADER;!WRITE HDR1 AND HDR2

;	0363	

;	0364	EXTERNAL ROUTINE

;	0365		ACCESS_FILE,			!ACCESS FILE

;	0366		BLOCK,				!BLOCK CURRENT IO REQUEST

;	0367		CHECK_ACCESS,			!CHECK ACCESS TO VOLUME

;	0368		CHECK_FILE_ACC,			!CHECK ACCESS TO FILE

;	0369		CLOSE_FILE	: L$CLOSE_FILE,	!CLOSE FILE

;	0370		FORMAT_FID,			!FORMAT FILE IDENTIFIER

;	0371		FORMAT_HDRS,			!FORMAT HEADERS

;	0372		GET_FIB,			!GET COPY OF USER'S FIB

;	0373		GET_START_HDR	: L$GET_START_HDR,	!GET HEADER TO START WITH

;	0374		MOUNT_VOL,			!MOUNT A VOLUME

;	0375		QUEUE_AST,			!ISSUE AST FOR USER LABELS

;	0376		POSITION_TO_END,		!POSITION TO END OF VOL SET

;	0377		READ_HDR,			!READ HEADER

;	0378		REWIND_VOL_SET,			!REWIND VOLUME SET

;	0379		SPACE,				!SPACE GIVEN NUMBER OF BLOCKS

;	0380		SPACE_TM,			!SPACE GIVEN NUMBER OF TAPE MARKS

;	0381		START_VIO,			!START VIRTUAL IO

;	0382		SYS$FAO		: ADDRESSING_MODE(ABSOLUTE),	!FORMAT ASCII OUTPUT

;	0383		WRITE_BLOCK,			!WRITE TAPE BLOCK

;	0384		WRITE_TM	: L$WRITE_TM;		!WRITE TAPE MARK

;	0385	

;	0386	EXTERNAL

;	0387		CURRENT_WCB	: REF BBLOCK,	!ADDRESS OF CURRENT WINDOW CONTROL BLOCK

;	0388		IO_PACKET	: REF BBLOCK,	!ADDRESS OF IO REQUEST PACKET

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

;	0390		HDR2		: REF BBLOCK;	!ADDRESS OF HDR2(EOF2) LABEL



; Bliss-32 7.352	Saturday 21-AUG-1978 23:29:30	DBB3:[MTAACP.SRC]CREATE.B32;13					Page 2

; Digital Equipment Corporation

;

;	0391	GLOBAL ROUTINE MTA_CREATE : NOPRES NOVALUE  =

;	0392	

;	0393	!++

;	0394	!

;	0395	! FUNCTIONAL DESCRIPTION:

;	0396	!	THIS IS THE MAIN PROCESSING ROUTINE FOR MTAACP CREATE FUNCTION

;	0397	!

;	0398	! CALLING SEQUENCE:

;	0399	!	MTA_CREATE()

;	0400	!

;	0401	! INPUT PARAMETERS:

;	0402	!	NONE

;	0403	!

;	0404	! IMPLICIT INPUTS:

;	0405	!	HDR1	  - ADDRESS HDR1(EOF1) LABEL

;	0406	!	HDR2	  - ADDRESS HDR2(EOF2) LABEL

;	0407	!	IO_PACKET - ADDRESS OF CURRENT IO REQUEST PACKET

;	0408	!	CURRENT_VCB - ADDRESS OF CURRENT VCB

;	0409	!

;	0410	! OUTPUT PARAMETERS:

;	0411	!	NONE

;	0412	!

;	0413	! IMPLICIT OUTPUTS:

;	0414	!	THE HEADER LABEL SET IS WRITTEN AND THE ACCESS TO THE FILE MADE IF REQUESTED

;	0415	!

;	0416	! ROUTINE VALUE:

;	0417	!	NONE

;	0418	!

;	0419	! SIDE EFFECTS:

;	0420	!	NONE

;	0421	!

;	0422	! USER ERRORS:

;	0423	!	SS$_BADPARAM	- BAD INPUT PARAMETERS TO CREATE OR MUST ASK TO WRITE FILE

;	0424	!	SS$_FILALRACC	- ONLY ONE FILE AT A TIME OPEN ON MAGNETIC TAPE

;	0425	!	SS$_FILENOTEXP	- THE FILE ABOUT TO BE OVERLAYED IS NOT EXPIRED

;	0426	!	SS$_NOPRIV	- THE USER DOES NOT HAVE NECESSARY PRIVILEGES

;	0427	!--

;	0428	

;	0429	BEGIN

;	0430	

;	0431	EXTERNAL REGISTER

;	0432		COMMON_REG;

;	0433	

;	0434	

;	0435	LOCAL

;	0436		PACKET:		REF BBLOCK,		!ADDRESS OF CURRENT IO REQUEST PACKET

;	0437		ABD:		REF BBLOCKVECTOR[,ABD$C_LENGTH],	!ADDRESS OF BUFFER DESCRIPTORS

;	0438		FIB:		REF BBLOCK,		!ADDRESS OF COPY OF USER'S FIB

;	0439		FUNCTION:	BBLOCK [1];		!IO FUNCTION

;	0440	

;	0441	! SETUP POINTERS TO INTERESTING STRUCTURES

;	0442	PACKET = .IO_PACKET;

;	0443	ABD = .BBLOCK[.PACKET[IRP$L_SVAPTE],AIB$L_DESCRIPT];	!ADDRESS OF BUFFER DESCRIPTORS

;	0444	FIB = GET_FIB(.ABD);				!GET COPY OF USER'S FILE INFORMATION BLOCK

;	0445	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:29:30	DBB3:[MTAACP.SRC]CREATE.B32;13					Page 2-1

; Digital Equipment Corporation

;

;	0446	! GET IO FUNCTION CODE

;	0447	FUNCTION = .PACKET[IRP$W_FUNC];

;	0448	

;	0449	! IS THE FUNCTION REQUESTED A VALID ONE?

;	0450	IF .FIB[FIB$V_TRUNC]

;	0451	OR .FUNCTION[IO$V_DELETE]

;	0452	OR (NOT .FUNCTION[IO$V_CREATE])

;	0453	    AND (.FIB[FIB$V_EXTEND]

;	0454	    OR .PACKET[IRP$W_BCNT] GTRU ABD$C_ATTRIB

;	0455	    OR .FUNCTION [IO$V_ACCESS]

;	0456	    )

;	0457	OR NOT .FIB[FIB$V_WRITE] AND .FUNCTION[IO$V_ACCESS]

;	0458	THEN ERR_EXIT(SS$_BADPARAM);

;	0459	

;	0460	! MAKE SURE THAT A CREATE IS NOT DONE ON A VOLUME SET THAT HAS AN OUTSTANDING ACCESS

;	0461	IF .CURRENT_WCB NEQ 0 AND .FUNCTION[IO$V_CREATE] 

;	0462	THEN ERR_EXIT(SS$_FILALRACC);

;	0463	

;	0464	! NOW FOR THE CREATE

;	0465	IF .FUNCTION[IO$V_CREATE] THEN

;	0466	

;	0467	    BEGIN

;	0468	! IF THERE IS A PARTIAL FILE THEN IT  IS CLOSED.  IF THE USER WANTS TO

;	0469	! ACCESS A PARTIAL FILE, THE ACCESS FUNCTION IO MUST BE USED

;	0470	    IF .CURRENT_VCB[VCB$V_PARTFILE] THEN CLOSE_FILE();

;	0471	

;	0472	    CHECK_ACCESS(1);				!MUST HAVE WRITE PRIVILEGE JUST TO CREATE

;	0473	

;	0474	! NOW POSITION THE TAPE AS REQUESTED UNLESS THIS IS A CREATE IF NOT FOUND

;	0475	    IF .PACKET[IRP$V_FCODE] EQL IO$_ACCESS 	!IF CREATE IF NOT FOUND

;	0476	    OR NOT (.FIB[FIB$V_REWIND] OR .FIB[FIB$V_CURPOS]) THEN POSITION_TO_END()

;	0477	    ELSE

;	0478		BEGIN

;	0479		IF .FIB[FIB$V_REWIND] THEN

;	0480		    BEGIN

;	0481		    MOUNT_VOL(1,$FIELDMASK(MOU$V_REWIND) + $FIELDMASK(MOU$V_LBLCHECK));!MOUNT VOLUME

;	0482		    IF NOT READ_HDR() THEN ERR_EXIT(SS$_TAPEPOSLOST);

;	0483		    END

;	0484		ELSE GET_START_HDR();			!CREATE FUNCTION WITH POSITIONING INDICATORS

;	0485		END;

;	0486	

;	0487	! CHECK EXPIRATION ON OVERLAYED FILES AND POSITION TAPE

;	0488	    IF NOT .CURRENT_VCB[VCB$V_LOGICEOVS] 

;	0489	    THEN

;	0490		BEGIN					!OVERLAYING FILE IF NOT AT END OF VOLUME SET

;	0491		CHECK_FILE_ACC();			!CAN FILE BE OVERLAYED?

;	0492		IF .CURRENT_VCB[VCB$B_TM] EQL 0		!POSITION TO WHERE FILE IS TO BE WRITTEN

;	0493		THEN SPACE(-2)				!HDR1 AND (HDR2 OR USER LABEL)

;	0494		ELSE

;	0495		    BEGIN

;	0496		    SPACE_TM(-1);			!NO HDR2 OR USER LABEL THEREFORE BACKSPACE TM

;	0497		    SPACE(-1);				!AND THEN HDR1

;	0498		    END;

;	0499		END

;	0500	    ELSE



; Bliss-32 7.352	Saturday 21-AUG-1978 23:29:30	DBB3:[MTAACP.SRC]CREATE.B32;13					Page 2-2

; Digital Equipment Corporation

;

;	0501		SPACE_TM(-1);				!LOGICAL END INDICATED BY TAPE MARK

;	0502	

;	0503	! INITIALIZE NEW FILE AND WRITE HEADERS

;	0504	    FORMAT_HDRS();

;	0505	    KERNEL_CALL(INIT_NEW_FILE);

;	0506	    WRITE_HEADERS();				!WRITE HDR1 AND HDR2

;	0507	

;	0508	! RETURN FID TO USER IN FIB

;	0509	    FORMAT_FID(FIB[FIB$W_FID_NUM]);

;	0510	    FIB[FIB$W_FID_RVN] = .CURRENT_VCB[VCB$B_CUR_RVN];

;	0511	

;	0512	! NOW IF NEWLY CREATED FILE SHOULD BE ACCESSED DO SO

;	0513	    IF .FUNCTION[IO$V_ACCESS] THEN ACCESS_NEW_FILE(.FIB,.PACKET,.ABD);

;	0514	    END;

;	0515		

;	0516	

;	0517	END;						!END OF ROUTINE





							    .TITLE  CREATE

							    .IDENT  \A0004\



							    .GLOBL  ACCESS_FILE, BLOCK, CHECK_ACCESS, CHECK_FILE_ACC

							    .GLOBL  CLOSE_FILE, FORMAT_FID, FORMAT_HDRS, GET_FIB, GET_START_HDR

							    .GLOBL  MOUNT_VOL, QUEUE_AST, POSITION_TO_END, READ_HDR

							    .GLOBL  REWIND_VOL_SET, SPACE, SPACE_TM, START_VIO, SYS$FAO

							    .GLOBL  WRITE_BLOCK, WRITE_TM, CURRENT_WCB, IO_PACKET

							    .GLOBL  HDR1, HDR2, SYS$CMKRNL



							    .PSECT  $CODE$,NOWRT,2



					 0000 00000 	    .ENTRY  MTA_CREATE, Save nothing				      ; 0391

		         53	0000G  CF  D0 00002 	    MOVL    IO_PACKET, PACKET					      ; 0442

		         55	  2C   B3  D0 00007 	    MOVL    @44(PACKET), ABD					      ; 0443

				       55  DD 0000B 	    PUSHL   ABD							      ; 0444

		  0000G  CF	       01  FB 0000D 	    CALLS   #1, GET_FIB						      ;

		         52	       50  D0 00012 	    MOVL    R0, FIB						      ;

		         54	  20   A3  3C 00015 	    MOVZWL  32(PACKET), FUNCTION				      ; 0447

		         1F	  17   A2  E8 00019 	    BLBS    23(FIB), 2$						      ; 0450

	   1B	         54	       08  E0 0001D 	    BBS     #8, FUNCTION, 2$					      ; 0451

	   0F	         54	       07  E0 00021 	    BBS     #7, FUNCTION, 1$					      ; 0452

	   12	    16   A2	       07  E0 00025 	    BBS     #7, 22(FIB), 2$					      ; 0453

		         05	  32   A3  B1 0002A 	    CMPW    50(PACKET), #5					      ; 0454

				       0C  1A 0002E 	    BGTRU   2$							      ;

	   08	         54	       06  E0 00030 	    BBS     #6, FUNCTION, 2$					      ; 0455

		         06	  01   A2  E8 00034 1$:     BLBS    1(FIB), 3$						      ; 0457

	   02	         54	       06  E1 00038 	    BBC     #6, FUNCTION, 3$					      ;

				       14  BF 0003C 2$:     CHMU    #20							      ; 0458

				0000G  CF  D5 0003E 3$:     TSTL    CURRENT_WCB						      ; 0461

				       08  13 00042 	    BEQL    4$							      ;

	   04	         54	       07  E1 00044 	    BBC     #7, FUNCTION, 4$					      ;

				00A4   8F  BF 00048 	    CHMU    #164						      ; 0462

	   01	         54	       07  E0 0004C 4$:     BBS     #7, FUNCTION, 5$					      ; 0465

					   04 00050 	    RET     							      ;

		         03	  0B   AB  E9 00051 5$:     BLBC    11(CURRENT_VCB), 6$					      ; 0470



; Bliss-32 7.352	Saturday 21-AUG-1978 23:29:30	DBB3:[MTAACP.SRC]CREATE.B32;13					Page 2-3

; Digital Equipment Corporation

;

				     0000  30 00055 	    BSBW    CLOSE_FILE						      ;

				       01  DD 00058 6$:     PUSHL   #1							      ; 0472

		  0000G  CF	       01  FB 0005A 	    CALLS   #1, CHECK_ACCESS					      ;

      20   A3	         06	       00  ED 0005F 	    CMPZV   #0, #6, 32(PACKET), #50				      ; 0475

				       32     00064									      ;

				       08  13 00065 	    BEQL    7$							      ;

	   0F	         62	       03  E0 00067 	    BBS     #3, (FIB), 9$					      ; 0476

	   07	         62	       04  E0 0006B 	    BBS     #4, (FIB), 8$					      ;

		  0000G  CF	       00  FB 0006F 7$:     CALLS   #0, POSITION_TO_END					      ;

				       1E  11 00074 	    BRB     11$							      ; 0475

	   17	         62	       03  E1 00076 8$:     BBC     #3, (FIB), 10$					      ; 0479

				       03  DD 0007A 9$:     PUSHL   #3							      ; 0481

				       01  DD 0007C 	    PUSHL   #1							      ;

		  0000G  CF	       02  FB 0007E 	    CALLS   #2, MOUNT_VOL					      ;

		  0000G  CF	       00  FB 00083 	    CALLS   #0, READ_HDR					      ; 0482

		         09	       50  E8 00088 	    BLBS    R0, 11$						      ;

				0224   8F  BF 0008B 	    CHMU    #548						      ;

				       03  11 0008F 	    BRB     11$							      ; 0479

				     0000  30 00091 10$:    BSBW    GET_START_HDR					      ; 0484

	   21	    0B   AB	       01  E0 00094 11$:    BBS     #1, 11(CURRENT_VCB), 14$				      ; 0488

		  0000G  CF	       00  FB 00099 	    CALLS   #0, CHECK_FILE_ACC					      ; 0491

				  2E   AB  95 0009E 	    TSTB    46(CURRENT_VCB)					      ; 0492

				       05  12 000A1 	    BNEQ    12$							      ;

		         7E	       02  CE 000A3 	    MNEGL   #2, -(SP)						      ; 0493

				       0B  11 000A6 	    BRB     13$							      ;

		         7E	       01  CE 000A8 12$:    MNEGL   #1, -(SP)						      ; 0496

		  0000G  CF	       01  FB 000AB 	    CALLS   #1, SPACE_TM					      ;

		         7E	       01  CE 000B0 	    MNEGL   #1, -(SP)						      ; 0497

		  0000G  CF	       01  FB 000B3 13$:    CALLS   #1, SPACE						      ;

				       08  11 000B8 	    BRB     15$							      ; 0488

		         7E	       01  CE 000BA 14$:    MNEGL   #1, -(SP)						      ; 0501

		  0000G  CF	       01  FB 000BD 	    CALLS   #1, SPACE_TM					      ;

		  0000G  CF	       00  FB 000C2 15$:    CALLS   #0, FORMAT_HDRS					      ; 0504

				       7E  D4 000C7 	    CLRL    -(SP)						      ; 0505

				       5E  DD 000C9 	    PUSHL   SP							      ;

				0000V  CF  9F 000CB 	    PUSHAB  INIT_NEW_FILE					      ;

	      00000000G  9F	       03  FB 000CF 	    CALLS   #3, @#SYS$CMKRNL					      ;

				     0000  30 000D6 	    BSBW    WRITE_HEADERS					      ; 0506

				  04   A2  9F 000D9 	    PUSHAB  4(FIB)						      ; 0509

		  0000G  CF	       01  FB 000DC 	    CALLS   #1, FORMAT_FID					      ;

		    08   A2	  2F   AB  9B 000E1 	    MOVZBW  47(CURRENT_VCB), 8(FIB)				      ; 0510

	   07	         54	       06  E1 000E6 	    BBC     #6, FUNCTION, 16$					      ; 0513

				       2C  BB 000EA 	    PUSHR   #^M<R2,R3,R5>					      ;

		  0000V  CF	       03  FB 000EC 	    CALLS   #3, ACCESS_NEW_FILE					      ;

					   04 000F1 16$:    RET     							      ; 0391



; Routine Size:  242 bytes





;	0518	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:29:30	DBB3:[MTAACP.SRC]CREATE.B32;13					Page 3

; Digital Equipment Corporation

;

;	0519	GLOBAL ROUTINE ACCESS_NEW_FILE(FIB,PACKET,ABD) : COMMON_CALL NOVALUE  =

;	0520	

;	0521	!++

;	0522	!

;	0523	! FUNCTIONAL DESCRIPTION:

;	0524	!	THIS ROUTINE ACCESSES A NEWLY CREATED FILE

;	0525	!

;	0526	! CALLING SEQUENCE:

;	0527	!	ACCESS_NEW_FILE(ARG1,ARG2,ARG3)

;	0528	!

;	0529	! INPUT PARAMETERS:

;	0530	!	ARG1 - ADDRESS OF COPY OF USER FILE IDENTIFICATION BLOCK

;	0531	!	ARG2 - ADDRESS OF CURRENT IO REQUEST PACKET

;	0532	!	ARG3 - ADDRESS OF BUFFER DESCRIPTOR VECTORS

;	0533	!

;	0534	! IMPLICIT INPUTS:

;	0535	!	NONE

;	0536	!

;	0537	! OUTPUT PARAMETERS:

;	0538	!	NONE

;	0539	!

;	0540	! IMPLICIT OUTPUTS:

;	0541	!	CHANGES MADE TO SYSTEM DATA BASE TO ALLOW VIRTUAL IO

;	0542	!	USER LABELS AND TAPE MARK ARE WRITTEN

;	0543	!

;	0544	! ROUTINE VALUE:

;	0545	!	NONE

;	0546	!

;	0547	! SIDE EFFECTS:

;	0548	!	NONE

;	0549	!

;	0550	!--

;	0551	

;	0552	BEGIN

;	0553	

;	0554	EXTERNAL REGISTER

;	0555		COMMON_REG;

;	0556	

;	0557	

;	0558	MAP

;	0559		FIB:		REF BBLOCK,	!FILE INFORMATION BLOCK

;	0560		PACKET:		REF BBLOCK;	!ADDRESS OF IO REQUEST BLOCK

;	0561	

;	0562	! CREATE WINDOW, SETUP DATA BASE CONNECTIONS, COMPLETE IO, QUEUE AST

;	0563	! PICKUP USER LABELS, AND STARTUP VIRTUAL IO

;	0564	KERNEL_CALL(ACCESS_FILE,.FIB[FIB$L_ACCTL],.PACKET[IRP$L_PID],0,1,.ABD);

;	0565	IF .CURRENT_VCB[VCB$L_USRLBLAST] NEQ 0 THEN

;	0566	    IF KERNEL_CALL(QUEUE_AST) THEN BLOCK(VCB$M_WAIUSRLBL);

;	0567	WRITE_TM();

;	0568	KERNEL_CALL(START_VIO);

;	0569	

;	0570	END;					!END OF ROUTINE









; Bliss-32 7.352	Saturday 21-AUG-1978 23:29:30	DBB3:[MTAACP.SRC]CREATE.B32;13					Page 3-1

; Digital Equipment Corporation

;





					 0400 000F2 	    .ENTRY  ACCESS_NEW_FILE, Save R10				      ; 0519

		         5A 00000000G  9F  9E 000F4 	    MOVAB   @#SYS$CMKRNL, R10					      ;

				  0C   AC  DD 000FB 	    PUSHL   ABD							      ; 0564

				       01  DD 000FE 	    PUSHL   #1							      ;

				       7E  D4 00100 	    CLRL    -(SP)						      ;

		         50	  08   AC  D0 00102 	    MOVL    PACKET, R0						      ;

				  0C   A0  DD 00106 	    PUSHL   12(R0)						      ;

				  04   BC  DD 00109 	    PUSHL   @FIB						      ;

				       05  DD 0010C 	    PUSHL   #5							      ;

				       5E  DD 0010E 	    PUSHL   SP							      ;

				0000G  CF  9F 00110 	    PUSHAB  ACCESS_FILE						      ;

		         6A	       08  FB 00114 	    CALLS   #8, SYS$CMKRNL					      ;

				  44   AB  D5 00117 	    TSTL    68(CURRENT_VCB)					      ; 0565

				       15  13 0011A 	    BEQL    1$							      ;

				       7E  D4 0011C 	    CLRL    -(SP)						      ; 0566

				       5E  DD 0011E 	    PUSHL   SP							      ;

				0000G  CF  9F 00120 	    PUSHAB  QUEUE_AST						      ;

		         6A	       03  FB 00124 	    CALLS   #3, SYS$CMKRNL					      ;

		         07	       50  E9 00127 	    BLBC    R0, 1$						      ;

				       10  DD 0012A 	    PUSHL   #16							      ;

		  0000G  CF	       01  FB 0012C 	    CALLS   #1, BLOCK						      ;

				     0000  30 00131 1$:     BSBW    WRITE_TM						      ; 0567

				       7E  D4 00134 	    CLRL    -(SP)						      ; 0568

				       5E  DD 00136 	    PUSHL   SP							      ;

				0000G  CF  9F 00138 	    PUSHAB  START_VIO						      ;

		         6A	       03  FB 0013C 	    CALLS   #3, SYS$CMKRNL					      ;

					   04 0013F 	    RET     							      ; 0519



; Routine Size:  78 bytes





;	0571	

;	0572	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:29:30	DBB3:[MTAACP.SRC]CREATE.B32;13					Page 4

; Digital Equipment Corporation

;

;	0573	GLOBAL ROUTINE WRITE_HEADERS : L$WRITE_HEADER NOVALUE  =

;	0574	

;	0575	!++

;	0576	!

;	0577	! FUNCTIONAL DESCRIPTION:

;	0578	!	THIS ROUTINE INSERTS THE FILE SECTION AND SEQUENCE NUMBER INTO HDR1, INSERTS

;	0579	!	THE HEADER LABEL IDENTIFIERS, ZEROES THE BLOCK COUNT AND WRITES HDR1 AND HDR2

;	0580	!

;	0581	! CALLING SEQUENCE:

;	0582	!	WRITE_HEADERS()

;	0583	!

;	0584	! INPUT PARAMETERS:

;	0585	!	NONE

;	0586	!

;	0587	! IMPLICIT INPUTS:

;	0588	!	HDR1 AND HDR2 PARTIALLY FORMATTED

;	0589	!

;	0590	! OUTPUT PARAMETERS:

;	0591	!	NONE

;	0592	!

;	0593	! IMPLICIT OUTPUTS:

;	0594	!	HDR1 AND HDR2 WRITTEN

;	0595	!

;	0596	! ROUTINE VALUE:

;	0597	!	NONE

;	0598	!

;	0599	! SIDE EFFECTS:

;	0600	!	NONE

;	0601	!

;	0602	!--

;	0603	

;	0604	BEGIN

;	0605	

;	0606	EXTERNAL REGISTER

;	0607		COMMON_REG;

;	0608	

;	0609	

;	0610	LOCAL

;	0611		DESCR	: VECTOR [2];		!DESCRIPTOR FOR FILE SECTION AND SEQUENCE NUMBER

;	0612	

;	0613	! STORE FILE SECTION AND SEQUENCE NUMBER

;	0614	DESCR[0] = HD1$S_FILESECNO + HD1$S_FILESEQNO;

;	0615	DESCR[1] = HDR1[HD1$T_FILESECNO];

;	0616	SYS$FAO(DESCRIPTOR('!4ZW!4ZW'),,DESCR,.CURRENT_VCB[VCB$W_CUR_SEQ],

;	0617		.CURRENT_VCB[VCB$W_CUR_NUM]);

;	0618	

;	0619	! ZERO BLOCK COUNT

;	0620	CH$FILL('0',HD1$S_BLOCKCNT,HDR1[HD1$T_BLOCKCNT]);

;	0621	

;	0622	! INSERTS HEADER LABEL IDENTIFIERS

;	0623	HDR1[HD1$L_HD1LID] = 'HDR1';

;	0624	HDR2[HD2$L_HD2LID] = 'HDR2';

;	0625	

;	0626	! NOW WRITE HEADERS

;	0627	WRITE_BLOCK(.HDR1,80);



; Bliss-32 7.352	Saturday 21-AUG-1978 23:29:30	DBB3:[MTAACP.SRC]CREATE.B32;13					Page 4-1

; Digital Equipment Corporation

;

;	0628	WRITE_BLOCK(.HDR2,80);

;	0629	

;	0630	END;				!END OF ROUTINE







					      00140 P.AAB:  .ASCII  \!4ZW!4ZW\						      ;

					      00148 P.AAA:  .LONG   8							      ;

					      0014C 	    .ADDRESS  P.AAB						      ;







				007C   8F  BB 00150 WRITE_HEADERS::

							    PUSHR   #^M<R2,R3,R4,R5,R6>					      ; 0573

		         5E	       04  C2 00154 	    SUBL2   #4, SP						      ;

				       08  DD 00157 	    PUSHL   #8							      ; 0614

      04   AE	  0000G  CF	       1B  C1 00159 	    ADDL3   #27, HDR1, DESCR+4					      ; 0615

		         7E	  24   AB  3C 00160 	    MOVZWL  36(CURRENT_VCB), -(SP)				      ; 0616

		         7E	  26   AB  3C 00164 	    MOVZWL  38(CURRENT_VCB), -(SP)				      ;

				  08   AE  9F 00168 	    PUSHAB  DESCR						      ;

				       7E  D4 0016B 	    CLRL    -(SP)						      ;

				  D8   AF  9F 0016D 	    PUSHAB  P.AAA						      ;

	      00000000G  9F	       05  FB 00170 	    CALLS   #5, @#SYS$FAO					      ;

		         56	0000G  CF  D0 00177 	    MOVL    HDR1, R6						      ; 0620

	   30	         6E	       00  2C 0017C 	    MOVC5   #0, (SP), #48, #6, 54(R6)				      ;

		    36   A6	       06     00180									      ;

		         66 31524448   8F  D0 00183 	    MOVL    #827475016, (R6)					      ; 0623

		  0000G  DF 32524448   8F  D0 0018A 	    MOVL    #844252232, @HDR2					      ; 0624

		         7E	  50   8F  9A 00193 	    MOVZBL  #80, -(SP)						      ; 0627

				       56  DD 00197 	    PUSHL   R6							      ;

		  0000G  CF	       02  FB 00199 	    CALLS   #2, WRITE_BLOCK					      ;

		         7E	  50   8F  9A 0019E 	    MOVZBL  #80, -(SP)						      ; 0628

				0000G  CF  DD 001A2 	    PUSHL   HDR2						      ;

		  0000G  CF	       02  FB 001A6 	    CALLS   #2, WRITE_BLOCK					      ;

		         5E	       08  C0 001AB 	    ADDL2   #8, SP						      ; 0573

				007C   8F  BA 001AE 	    POPR    #^M<R2,R3,R4,R5,R6>					      ;

					   05 001B2 	    RSB     							      ;



; Routine Size:  99 bytes





;	0631	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:29:30	DBB3:[MTAACP.SRC]CREATE.B32;13					Page 5

; Digital Equipment Corporation

;

;	0632	ROUTINE INIT_NEW_FILE : COMMON_CALL NOVALUE  =

;	0633	

;	0634	!++

;	0635	!

;	0636	! FUNCTIONAL DESCRIPTION:

;	0637	!	THIS ROUTINE INITIALIZES THE FILE IDENTIFIER AND SETS STATUS

;	0638	!	INDICATORS.

;	0639	!

;	0640	! CALLING SEQUENCE:

;	0641	!	INIT_NEW_FILE(), CALLED IN KERNEL MODE

;	0642	!

;	0643	! INPUT PARAMETERS:

;	0644	!	NONE

;	0645	!

;	0646	! IMPLICIT INPUTS:

;	0647	!	CURRENT_VCB - ADDRESS OF CURRENT VOLUME CONTROL BLOCK

;	0648	!

;	0649	! OUTPUT PARAMETERS:

;	0650	!	NONE

;	0651	!

;	0652	! IMPLICIT OUTPUTS:

;	0653	!	CURRENT FILE ID, STARLET FILE INDICATOR, AND LOG END_OF_VOLUME

;	0654	!	SET UPDATED

;	0655	!

;	0656	! ROUTINE VALUE:

;	0657	!	NONE

;	0658	!

;	0659	! SIDE EFFECTS:

;	0660	!	NONE

;	0661	!

;	0662	!--

;	0663	

;	0664	BEGIN

;	0665	

;	0666	EXTERNAL REGISTER

;	0667		COMMON_REG;

;	0668	

;	0669	

;	0670	! IF END OF VOLUME SET OR DUMMY FILE, INC FILE NUMBER

;	0671	IF .CURRENT_VCB[VCB$V_LOGICEOVS] 

;	0672	OR (.CURRENT_VCB[VCB$B_CUR_RVN] EQL 1 AND .CURRENT_VCB[VCB$W_CUR_NUM] EQL 0)

;	0673	THEN CURRENT_VCB[VCB$W_CUR_NUM] = .CURRENT_VCB[VCB$W_CUR_NUM] + 1;

;	0674	

;	0675	CURRENT_VCB[VCB$W_CUR_SEQ] = 1;

;	0676	CURRENT_VCB[VCB$V_STARFILE] = 1;

;	0677	

;	0678	! SET STATUS INDICATORS TO SHOW PARTIAL FILE AND NOT AT END OF VOLUME SET

;	0679	CURRENT_VCB[VCB$V_LOGICEOVS] = 0;

;	0680	CURRENT_VCB[VCB$V_PARTFILE] = 1;

;	0681	END;			!END OF ROUTINE













; Bliss-32 7.352	Saturday 21-AUG-1978 23:29:30	DBB3:[MTAACP.SRC]CREATE.B32;13					Page 5-1

; Digital Equipment Corporation

;

					 0000 001B3 INIT_NEW_FILE:

							    .WORD   Save nothing					      ; 0632

	   0B	    0B   AB	       01  E0 001B5 	    BBS     #1, 11(CURRENT_VCB), 1$				      ; 0671

		         01	  2F   AB  91 001BA 	    CMPB    47(CURRENT_VCB), #1					      ; 0672

				       08  12 001BE 	    BNEQ    2$							      ;

				  24   AB  B5 001C0 	    TSTW    36(CURRENT_VCB)					      ;

				       03  12 001C3 	    BNEQ    2$							      ;

				  24   AB  B6 001C5 1$:     INCW    36(CURRENT_VCB)					      ; 0673

		    26   AB	       01  B0 001C8 2$:     MOVW    #1, 38(CURRENT_VCB)					      ; 0675

		    2D   AB	       01  88 001CC 	    BISB2   #1, 45(CURRENT_VCB)					      ; 0676

		    0B   AB	       02  8A 001D0 	    BICB2   #2, 11(CURRENT_VCB)					      ; 0679

		    0B   AB	       01  88 001D4 	    BISB2   #1, 11(CURRENT_VCB)					      ; 0680

					   04 001D8 	    RET     							      ; 0632



; Routine Size:  38 bytes





;	0682	

;	0683	END

;	0684	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $CODE$         	   473  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        43         0       255











; Size:		457 code + 16 data bytes

; Run Time:	00:13.4

; Elapsed Time:	00:24.7

; Memory Used:	310 pages

; Compilation Complete

