PIPUNL M0204, UNLOCK COMMAND - 	MACRO M1110  22-AUG-78 01:37

TABLE OF CONTENTS



     7-    1	**** PIPUNL VERSION M0204 ****

PIPUNL M0204, UNLOCK COMMAND - 	MACRO M1110  22-AUG-78 01:37  PAGE 7





      1						.TITLE	PIPUNL M0204, UNLOCK COMMAND - PIP

						.SBTTL	**** PIPUNL VERSION M0204 ****

						.IDENT	/M0204/

      2					; ALTERED WEDNESDAY 8-JAN-75 12:45

      3					;

      4					;

      5					; B. SCHREIBER	27-AUG-77

      6					;

      7					;	BLS025 -- ADD EXIT WITH STATUS

      8					;

      9					; B. SCHREIBER	7-JUN-78

     10					;

     11					;	BLS052 -- INTEGRATE ODS-2 CHANGES FROM A. GOLDSTEIN AND E.

     12					;		MARISON.

     13					;

     14					; COPYRIGHT (C) 1978, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.

     15					; COPYRIGHT (C) 1977, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.

     16					; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD MASS.

     17

     18					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE

     19					; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION

     20					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT

     21					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.

     22

     23					; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT

     24					; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL

     25					; EQUIPMENT CORPORATION.

     26

     27					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY

     28					; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

     29					;

     30					; PETER H. LIPMAN	2-MAY-74

     31

     32						.MCALL	FDOF$L

     33	000000					FDOF$L			;DEFINE THE FDB OFFSETS LOCALLY

     34					;

     35						.MCALL	CALL,RETURN

     36

     37

     38	000000					PURE.I

     39

     40					; UNLOCK A LOCKED FILE

     41	000000				UNLOCK::

     42	000000	012701 	001000 			MOV	#1000,R1

     43	000004					CALL	.DYALC		;ALLOCATE A HEADER BUFFER

     44	000010	010067 	000000G			MOV	R0,.HDRAD	;AND SAVE IT'S ADDRESS

     45	000014					CALL	FSTOUT

     46	000020	012700 	000000G			MOV	#FDBOUT,R0

     47	000024	052767 	000000G	000000G	UNLCK1:	BIS	#FRSTIM,CPYCTL

     48	000032					CALL	PARSE

     49	000036	103003 				BCC	10$

     50	000040					CALL	PRSERR

     51	000044	000464 				BR	ULKNXT

     52	000046	016067 	000120 	000000G	10$:	MOV	F.FVER(R0),VERSAV

     53	000054				UNLCK2:										;BLS052

     54						.IF NDF	O$$DS2								;BLS052

     55						MOV	VERSAV,F.FVER(R0)						;BLS052

PIPUNL M0204, UNLOCK COMMAND - 	MACRO M1110  22-AUG-78 01:37  PAGE 7-1

**** PIPUNL VERSION M0204 ****



     56						.ENDC									;BLS052

     57	000054					CALL	FNDNXT								;**-1

     58	000060	103441 				BCS	65$

     59	000062	042767 	000000G	000000G		BIC	#FRSTIM,CPYCTL

     60					; READ THE FILE ATTRIBUTES

     61	000070					CALL	RDATT

     62	000074	103436 				BCS	70$

     63					;

     64					; NOW VERIFY THAT FILE IS LOCKED

     65	000076	016705 	000000G			MOV	.HDRAD,R5	;ADDRESS OF HEADER BUFFER TO R5

     66						.IF DF	O$$DS2								;BLS052

     67	000102	062705 	000064 			ADD	#AB.CHU,R5	;EHM026 R5=ADDRESS OF CHARACTERISTICS BYTE	;BLS052

     68						.IFF									;BLS052

     69						ADD	#HH.CHU,R5	;R5=ADDRESS OF CHARACTERISTICS BYTE

     70						.ENDC									;BLS052

     71	000106	132715 	000000G			BITB	#HS.PHL,(R5)

     72	000112	001420 				BEQ	40$		;BRANCH HF FILE NOT LOCKED

     73	000114	142715 	000000G			BICB	#HS.PHL,(R5)	;CLEAR THE LOCK BIT

     74					;

     75					; SET UP TO WRITE THE USER CHARACTERISTICS BACK TO THE FILE

     76					; FIRST PUT AN ATTRIBUTE BLOCK ON THE STACK

     77	000120	005046 				CLR	-(SP)

     78	000122	010546 				MOV	R5,-(SP)	;ADDRESS OF BYTE TO WRITE

     79	000124	012746 	000000G			MOV	#HA.CHU,-(SP)	;ATTRIBUTE CODE AND BYTE COUNT

     80	000130	010601 				MOV	SP,R1		;R1=ADDRESS OF ATTRIBUTE BLOCK

     81	000132					CALL	WRTATT		;WRITE THE ATTRIBUTES

     82	000136	062706 	000006 			ADD	#6,SP		;CLEAN UP THE STACK

     83	000142	000420 				BR	ULKNX1

     84					;

     85					; BAD SYNTAX FOR UNLOCK COMMAND

     86	000144				20$:	ERROUT	UN04

	000144	104402 				TRAP	X

	000146	000000G				.WORD	UN04SZ

	000150	000000G				.WORD	UN04MG

     87	000152	000424 				BR	UNLKX1

     88					;

     89					; FILE ALREADY UNLOCKED

     90	000154				40$:	ERROUT	UN03,0

	000154	104406 				TRAP	X

	000156	000000G				.WORD	UN03SZ

	000160	000000G				.WORD	UN03MG

     91	000162	000406 				BR	80$

     92					;

     93					; FIND ERROR

     94	000164				65$:	CALL	FNDERR

     95	000170	000412 				BR	ULKNXT

     96					;

     97					; ERROR FROM READ ATTRIBUTES

     98	000172				70$:	ERROUT	UN02,0,0

	000172	104426 				TRAP	X

	000174	000000G				.WORD	UN02SZ

	000176	000000G				.WORD	UN02MG

     99	000200				80$:	CALL	SETWAR		;SET WARNING STATUS

    100					;

    101					; COME HERE TO CONTINUE WITH NEXT FILE IN WILD CARD CLASS

    102	000204	012700 	000000G		ULKNX1:	MOV	#FDBOUT,R0

    103	000210					CALL	NXTFIL		;ANY MORE FILES IN THIS FILE SPEC?

PIPUNL M0204, UNLOCK COMMAND - 	MACRO M1110  22-AUG-78 01:37  PAGE 7-2

**** PIPUNL VERSION M0204 ****



    104	000214	103317 				BCC	UNLCK2		;BRANCH IF YES

    105					;

    106					; COME HERE TO CONTINUE WITH THE NEXT FILE SPECIFIER

    107	000216				ULKNXT:	CALL	NXTOUT

    108	000222	103300 				BCC	UNLCK1

    109	000224	000167 	000000G		UNLKX1:	JMP	CLOSX

    110

    111					;

    112					;

    113		000001 				.END

PIPUNL M0204, UNLOCK COMMAND - 	MACRO M1110  22-AUG-78 01:37  PAGE 7-3

SYMBOL TABLE



AB.CDT  000105   	F.BKDN= 000026   	F.MBC1= 000055   	NXTOUT= ****** GX	S.FNB = 000036

AB.CHU  000064   	F.BKDS= 000020   	F.MBFG= 000056   	N.DID = 000024   	S.FNBW= 000017

AB.EXP  000122   	F.BKEF= 000050   	F.NRBD= 000024   	N.DVNM= 000032   	S.FNTY= 000004

AB.FNU  000000   	F.BKP1= 000051   	F.NREC= 000030   	N.FID = 000000   	S.FTYP= 000002

AB.FP   000062   	F.BKST= 000024   	F.OVBS= 000030   	N.FNAM= 000006   	S.NFEN= 000020

AB.FSQ  000002   	F.BKVB= 000064   	F.RACC= 000016   	N.FTYP= 000014   	ULKNXT  000216R     002

AB.GC   000061   	F.CHR = 000075   	F.RATT= 000001   	N.FVER= 000016   	ULKNX1  000204R     002

AB.NAM  000006   	F.CNTG= 000034   	F.RCNM= 000034   	N.NEXT= 000022   	UNLCK1  000024R     002

AB.PC   000060   	F.DFNB= 000046   	F.RCTL= 000017   	N.STAT= 000020   	UNLCK2  000054R     002

AB.RDT  000070   	F.DSPT= 000044   	F.RSIZ= 000002   	N.UNIT= 000034   	UNLKX1  000224R     002

AB.REV  000066   	F.DVNM= 000134   	F.RTYP= 000000   	O$$DS2= 000001   	UNLOCK  000000RG    002

AB.UAT  000020   	F.EFBK= 000010   	F.SEQN= 000100   	PARSE = ****** GX	UN02MG= ****** GX

CLOSX = ****** GX	F.EFN = 000050   	F.SPDV= 000072   	PRSERR= ****** GX	UN02SZ= ****** GX

CPYCTL= ****** GX	F.EOBB= 000032   	F.SPUN= 000074   	RDATT = ****** GX	UN03MG= ****** GX

FDBOUT= ****** GX	F.ERR = 000052   	F.STBK= 000036   	R$$DPB= 000001   	UN03SZ= ****** GX

FNDERR= ****** GX	F.FACC= 000043   	F.UNIT= 000136   	R$$DYM= 000001   	UN04MG= ****** GX

FNDNXT= ****** GX	F.FFBY= 000014   	F.URBD= 000020   	R$$EIS= 000000   	UN04SZ= ****** GX

FRSTIM= ****** GX	F.FNAM= 000110   	F.VBN = 000064   	R$$VMS= 000001   	VERSAV= ****** GX

FSTOUT= ****** GX	F.FNB = 000102   	F.VBSZ= 000060   	R$$11M= 000001   	WRTATT= ****** GX

F.ACTL= 000076   	F.FTYP= 000116   	HA.CHU= ****** GX	SETWAR= ****** GX	X     = 000026

F.ALOC= 000040   	F.FVER= 000120   	HS.PHL= ****** GX	S.FATT= 000016   	.DYALC= ****** GX

F.BBFS= 000062   	F.HIBK= 000004   	NB.NXD= 020000   	S.FDB = 000140   	.HDRAD= ****** GX

F.BDB = 000070   	F.LUN = 000042   	NB.WLV= 010000   	S.FNAM= 000006   	...TPC= 000140

F.BGBC= 000057   	F.MBCT= 000054   	NXTFIL= ****** GX



. ABS.	000131	   000

      	000000	   001

PURE$I	000230	   002

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  3784 WORDS  ( 15 PAGES)

DYNAMIC MEMORY:  4884 WORDS  ( 18 PAGES)

ELAPSED TIME:  00:00:14

OBJ$:PIPUNL,LIS$:PIPUNL/-SP=SRC$:PIPMAC,PIPUNL

