

; Bliss-32 7.352	Saturday 21-AUG-1978 23:38:05	DBB3:[MTAACP.SRC]MODIFY.B32;9					Page 1

; Digital Equipment Corporation

;

;	0001	MODULE MODIFY (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'A0002'

;	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 EXECUTES THE MODIFY FUNCTION

;	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:  18-JUL-77

;	0042	  

;	0043	!

;	0044	! REVISION HISTORY:

;	0045	!

;	0046	!   D. H. Gillespie, 12-May-78  14:19

;	0047	!   A0001 - change CURRENT_VCB to a register

;	0048	!

;	0049	!   D. H. Gillespie, 23-May-78  9:34

;	0050	!   A0002 - add NOTUSED

;	0051	!

;	0052	!**

;	0053	

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

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



; Bliss-32 7.352	Saturday 21-AUG-1978 23:38:05	DBB3:[MTAACP.SRC]MODIFY.B32;9					Page 1-1

; Digital Equipment Corporation

;

;	0351	

;	0352	FORWARD ROUTINE

;	0353		INS_USRLBL_ID	: COMMON_CALL NOVALUE,	!INSERT INTO USER LABEL THE USER LABEL ID

;	0354		MTA_MODIFY	: NOPRES NOVALUE,	!MAIN CONTROL FOR MODIFY ACP FUNCTION

;	0355		TURN_OFF_WRITE	: COMMON_CALL NOVALUE,	!TURN OF EXCLUSIVE WRITE

;	0356		UPDATE_MUSTCLOS	: COMMON_CALL NOVALUE;	!INDICATE MUST CLOSE FILE

;	0357	

;	0358	MACRO	MAX	= 0,0,8,0%;			!MAXIMUM SIZE OF ATTRIBUTE GIVEN IN ATR_TABLE

;	0359	

;	0360	EXTERNAL

;	0361		ATR_TABLE	: BBLOCKVECTOR[MAX_ATTR_CODE,1],	!ATTRIBUTE TABLE

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

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

;	0364		IO_PACKET	: REF BBLOCK;		!ADDRESS OF CURRENT IO REQUEST PACKET

;	0365	

;	0366	EXTERNAL ROUTINE

;	0367		CLOSE_FILE	: L$CLOSE_FILE,		!CLOSE THE FILE OPEN FOR WRITE

;	0368		COMPLETE_USRLBL,			!COMPLETE PROCESSING OF USER LABELS

;	0369		GET_FIB,				!GET COPY OF USER'S FILE INFO BLOCK

;	0370		UNBLOCK,				!UNBLOCK PROCESSING FOR USER LABEL PROCESSING COMPLETION

;	0371		WRITE_BLOCK	: NOVALUE,		!WRITE LOGICAL BLOCK

;	0372		WRITE_TRAILERS	: L$WRITE_TRAILER NOVALUE;	!WRITE EOF1 AND EOF2



; Bliss-32 7.352	Saturday 21-AUG-1978 23:38:05	DBB3:[MTAACP.SRC]MODIFY.B32;9					Page 2

; Digital Equipment Corporation

;

;	0373	GLOBAL ROUTINE MTA_MODIFY : NOPRES NOVALUE  =

;	0374	

;	0375	!++

;	0376	!

;	0377	! FUNCTIONAL DESCRIPTION:

;	0378	!	THIS ROUTINE EXECUTES THE MODIFY FUNCTION

;	0379	!

;	0380	! CALLING SEQUENCE:

;	0381	!	MTA_MODIFY()

;	0382	!

;	0383	! INPUT PARAMETERS:

;	0384	!	NONE

;	0385	!

;	0386	! IMPLICIT INPUTS:

;	0387	!	IO_PACKET - ADDRESS OF CURRENT IO REQUEST PACKET

;	0388	!

;	0389	! OUTPUT PARAMETERS:

;	0390	!	NONE

;	0391	!

;	0392	! IMPLICIT OUTPUTS:

;	0393	!	NONE

;	0394	!

;	0395	! ROUTINE VALUE:

;	0396	!	NONE

;	0397	!

;	0398	! SIDE EFFECTS:

;	0399	!	THIS ROUTINE ONLY HANDLES USER LABELS AND END USER LABEL PROCESSING WITH

;	0400	!	NEXT AST

;	0401	!

;	0402	!--

;	0403	

;	0404	BEGIN

;	0405	

;	0406	EXTERNAL REGISTER

;	0407		COMMON_REG;

;	0408	

;	0409	

;	0410	LOCAL

;	0411		ABD		: REF BBLOCKVECTOR [,ABD$C_LENGTH],	!ADDRESS OF DESCRIPTOR VECTOR

;	0412		AST_BLOCK	: REF BBLOCK,		!ADDRESS OF AST CONTROL BLOCK

;	0413		CODE,					!ATTRIBUTE CODE

;	0414		COUNT,					!NUMBER OF CHAR IN ATTRIBUTE

;	0415		MODE,

;	0416		LENGTH,

;	0417		P,					!POINTER TO ATTRIBUTE

;	0418		PACKET		: REF BBLOCK;		!IO PACKET ADDRESS

;	0419	

;	0420	

;	0421	PACKET = .IO_PACKET;

;	0422	ABD = .BBLOCK[.PACKET[IRP$L_SVAPTE],AIB$L_DESCRIPT];

;	0423	GET_FIB(.ABD);

;	0424	

;	0425	INCRU I FROM ABD$C_ATTRIB TO .PACKET[IRP$W_BCNT] -1 DO

;	0426	    BEGIN

;	0427	    P = .ABD[.I,ABD$W_TEXT] + ABD[.I,ABD$W_TEXT];



; Bliss-32 7.352	Saturday 21-AUG-1978 23:38:05	DBB3:[MTAACP.SRC]MODIFY.B32;9					Page 2-1

; Digital Equipment Corporation

;

;	0428	    COUNT = .ABD[.I,ABD$W_COUNT];

;	0429	    CODE = .(.P)<0,8> - 1;

;	0430	    P = .P + 1;

;	0431	    IF .CODE GTRU MAX_ATTR_CODE - 1

;	0432	    THEN ERR_EXIT(SS$_BADATTRIB);

;	0433	

;	0434	! ONLY ATTRIBUTES THAT CAN BE MODIFIED ARE USER LABELS AND END USER LABELS

;	0435	    IF .CODE EQL ATR$C_USERLABEL - 1 THEN

;	0436		BEGIN

;	0437		ERR_EXIT(SS$_BADATTRIB);

;	0438	!	IF .COUNT GTRU 80 OR .COUNT LSS 18 THEN ERR_EXIT(SS$_BADATTRIB);

;	0439	!	IF .CURRENT_WCB EQL 0 THEN ERR_EXIT(SS$_ILLUSRLBLWT);

;	0440	!	IF .CURRENT_WCB[WCB$V_READ] THEN ERR_EXIT(SS$_ILLUSRLBLWT);

;	0441	!	IF .CURRENT_VCB[VCB$B_TM] EQL 1 THEN

;	0442	! WHEN REQUEST TO WRITE USER LABEL IS RECEIVED WHEN IN THE DATA AREA

;	0443	! THEN A FORCED CLOSE TAKES PLACE

;	0444	!	    BEGIN

;	0445	!	    KERNEL_CALL(UPDATE_MUSTCLOS);

;	0446	!	    WRITE_TRAILERS('F');

;	0447	!	    END;

;	0448	!	IF NOT .CURRENT_VCB[VCB$V_WAIUSRLBL]

;	0449	!	AND NOT (.HDR1[EO1$L_EO1LID] EQL 'EOF1'

;	0450	!	    AND .CURRENT_VCB[VCB$B_TM] EQL 2) THEN ERR_EXIT (SS$_ILLUSRLBLWT);

;	0451	!	KERNEL_CALL(INS_USRLBL_ID,.P);

;	0452	!	WRITE_BLOCK(.P,.COUNT);		!WRITE USER LABEL

;	0453		END;

;	0454	

;	0455	! END OF USER LABEL PROCESSING WITH NEXT AST

;	0456	    IF .CODE EQL ATR$C_ENDLBLAST-1 THEN 

;	0457		BEGIN

;	0458		ERR_EXIT(SS$_BADATTRIB);

;	0459	!	IF .COUNT NEQ 4 THEN ERR_EXIT(SS$_BADATTRIB);

;	0460	!	IF .CURRENT_WCB EQL 0 THEN ERR_EXIT(SS$_ILLUSRLBLWT);

;	0461	!	IF .CURRENT_WCB[WCB$V_READ] THEN ERR_EXIT(SS$_ILLUSRLBLWT);

;	0462	!	IF NOT .CURRENT_VCB[VCB$V_WAIUSRLBL]

;	0463	!	AND NOT .CURRENT_VCB[VCB$V_MUSTCLOSE] THEN ERR_EXIT(SS$_ILLUSRLBLWT);

;	0464	!	AST_BLOCK = .(.P);

;	0465	!	BEGIN

;	0466	!	BUILTIN PROBER;

;	0467	!	MODE = 0;

;	0468	!	LENGTH = 4;

;	0469	!	IF .AST_BLOCK NEQ 0 

;	0470	!	AND (NOT PROBER(MODE,LENGTH,.AST_BLOCK)

;	0471	!	OR .AST_BLOCK[ACB$B_TYPE] NEQ DYN$C_ACB)

;	0472	!	THEN ERR_EXIT(SS$_ILLLBLAST);

;	0473	!	END;

;	0474	!	IF .CURRENT_VCB[VCB$V_MUSTCLOSE] THEN

;	0475	!	    BEGIN

;	0476	!	    CLOSE_FILE();

;	0477	!	    KERNEL_CALL(TURN_OFF_WRITE);

;	0478	!	    END;

;	0479	!	KERNEL_CALL(COMPLETE_USRLBL,.AST_BLOCK,.I,.ABD);

;	0480	

;	0481	! IF UNBLOCK NECESSARY DO IT NOW

;	0482	!	IF .CURRENT_VCB[VCB$V_WAIUSRLBL] THEN UNBLOCK(.CURRENT_VCB);



; Bliss-32 7.352	Saturday 21-AUG-1978 23:38:05	DBB3:[MTAACP.SRC]MODIFY.B32;9					Page 2-2

; Digital Equipment Corporation

;

;	0483		END;

;	0484	    END;

;	0485	

;	0486	END;						!END OF ROUTINE





							    .TITLE  MODIFY

							    .IDENT  \A0002\



							    .GLOBL  ATR_TABLE, CURRENT_WCB, HDR1, IO_PACKET, CLOSE_FILE

							    .GLOBL  COMPLETE_USRLBL, GET_FIB, UNBLOCK, WRITE_BLOCK

							    .GLOBL  WRITE_TRAILERS



							    .PSECT  $CODE$,NOWRT,2



					 0000 00000 	    .ENTRY  MTA_MODIFY, Save nothing				      ; 0373

		         52	0000G  CF  D0 00002 	    MOVL    IO_PACKET, PACKET					      ; 0421

		         53	  2C   B2  D0 00007 	    MOVL    @44(PACKET), ABD					      ; 0422

				       53  DD 0000B 	    PUSHL   ABD							      ; 0423

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

		         55	  32   A2  3C 00012 	    MOVZWL  50(PACKET), R5					      ; 0425

				       55  D7 00016 	    DECL    R5							      ;

		         50	       05  D0 00018 	    MOVL    #5, I						      ;

				       2D  11 0001B 	    BRB     5$							      ;

		         51	     6340  7E 0001D 1$:     MOVAQ   (ABD)[I], R1					      ; 0427

		         54	       61  3C 00021 	    MOVZWL  (R1), P						      ;

		         54	       51  C0 00024 	    ADDL2   R1, P						      ;

				  02 A340  7F 00027 	    PUSHAQ  2(ABD)[I]						      ; 0428

		         56	       9E  3C 0002B 	    MOVZWL  @(SP)+, COUNT					      ;

		         52	       84  9A 0002E 	    MOVZBL  (P)+, CODE						      ; 0429

				       52  D7 00031 	    DECL    CODE						      ;

		         18	       52  D1 00033 	    CMPL    CODE, #24						      ; 0431

				       02  1B 00036 	    BLEQU   2$							      ;

				       34  BF 00038 	    CHMU    #52							      ; 0432

		         0B	       52  D1 0003A 2$:     CMPL    CODE, #11						      ; 0435

				       02  12 0003D 	    BNEQ    3$							      ;

				       34  BF 0003F 	    CHMU    #52							      ; 0437

		         0E	       52  D1 00041 3$:     CMPL    CODE, #14						      ; 0456

				       02  12 00044 	    BNEQ    4$							      ;

				       34  BF 00046 	    CHMU    #52							      ; 0458

				       50  D6 00048 4$:     INCL    I							      ; 0425

		         55	       50  D1 0004A 5$:     CMPL    I, R5						      ;

				       CE  1B 0004D 	    BLEQU   1$							      ;

					   04 0004F 	    RET     							      ; 0373



; Routine Size:  80 bytes





;	0487	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:38:05	DBB3:[MTAACP.SRC]MODIFY.B32;9					Page 3

; Digital Equipment Corporation

;

;	0488	ROUTINE TURN_OFF_WRITE : COMMON_CALL NOVALUE  =

;	0489	

;	0490	!++

;	0491	!

;	0492	! FUNCTIONAL DESCRIPTION:

;	0493	!	THIS ROUTINE NOTES THAT EXCLUSIVE WRITING IS NO LONGER TAKING PLACE

;	0494	!

;	0495	! CALLING SEQUENCE:

;	0496	!	TURN_OFF_WRITE(), KERNEL MODE

;	0497	!

;	0498	! INPUT PARAMETERS:

;	0499	!	NONE

;	0500	!

;	0501	! IMPLICIT INPUTS:

;	0502	!	NONE

;	0503	!

;	0504	! OUTPUT PARAMETERS:

;	0505	!	NONE

;	0506	!

;	0507	! IMPLICIT OUTPUTS:

;	0508	!	NONE

;	0509	!

;	0510	! ROUTINE VALUE:

;	0511	!	NONE

;	0512	!

;	0513	! SIDE EFFECTS:

;	0514	!	THE WINDOW NO LONGER MAPS VIRTUAL I/O

;	0515	!

;	0516	! USER ERRORS:

;	0517	!	NONE

;	0518	!

;	0519	!--

;	0520	

;	0521	BEGIN

;	0522	

;	0523	EXTERNAL REGISTER

;	0524		COMMON_REG;

;	0525	

;	0526	CURRENT_WCB[WCB$V_READ] = 1;		!WRITING AND READING

;	0527	

;	0528	END;











					 0000 00050 TURN_OFF_WRITE:

							    .WORD   Save nothing					      ; 0488

		         50	0000G  CF  D0 00052 	    MOVL    CURRENT_WCB, R0					      ; 0526

		    0B   A0	       01  88 00057 	    BISB2   #1, 11(R0)						      ;

					   04 0005B 	    RET     							      ; 0488



; Routine Size:  12 bytes







; Bliss-32 7.352	Saturday 21-AUG-1978 23:38:05	DBB3:[MTAACP.SRC]MODIFY.B32;9					Page 3-1

; Digital Equipment Corporation

;



; Bliss-32 7.352	Saturday 21-AUG-1978 23:38:05	DBB3:[MTAACP.SRC]MODIFY.B32;9					Page 4

; Digital Equipment Corporation

;

;	0529	ROUTINE UPDATE_MUSTCLOS : COMMON_CALL NOVALUE  =

;	0530	

;	0531	!++

;	0532	!

;	0533	! FUNCTIONAL DESCRIPTION:

;	0534	!	THIS ROUTINE NOTES THAT THE FILE MUST BE CLOSE AND INHIBITS ANY

;	0535	!	MORE VIRTUAL READS OR WRITES

;	0536	!

;	0537	! CALLING SEQUENCE:

;	0538	!	UPDATE_MUSTCLOS(), KERNEL MODE

;	0539	!

;	0540	! INPUT PARAMETERS:

;	0541	!	NONE

;	0542	!

;	0543	! IMPLICIT INPUTS:

;	0544	!	CURRENT_WCB	- ADDRESS OF CURRENT WINDOW CONTROL BLOCK

;	0545	!	CURRENT_VCB	- ADDRESS OF CURRENT VOLUME CONTROL BLOCK

;	0546	!

;	0547	! OUTPUT PARAMETERS:

;	0548	!	NONE

;	0549	!

;	0550	! IMPLICIT OUTPUTS:

;	0551	!	NONE

;	0552	!

;	0553	! ROUTINE VALUE:

;	0554	!	NONE

;	0555	!

;	0556	! SIDE EFFECTS:

;	0557	!	NONE

;	0558	!

;	0559	! USER ERRORS:

;	0560	!	NONE

;	0561	!

;	0562	!--

;	0563	

;	0564	BEGIN

;	0565	

;	0566	EXTERNAL REGISTER

;	0567		COMMON_REG;

;	0568	

;	0569	

;	0570	CURRENT_WCB[WCB$W_NMAP] = 0;

;	0571	CURRENT_VCB[VCB$V_MUSTCLOSE] = 1;

;	0572	

;	0573	END;











					 0000 0005C UPDATE_MUSTCLOS:

							    .WORD   Save nothing					      ; 0529

		         50	0000G  CF  D0 0005E 	    MOVL    CURRENT_WCB, R0					      ; 0570

				  16   A0  B4 00063 	    CLRW    22(R0)						      ;

		    0B   AB	  40   8F  88 00066 	    BISB2   #64, 11(CURRENT_VCB)				      ; 0571



; Bliss-32 7.352	Saturday 21-AUG-1978 23:38:05	DBB3:[MTAACP.SRC]MODIFY.B32;9					Page 4-1

; Digital Equipment Corporation

;

					   04 0006B 	    RET     							      ; 0529



; Routine Size:  16 bytes





;	0574	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:38:05	DBB3:[MTAACP.SRC]MODIFY.B32;9					Page 5

; Digital Equipment Corporation

;

;	0575	ROUTINE INS_USRLBL_ID(ADDR) : COMMON_CALL NOVALUE  =

;	0576	

;	0577	!++

;	0578	!

;	0579	! FUNCTIONAL DESCRIPTION:

;	0580	!	THIS ROUTINE INSERTS THE USER LABEL ID INTO THE USER LABEL

;	0581	!

;	0582	! CALLING SEQUENCE:

;	0583	!	INS_USRLBL_ID(ARG1), CALLED IN KERNEL MODE

;	0584	!

;	0585	! INPUT PARAMETERS:

;	0586	!	ARG1 - ADDRESS OF USER LABEL

;	0587	!

;	0588	! IMPLICIT INPUTS:

;	0589	!	NONE

;	0590	!

;	0591	! OUTPUT PARAMETERS:

;	0592	!	NONE

;	0593	!

;	0594	! IMPLICIT OUTPUTS:

;	0595	!	FIRST THREE CHARACTERS OF USER LABEL EITHER 'UHL' OR 'UTL'

;	0596	!

;	0597	! ROUTINE VALUE:

;	0598	!	NONE

;	0599	!

;	0600	! SIDE EFFECTS:

;	0601	!	NONE

;	0602	!

;	0603	! USER ERRORS:

;	0604	!	NONE

;	0605	!

;	0606	!--

;	0607	

;	0608	BEGIN

;	0609	

;	0610	EXTERNAL REGISTER

;	0611		COMMON_REG;

;	0612	

;	0613	IF .CURRENT_VCB[VCB$B_TM] EQL 0 THEN (.ADDR)<0,24> = 'UHL' ELSE (.ADDR)<0,24> = 'UTL';

;	0614	END;			!END OF ROUTINE











					 0000 0006C INS_USRLBL_ID:

							    .WORD   Save nothing					      ; 0575

				  2E   AB  95 0006E 	    TSTB    46(CURRENT_VCB)					      ; 0613

				       0B  12 00071 	    BNEQ    1$							      ;

	   18	         00 004C4855   8F  F0 00073 	    INSV    #4999253, #0, #24, @ADDR				      ;

				  04   BC     0007B									      ;

					   04 0007D 	    RET     							      ;

	   18	         00 004C5455   8F  F0 0007E 1$:     INSV    #5002325, #0, #24, @ADDR				      ;

				  04   BC     00086									      ;

					   04 00088 	    RET     							      ; 0575



; Bliss-32 7.352	Saturday 21-AUG-1978 23:38:05	DBB3:[MTAACP.SRC]MODIFY.B32;9					Page 5-1

; Digital Equipment Corporation

;



; Routine Size:  29 bytes





;	0615	END

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

;

;  DBA4:[SYSLIB]LIB.L32;1		      5582        20         0       235











;	0617	

; Size:		137 code + 0 data bytes

; Run Time:	00:07.3

; Elapsed Time:	00:21.4

; Memory Used:	270 pages

; Compilation Complete

