PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31

TABLE OF CONTENTS



     7-    1	**** PIPCPY VERSION M0240 ****

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 7





      1						.TITLE	PIPCPY M0240, COPY COMMAND-PIP

						.SBTTL	**** PIPCPY VERSION M0240 ****

						.IDENT	/M0240/

      2					; ALTERED:

      3					; DEBORAH HOLTZ GILLESPIE  6 JAN 76 14:00(***)

      4					; ANDREW C. GOLDSTEIN  8 NOV 76  10:29

      5					; BENN L. SCHREIBER	1-APR-77

      6					; BLS011	8-JUN-77

      7					;		READ/WRITE ATTRIBUTES FROM INPUT TO OUTPUT ON ALL

      8					;		COPIES EXCEPT APPEND (FOR RMS-11)

      9					;

     10					; B. SCHREIBER	27-AUG-77

     11					;

     12					;	BLS025 -- ADD EXIT WITH STATUS

     13					;

     14					; B. SCHREIBER 27-AUG-77

     15					;

     16					;	BLS026 -- CHECK F.RCTL TO DECIDE IF OUTPUT IS LP:

     17					;

     18					; B. SCHREIBER	9-MAR-78

     19					;

     20					;	BLS043 -- NEVER TRY TO ALLOCATE A RECORD BUFFER .GT. 16K

     21					;

     22					; B. SCHREIBER	24-MAR-78

     23					;

     24					;	BLS044 -- DON'T WRITE ATTRIBTES ON APPEND OPERATIONS

     25					;

     26					; B. SCHREIBER	25-MAR-78

     27					;

     28					;	BLS045 -- FIX /UF...IT WAS ALWAYS TRYING TO CREATE DIRECTORY

     29					;

     30					; B. SCHREIBER 	15-MAY-78

     31					;

     32					;	BLS047 -- CORRECT ERROR IN REDATR/WRTATR

     33					;

     34					; B. SCHREIBER	25-MAY-78

     35					;

     36					;	BLS050 -- CLEAR F.SEQN BEFORE OPENING OUTPUT FILE UNTIL

     37					;		  FCS BUG IS FIXED (TYPING A SEQUENCED FILE TO

     38					;		  THE TERMINAL AND THEN TYPING ANOTHER FILE IN

     39					;		  THE SAME COMMAND FAILS).

     40					;

     41					; B. SCHREIBER	7-JUN-78

     42					;

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

     44					;		MARISON

     45					;

     46					; B. SCHREIBER	12-JUL-78

     47					;

     48					;	BLS058 -- CORRECT SPANBLOCKS ATTRIBUTE HANDLING

     49					;

     50					; B. SCHREIBER	12-JUL-78

     51					;

     52					;	BLS059 -- WARN OF CONFLICTING ATTRIBUTES ON MERGE

     53					;

     54					; B. SCHREIBER	12-JUL-78

     55					;

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 7-1

**** PIPCPY VERSION M0240 ****



     56					;	BLS060 -- ATTACH RECORD ORIENTED INPUT DEVICE

     57					;

     58					; B. SCHREIBER	12-JUL-78

     59					;

     60					;	BLS061 -- SET FILE OWNER ON MERGE WITH /FO

     61					;

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

     63					; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD MASS.

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

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

     66

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

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

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

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

     71

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

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

     74					; EQUIPMENT CORPORATION.

     75

     76					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY

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

     78					;

     79					; PETER H. LIPMAN	2-MAY-74

     80					;

     81						.IF	GT,R$$11M

     82						.MACRO	OPEN$	A1,A2,A3,A4,A5,A6,A7,A8,A9

     83						.MCALL	OFNB$

     84						OFNB$	A1,A2,A3,A4,A5,A6,A7,A8,A9

     85						.ENDM	OPEN$

     86					;

     87						.MACRO	GET$	A1,A2,A3,A4

     88						.MCALL	GET$S

     89						GET$S	A1,A2,A3,A4

     90						.ENDM	GET$

     91					;

     92						.MACRO	PUT$	A1,A2,A3,A4

     93						.MCALL	PUT$S

     94						PUT$S	A1,A2,A3,A4

     95						.ENDM	PUT$

     96					;

     97						.ENDC

     98

     99	000000					FLDSOF

    100						.MCALL	CSI$,FDOF$L,FCSBT$,IOERR$

    101	000000					CSI$

    102	000000					FDOF$L			;DEFINE FDB OFFSETS LOCALLY

    103	000000					FCSBT$			;DEFINE FDB BITS AND VALUES LOCALLY

    104	000000					IOERR$			;DEFINE I/O ERROR CODES LOCALLY

    105						.MCALL	CALL,RETURN

    106						.MCALL	FDRC$R,FDAT$R,FDBF$R

    107						.MCALL	OPEN$R,OPEN$U,OPEN$A,OPEN$,OFNB$W,CLOSE$

    108						.MCALL	PUT$,GET$,QIO$,DIR$,WTSE$S,WSIG$S

    109					;

    110	000000					MSG1	LPHD,<<14>>	;HEADER FOR COPY TO LP:

    111

    112	000000					IMPURE

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 7-2

**** PIPCPY VERSION M0240 ****



    113

    114	000000				QIODPB:	QIO$	,,RWEFN,,IOSTBK,,<,,,,>

    115		000014 				Q.XFAD=Q.IOPL		;TRANSFER ADDRESS OFFSET

    116		000016 				Q.XFSZ=Q.IOPL+2		;TRANSFER SIZE OFFSET

    117		000022 				Q.XFVB=Q.IOPL+6		;TRANSFER VBN OFFSET

    118	000030				QIOATR:	QIO$	0,0,RATEFN,,IOSTBK,,<0,RATUFA,0,0,0,0>

    119	000060	177777 			ATRSAV:	.WORD	-1		;SAVE ATTRIBUTES HERE FOR CHECKING		;BLS059

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 8

**** PIPCPY VERSION M0240 ****



    121	000062					PURE.I

    122

    123					; COPY THE INPUT FILE TO THE OUTPUT FILE

    124	000000				COPY::

    125	000000	012767 	177777 	000060'		MOV	#-1,ATRSAV	;RESET THE ATTR. FLAG WORD			;BLS059

    126	000006	016767 	000000G	000000G		MOV	.OULCL,.LCLSW	;LOCAL OUTPUT SWITCHES APPLY

    127									;TO ALL INPUT SPECIFIERS

    128	000014	042767 	000000G	000000G		BIC	#FILCL,.LCLSW	;KOCK DOWN SWITCHES THAT DON'T DEFAULT

    129	000022	032767 	000000G	000002G		BIT	#APPDBT,CMDWRD+2

    130	000030	001403 				BEQ	10$

    131	000032	052767 	000000G	000002G		BIS	#MERGBT,CMDWRD+2	;APPEND OR UPDATE IMPLY MERGE

    132	000040	005767 	000000G		10$:	TST	INSPEC		;ANY INPUT FILE SPEC AT ALL?

    133	000044	001003 				BNE	30$

    134	000046					ERROUX	CP02		;NOTHING TO COPY!

	000046	104403 				TRAP	X

	000050	000000G				.WORD	CP02SZ

	000052	000000G				.WORD	CP02MG

    135					; INITIALIZE THE DEFAULT NAME BLOCKS AND PUT ADDRESSES IN FDB'S

    136	000054	012767 	000000G	000046G	30$:	MOV	#NAMBLK,FDBOUT+F.DFNB

    137	000062	005001 				CLR	R1

    138	000064	005002 				CLR	R2

    139	000066					CALL	STNMBK		;INIT "NAMBLK"

    140	000072	012700 	000000G			MOV	#NMBLK1,R0

    141	000076	010067 	000046G			MOV	R0,FDBIN+F.DFNB

    142					; R1 AND R2 SHOULD STILL CONTAIN 0

    143	000102					CALL	STNBK1		;INIT NAMBLK IN R0

    144	000106	012767 	000000G	000044G		MOV	#IFNPT,FDBIN+F.DSPT ;INIT DESCRIPTOR POINTERS

    145	000114	012767 	000000G	000044G		MOV	#OFNPT,FDBOUT+F.DSPT

    146	000122	012700 	000000G			MOV	#FDBOUT,R0

    147	000126	112760 	000016 	000043 		MOVB	#FO.WRT,F.FACC(R0) ; SET INTENT TO CAUSE SPOOLING

    148	000134					CALL	PARSE		;PARSE THE OUTPUT FILE NAME

    149	000140	103014 				BCC	40$

    150	000142	032767 	000000G	000000G		BIT	#UFDBIT,CPYCTL	; CHECK FOR UFD CREATION MODE

    151	000150	001404 				BEQ	35$		; NO

    152	000152	126027 	000052 	177746 		CMPB	F.ERR(R0),#IE.NSF ; CHECK FOR NO SUCH FILE

    153	000160	001404 				BEQ	40$		; IGNORE AT THIS LEVEL

    154	000162				35$:	CALL	PRSERR		;FAILED TO PARSE OUTPUT FILE NAME

    155	000166	000167 	000000G			JMP	CLOSX

    156	000172				40$:	CALL	CWLDUI		;CHECK FOR LEGAL WILD UIC

    157	000176	103003 				BCC	42$		;BRANCH IF OK

    158	000200					ERROUX	CP01		;ONLY [*,*] IS LEGAL FOR OUTPUT

	000200	104403 				TRAP	X

	000202	000000G				.WORD	CP01SZ

	000204	000000G				.WORD	CP01MG

    159	000206	032761 	000000G	000020 	42$:	BIT	#NB.SFN,N.STAT(R1) ;NO WILD CARDS IN NAME?

    160	000214	001431 				BEQ	46$		;BRANCH IF YES

    161	000216	016102 	000020 			MOV	N.STAT(R1),R2

    162	000222	042702 	000000C			BIC	#^C<NB.SFN>,R2

    163	000226	022702 	000000G			CMP	#NB.SFN,R2	;*.*;* ?

    164	000232	001412 				BEQ	44$		;BRANCH IF YES, OK

    165	000234	022702 	000060 			CMP	#NB.SNM!NB.STP,R2 ;*.* ?

    166	000240	001004 				BNE	43$		;BRANCH IF NO, ILLEGAL  USE OF *

    167	000242	032761 	000001 	000020 		BIT	#NB.VER,N.STAT(R1) ;NOT EXPLICIT VERSION

    168	000250	001403 				BEQ	44$		;BRANCH IF YES, OK

    169	000252				43$:	ERROUX	CP04,1		;ILLEGAL * IN OUTPUT NAME

	000252	104413 				TRAP	X

	000254	000000G				.WORD	CP04SZ

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 8-1

**** PIPCPY VERSION M0240 ****



	000256	000000G				.WORD	CP04MG

    170	000260	042767 	000001 	000000G	44$:	BIC	#CS.NMF,OUSPEC	;NORMALIZE WILD CARD OUTPUT NAME

    171	000266	005067 	000010G			CLR	OFNPT+N.FNMD

    172	000272	042761 	000000G	000020 		BIC	#NB.SFN,N.STAT(R1)

    173	000300	032767 	000001 	000000G	46$:	BIT	#CS.NMF,OUSPEC	;IF EXPLICIT OUTPUT FILE NAME

    174	000306	001013 				BNE	54$		;BRANCH IF YES

    175	000310	032767 	000000C	000002G		BIT	#MERGBT!UPDTBT,CMDWRD+2	;MERGE, APPEND, OR UPDATE REQUEST?

    176	000316	001416 				BEQ	60$		;BRANCH IF NO

    177	000320	132760 	000010 	000017 		BITB	#FD.DIR,F.RCTL(R0)

    178	000326	001412 				BEQ	60$		;OK IF NON DIRECTORY DEVICE

    179	000330					ERROUX	CP05,1		;MUST HAVE EXPLICIT OUTPUT FILE NAME

	000330	104413 				TRAP	X

	000332	000000G				.WORD	CP05SZ

	000334	000000G				.WORD	CP05MG

    180	000336	032767 	000030 	000000G	54$:	BIT	#CS.MOR!CS.WLD,INSPEC ;MULTIPLE INPUT FILES?

    181	000344	001403 				BEQ	60$

    182					;

    183					; EXPLICIT OUTPUT FILE NAME AND MULTIPLE INPUT FILES IMPLY A MERGE

    184	000346	052767 	000000G	000002G		BIS	#MERGBT,CMDWRD+2

    185	000354	012700 	000000G		60$:	MOV	#FDBIN,R0

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 9

**** PIPCPY VERSION M0240 ****



    187

    188	000360				COPY2:	CALL	PARSE		;PARSE THE FILE NAME

    189	000364	103004 				BCC	10$

    190	000366					CALL	PRSERR

    191	000372	000167 	003142 			JMP	CPYNXT

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

    193	000404	052767 	000000G	000000G		BIS	#FRSTIM,CPYCTL	;FIRST FIND OPERATION NOT DONE YET

    194	000412	032767 	000001 	000000G		BIT	#CS.NMF,INSPEC	;ALLOW NULL INPUT FILE NAME TO = *.*;*

    195	000420	001025 				BNE	CPYWLD

    196	000422	005762 	000016 			TST	N.FLID(R2)	;UNLESS FILE ID SPECIFIED

    197	000426	001022 				BNE	CPYWLD

    198	000430	132760 	000010 	000017 		BITB	#FD.DIR,F.RCTL(R0) ;OR UNLESS NON DIRECTORY DEVICE

    199	000436	001416 				BEQ	CPYWLD

    200						.IF DF	O$$DS2								;BLS052

    201	000440	032761 	000007 	000020 		BIT	#NB.NAM!NB.TYP!NB.VER,N.STAT(R1) ;OR UNLESS DO TO		;BLS052

    202											 ;LOGICAL NAMES IT		;BLS052

    203											 ;ONLY LOOKED LIKE A		;BLS052

    204											 ;NULL FILENAME			;BLS052

    205	000446	001012 				BNE	CPYWLD								;BLS052

    206						.ENDC									;BLS052

    207	000450	052761 	000000G	000020 		BIS	#NB.SFN,N.STAT(R1) ;SINCE WILD CARDS ON INPUT SIDE

    208	000456	032767 	000001 	000000G		BIT	#CS.NMF,OUSPEC	;OUTPUT FILE NAME IMPLIES MERGE

    209	000464	001403 				BEQ	CPYWLD

    210	000466	052767 	000000G	000002G		BIS	#MERGBT,CMDWRD+2

    211	000474	012701 	000000G		CPYWLD:	MOV	#CPYCTL,R1	;POINT TO COPY CONTROL SWITCHES

    212	000500	016702 	000000G			MOV	BUFSIZ,R2	;GET BUFFER SIZE SPEC, IF ANY

    213	000504					CALL	GETBR		;SET UP BUFFER SIZE AND REWIND CONTROL

    214						.IF NDF	O$$DS2								;BLS052

    215						MOV	VERSAV,F.FVER(R0)

    216						.ENDC									;BLS052

    217	000510					CALL	FNDNXT

    218	000514	103004 				BCC	COPY1		;BRANCH IF SUCCESSFUL

    219					;

    220					; ERROR FROM LOOKUP

    221	000516					CALL	FNDERR

    222	000522	000167 	003012 			JMP	CPYNXT

    223	000526	005067 	000000G		COPY1:	CLR	OURACC

    224	000532	012767 	000004 	000000G		MOV	#FD.PLC,INRACC

    225	000540	032767 	000001 	000000G		BIT	#CS.NMF,OUSPEC	;IS OUTPUT FILE NAME EXPLICIT

    226	000546	001075 				BNE	40$		;BRANCH IF YES

    227	000550	010002 				MOV	R0,R2

    228	000552	062702 	000110 			ADD	#F.FNAM,R2	;R2=ADR OF FNAME IN NAME BLOCK

    229	000556	005001 				CLR	R1		;R1= DIRECTORY ID FIELD

    230	000560					CALL	STNMBK		;STORE INTO NAMBLK

    231					;

    232					; IF THE OUTPUT DIRECTORY IS WILD CARD, USE THE INPUT DIR ID

    233	000564	032767 	000000G	000020G		BIT	#NB.SDI,OWUIC+N.STAT

    234	000572	001412 				BEQ	10$

    235	000574	016702 	000044G			MOV	FDBOUT+F.DSPT,R2

    236	000600	016703 	000044G			MOV	FDBIN+F.DSPT,R3

    237	000604	016362 	000004 	000004 		MOV	N.DIRD(R3),N.DIRD(R2)

    238	000612	016362 	000006 	000006 		MOV	N.DIRD+2(R3),N.DIRD+2(R2)

    239					;

    240					; DEFAULT FILE VERSION TO THAT OF INPUT FILE UNLESS DEVICE AND

    241					; DIRECTORY ARE THE SAME.

    242	000620	032767 	000000G	000000G	10$:	BIT	#NVERBT,CPYCTL	;FORCING NEW OUTPUT FILE VERSION?

    243	000626	001016 				BNE	30$		;BRANCH IF YES

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 9-1

**** PIPCPY VERSION M0240 ****



    244	000630	016767 	000120G	000016G		MOV	FDBIN+F.FVER,NAMBLK+N.FVER

    245	000636					CALL	SAME		;***SAME UNIT,DEV,DIR?

    246	000642	103437 				BCS	40$		;***NOT THE SAME

    247	000644	032767 	000000G	000122G		BIT	#NB.SFL,FDBIN+F.FNB+N.STAT

    248	000652	001431 				BEQ	35$

    249					; WILD CARD COPY TO SAME DEVICE, DIRECTORY IS ILLEGAL

    250	000654					ERROUT	CP03

	000654	104402 				TRAP	X

	000656	000000G				.WORD	CP03SZ

	000660	000000G				.WORD	CP03MG

    251	000662	000421 				BR	32$

    252					;

    253					; PRODUCE NEW VERSION OF FILE, DON'T PRESERVE THE INPUT FILE'S VERSION NUMBER

    254					;

    255	000664	032767 	000010 	000122G	30$:	BIT	#NB.SVR,FDBIN+F.FNB+N.STAT ;IF WILD VERSION SPECIFIED

    256	000672	001012 				BNE	31$		;ERROR

    257					; ***IF MULTIPLE RECORD COPY WITH LATEST VERSION IMPLIED(NAME.*

    258					; ***OR *.TYP) AND /NV SWITCH, THEN INFINITE LOOP PROBLEM RESULTS

    259					; ***WHEN UNIT,DEVICE,DIRECTORY ARE THE SAME.

    260					; ***NAME.TYP IS SINGLE RECORD COPY OPERATION SO LATEST VERSION OK

    261					; ***WITH /NV SWITCH.

    262	000674	032767 	000060 	000122G		BIT	#NB.SNM!NB.STP,FDBIN+F.FNB+N.STAT	;WILD CARD

    263	000702	001415 				BEQ	35$		;***NO SO OK

    264	000704	005767 	000000G			TST	VERSAV		;***ORIGINAL VER #, LATEST VERSION IMPLIED?

    265	000710	001012 				BNE	35$		;***IF 1ST OR SPECIFIC #, OK

    266	000712					CALL	SAME		;***SAME DEV, UNIT,DIR?

    267	000716	103407 				BCS	35$		;***NOT THE SAME

    268	000720				31$:	ERROUT	CP15		;THEN ILLEGAL

	000720	104402 				TRAP	X

	000722	000000G				.WORD	CP15SZ

	000724	000000G				.WORD	CP15MG

    269	000726				32$:	CALL	SETWAR		;SET WARNING EXIT STATUS

    270	000732	000167 	002602 			JMP	CPYNXT		;GET NEXT FILE

    271	000736	005067 	000016G		35$:	CLR	NAMBLK+N.FVER	;FORCE DEFAULT (NEW) OUTPUT FILE VERSION

    272					;

    273					; NOW SEE IF CAN COPY IN BLOCK MODE INSTEAD OF RECORD MODE

    274	000742	005767 	000070G		40$:	TST	FDBOUT+F.BDB	;IF OUTPUT FILE IS ALREADY OPEN

    275	000746	001113 				BNE	CPYOPN		;SET UP RECORD ORIENTED INPUT FILE

    276	000750	032767 	000000G	000002G		BIT	#MERGBT,CMDWRD+2	;IF 1ST FILE OF MERGE

    277	000756	001406 				BEQ	50$		;BRANCH IF NOT

    278	000760					FDBF$R	#FDBIN,,#512.	;FORCE STANDARD BUF SIZE, AVOID FRAGMENTING FSR1

    279	000772	000501 				BR	CPYOPN		;AND USE RECORD ORIENTED COPY

    280	000774	026767 	000062G	000062G	50$:	CMP	FDBIN+F.BBFS,FDBOUT+F.BBFS ;BLOCK SIZES THE SAME?

    281	001002	001075 				BNE	CPYOPN		;BRANCH IF NO, RECORD ORIENTED COPY

    282	001004	026727 	000062G	001000 		CMP	FDBIN+F.BBFS,#1000 ;MUST BE 1000 BYTE BLOCKS

    283	001012	001071 				BNE	CPYOPN		;BRANCH IF NOT

    284					;

    285	001014	032767 	000000G	000000G		BIT	#SPANBT,CPYCTL	; CAN RECORDS CROSS BLK BOUNDARIES?

    286	001022	001465 				BEQ	CPYOPN		; IF EQ NO--MUST DO RECORD COPY

    287					; BOTH MUST BE BLOCK ORIENTED AND NON SEQUENTIAL

    288	001024	132767 	000041 	000017G		BITB	#FD.REC!FD.SQD,FDBIN+F.RCTL

    289	001032	001061 				BNE	CPYOPN

    290	001034	132767 	000041 	000017G		BITB	#FD.REC!FD.SQD,FDBOUT+F.RCTL

    291	001042	001055 				BNE	CPYOPN

    292					;

    293					; BOTH FILES ARE BLOCK ORIENTED AND THE SAME BLOCK SIZE, USE READ/WRITE

    294					;

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 9-2

**** PIPCPY VERSION M0240 ****



    295	001044	026767 	000000G	000000G		CMP	.DYSIZ,.DYBYT	; SEE IF DYNAMIC BUFFER IS ALLOCATED

    296	001052	001412 				BEQ	60$		; BRANCH IF YES

    297					;

    298					; FAKE AN ALLOCATION OF THE ENTIRE DYNAMIC BUFFER REGION. WE CANNOT

    299					; CALL $RQLCB SINCE THE DESIRED SIZE MAY BE OVER 16K AND CAUSE

    300					; SIGN PROBLEMS.

    301					;

    302	001054					CALL	.DYREL		; RELEASE ANYTHING THAT'S ALLOCATED

    303	001060	016767 	000000G	000000G		MOV	.DYSIZ,.DYBYT	; SET ALLOCATED SIZE

    304	001066	013700 	000000G			MOV	@#.FSRPT,R0	; GET FSR2 ADDRESS

    305	001072	011067 	000000G			MOV	(R0),.DYBUF	; SET BUFFER ADDRESS

    306	001076	005010 				CLR	(R0)		; MARK ENTIRE FSR ALLOCATED

    307

    308	001100	012700 	000000G		60$:	MOV	#FDBIN,R0

    309	001104	012767 	000001 	000000G		MOV	#FD.RWM,INRACC

    310	001112	012767 	000001 	000000G		MOV	#FD.RWM,OURACC

    311	001120	000426 				BR	CPYOPN

    312

    313

    314					; ***IS INPUT AND OUTPUT ON THE SAME DEVICE,UNIT,DIRECTORY?

    315					; ***OUTPUT:  C=0 YES, C=1 NO

    316

    317	001122	026767 	000134G	000134G	SAME:	CMP	FDBIN+F.DVNM,FDBOUT+F.DVNM	;***SAME DEVICE?

    318	001130	001020 				BNE	10$		;***NOT THE SAME DEVICE

    319	001132	026767 	000136G	000136G		CMP	FDBIN+F.UNIT,FDBOUT+F.UNIT	;***SAME UNIT?

    320	001140	001014 				BNE	10$		;***NOT SAME UNIT

    321	001142	012704 	000003 			MOV	#3,R4		;***THREE WORDS DESCRIBE DIRECTORY

    322	001146	012702 	000126G			MOV	#FDBIN+F.FNB+N.DID,R2	;***INPUT DIR. ADDR.

    323	001152	012703 	000126G			MOV	#FDBOUT+F.FNB+N.DID,R3	;***OUTPUT DIR ADDR

    324	001156	022223 			5$:	CMP	(R2)+,(R3)+	;***INPUT=OUTPUT?

    325	001160	001004 				BNE	10$		;***NOT EQUAL

    326	001162					SOB	R4,5$		;***MORE TO GO?

    327	001166	000241 				CLC			;***YES,THEY'RE THE SAME

    328	001170					RETURN

    329	001172	000261 			10$:	SEC			;***NOT THE SAME

    330	001174					RETURN

    331

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 10

**** PIPCPY VERSION M0240 ****



    333

    334	001176				CPYOPN:

    335	001176	012701 	000000G			MOV	#CPYCTL,R1	;POINT TO COPY CONTROL SWITCHES

    336	001202	016702 	000000G			MOV	BUFSIZ,R2	;GET BUFFER SIZE SPEC, IF ANY

    337	001206					CALL	GETBR		;SET UP BUFFER SIZE AND REWIND CONTROL

    338	001212	012701 	000000G			MOV	#STBLK,R1	;R1=ADDRESS OF STATISTICS BLOCK

    339	001216	132760 	000040 	000017 		BITB	#FD.SQD,F.RCTL(R0) ;IF SEQUENTIAL DEVICE

    340	001224	001002 				BNE	10$		;DON'T READ THE STATISTICS BLOCK

    341	001226	010160 	000036 			MOV	R1,F.STBK(R0)	;OTHERWISE READ IT AT OPEN TIME

    342	001232	005021 			10$:	CLR	(R1)+		;ZERO THE LBN IN THE STATISTICS BLOCK

    343	001234	005021 				CLR	(R1)+

    344	001236	005021 				CLR	(R1)+		;AND ZERO THE SIZE FIELD

    345	001240	005011 				CLR	(R1)		;LEAVING R1 POINTING AT LOW ORDER SIZE

    346	001242					OPEN$R	R0,,,INRACC	;OPEN THE INPUT FILE

    347	001262	103002 				BCC	20$		;

    348	001264	000167 	002432 		15$:	JMP	CERR51		;FAILED TO OPEN INPUT FILE

    349	001270	005060 	000076 		20$:	CLR	F.ACTL(R0)	; SHUT OFF REWIND IF SET

    350	001274	010146 				MOV	R1,-(SP)

    351	001276					CALL	RECATT		;ATTACH DEVICE IF RECORD ORIENTED		;BLS060

    352	001302	012601 				MOV	(SP)+,R1

    353	001304	032767 	000000G	000002G		BIT	#APPDBT,CMDWRD+2 ;IF THIS IS APPEND

    354	001312	001042 				BNE	30$		;DON'T BOTHER WITH ATTRIBUTES

    355	001314	032767 	000000G	000002G		BIT	#MERGBT,CMDWRD+2 ; IS THIS A MERGE OR UPDATE?

    356	001322	001414 				BEQ	25$		;IF EQ NO

    357	001324	005767 	000060'			TST	ATRSAV		;ATTRIBUTES SET UP?				;BLS059

    358	001330	002005 				BGE	23$		;IF GE YES					;BLS059

    359	001332	116067 	000001 	000060'		MOVB	F.RATT(R0),ATRSAV ;NO--SET UP NOW				;BLS059

    360	001340	105067 	000061'			CLRB	ATRSAV+1	;...						;BLS059

    361	001344				23$:				;REF LABEL					;BLS059

    362	001344	032767 	000000G	000000G		BIT	#FRSTIM,CPYCTL	;YES--IS THIS FIRST TIME THROUGH?

    363	001352	001403 				BEQ	27$		;IF EQ NO--DON'T BOTHER WITH ATTRIBUTES		;BLS059

    364	001354				25$:	CALL	REDATR		;READ THE ATTRIBUTES FROM INPUT FILE		;**-1

    365	001360	103741 				BCS	15$		;IF CS THEN ERROR--CAN'T OPEN FILE

    366	001362	032767 	000000G	000002G	27$:	BIT	#MERGBT,CMDWRD+2 ;MERGING?					;BLS059

    367	001370	001413 				BEQ	30$		;IF EQ NO					;BLS059

    368	001372	126067 	000001 	000060'		CMPB	F.RATT(R0),ATRSAV ;RECORD ATTRIBUTES THE SAME?			;BLS059

    369	001400	001407 				BEQ	30$		;IF EQ YES					;BLS059

    370	001402	010146 				MOV	R1,-(SP)	;SAVE R1 OVER ERROR PRINTING			;BLS059

    371	001404					ERROUT	CP17,0		;NO--WARN USER					;BLS059

	001404	104406 				TRAP	X

	001406	000000G				.WORD	CP17SZ

	001410	000000G				.WORD	CP17MG

    372	001412	012601 				MOV	(SP)+,R1	;RESTORE R1					;BLS059

    373	001414					CALL	SETWAR		;SET WARNING STATUS				;BLS059

    374					;

    375					; ESTABLISH SIZE AND CONTIGUOUS ATTRIBUTE FOR THE INPUT FILE

    376					;

    377	001420	032760 	000001 	000016 	30$:	BIT	#FD.RWM,F.RACC(R0) ;SEE IF THIS IS A BLOCK COPY

    378	001426	001427 				BEQ	40$		;BRANCH IF NOT

    379	001430	010002 				MOV	R0,R2		;COPY FDB ADDRESS

    380	001432	005710 				TST	(R0)		;SEE IF INPUT FILE HAS RECORD ATTRIBUTES

    381	001434	001406 				BEQ	35$		;IF EQ NO--GO MAKE SOME UP

    382	001436	062702 	000004 			ADD	#4,R2		;NO--POINT CORRECTLY

    383	001442	132710 	177760 			BITB	#^C17,(R0)	;LEGAL RMS RECORD TYPE?

    384	001446	001417 				BEQ	40$		;IF EQ NO

    385	001450	000404 				BR	37$		;YES--GO FIX UP

    386	001452	012722 	000001 		35$:	MOV	#R.FIX,(R2)+	;BUILD RECORD ATTRIBUTES--512 BYTES FIXED

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 10-1

**** PIPCPY VERSION M0240 ****



    387	001456	012722 	001000 			MOV	#512.,(R2)+	;

    388	001462	014122 			37$:	MOV	-(R1),(R2)+	;SIZE FROM STAT BLOCK

    389	001464	016122 	000002 			MOV	2(R1),(R2)+	;TO F.HIBK

    390	001470	012122 				MOV	(R1)+,(R2)+	;AND TO F.EFBK

    391	001472	011112 				MOV	(R1),(R2)

    392	001474	062712 	000001 			ADD	#1,(R2)		;EFBK IS PLUS 1

    393	001500	005542 				ADC	-(R2)

    394	001502	005062 	000004 			CLR	4(R2)		;ZERO F.FFBY

    395	001506				40$:

    396

    397	001506	005003 			EXTSIZ:	CLR	R3		;ASSUME NON CONTIGUOUS

    398	001510	011105 				MOV	(R1),R5		;R5=SIZE OF FILE SPACE ALLOCATED

    399	001512	014104 				MOV	-(R1),R4	;R4=HIGH ORDER

    400	001514	014146 				MOV	-(R1),-(SP)	;IF BOTH LBN WORDS ARE 0

    401	001516	054126 				BIS	-(R1),(SP)+	;THEN FILE IS NON CONTIGUOUS

    402	001520	001404 				BEQ	10$		;BRANCH IF NOT CONTIGUOUS

    403	001522	032767 	000000G	000000G		BIT	#NTCNTG,CPYCTL	;/-CO SWITCH?

    404	001530	001022 				BNE	30$		;BRANCH IF COPYING CONTIGUOUS

    405					;

    406					; USE FILE SIZE FROM RECORD ATTRIBUTE

    407					;

    408	001532	132760 	000040 	000017 	10$:	BITB	#FD.SQD,F.RCTL(R0) ;CHECK IF THIS IS MAGTAPE

    409	001540	001012 				BNE	20$		;YES - NO DEFAULT INITIAL EXTEND

    410	001542	016005 	000012 			MOV	F.EFBK+2(R0),R5	;R5=VBN OF END OF FILE

    411	001546	016004 	000010 			MOV	F.EFBK(R0),R4

    412	001552	005760 	000014 			TST	F.FFBY(R0)	;UNLESS FFBY=0

    413	001556	001003 				BNE	20$		;

    414	001560	162705 	000001 			SUB	#1,R5		;IN WHICH CASE IT IS ONE TOO BIG

    415	001564	005604 				SBC	R4

    416	001566	032767 	000000G	000000G	20$:	BIT	#CNTGBT,CPYCTL	;FORCE CONTIGUOUS?

    417	001574	001401 				BEQ	40$		;BRANCH IF NO

    418	001576	005203 			30$:	INC	R3		;CONTIGUOUS ALLOCATION

    419					;

    420					; SEE IF USER WANTS TO OVERRIDE THE EXTEND SIZE. IF HE SAID /BL:N, THEN

    421					; USE THAN EXTEND SIZE.

    422					;

    423	001600	032767 	000000G	000000G	40$:	BIT	#BLKBIT,CPYCTL	;/BL SWITCH SPECIFIED?

    424	001606	001404 				BEQ	50$		;BRANCH IF NO

    425	001610	016705 	000000G			MOV	BLKCNT,R5	;USE SPECIFIED SIZE

    426	001614	016704 	000002G			MOV	BLKCNT+2,R4

    427	001620	012702 	000000G		50$:	MOV	#.EXTSZ,R2	;POINT TO PLACE TO SAVE SIZE

    428	001624	010422 				MOV	R4,(R2)+	;SAVE ALLOCATION DATA FOR LATER

    429	001626	010522 				MOV	R5,(R2)+

    430	001630	010322 				MOV	R3,(R2)+

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 11

**** PIPCPY VERSION M0240 ****



    432

    433					;

    434					; NOW PREPARE TO OPEN THE OUTPUT FILE

    435					;

    436	001632				OUTOPN:

    437	001632	010001 				MOV	R0,R1		;PRESERVE THE INPUT FDB IN R1

    438	001634	012700 	000000G			MOV	#FDBOUT,R0	;OUTPUT FDB

    439	001640	005760 	000070 			TST	F.BDB(R0)	;

    440	001644	001402 				BEQ	10$

    441	001646	000167 	001010 			JMP	ISOPEN		;BRANCH IF OUTPUT FILE IS ALEADY OPEN

    442

    443	001652				10$:	CALL	COPYAT		; COPY RECORD ATTRIBUTES TO OUTPUT

    444	001656	012701 	000000G			MOV	#.OULCL,R1	;POINT TO OUTPUT LOCAL SWITCHES

    445	001662	016702 	000000G			MOV	OBFSIZ,R2	;GET OUTPUT BUFFER SPEC

    446	001666					CALL	GETBR		;SET UP REWIND CONTROL AND BUFFER SIZE

    447	001672					CALL	.LPCHK		;SEE IF A LINE PRINTER

    448	001676	103403 				BCS	20$		;IF CS NO

    449	001700					FDBF$R	R0,,#132.	;OVERRIDE BUFFER SIZE

    450	001706	132760 	000004 	000017 	20$:	BITB	#FD.TTY,F.RCTL(R0) ; SEE IF OUTPUT IS A TERMINAL

    451	001714	001403 				BEQ	30$		; BRANCH IF NOT

    452	001716					FDBF$R	R0,,#512.	; YES - LET HANDLER WRAP LONG LINES

    453	001724				30$:	FDRC$R	R0,OURACC

    454	001732					CALL	PRSREG

    455	001736					CALL	.PARSE

    456	001742	103074 				BCC	80$

    457	001744	126027 	000052 	177746 		CMPB	F.ERR(R0),#IE.NSF ; SEE IF DIRECTORY DOES NOT EXIST

    458	001752	001004 				BNE	35$		; BRANCH IF DIRECTORY EXISTS			;BLS045

    459	001754	032767 	000000G	000000G		BIT	#UFDBIT,CPYCTL	; SEE IF DIRECTORY CREATION ENABLED		;**-1

    460	001762	001007 				BNE	40$		; YES

    461	001764				35$:	CALL	PRSERR								;BLS045

    462	001770	012767 	000000G	000000G		MOV	#EX$ERR,.EXSTS	;SET AN ERROR STATUS				;**-1

    463	001776	000167 	000000G			JMP	CLOSX

    464

    465					;

    466					; WATCH THIS!! THE DIRECTORY DOES NOT EXIST, SO WE WILL CREATE ONE

    467					; ON THE FLY. OBSERVE THAT THE FAILURE FROM PARSE HAS LEFT THE

    468					; NAME BLOCK OF FDBOUT SET UP TO DO THE ENTER IN THE MFD - THE

    469					; DIRECTORY NAME IS ALL SET UP.

    470					;

    471	002002				40$:										;BLS052

    472						.IF DF	O$$DS2								;BLS052

    473	002002	005760 	000126 			TST	F.FNB+N.DID(R0)	;WAS DIR ID RETURNED BY PARSE?			;BLS052

    474									;(VMS ELEPHANT PARSE DOES NOT)			;BLS052

    475	002006	001766 				BEQ	35$		;IF EQ NO--ERROR				;BLS052

    476						.ENDC									;BLS052

    477	002010	062700 	000110 			ADD	#F.FNB+6,R0	;POINT TO NAME BLOCK LESS FID			;BLS052

    478	002014	012701 	000014 			MOV	#S.FNB/2-3,R1	; WORD COUNT TO COPY				;**-1

    479	002020	012702 	000110G			MOV	#DIFDB+F.FNB+6,R2 ; ADDRESS OF DIRECTORY NAME BLOCK

    480	002024	012022 			50$:	MOV	(R0)+,(R2)+	; COPY THE NAME BLOCK

    481	002026					SOB	R1,50$

    482

    483	002032					CALL	.RFOWN		; SAVE CURRENT FILE OWNER WORD

    484	002036	010146 				MOV	R1,-(SP)

    485	002040	016701 	000132G			MOV	DIFDB+F.FNB+N.DID+4,R1 ; GET UIC FOR DIRECTORY

    486	002044					CALL	.WFOWN		; AND SET IT UP

    487	002050					FDAT$R	#DIFDB,,,,#1	; SET FOR 1 BLOCK CONTIGUOUS

    488	002062					OFNB$W	R0		; CREATE IT ALREADY

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 11-1

**** PIPCPY VERSION M0240 ****



    489	002074	103006 				BCC	70$

    490	002076	012601 			60$:	MOV	(SP)+,R1	; RESTORE FILE OWNER WORD

    491	002100					CALL	.WFOWN

    492	002104					ERROUX	CP16,0,0	; FAILED TO CREATE DIRECTORY

	002104	104427 				TRAP	X

	002106	000000G				.WORD	CP16SZ

	002110	000000G				.WORD	CP16MG

    493

    494	002112				70$:	CLOSE$	R0		; CLOSE THE FILE

    495	002116	103767 				BCS	60$

    496	002120	012601 				MOV	(SP)+,R1	; RESTORE FILE OWNER WORD

    497	002122					CALL	.WFOWN

    498	002126	012700 	000000G			MOV	#FDBOUT,R0	; RESTORE R0

    499	002132	000665 				BR	20$		; AND TRY CREATING OUTPUT AGAIN

    500

    501	002134				80$:	CALL	.GFOWN		;SET UP FILE OWNER FOR /FO SWITCH

    502	002140	005060 	000100 			CLR	F.SEQN(R0)	;CLEAR SEQUENCE # IN CASE TO TERMINAL		;BLS050

    503									;(NEEDED TIL FCS BUG IS FIXED)			;BLS050

    504	002144	032767 	000000C	000002G		BIT	#APPDBT!UPDTBT,CMDWRD+2

    505	002152	001030 				BNE	OPENAU		;BRANCH IF APPENDING OR UPDATING

    506					;

    507					; CREATING A NEW FILE

    508					;

    509	002154	012702 	000000G			MOV	#.EXTSZ,R2	;POINT TO EXTEND SIZE DATA

    510	002160	005722 				TST	(R2)+		;SEE IF HIGH ORDER IS NON-ZERO

    511	002162	001007 				BNE	90$		;IF SO MUST EXTEND LATER

    512	002164	012205 				MOV	(R2)+,R5	;GET LOW ORDER SIZE

    513	002166	100405 				BMI	90$		;BRANCH IF OVER 15 BITS

    514	002170	005722 				TST	(R2)+		;CHECK CONTIGUOUS FLAG

    515	002172	001001 				BNE	89$

    516	002174	005405 				NEG	R5		;NON-CONTIGUOUS

    517	002176	010560 	000034 		89$:	MOV	R5,F.CNTG(R0)	;SET INITIAL ALLOCATION

    518

    519	002202	012705 	000116 		90$:	MOV	#FO.WRT!FA.NSP,R5 ;ASSUME NOT SUPERSEDING

    520	002206	032767 	000000G	000000G		BIT	#SPSDBT,CPYCTL	;IS SUPERSEDE DESIRED

    521	002214	001402 				BEQ	100$		;BRANCH IF NO

    522	002216	012705 	000016 			MOV	#FO.WRT,R5	;

    523	002222				100$:	OPEN$	R0,R5		;OPEN A NEW FILE

    524	002232	000432 				BR	OPENWA		;GO FINISH UP

    525

    526					;

    527					; OPEN FOR APPEND OR UPDATE

    528					;

    529	002234				OPENAU:

    530	002234	032767 	000000G	000002G		BIT	#APPDBT,CMDWRD+2

    531	002242	001020 				BNE	110$		;BRANCH IF OPEN FOR APPEND

    532	002244					OPEN$U	R0		;OPEN FOR UPDATE (REWRITE THE FILE)

    533	002256	103427 				BCS	OPNCHK

    534	002260					CALL	COPYAT		; COPY RECORD ATTRIBUTES TO OUTPUT

    535	002264	005060 	000010 			CLR	F.EFBK(R0)	; BUT ZERO EOF MARK

    536	002270	012760 	000001 	000012 		MOV	#1,F.EFBK+2(R0)

    537	002276	005060 	000014 			CLR	F.FFBY(R0)

    538	002302	000420 				BR	OPNOK

    539	002304				110$:	OPEN$A	R0		;OPEN FOR APPEND (ADD TO END OF FILE)

    540	002316	000407 				BR	OPNCHK		;DON'T WRITE ATTRIBUTES ON APPEND		;BLS044

    541	002320	103406 			OPENWA:	BCS	OPNCHK		;IF CS THEN ERROR

    542	002322	132767 	000041 	000017G		BITB	#FD.SQD!FD.REC,FDBIN+F.RCTL ;IS INPUT A DISK?

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 11-2

**** PIPCPY VERSION M0240 ****



    543	002330	001005 				BNE	OPNOK		;NO--SKIP WRITING ATTRIBUTES

    544	002332					CALL	WRTATR		;WRITE ATTRIBUTES

    545	002336	103002 			OPNCHK:	BCC	OPNOK

    546	002340	000167 	000754 			JMP	CERR2

    547	002344				OPNOK:	CALL	RECATT		;ATTACH RECORD DEVICE

    548	002350	103144 				BCC	ISOPEN

    549	002352	000167 	001022 			JMP	CERR3

    550					;

    551					; SUBROUTINE TO COPY RECORD ATTRIBUTES FROM INPUT FDB TO OUTPUT

    552					;

    553	002356				COPYAT:	FDAT$R	R0,FDBIN+F.RTYP,FDBIN+F.RATT,FDBIN+F.RSIZ

    554	002400	132767 	000001 	000075G		BITB	#CH.AND,FDBIN+F.CHR ;IS INPUT ANSII MAGTAPE?			;BLS058

    555	002406	001407 				BEQ	120$		;IF EQ NO--SKIP /SB PROCESSING			;BLS058

    556	002410	032767 	000000G	000000G		BIT	#SPANBT,CPYCTL	; CAN RECORDS CROSS BLOCK BOUNDARIES?

    557	002416	001403 				BEQ	120$		; IF EQ NO--DON'T CLEAR FD.BLK

    558	002420	142760 	000010 	000001 		BICB	#FD.BLK,F.RATT(R0) ;  CLEAR BLOCKING BIT ON OUTPUT

    559	002426				120$:	RETURN

    560					;

    561					; SUBROUTINE TO SET UP REWIND CONTROL AND BUFFER SIZE FOR

    562					; INPUT AND OUTPUT FILES.

    563					;

    564					; INPUTS:

    565					;	R0 = FDB

    566					;	R1 = ADDR OF SWITCH WORD

    567					;	R2 = BUFFER SIZE

    568					;

    569	002430	032711 	000000G		GETBR:	BIT	#BSZBIT,(R1)	;CHECK IF BLOCK SIZE SPECIFIED

    570	002434	001402 				BEQ	130$		;BRANCH IF NO

    571	002436	010260 	000030 			MOV	R2,F.OVBS(R0)	; YES - SET IT UP

    572	002442	032711 	000000G		130$:	BIT	#RWDBIT,(R1)	;CHECK IF REWIND SPECIFIED

    573	002446	001405 				BEQ	140$		;BANCH IF NO

    574	002450	012760 	104000 	000076 		MOV	#FA.ENB!FA.RWD,F.ACTL(R0) ;SET IT UP

    575	002456	042711 	000000G			BIC	#RWDBIT,(R1)	;REWIND IS ONCE ONLY

    576	002462				140$:	RETURN

    577					;

    578					; SUBROUTINE TO READ/WRITE ATTRIBUTES

    579					;

    580					; INPUT:

    581					;	R0	FDB PTR

    582					;	R1	IO.RAT OR IO.WAT

    583					;

    584					; OUTPUT:

    585					;	CC	ALL IS WELL

    586					;	CS	ERROR

    587					;	ATTRIBUTES IN LINBUF IF IO.RAT AND CC

    588					;

    589	002464	010146 			REDATR:	MOV	R1,-(SP)	;SAVE R1

    590	002466	012701 	000000G			MOV	#IO.RAT,R1	;SET FN

    591	002472	112767 	177774 	000000G		MOVB	#-4,RATUFA	;SET READ FN

    592	002500	012767 	000000G	000034'		MOV	#INLUN,QIOATR+Q.IOLU ;SET LUN

    593	002506	000411 				BR	RDWRAT		;GO DO IT

    594	002510	010146 			WRTATR:	MOV	R1,-(SP)	;SAVE R1

    595	002512	012701 	000000G			MOV	#IO.WAT,R1	;SET FN

    596	002516	112767 	000004 	000000G		MOVB	#4,RATUFA	;SET WRITE FN

    597	002524	012767 	000000G	000034'		MOV	#OUTLUN,QIOATR+Q.IOLU ;SET LUN

    598	002532	010167 	000032'		RDWRAT:	MOV	R1,QIOATR+Q.IOFN ;SET FN

    599	002536	010067 	000044'			MOV	R0,QIOATR+Q.IOPL ;SET PTR TO FDB

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 11-3

**** PIPCPY VERSION M0240 ****



    600	002542	062767 	000102 	000044'		ADD	#F.FNB,QIOATR+Q.IOPL ;BUT ACP WANTS FILE ID

    601	002550	132760 	000041 	000017 		BITB	#FD.SQD!FD.REC,F.RCTL(R0) ;SEQUENTIAL OR RECORD DEVICE?

    602	002556	001020 				BNE	20$		;IF NE YES--DON'T READ ATTRIBUTES

    603	002560					DIR$	#QIOATR		;READ/WRITE ATTRIBUTES

    604	002566	103414 				BCS	20$		;IF CS ERROR

    605	002570					WTSE$S	#RATEFN		;WAIT FOR COMPLETION

    606	002602	103406 				BCS	20$		;IF CS ERROR

    607	002604	116760 	000000G	000052 		MOVB	IOSTBK,F.ERR(R0) ;PUT ERROR CODE IN VISIBLE SPOT		;BLS047

    608	002612	003002 				BGT	20$		;IF GT THEN OK					;BLS047

    609	002614	001401 				BEQ	20$		;IF EQ OK					;**-1

    610	002616	000261 			10$:	SEC			;FLAG ERROR

    611	002620	012601 			20$:	MOV	(SP)+,R1	;RESTORE R1

    612	002622					RETURN			;BACK TO CALLER

    613					;+

    614					; .LPCHK -- SEE IF DEVICE IS LINE PRINTER

    615					;

    616					; INPUTS:

    617					;

    618					;	R0	FDB ADDRESS

    619					;

    620					; OUTPUTS:

    621					;

    622					;	C-SET	NOT LP:

    623					;	C-CLEAR	LP:

    624					;

    625					;-

    626

    627	002624	000241 			.LPCHK::CLC			;ASSUME A LINE PRINTER

    628	002626	132760 	000001 	000017 		BITB	#FD.REC,F.RCTL(R0) ;MUST BE RECORD ORIENTED

    629	002634	001410 				BEQ	10$		;IF EQ NOT LP

    630	002636	132760 	000002 	000017 		BITB	#FD.CCL,F.RCTL(R0) ;AND CARRIAGE CONTROL

    631	002644	001404 				BEQ	10$		;IF EQ NOT LP

    632	002646	132760 	177774 	000017 		BITB	#^C<FD.REC!FD.CCL>,F.RCTL(R0) ;NO OTHER BITS SET?

    633	002654	001401 				BEQ	20$		;IF EQ IT IS LP:

    634	002656	000261 			10$:	SEC			;FLAG NOT LP:

    635	002660				20$:	RETURN			;

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 12

**** PIPCPY VERSION M0240 ****



    637					;

    638					; BOTH FILES ARE NOW OPEN. IF RECORD ORIENTED COPY, ALLOCATE REMAINING

    639					; BUFFER SPACE AS A RECORD BUFFER

    640					;

    641	002662	005060 	000076 		ISOPEN:	CLR	F.ACTL(R0)	; SHUT OFF REWIND IF SET

    642	002666	032760 	000001 	000016 		BIT	#FD.RWM,F.RACC(R0) ; SEE IF BLOCK COPY IN USE

    643	002674	001043 				BNE	4$		; YES - NO RECORD BUFFER NEEDED

    644	002676					FDRC$R	R0,,#0,#0	;NO USER RECORD BUFFER

    645	002706	005001 				CLR	R1

    646	002710	013702 	000000G			MOV	@#.FSRPT,R2	; GET BUFFER FREE LIST HEAD FROM FSR2

    647	002714	011202 			1$:	MOV	(R2),R2		; CHAIN TO NEXT FREE AREA

    648	002716	001406 				BEQ	2$		; BRANCH IF NO MORE

    649	002720	026201 	000002 			CMP	2(R2),R1	; SEE IF THIS SPACE IS LARGER THAN PREVIOUS

    650	002724	101773 				BLOS	1$		; NO, KEEP LOOKING

    651	002726	016201 	000002 			MOV	2(R2),R1	; YES, CONSIDER THIS SPACE

    652	002732	000770 				BR	1$		; BUT KEEP TRYING

    653

    654	002734	005701 			2$:	TST	R1		; SEE IF WE FOUND ANYTHING

    655	002736	001005 				BNE	3$

    656	002740	012700 	000000G			MOV	#FDBIN,R0

    657	002744					ERROUX	DY01,0		;NOT ENOUGH BUFFER SPACE

	002744	104407 				TRAP	X

	002746	000000G				.WORD	DY01SZ

	002750	000000G				.WORD	DY01MG

    658					;*****PATCH REQUIRED UNTIL FCS IS FIXED						;BLS043

    659					;										;BLS043

    660	002752	100002 			3$:	BPL	301$		;IF LT 16K (SIGN BIT OFF) SKIP AHEAD		;BLS043

    661	002754	012701 	077776 			MOV	#77776,R1	;ELSE USE 16K-2 BYTES				;BLS043

    662	002760				301$:	CALL	.DYALC		;ALLOCATE THE RECORD BUFFER			;BLS043

    663					;										;BLS043

    664					;*****ABOVE PATCH REQUIRED UNTIL FCS IS FIXED					;BLS043

    665	002764					FDRC$R	#FDBIN,,.DYBUF,.DYBYT						;**-1

    666					;

    667					; OUTPUT FILE IS OPEN - SEE IF EXTEND IS NECESSARY

    668					;

    669	003004	012700 	000000G		4$:	MOV	#FDBOUT,R0

    670	003010	132760 	000041 	000017 		BITB	#FD.REC!FD.SQD,F.RCTL(R0) ;DON'T EXTEND REC OR SEQ DEV

    671	003016	001052 				BNE	30$

    672	003020	016004 	000006 			MOV	F.HIBK+2(R0),R4	;LOW ORDER SIZE OF FILE IN BLOCKS

    673	003024	016003 	000004 			MOV	F.HIBK(R0),R3	;HIGH ORDER SIZE OF FILE

    674	003030	010446 				MOV	R4,-(SP)

    675	003032	050326 				BIS	R3,(SP)+	;SEE IF FILE IS NON-NULL

    676	003034	001402 				BEQ	5$		;BRANCH IF NULL

    677	003036	005067 	000004G			CLR	.EXTSZ+4	;FORCE NON-CONTIGUOUS EXTEND

    678	003042	016001 	000012 		5$:	MOV	F.EFBK+2(R0),R1	;GET CURENT EOF

    679	003046	016002 	000010 			MOV	F.EFBK(R0),R2

    680	003052	005760 	000014 			TST	F.FFBY(R0)	;IF FFBY=0

    681	003056	001003 				BNE	10$		;

    682	003060	162701 	000001 			SUB	#1,R1		;SUBTRACTED ONE TOO MANY

    683	003064	005602 				SBC	R2		;

    684	003066	160401 			10$:	SUB	R4,R1		;COMPUTE NEGATIVE OF SPACE LEFT

    685	003070	005602 				SBC	R2

    686	003072	160302 				SUB	R3,R2

    687	003074	012705 	000000G			MOV	#.EXTSZ,R5	;POINT TO SIZE DATA

    688	003100	062502 				ADD	(R5)+,R2	;COMPUTE ADDITIONAL SPACE NEEDED

    689	003102	062501 				ADD	(R5)+,R1

    690	003104	005502 				ADC	R2

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 12-1

**** PIPCPY VERSION M0240 ****



    691	003106	100416 				BMI	30$		;NEGATIVE MEANS ENOUGH

    692	003110	001002 				BNE	25$

    693	003112	005701 				TST	R1		;CHECK LOW ORDER IF HIGH IS ZERO

    694	003114	001413 				BEQ	30$		;BRANCH IF NO EXTEND NEEDED

    695	003116	000302 			25$:	SWAB	R2		;SET UP HIGH ORDER EXTEND CONTROL

    696	003120	105002 				CLRB	R2

    697	003122	052702 	000200 			BIS	#200,R2		;ENABLE EXTEND CONTROL

    698	003126	005725 				TST	(R5)+		;SEE IF CONTIGUOUS

    699	003130	001402 				BEQ	26$		;BRANCH IF NO

    700	003132	052702 	000005 			BIS	#5,R2

    701	003136				26$:	CALL	.EXTND

    702	003142	103531 				BCS	CERR52

    703

    704	003144				30$:	CALL	.LPCHK		;SEE IF OUTPUT TO LP:

    705	003150	103427 				BCS	40$		;IF CS NO

    706	003152					FDAT$R	R0,#R.VAR,#0

    707	003164					PUT$	R0,#LPHDMG,#LPHDSZ ;START WITH A FORM FEED

    708	003204	103537 				BCS	CERR1		;BRANCH IF WRITE ERROR

    709	003206					FDAT$R	R0,FDBIN+F.RTYP,FDBIN+F.RATT,FDBIN+F.RSIZ

    710

    711	003230				40$:

    712	003230	012701 	000000G		COPYGO:	MOV	#FDBIN,R1	;SET R1, R2 TO FDB ADDRESSES

    713	003234	012702 	000000G			MOV	#FDBOUT,R2	;TO GAIN SPEED IN COPY LOOP

    714	003240	132761 	000001 	000016 		BITB	#FD.RWM,F.RACC(R1)

    715	003246	001402 				BEQ	40$

    716	003250	000167 	000502 			JMP	CPYBLK		;BRANCH IF COPYING IN BLOCK MODE

    717					;

    718					; COPY IN RECORD MODE

    719	003254				40$:	GET$	R1

    720	003262	103514 				BCS	CPYEOF		;BRANCH IF ERROR IN READ, EOF?

    721	003264	016767 	000026G	000026G		MOV	FDBIN+F.NRBD+2,FDBOUT+F.NRBD+2 ; SET OUTPUT ADDRESS

    722	003272	016767 	000024G	000024G		MOV	FDBIN+F.NRBD,FDBOUT+F.NRBD ; AND SIZE

    723	003300	016767 	000100G	000100G		MOV	FDBIN+F.SEQN,FDBOUT+F.SEQN ; COPY RECORD SEQUENCE NO.

    724	003306					PUT$	R2

    725	003314	103357 				BCC	40$		;DO NEXT RECORD IF ALL IS WELL

    726	003316	000472 				BR	CERR1		;WRITE ERROR

    727					;

    728					; FAILED TO OPEN OUTPUT FILE

    729	003320	005060 	000076 		CERR2:	CLR	F.ACTL(R0)	; SHUT OFF REWIND IF SET

    730	003324	122760 	177750 	000052 		CMPB	#IE.DFU,F.ERR(R0) ;ALLOCATION FAILURE?

    731	003332	001426 				BEQ	CERR53		;BRANCH IF YES

    732	003334	122760 	177707 	000052 		CMPB	#IE.DUP,F.ERR(R0) ;FILE ALREADY EXISTS?

    733	003342	001404 				BEQ	10$		;BRANCH IF YES

    734	003344					ERROUT	OP02,0,0	;FAILED TO OPEN OUTPUT FILE

	003344	104426 				TRAP	X

	003346	000000G				.WORD	OP02SZ

	003350	000000G				.WORD	OP02MG

    735	003352	000410 				BR	20$

    736	003354				10$:	ERROUT	OP08,0		;OUTPUT FILE ALREADY EXISTS

	003354	104406 				TRAP	X

	003356	000000G				.WORD	OP08SZ

	003360	000000G				.WORD	OP08MG

    737	003362	032767 	000000G	000002G		BIT	#MERGBT,CMDWRD+2	;IF MERGING

    738	003370	001001 				BNE	20$		;THEN CAN'T CONTINUE WITH NEXT FILE

    739	003372	000457 				BR	COPYXW		;SET WARNING STATUS AND CONTINUE

    740	003374	000167 	000000G		20$:	JMP	CLOSX

    741					;

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 12-2

**** PIPCPY VERSION M0240 ****



    742					; FAILE TO ATTACH THE TTY

    743	003400				CERR3:	ERROUT	DI06,0,0

	003400	104426 				TRAP	X

	003402	000000G				.WORD	DI06SZ

	003404	000000G				.WORD	DI06MG

    744	003406	000451 				BR	COPYXW		;SET WARNING STATUS AND CONTINUE

    745					;

    746					; EXTEND FAILURE AT OPEN TIME

    747					;

    748	003410	012702 	000001 		CERR53:	MOV	#1,R2		;ASSUME IT WAS CONTIGUOUS EXTEND

    749	003414	016701 	000000G			MOV	.EXTSZ,R1

    750	003420	002002 				BGE	CERR52		;BRANCH IF IT WAS CONTIGUOUS

    751	003422	005002 				CLR	R2		;NON-CONTIGUOUS

    752	003424	005401 				NEG	R1

    753					;

    754					; FAILED TO EXTEND THE OUTPUT FILE

    755					; R1 = DESIRED SIZE OF EXTEND, R2=0 FOR NON-CONTIGUOUS EXTEND, 1 FOR

    756					; CONTIGUOUS REQUEST.

    757					;

    758	003426	122760 	177750 	000052 	CERR52:	CMPB	#IE.DFU,F.ERR(R0) ;DEVICE FULL?

    759	003434	001016 				BNE	30$		;BRANCH IF SOME OTHER ERROR

    760	003436	005702 				TST	R2		;ASKING FOR CONTIGUOUS SPACE?

    761	003440	001010 				BNE	20$		;BRANCH IF YES

    762	003442	010146 				MOV	R1,-(SP)	;SAVE EXTEND SIZE

    763	003444					ERROUT	CP11,0		;COULDN'T ALLOCATE ANY SPACE

	003444	104406 				TRAP	X

	003446	000000G				.WORD	CP11SZ

	003450	000000G				.WORD	CP11MG

    764	003452	022627 	000024 			CMP	(SP)+,#20.	;IF RELATIVELY LARGE SPACE WAS NEEDED

    765	003456	101025 				BHI	COPYXW		;SET WARNING STATUS AND CONTINUE

    766	003460	000407 				BR	40$		;OTHERWISE STOP THE COPY LOOP NOW

    767	003462				20$:	ERROUT	CP10,0		;FAILED TO FIND CONTIGUOUS SPACE

	003462	104406 				TRAP	X

	003464	000000G				.WORD	CP10SZ

	003466	000000G				.WORD	CP10MG

    768	003470	000420 				BR	COPYXW		;SET WARNING STATUS AND CONTINUE

    769	003472				30$:	ERROUT	CP12,0,0	;COULDN'T EXTEND - PRINT REASON

	003472	104426 				TRAP	X

	003474	000000G				.WORD	CP12SZ

	003476	000000G				.WORD	CP12MG

    770	003500	000167 	000000G		40$:	JMP	CLOSX		;EXIT FROM THE COPY LOOP

    771					;

    772					; WRITE ERROR

    773	003504				CERR1:	ERROUT	CP14,0,0

	003504	104426 				TRAP	X

	003506	000000G				.WORD	CP14SZ

	003510	000000G				.WORD	CP14MG

    774	003512	000407 				BR	COPYXW		;SET WARNING STATUS AND CONTINUE

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 13

**** PIPCPY VERSION M0240 ****



    776	003514	122760 	177766 	000052 	CPYEOF:	CMPB	#IE.EOF,F.ERR(R0)

    777	003522	001411 				BEQ	COPYX

    778					;

    779					; READ ERROR

    780	003524				CERR6:	ERROUT	CP13,0,0

	003524	104426 				TRAP	X

	003526	000000G				.WORD	CP13SZ

	003530	000000G				.WORD	CP13MG

    781	003532				COPYXW:	CALL	SETWAR		;SET WARNING STATUS

    782	003536	000403 				BR	COPYX

    783

    784	003540	042767 	000000G	000122G	CPYNXT:	BIC	#NB.SFL,FDBIN+F.FNB+N.STAT

    785	003546				COPYX:	CALL	CLSIN		;CLOSE INPUT FILE

    786	003552					CALL	.DYREL		; RELEASE THE RECORD BUFFER TO KEEP FSR CLEAN

    787	003556	032767 	000000G	000002G		BIT	#MERGBT,CMDWRD+2 ;AND THE OUTPUT FILE UNLESS MERGE MODE

    788	003564	001014 				BNE	10$

    789	003566	005767 	000070G			TST	FDBOUT+F.BDB	;NEED TO CLOSE OUTPUT FILE?

    790	003572	001407 				BEQ	5$		;BRANCH IF ALREADY CLOSED

    791	003574	016746 	000102G			MOV	FDBOUT+F.FNB+N.FID,-(SP) ;SAVE OUTPUT FILE ID

    792	003600					CALL	CLSOUT		;CLOSE THE OUTPUT FILE

    793	003604	012602 				MOV	(SP)+,R2	;R2=SAVED FILE NUMBER

    794	003606					CALL	WRFOWN		;WRITE THE FILE OWNER				;BLS061

    795	003612	005067 	000000G		5$:	CLR	BLKCNT		;RESET ONLY IF NOT A MERGE OPERATION		;**-10

    796	003616	012700 	000000G		10$:	MOV	#FDBIN,R0	;R0=INPUT FDB ADDRESS

    797	003622					CALL	NXTFIL		;IS THERE A WILD CARD FILE?

    798	003626	103405 				BCS	CPYNX1		;BRANCH IF NO

    799	003630	042767 	000000G	000000G		BIC	#FRSTIM,CPYCTL	;SAY "NOT THE FIRST TIME"

    800	003636	000167 	174632 			JMP	CPYWLD

    801	003642				CPYNX1:	CALL	NXTIN		;GET THE NEXT INPUT SPECIFIER

    802	003646	103405 				BCS	10$		;BRANCH IF NO MORE SPECS

    803	003650	012767 	177777 	000060'		MOV	#-1,ATRSAV	;RESET ATTRIBUTE FLAG				;BLS059

    804	003656	000167 	174476 			JMP	COPY2

    805	003662	032767 	000000G	000002G	10$:	BIT	#MERGBT,CMDWRD+2 ;MERGEING?					;BLS061

    806	003670	001412 				BEQ	30$		;IF EQ NO					;BLS061

    807	003672	005767 	000070G			TST	FDBOUT+F.BDB	;YES--FILE OPEN?				;BLS061

    808	003676	001407 				BEQ	30$		;IF EQ NO					;BLS061

    809	003700	016746 	000102G			MOV	FDBOUT+F.FNB+N.FID,-(SP) ;YES--SAVE FILE ID			;BLS061

    810	003704					CALL	CLSOUT		;CLOSE OUTPUT FILE				;BLS061

    811	003710	012602 				MOV	(SP)+,R2	;RESTORE FILE ID				;BLS061

    812	003712					CALL	WRFOWN		;WRITE FILE OWNER				;BLS061

    813	003716	000167 	000000G		30$:	JMP	CLOSX		;						;BLS061

    814															;**-1

    815					; FAILED TO OPEN INPUT FILE

    816	003722	005060 	000076 		CERR51:	CLR	F.ACTL(R0)	; SHUT OFF REWIND IF SET

    817	003726	122760 	177746 	000052 		CMPB	#IE.NSF,F.ERR(R0)  ;WAS FILE NOT FOUND?

    818	003734	001003 				BNE	CERR13		;BRANCH IF SOME OTHER ERROR

    819	003736					CALL	FNDERR

    820	003742	000701 				BR	COPYX

    821	003744				CERR13:	ERROUT	OP01,0,0

	003744	104426 				TRAP	X

	003746	000000G				.WORD	OP01SZ

	003750	000000G				.WORD	OP01MG

    822	003752	000667 				BR	COPYXW		;SET WARNING STATUS AND CONTINUE

    823	003754	000653 			BRCER1:	BR	CERR1		;BRANCH AID TO GET TO CERR1

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 14

**** PIPCPY VERSION M0240 ****



    825					;

    826					; COPY IN BLOCK MODE

    827	003756	016767 	000000G	000014'	CPYBLK:	MOV	.DYBUF,QIODPB+Q.XFAD ;PUT BUFFER ADDRESS IN DPB

    828	003764	016704 	000010G			MOV	FDBIN+F.EFBK,R4

    829	003770	016705 	000012G			MOV	FDBIN+F.EFBK+2,R5 ;R4,R5 = NO.OF BLOCK IN USE

    830	003774	005767 	000014G			TST	FDBIN+F.FFBY	 ;ONE TOO BIG IF FFBY=0

    831	004000	001003 				BNE	10$

    832	004002	162705 	000001 			SUB	#1,R5

    833	004006	005604 				SBC	R4

    834	004010	005067 	000022'		10$:	CLR	QIODPB+Q.XFVB

    835	004014	012767 	000001 	000024'		MOV	#1,QIODPB+Q.XFVB+2 ;START AT VBN 1

    836	004022	016703 	000000G		20$:	MOV	.DYBLK,R3	;R3=NO. OF BLOCKS AVAILABLE IN BUFFER

    837	004026	005704 				TST	R4		;IF MORE THAN 65K BLOCKS LEFT

    838	004030	001004 				BNE	30$		;TRANSFER MAX BUFFER SIZE

    839	004032	020503 				CMP	R5,R3		;OR IF MORE BLOCKS THAN BUFFER SPACE

    840	004034	101002 				BHI	30$		;TRANSFER MAX BUFFER SIZE

    841	004036	010503 				MOV	R5,R3		;OTHERWISE USE WHAT'S LEFT

    842	004040	001434 				BEQ	40$		;BRANCH IF NONE LEFT, ALL DONE

    843	004042	010301 			30$:	MOV	R3,R1

    844	004044	000301 				SWAB	R1

    845	004046	006301 				ASL	R1		;CONVERT BLOCK COUNT TO BYTE COUNT

    846	004050	010167 	000016'			MOV	R1,QIODPB+Q.XFSZ ;AND STORE IT IN THE DPB

    847	004054	012767 	000000G	000002'		MOV	#IO.RVB,QIODPB+Q.IOFN ;I/O FUNCTION CODE FOR READ VIRTUAL

    848	004062	012700 	000000G			MOV	#FDBIN,R0

    849	004066					CALL	RWGO		;PERFORM THE READ

    850	004072	103614 				BCS	CERR6		;BRANCH IF ERROR

    851	004074	012767 	000000G	000002'		MOV	#IO.WVB,QIODPB+Q.IOFN ;I/O FUCNTION CODE FOR WRITE VIRTUAL

    852	004102	012700 	000000G			MOV	#FDBOUT,R0

    853	004106					CALL	RWGO		;WRITE THE BLOCK

    854	004112	103720 				BCS	BRCER1		;IF CS WRITE ERROR

    855	004114	160305 				SUB	R3,R5

    856	004116	005604 				SBC	R4		;R4,R5 = NO. OF BLOCKS LEFT TO TRANSFER

    857	004120	060367 	000024'			ADD	R3,QIODPB+Q.XFVB+2

    858	004124	005567 	000022'			ADC	QIODPB+Q.XFVB	;UPDATE THE NEXT VBN

    859	004130	000734 				BR	20$		;GO DO THE NEXT SET OF VBN'S

    860	004132	016767 	000010G	000010G	40$:	MOV	FDBIN+F.EFBK,FDBOUT+F.EFBK ;SET OUTPUT EOF

    861	004140	016767 	000012G	000012G		MOV	FDBIN+F.EFBK+2,FDBOUT+F.EFBK+2

    862	004146	016767 	000014G	000014G		MOV	FDBIN+F.FFBY,FDBOUT+F.FFBY

    863	004154	000167 	177366 			JMP	COPYX

    864					;+

    865					; START UP A READ OR WRITE VIRTUAL BLOCK FOR BLOCK MODE COPY

    866					;

    867					; INPUTS:

    868					;

    869					;	R0=FDB ADDRESS

    870					;

    871					; OUTPUTS:

    872					;

    873					;	C=0 IF SUCCESSFUL, C=1 IF ERROR

    874					;	F.ERR(R0) SET TO ERROR CODE IF ERROR

    875					;	ALL REGISTERS PRESERVED

    876					;

    877					;-

    878	004160	116067 	000042 	000004'	RWGO:	MOVB	F.LUN(R0),QIODPB+Q.IOLU

    879	004166	005060 	000052 		10$:	CLR	F.ERR(R0)

    880	004172					DIR$	#QIODPB		;ISSUE THE QI/O

    881	004200	103416 				BCS	20$

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 14-1

**** PIPCPY VERSION M0240 ****



    882	004202					WTSE$S	#RWEFN		;WAIT FOR COMPLETION

    883	004214	116760 	000000G	000052 		MOVB	IOSTBK,F.ERR(R0) ;SET ERROR IF ANY

    884	004222	002415 				BLT	30$		;BRANCH IF ERROR

    885	004224	026767 	000002G	000016'		CMP	IOSTBK+2,QIODPB+Q.XFSZ ;ALL BYTES TRANSFERRED?

    886	004232	001021 				BNE	50$		;BRANCH IF NO, ERROR

    887	004234					RETURN

    888	004236	013760 	000000G	000052 	20$:	MOV	@#$DSW,F.ERR(R0) ;PICK UP REASON FOR QI/O FAILURE

    889	004244	022760 	000000G	000052 		CMP	#IE.UPN,F.ERR(R0) ;OUT OF DYNAMIC MEMORY?

    890	004252	001405 				BEQ	40$		;YES, WAIT AND TRY AGAIN

    891	004254	000413 				BR	60$

    892	004256	122760 	177751 	000052 	30$:	CMPB	#IE.NOD,F.ERR(R0) ;NO DYNAMIC MEMORY AVAILABLE?

    893	004264	001007 				BNE	60$

    894	004266				40$:	WSIG$S			;YES, WAIT AND TRY AGAIN

    895	004274	000734 				BR	10$

    896	004276	112760 	177761 	000052 	50$:	MOVB	#IE.ABO,F.ERR(R0) ;FAILED TO TRANSFER DESIRED COUNT, ABORT

    897	004304	000261 			60$:	SEC

    898	004306					RETURN

    899

    900					;										;BLS061

    901					; WRITE FILE OWNER								;BLS061

    902					;										;BLS061

    903															;BLS061

    904	004310	016703 	000000G		WRFOWN:	MOV	.FOWNR,R3	;WAS THERE A FILE OWNER?			;BLS061

    905	004314	001416 				BEQ	10$		;IF EQ NO					;BLS061

    906	004316	010260 	000102 			MOV	R2,F.FNB+N.FID(R0) ;YES--RESTORE FILE ID			;BLS061

    907	004322	005046 				CLR	-(SP)		;SET UP ATTRIBUTES LIST				;BLS061

    908	004324	012746 	000000G			MOV	#.FOWNR,-(SP)	;...						;BLS061

    909	004330	012746 	000000G			MOV	#HA.UI,-(SP)	;WRITE FILE OWNER ATTRIBUTE			;BLS061

    910	004334	010601 				MOV	SP,R1		;POINT R1 TO ATTRIBUTE LIST			;BLS061

    911	004336					CALL	WRTATT		;WRITE ATTRIBUTES				;BLS061

    912	004342	062706 	000006 			ADD	#6,SP		;DELETE ATT. LIST FROM STACK			;BLS061

    913	004346	005067 	000102G			CLR	FDBOUT+F.FNB+N.FID ;ZERO FILE NUMBER AGAIN			;BLS061

    914	004352				10$:	RETURN									;BLS061

    915					;

    916					;

    917		000001 				.END

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 14-2

SYMBOL TABLE



AB.CDT  000105   	CP10MG= ****** GX	FA.WRT= 000002   	F.EFN = 000050   	IE.DFU= 177750

AB.CHU  000064   	CP10SZ= ****** GX	FDBIN = ****** GX	F.EOBB= 000032   	IE.DNA= 177771

AB.EXP  000122   	CP11MG= ****** GX	FDBOUT= ****** GX	F.ERR = 000052   	IE.DNR= 177775

AB.FNU  000000   	CP11SZ= ****** GX	FD.BLK= 000010   	F.FACC= 000043   	IE.DUN= 177767

AB.FP   000062   	CP12MG= ****** GX	FD.CCL= 000002   	F.FFBY= 000014   	IE.DUP= 177707

AB.FSQ  000002   	CP12SZ= ****** GX	FD.COM= 020000   	F.FNAM= 000110   	IE.EOF= 177766

AB.GC   000061   	CP13MG= ****** GX	FD.CR = 000002   	F.FNB = 000102   	IE.EOT= 177702

AB.NAM  000006   	CP13SZ= ****** GX	FD.DIR= 000010   	F.FTYP= 000116   	IE.EOV= 177765

AB.PC   000060   	CP14MG= ****** GX	FD.FTN= 000001   	F.FVER= 000120   	IE.EXP= 177665

AB.RDT  000070   	CP14SZ= ****** GX	FD.F11= 040000   	F.HIBK= 000004   	IE.FEX= 177717

AB.REV  000066   	CP15MG= ****** GX	FD.INS= 000010   	F.LUN = 000042   	IE.FHE= 177705

AB.UAT  000020   	CP15SZ= ****** GX	FD.ISP= 002000   	F.MBCT= 000054   	IE.FLN= 177657

APPDBT= ****** GX	CP16MG= ****** GX	FD.MNT= 100000   	F.MBC1= 000055   	IE.FOP= 177713

ATRSAV  000060R     003	CP16SZ= ****** GX	FD.OSP= 004000   	F.MBFG= 000056   	IE.HFU= 177744

BLKBIT= ****** GX	CP17MG= ****** GX	FD.PLC= 000004   	F.NRBD= 000024   	IE.IES= 177656

BLKCNT= ****** GX	CP17SZ= ****** GX	FD.PRN= 000004   	F.NREC= 000030   	IE.IFC= 177776

BRCER1  003754R     004	CS.DIF= 000002   	FD.PSE= 010000   	F.OVBS= 000030   	IE.IFU= 177747

BSZBIT= ****** GX	CS.DVF= 000004   	FD.RAH= 000001   	F.RACC= 000016   	IE.ILL= 177726

BUFSIZ= ****** GX	CS.EQU= 000040   	FD.RAN= 000002   	F.RATT= 000001   	IE.ISQ= 177703

CERR1   003504R     004	CS.INP= 000001   	FD.REC= 000001   	F.RCNM= 000034   	IE.LCK= 177745

CERR13  003744R     004	CS.MOR= 000020   	FD.RWM= 000001   	F.RCTL= 000017   	IE.MOD= 177753

CERR2   003320R     004	CS.NMF= 000001   	FD.SDI= 000020   	F.RSIZ= 000002   	IE.NBF= 177731

CERR3   003400R     004	CS.OUT= 000002   	FD.SQD= 000040   	F.RTYP= 000000   	IE.NBK= 177727

CERR51  003722R     004	CS.WLD= 000010   	FD.TTY= 000004   	F.SEQN= 000100   	IE.NDR= 177670

CERR52  003426R     004	CWLDUI= ****** GX	FD.WBH= 000002   	F.SPDV= 000072   	IE.NFI= 177704

CERR53  003410R     004	C.CMLD= 000002   	FF.CHR= 000005   	F.SPUN= 000074   	IE.NFW= 177673

CERR6   003524R     004	C.DEVD= 000006   	FF.NV = 000003   	F.STBK= 000036   	IE.NLK= 177661

CH.AND= 000001   	C.DIRD= 000012   	FF.POE= 000002   	F.UNIT= 000136   	IE.NLN= 177733

CLOSX = ****** GX	C.DSDS= 000006   	FF.RWD= 000001   	F.URBD= 000020   	IE.NNC= 177663

CLSIN = ****** GX	C.FILD= 000016   	FF.RWF= 000006   	F.VBN = 000064   	IE.NNL= 177662

CLSOUT= ****** GX	C.MKW1= 000024   	FF.SPC= 000004   	F.VBSZ= 000060   	IE.NNN= 177674

CMDWRD= ****** GX	C.MKW2= 000026   	FILCL = ****** GX	GETBR   002430R     004	IE.NOD= 177751

CNTGBT= ****** GX	C.SIZE= 000054   	FNDERR= ****** GX	HA.UI = ****** GX	IE.NSF= 177746

COPY    000000RG    004	C.STAT= 000001   	FNDNXT= ****** GX	IE.ABO= 177761   	IE.NST= 177660

COPYAT  002356R     004	C.SWAD= 000022   	FO.APD= 000106   	IE.ALC= 177654   	IE.OFL= 177677

COPYGO  003230R     004	C.TYPR= 000000   	FO.MFY= 000002   	IE.ALN= 177736   	IE.ONP= 177773

COPYX   003546R     004	DIFDB = ****** GX	FO.RD = 000001   	IE.AST= 177660   	IE.OVR= 177756

COPYXW  003532R     004	DI06MG= ****** GX	FO.UPD= 000006   	IE.BAD= 177777   	IE.PES= 177655

COPY1   000526R     004	DI06SZ= ****** GX	FO.WRT= 000016   	IE.BBE= 177710   	IE.PRI= 177760

COPY2   000360R     004	DY01MG= ****** GX	FRSTIM= ****** GX	IE.BCC= 177676   	IE.RAC= 177724

CPYBLK  003756R     004	DY01SZ= ****** GX	F.ACTL= 000076   	IE.BDI= 177714   	IE.RAT= 177723

CPYCTL= ****** GX	EXTSIZ  001506R     004	F.ALOC= 000040   	IE.BDR= 177716   	IE.RBG= 177730

CPYEOF  003514R     004	EX$ERR= ****** GX	F.BBFS= 000062   	IE.BDV= 177711   	IE.RCN= 177722

CPYNXT  003540R     004	FA.APD= 000100   	F.BDB = 000070   	IE.BHD= 177700   	IE.RER= 177740

CPYNX1  003642R     004	FA.CRE= 000010   	F.BGBC= 000057   	IE.BLB= 177672   	IE.RNM= 177715

CPYOPN  001176R     004	FA.DLK= 001000   	F.BKDN= 000026   	IE.BLK= 177754   	IE.RSU= 177757

CPYWLD  000474R     004	FA.ENB= 100000   	F.BKDS= 000020   	IE.BNM= 177712   	IE.SNC= 177735

CP01MG= ****** GX	FA.EXC= 002000   	F.BKEF= 000050   	IE.BTF= 177664   	IE.SPC= 177772

CP01SZ= ****** GX	FA.EXT= 000004   	F.BKP1= 000051   	IE.BTP= 177725   	IE.SQC= 177734

CP02MG= ****** GX	FA.NSP= 000100   	F.BKST= 000024   	IE.BVR= 177701   	IE.SRE= 177762

CP02SZ= ****** GX	FA.POS= 010000   	F.BKVB= 000064   	IE.BYT= 177755   	IE.STK= 177706

CP03MG= ****** GX	FA.RD = 000001   	F.CHR = 000075   	IE.CKS= 177742   	IE.TMM= 177671

CP03SZ= ****** GX	FA.RWD= 004000   	F.CNTG= 000034   	IE.CLO= 177732   	IE.TMO= 177666

CP04MG= ****** GX	FA.SEQ= 040000   	F.DFNB= 000046   	IE.CNR= 177667   	IE.ULK= 177653

CP04SZ= ****** GX	FA.SHR= 000040   	F.DSPT= 000044   	IE.CON= 177752   	IE.UPN= ****** GX

CP05MG= ****** GX	FA.TMP= 000020   	F.DVNM= 000134   	IE.DAA= 177770   	IE.VER= 177774

CP05SZ= ****** GX	FA.WCK= 020000   	F.EFBK= 000010   	IE.DAO= 177763   	IE.WAC= 177743

PIPCPY M0240, COPY COMMAND-PIP	MACRO M1110  22-AUG-78 01:31  PAGE 14-3

SYMBOL TABLE



IE.WAT= 177741   	NB.NXD= 020000   	OPENWA  002320R     004	RECATT= ****** GX	VERSAV= ****** GX

IE.WCK= 177652   	NB.SDI= ****** GX	OPNCHK  002336R     004	REDATR  002464R     004	WRFOWN  004310R     004

IE.WER= 177737   	NB.SD1= 000400   	OPNOK   002344R     004	RWDBIT= ****** GX	WRTATR  002510R     004

IE.WLK= 177764   	NB.SD2= 001000   	OP01MG= ****** GX	RWEFN = ****** GX	WRTATT= ****** GX

IE.2DV= 177720   	NB.SFL= ****** GX	OP01SZ= ****** GX	RWGO    004160R     004	X     = 000026

IFNPT = ****** GX	NB.SFN= ****** GX	OP02MG= ****** GX	R$$DPB= 000001   	$DSW  = ****** GX

INLUN = ****** GX	NB.SNM= 000040   	OP02SZ= ****** GX	R$$DYM= 000001   	$$MSG = 000000

INRACC= ****** GX	NB.STP= 000020   	OP08MG= ****** GX	R$$EIS= 000000   	$$$ARG= 000006

INSPEC= ****** GX	NB.SVR= 000010   	OP08SZ= ****** GX	R$$MSG= 000000   	$$$OST= 000014

IOSTBK= ****** GX	NB.TYP= 000002   	OURACC= ****** GX	R$$VMS= 000001   	.CLOSE= ****** G

IO.RAT= ****** GX	NB.VER= 000001   	OUSPEC= ****** GX	R$$11M= 000001   	.DYALC= ****** GX

IO.RVB= ****** GX	NB.WLV= 010000   	OUTLUN= ****** GX	R.FIX = 000001   	.DYBLK= ****** GX

IO.WAT= ****** GX	NMBLK1= ****** GX	OUTOPN  001632R     004	R.SEQ = 000003   	.DYBUF= ****** GX

IO.WVB= ****** GX	NTCNTG= ****** GX	OWUIC = ****** GX	R.VAR = 000002   	.DYBYT= ****** GX

ISOPEN  002662R     004	NVERBT= ****** GX	O$$DS2= 000001   	SAME    001122R     004	.DYREL= ****** GX

IS.BV = 000005   	NXTFIL= ****** GX	PARSE = ****** GX	SETWAR= ****** GX	.DYSIZ= ****** GX

IS.CC = 001401   	NXTIN = ****** GX	PAR$$$= 000002   	SPANBT= ****** GX	.EXSTS= ****** GX

IS.CR = 006401   	N.DEVD= 000000   	PRSERR= ****** GX	SPSDBT= ****** GX	.EXTND= ****** GX

IS.EOT= 002001   	N.DID = 000024   	PRSREG= ****** GX	STBLK = ****** GX	.EXTSZ= ****** GX

IS.ESC= 015401   	N.DIRD= 000004   	QIOATR  000030R     003	STNBK1= ****** GX	.FOWNR= ****** GX

IS.ESQ= 115401   	N.DVNM= 000032   	QIODPB  000000R     003	STNMBK= ****** GX	.FSRPT= ****** GX

IS.PES= 100001   	N.FID = 000000   	Q.IOAE= 000012   	S.APPD= 000010   	.GETSQ= ****** G

IS.PND= 000000   	N.FLID= 000016   	Q.IOEF= 000006   	S.FATT= 000016   	.GFOWN= ****** GX

IS.RDD= 000002   	N.FNAM= 000006   	Q.IOFN= 000002   	S.FDB = 000140   	.LCLSW= ****** GX

IS.SUC= 000001   	N.FNMD= 000010   	Q.IOLU= 000004   	S.FIDS= 000014   	.LPCHK  002624RG    004

IS.TAB= 004401   	N.FTYP= 000014   	Q.IOPL= 000014   	S.FNAM= 000006   	.OPFNB= ****** G

IS.TMO= 000002   	N.FVER= 000016   	Q.IOPR= 000007   	S.FNB = 000036   	.OULCL= ****** GX

LPHDMG= 000000R     002	N.NEXT= 000022   	Q.IOSB= 000010   	S.FNBW= 000017   	.PARSE= ****** GX

LPHDSZ= 000001   	N.SPEC= 000014   	Q.XFAD= 000014   	S.FNTY= 000004   	.PUTSQ= ****** G

MERGBT= ****** GX	N.STAT= 000020   	Q.XFSZ= 000016   	S.FTYP= 000002   	.RFOWN= ****** GX

NAMBLK= ****** GX	N.UNIT= 000034   	Q.XFVB= 000022   	S.NFEN= 000020   	.WFOWN= ****** GX

NB.DEV= 000200   	OBFSIZ= ****** GX	RATEFN= ****** GX	UFDBIT= ****** GX	...GBL= 000000

NB.DIR= 000100   	OFNPT = ****** GX	RATUFA= ****** GX	UPDTBT= ****** GX	...TPC= 000140

NB.NAM= 000004   	OPENAU  002234R     004	RDWRAT  002532R     004



. ABS.	000131	   000

      	000000	   001

MSGSTR	000001	   002

IMPURE	000062	   003

PURE$I	004354	   004

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  7981 WORDS  ( 32 PAGES)

DYNAMIC MEMORY:  9108 WORDS  ( 35 PAGES)

ELAPSED TIME:  00:01:08

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

