RSXIO	MACRO M1110  21-AUG-78 22:54

TABLE OF CONTENTS



    32-   14	OPENIT		OPEN A FILE

    33-   63	SWSCN		SCAN SWITCH OPTIONS

    34-   98	OPTN		SET/CLEAR ONE DIRECTIVE OPTION

    35-  146	CLOSET		CLOSE ALL FILES

    36-  176	MLIBR		RECORD MACRO LIBRARY

    36-  195	STKLIB		STACK FILE ID FOR MACRO LIBRARY

    37-  224	LIBRY		MACRO LIBRARY DIRECTIVE

    38-  275	COPNAM		COPY MACRO LIBRARY FILE NAME INTO "LIBBUF"

    39-  310	ERRPRI		PRINT ERROR MESSAGES

    40-  355	LIBRARY OPEN FAILURE ROUTINE

    41-  375	BUFFER AND C.S.I. BLOCK FOR USE WITH .LIBRARY

    41-  389	ERROR MESSAGES FOR .LIBRARY AND INTERMEDIATE FILE I/O

    42-  397	ASSEMBLY TIME STATISTICS

RSXIO	MACRO M1110  21-AUG-78 22:54  PAGE 26





      1						.IDENT	\X03.11\

      2					;

      3					; COPYRIGHT (C) 1977, 1978

      4					; DIGITAL EQUIPMENT CORPORATION, MAYNARD MASSACHUSETTS 01754

      5					;

      6					; THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ON A SINGLE

      7					; COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH THE INCLUSION OF THE

      8					; ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE, OR ANY OTHER COPIES THEREOF,

      9					; MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON

     10					; EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE

     11					; TERMS.  TITLE TO AND OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES

     12					; REMAIN IN DEC.

     13					;

     14					; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE

     15					; AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT

     16					; CORPORATION.

     17					;

     18					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS

     19					; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

     20					;

     21

     22					;++

     23					; FACILITY:	VAX-11 MACRO OBJECT MODULE LIBRARY "MAR.OLB"

     24					;

     25					; ABSTRACT:	THIS MODULE IS PART OF THE VAX-11 MACRO ASSEMBLER, ITS DESCRIPTION

     26					;		IS ON THE FOLLOWING PAGE.

     27					;

     28					;

     29					; ENVIRNOMENT:	VAX-11 MACRO RUNS ON ANY VAX-11 WITH COMPATIBILITY MODE, UNDER

     30					;		THE CME (COMPATIBILITY MODE EMULATOR) OF VAX/VMS OR ON A PDP-11

     31					;		WITH EXTENDED INSTRUCTIONS UNDER RSX-11/M.

     32					;

     33					; AUTHOR:	STEVE POULSEN, CREATION DATE:  22-JUL-76

     34					;		DALE A. ROEDGER, 10-JAN-77 - 19-DEC-77

     35					;		DAVE N. CUTLER

     36					;		BENN L. SCHREIBER

     37					;

     38					; MODIFIED BY:

     39					;

     40					;--

     41					.IF NDF $DATA$

RSXIO	MACRO M1110  21-AUG-78 22:54  PAGE 32





      1					.TITLE	RSXIO

      2					;++

      3					;

      4					; THE ROUTINES IN THIS MODULE ARE USED TO OPEN AND CLOSE FILES

      5					; DURING THE ASSEMBLY PROCESS.

      6					;

      7					;--

      8

      9					.MCALL	OFNB$,	QIOW$S,	CLOSE$,	PRINT$,	PUT$S,	FDOP$R

     10					.MCALL	CSI$,	CSI$1,	CSI$2,	WSIG$S

     11

     12	000000				.PSECT	RSXIO

     13

     14					.SBTTL	OPENIT		OPEN A FILE

     15					;++

     16					;

     17					; THIS ROUTINE OPENS A FILE OBTAINED FROM THE USER'S COMMAND LINE BY CSI$2.

     18					;

     19					; INPUTS:

     20					;	R5 - ADDRESS OF THE CSI BLOCK

     21					;	R1 - ADDRESS OF THE DEFAULT FILE NAME BLOCK (FNB)

     22					;	R3 - ADDRESS OF THE FILE DESCRIPTOR BLOCK (FDB)

     23					;

     24					;--

     25

     26	000000				OPENIT::

     27	000000	132765 	000010 	000001 		BITB	#CS.WLD,C.STAT(R5)		; DOES FILE HAVE WILD CARDS?

     28	000006	001410 				BEQ	5$				; NO

     29	000010					ERRPRT	NOWCRD,CSIBLK+C.FILD		; NO WILD CARDS ALLOWED

     30	000024	000167 	000000G			JMP	ABORT				; TERMINATE ASSEMBLY

     31

     32	000030	132767 	000000G	000000C	5$:	BITB	#FD.REC,LSTBLK+F.RCTL		; RECORD ORIENTED DEVICE?

     33	000036	001421 				BEQ	10$				; SKIP IF NOT

     34	000040	116700 	000000C			MOVB	LSTBLK+F.LUN,R0			; GET LUN

     35	000044					QIOW$S	#IO.DET,R0			; DETATCH LISTING DEVICE

     36	000102	010502 			10$:	MOV	R5,R2				; COPY PTR TO CSIBLK

     37	000104	062702 	000006 			ADD	#C.DSDS,R2			; POINT TO DATA SET DESC

     38	000110					FDOP$R	R3,,R2,R1			; #FDB,LUN,#DATASET DESC, DEFAULT FNB

     39	000122	132765 	000005 	000001 		BITB	#CS.NMF!CS.DVF,C.STAT(R5)	; NAME OR DEVICE?

     40	000130	001430 				BEQ	30$				; NO, NO FILE FOUND

     41	000132	010300 				MOV	R3,R0				; COPY FDB POINTER

     42	000134	010001 				MOV	R0,R1				; COPY AGAIN

     43	000136	062701 	000000G			ADD	#F.FNB,R1			; POINT TO FNB

     44	000142	016002 	000000G			MOV	F.DSPT(R0),R2			; DATASET DESC

     45	000146	016003 	000000G			MOV	F.DFNB(R0),R3			; DEFAULT FNB

     46	000152	004767 	000000G			JSR	PC,.PARSE			; PARSE THE FILE

     47	000156	103007 				BCC	20$				; SKIP IF OKAY

     48	000160					ERRPRT	PRSFLD,CSIBLK+C.FILD		; PARSE FAILURE

     49	000174	000435 				BR	50$				; ERROR EXIT

     50	000176				20$:	OFNB$	R0				; OPEN BY FILE NAME BLOCK

     51	000202	103003 				BCC	30$				; IT IS OPEN

     52	000204	004767 	000000G			JSR	PC,OPNFAIL			; FILE OPEN FAILURE

     53	000210	000772 				BR	20$				; TRY TO OPEN AGAIN

     54	000212	132767 	000000G	000000C	30$:	BITB	#FD.REC,LSTBLK+F.RCTL		; RECORD ORIENTED DEVICE?

     55	000220	001421 				BEQ	40$				; SKIP IF NOT

     56	000222	116700 	000000C			MOVB	LSTBLK+F.LUN,R0			; GET LUN

     57	000226					QIOW$S	#IO.ATT,R0			; ATTACH LISTING DEVICE

RSXIO	MACRO M1110  21-AUG-78 22:54  PAGE 32-1

OPENIT		OPEN A FILE



     58	000264	000241 			40$:	CLC					; SET NO ERROR

     59	000266	000401 				BR	OPENIX				; EXIT

     60	000270	000261 			50$:	SEC					; SET ERROR RETURN

     61	000272	000207 			OPENIX:	RTS	PC				; RETURN

RSXIO	MACRO M1110  21-AUG-78 22:54  PAGE 33

SWSCN		SCAN SWITCH OPTIONS



     63					.SBTTL	SWSCN		SCAN SWITCH OPTIONS

     64					;++

     65					;

     66					; SWSCN -- SCAN SWITCH TABLES.  THIS ROUTINE SCANS AND SETS/CLEARS

     67					;	   ANY SWITCHES ASSOCIATED WITH A FILE.

     68					;

     69					;--

     70

     71	000274	012703 	000000G		SWSCN::	MOV	#SWCHTB,R3			; POINT TO SWITCH TABLE

     72	000300	012300 			1$:	MOV	(R3)+,R0			; GET NEXT SWITCH

     73	000302	001424 				BEQ	4$				; END OF TABLE

     74	000304	030065 	000024 			BIT	R0,C.MKW1(R5)			; SWITCH SET?

     75	000310	001003 				BNE	2$				; YES

     76	000312	062703 	000006 			ADD	#6,R3				; SKIP ENTRY

     77	000316	000770 				BR	1$				; TRY NEXT SWITCH

     78

     79	000320	012301 			2$:	MOV	(R3)+,R1			; GET VALUE TABLE PTR

     80	000322	010302 				MOV	R3,R2				; POINT TO DIRECTIVE OPTIONS

     81	000324	062703 	000002 			ADD	#2,R3				; BUMP POINTER

     82	000330	012304 				MOV	(R3)+,R4			; GET FLAG (SET/CLEAR)

     83	000332	030065 	000026 			BIT	R0,C.MKW2(R5)			; NEGATED OPTION?

     84	000336	001001 				BNE	3$				; NO

     85	000340	005104 				COM	R4				; COMPLEMENT SWITCH

     86

     87	000342	010346 			3$:	MOV	R3,-(SP)			; SAVE POINTER

     88	000344	004767 	000022 			JSR	PC,OPTN				; SCAN THIS OPTION

     89	000350	012603 				MOV	(SP)+,R3			; RESTORE POINTER

     90	000352	000752 				BR	1$				; AND CONTINUE

     91

     92	000354	032765 	000000G	000024 	4$:	BIT	#SWM.ML,C.MKW1(R5)		; MACRO LIBRARY?

     93	000362	001402 				BEQ	5$				; NO

     94	000364	004767 	000504 			JSR	PC,MLIBR			; YES, HANDLE IT

     95	000370	000207 			5$:	RTS	PC				; RETURN

     96

RSXIO	MACRO M1110  21-AUG-78 22:54  PAGE 34

OPTN		SET/CLEAR ONE DIRECTIVE OPTION



     98					.SBTTL	OPTN		SET/CLEAR ONE DIRECTIVE OPTION

     99					;++

    100					;

    101					; OPTN -- SCAN ONE OPTION AND SET/CLEAR DIRECTIVE OPTION

    102					;

    103					; INPUTS:

    104					;	R1 - POINTER TO SWITCH VALUE TABLE

    105					;	R2 - POINTER TO DIRECTIVE OPTION LIST

    106					;	R4 - NEW OPTION VALUE (-1 => SET, 0 => CLEAR)

    107					;

    108					;--

    109

    110	000372	010203 			OPTN::	MOV	R2,R3				; SET SCAN POINTER

    111	000374	005711 				TST	(R1)				; ANYTHING IN TABLE

    112	000376	001011 				BNE	1$				; YES, SCAN OPTION

    113	000400	021227 	000000G			CMP	(R2),#LS.LST			; LISTING DIRECTIVE?

    114	000404	001045 				BNE	5$				; NO, SO NO ACTION

    115	000406	006304 				ASL	R4				; RANGE = -2,0

    116	000410	005204 				INC	R4				; RANGE = -1,1

    117	000412	005404 				NEG	R4				; RANGE = 1,-1

    118	000414	060467 	000000G			ADD	R4,LISTLV			; BUMP LISTING LEVEL

    119	000420	000437 				BR	5$				; AND EXIT

    120

    121	000422	011303 			1$:	MOV	(R3),R3				; POINT TO FIRST OPTION

    122	000424	001430 				BEQ	4$				; ALL DONE

    123	000426	021163 	000012 			CMP	(R1),SYMCHRS(R3)			; FIRST 2 CHARS MATCH?

    124	000432	001373 				BNE	1$				; NO, KEEP LOOKING

    125	000434	005761 	000002 			TST	2(R1)				; 3 CHARS?

    126	000440	001411 				BEQ	2$				; NO

    127	000442	122763 	000002 	000011 		CMPB	#2,SYMLEN(R3)			; 3 CHAR OPTION?

    128	000450	002364 				BGE	1$				; NO

    129	000452	026163 	000002 	000014 		CMP	2(R1),SYMCHRS+2(R3)		; THIRD CHAR MATCH?

    130	000460	001360 				BNE	1$				; NO

    131	000462	000404 				BR	3$				; YES

    132

    133	000464	122763 	000002 	000011 	2$:	CMPB	#2,SYMLEN(R3)			; 3 CHAR OPTION

    134	000472	002753 				BLT	1$				; YES, NO MATCH

    135

    136	000474	010463 	000006 		3$:	MOV	R4,SYMVL2(R3)			; SET OPTION

    137	000500	056367 	000002 	000000G		BIS	SYMFLAG(R3),CMDFLG		; SET FLAG TO OVERRIDE SRC DIRECTIVE

    138	000506	062701 	000004 		4$:	ADD	#4,R1				; POINT TO NEXT VALUE

    139	000512	010203 				MOV	R2,R3				; RESET SCAN POINTER

    140	000514	005711 				TST	(R1)				; MORE OPTIONS?

    141	000516	001341 				BNE	1$				; YES

    142

    143	000520	000207 			5$:	RTS	PC				; NO

    144

RSXIO	MACRO M1110  21-AUG-78 22:54  PAGE 35

CLOSET		CLOSE ALL FILES



    146					.SBTTL	CLOSET		CLOSE ALL FILES

    147					;++

    148					;

    149					; THIS ROUTINE CLOSES THE FILES THAT WERE OPENED DURING THE

    150					; ASSEMBLY PROCESS, AND SPOOLS THE LISTING FILE IF THE SPOOL FLAG

    151					; WAS SET.

    152					;

    153					;--

    154

    155	000522				CLOSET::

    156	000522					CLOSE$	#VAXBLK				; CLOSE INPUT FILE

    157	000532					CLOSE$	#OBJBLK				; CLOSE OBJECT CODE

    158	000542					CLOSE$	#INTBLK				; CLOSE INTERMEDIATE CODE FILE

    159	000552					CLOSE$	#MLBBLK				; CLOSE MACRO LIBRARY

    160	000562	005767 	000000G			TST	LSTXST				; ANY LISTING FILE?

    161	000566	001535 				BEQ	20$				; NOPE

    162	000570	132767 	000000G	000000C		BITB	#FD.REC,LSTBLK+F.RCTL		; RECORD DEVICE?

    163	000576	001422 				BEQ	5$				; SKIP IF NOT

    164	000600	116701 	000000C			MOVB	LSTBLK+F.LUN,R1			; GET LIST DEV'S LUN

    165	000604					QIOW$S	#IO.DET,R1			; DETACH LISTING DEVICE

    166	000642	000503 				BR	10$				; CLOSE FILES

    167	000644	032767 	000000G	000000G	5$:	BIT	#SWM.SP,SPOOLF			; SPOOL OUTPUT FILE?

    168	000652	001477 				BEQ	10$				; NO

    169	000654					PRINT$	#LSTBLK				; SPOOL OUTPUT

    170	001050	000404 				BR	20$				; AND EXIT

    171	001052				10$:	CLOSE$	#LSTBLK				; CLOSE LISTING FILE

    172	001062				20$:	CLOSE$	#TTYBLK				; CLOSE TTY

    173	001072	000207 				RTS	PC				; AND RETURN

    174

RSXIO	MACRO M1110  21-AUG-78 22:54  PAGE 36

MLIBR		RECORD MACRO LIBRARY



    176					.SBTTL	MLIBR		RECORD MACRO LIBRARY

    177					;++

    178					;

    179					; THIS ROUTINE IS CALLED IF THE INPUT FILE JUST OPENED FROM THE USER'S

    180					; COMMAND LINE WAS A MACRO LIBRARY.  IT PLACES THE FILE ID OF THE MACRO

    181					; LIBRARY ON A STACK TO BE USED FOR FUTURE OPENS.

    182					;

    183					;--

    184

    185	001074				MLIBR::

    186	001074	005767 	000000G			TST	P2			; PASS 2?

    187	001100	002404 				BLT	1$			; YES, NOTHING TO SAVE

    188	001102	012702 	000000C			MOV	#VAXBLK+F.FNB+N.FID,R2	; LOAD PTR TO FILE ID

    189	001106	004767 	000006 			JSR	PC,STKLIB		; GO ADD THIS LIBRARY TO STACK

    190	001112	004767 	000000G		1$:	JSR	PC,NXTFIL		; OPEN NEXT INPUT FILE

    191	001116	000207 				RTS	PC			; AND EXIT

    192

    193

    194

    195					.SBTTL	STKLIB		STACK FILE ID FOR MACRO LIBRARY

    196					;++

    197					;

    198					; THIS ROUTINE TAKES THE FILE ID POINTED TO BY "R2" AND LOADS IT INTO

    199					; A BLOCK OF FREE MEMORY.  IT THEN PLACES THAT BLOCK AT THE HEAD OF A

    200					; LINKED LIST OF FILE ID BLOCKS WHOSE HEAD IS "CURMLB".

    201					;

    202					; INPUTS:

    203					;	R2 - POINTS TO THE FILE ID IN THE FILE DESCRIPTOR BLOCK

    204					;

    205					;--

    206

    207	001120				STKLIB::

    208	001120	012767 	177777 	000000G		MOV	#-1,LASTML		; MUST OPEN NEW LIBRARY

    209	001126	005067 	000000G			CLR	MLBIND			; CLEAR MACRO INDEX BUFFER POINTER

    210	001132	016701 	000000G			MOV	FREEPT,R1		; POINT TO FREE STORAGE

    211	001136	016711 	000000G			MOV	CURMLB,(R1)		; NEW LIBRARY POINTS TO PREV.

    212	001142	010167 	000000G			MOV	R1,CURMLB		; NEW LIBRARY BECOMES TOP OF LIST

    213	001146	005721 				TST	(R1)+			; POINT PAST LINK

    214	001150	012221 				MOV	(R2)+,(R1)+		; COPY FILE ID INTO ENTRY

    215	001152	012221 				MOV	(R2)+,(R1)+		;

    216	001154	012221 				MOV	(R2)+,(R1)+		;

    217	001156	016221 	000000C			MOV	N.DVNM-<N.FID+6>(R2),(R1)+ ; DEVICE NAME

    218	001162	016221 	000000C			MOV	N.UNIT-<N.FID+6>(R2),(R1)+ ; UNIT NUMBER

    219	001166	005021 				CLR	(R1)+			; CLEAR NUMBER OF MNT ENTRIES

    220	001170	005021 				CLR	(R1)+			; CLEAR STARTING VIRTUAL BLOCK NUMBER

    221	001172	010167 	000000G			MOV	R1,FREEPT		; ALLOCATE BLOCK

    222	001176	000207 				RTS	PC			; RETURN TO CALLING ROUTINE

RSXIO	MACRO M1110  21-AUG-78 22:54  PAGE 37

LIBRY		MACRO LIBRARY DIRECTIVE



    224					.SBTTL	LIBRY		MACRO LIBRARY DIRECTIVE

    225

    226	000000				.PSECT	LIBRY

    227

    228					;++

    229					;

    230					; THIS ROUTINE CHECKS THE SYNTAX OF THE FILE NAME SUPPLIED IN THE DIRECTIVE.

    231					; IT THEN SUPPLIES ANY MISSING INFORMATION NEEDED TO DO AN OPEN AND OPENS THE

    232					; FILE.  IF THE OPEN WAS SUCCESSFUL IT STACKS THE FILE ID FOR USE WHEN MACROS

    233					; ARE CALLED BY THE PROGRAM.

    234					;

    235					;--

    236

    237	000000				LIBRY::					; DIRECTIVE = KLIBRARY

    238	000000					SAVAL				; SAVE R0 - R5

    239	000004	012767 	177777 	000000G		MOV	#-1,LASTML		; REQUIRE LIBRARY TO BE RE-OPENED

    240	000012					CLOSE$	#MLBBLK			; CLOSE CURENTLY OPEN MACRO LIBRARY

    241	000022	004767 	000204 			JSR	PC,COPNAM		; COPY FILE NAME TO "LIBBUF"

    242	000026	103500 				BCS	LIBRYX			; EXIT IF ERROR

    243	000030	012705 	000050'			MOV	#LIBBLK,R5		; GET ADDRESS OF CSI BLOCK

    244	000034					CSI$1	R5,#LIBBUF,R3		; CHECK SYNTAX OF FILE NAME (R3 = LEN)

    245	000054	103461 				BCS	100$			; SYNTAX ERROR EXIT

    246	000056					CSI$2	R5,OUTPUT		; SCAN AS OUTPUT FILE

    247	000070	103453 				BCS	100$			; TREAT ERRORS AS SYNTAX

    248	000072	010502 				MOV	R5,R2			; COPY ADDRESS OF CSI BLOCK

    249	000074	062702 	000006 			ADD	#C.DSDS,R2		; POINT TO DATASET DESC. IN "LIBBLK"

    250	000100					FDOP$R	#MLBBLK,,R2,#MLBFIL	; SUPPLY DEFAULTS FOR ITEMS OMITTED

    251	000116	132765 	000001 	000001 		BITB	#CS.NMF,C.STAT(R5)	; MAKE SURE NAME WAS GIVEN

    252	000124	001432 				BEQ	95$			; NO FILE NAME SUPPLIED

    253	000126	012700 	000000G			MOV	#MLBBLK,R0		; GET ADDRESS OF MACRO LIBRARY FDB

    254	000132	010001 				MOV	R0,R1			; COPY IT TO R1

    255	000134	062701 	000000G			ADD	#F.FNB,R1		; R1 POINTS TO FNB TO BE FILLED IN

    256	000140	016002 	000000G			MOV	F.DSPT(R0),R2		; R2 POINTS TO DATASET DESCRIPTOR

    257	000144	016003 	000000G			MOV	F.DFNB(R0),R3		; R3 POINTS TO DEFAULT FILE NAME BLK

    258	000150	004767 	000000G			JSR	PC,.PARSE		; PARSE FILE TO FILL IN MISSING INFO.

    259	000154	103413 				BCS	90$			; ERROR IN PARSE

    260	000156				80$:	OFNB$	R0			; OPEN BY FILE NAME BLOCK

    261	000162	103003 				BCC	85$			; SKIP IF OPEN OKAY

    262	000164	004767 	000112'			JSR	PC,LIBFAIL		; LIBRARY FILE OPEN FAILURE

    263	000170	000772 				BR	80$			; TRY OPEN AGAIN

    264	000172	012702 	000000C		85$:	MOV	#MLBBLK+F.FNB+N.FID,R2	; LOAD POINTER TO FILE ID

    265	000176	004767 	001120'			JSR	PC,STKLIB		; STACK LIBRARY FILE ID

    266	000202	000412 				BR	LIBRYX			; EXIT

    267	000204	012700 	000000G		90$:	MOV	#PRSERR,R0		; ERROR IN PARSE

    268	000210	000405 				BR	110$			; OUTPUT ERROR MESSAGE

    269	000212	012700 	000000G		95$:	MOV	#NOFILE,R0		; NO FILE NAME SUPPLIED

    270	000216	000402 				BR	110$			; OUTPUT ERROR MESSAGE

    271	000220	012700 	000000G		100$:	MOV	#DIRERR,R0		; DIRECTIVE SYNTAX ERROR

    272	000224	004767 	000000G		110$:	JSR	PC,ERORPT		; OUTPUT ERROR

    273	000230	000207 			LIBRYX:	RTS	PC			; RETURN AND RESTORE REGISTERS

RSXIO	MACRO M1110  21-AUG-78 22:54  PAGE 38

COPNAM		COPY MACRO LIBRARY FILE NAME INTO "LIBBUF"



    275					.SBTTL	COPNAM		COPY MACRO LIBRARY FILE NAME INTO "LIBBUF"

    276					;++

    277					;

    278					; THIS ROUTINE COPIES THE FILE NAME BETWEEN DELIMITERS FROM THE SOURCE PROGRAM

    279					; INTO A 40 CHARACTER BUFFER FOR USE BY ".LIBRARY" AND ".INCLUDE".

    280					; IT RETURNS WITH "C-BIT" CLEAR IF SUCCESS AND THE CHARACTER COUNT IN R3.

    281					; THE "C-BIT" IS SET IF FAILURE.

    282					;

    283					;--

    284

    285	000232				COPNAM::

    286	000232					SPNOR				; SKIP OVER BLANKS

    287	000236	016702 	000000G			MOV	CHAR,R2			; SAVE DELIMITER

    288	000242	012701 	000000'			MOV	#LIBBUF,R1		; GET ADDRESS OF BUFFER

    289	000246	005003 				CLR	R3			; START CHARACTER COUNT AT ZERO

    290	000250	005067 	000000G		10$:	CLR	CHAR			; RETURN ALL CHARACTERS

    291	000254					CALL	GETCHR			; INPUT CHARACTER

    292	000260	020002 				CMP	R0,R2			; IS IT THE DELIMITER

    293	000262	001417 				BEQ	40$			; EXIT IF DELIMITER

    294	000264	020027 	000015 			CMP	R0,#CR			; IS IT "EOL"

    295	000270	001406 				BEQ	30$			; ERROR, NO TERMINATION FOR ARG.

    296	000272	020327 	000050 			CMP	R3,#FILLEN		; TOO MANY CHARACTERS?

    297	000276	002002 				BGE	20$			; SKIP IF TOO MANY

    298	000300	005203 				INC	R3			; COUNT THIS CHARACTER

    299	000302	110021 				MOVB	R0,(R1)+		; STORE IN BUFFER

    300	000304	000761 			20$:	BR	10$			; CONTINUE READING CHARS

    301	000306	012700 	000000G		30$:	MOV	#UNTERM,R0		; POINTER TO MESSAGE

    302	000312					CALL	ERORPT			; UNTERMINATED ARGUMENT

    303	000316	000261 				SEC				; SET ERROR RETURN

    304	000320	000403 				BR	50$			; EXIT

    305	000322				40$:	CALL	GETCHR			; SKIP OVER DELIMITER

    306	000326	000241 				CLC				; SUCCESS RETURN

    307	000330	000207 			50$:	RTS	PC			; RETURN TO CALLER

    308

RSXIO	MACRO M1110  21-AUG-78 22:54  PAGE 39

ERRPRI		PRINT ERROR MESSAGES



    310					.SBTTL	ERRPRI		PRINT ERROR MESSAGES

    311

    312	000000				.PSECT	PRNTER

    313

    314					;++

    315					;

    316					; THIS ROUTINE PRINTS AN ERROR MESSAGE ON THE USER'S TERMINAL AND SETS THE

    317					; STATUS WORD TO 2.  THE MESSAGE IS A COUNTED ASCII STRING WHOSE COUNT IS

    318					; THE FIRST WORD OF THE STRING.  THE POINTER IS PASSED IN R0.

    319					; THE ROUTINE WILL ALSO PRINT AN OPTIONAL FILE NAME THAT IS POINTED TO BY R1.

    320					; IF R1 IS ZERO OR THE LENGTH OF THE FILE NAME IS ZERO, NO FILE NAME IS

    321					; PRINTED.

    322					;

    323					;--

    324

    325	000000				ERRPRI::				; PRINT ERROR MESSAGE

    326	000000	010246 				MOV	R2,-(SP)		; SAVE R2

    327	000002	010146 				MOV	R1,-(SP)		; SAVE FILE POINTER

    328	000004	012001 				MOV	(R0)+,R1		; GET COUNT OF CHARS

    329	000006	016702 	000000G			MOV	FREEPT,R2		; POINT TO BUFFER

    330	000012	112022 			1$:	MOVB	(R0)+,(R2)+		; COPY MESSAGE

    331	000014	077102 				SOB	R1,1$			; ONCE PER CHAR

    332

    333	000016	012601 				MOV	(SP)+,R1		; PICK UP FILE POINTER

    334	000020	001414 				BEQ	10$			; EXIT IF NO FILE NAME

    335	000022	016100 	000002 			MOV	2(R1),R0		; POINT TO FILE NAME TEXT

    336	000026	011101 				MOV	(R1),R1			; PICK UP LENGTH OF NAME

    337	000030	001410 				BEQ	10$			; SKIP IF LENGTH IS ZERO

    338

    339	000032	112722 	000040 			MOVB	#SPACE,(R2)+		; SPACE

    340	000036	112722 	000042 			MOVB	#'",(R2)+		; QUOTE

    341	000042	112022 			5$:	MOVB	(R0)+,(R2)+		; COPY NAME

    342	000044	077102 				SOB	R1,5$			; ONCE PER CHAR

    343	000046	112722 	000042 			MOVB	#'",(R2)+		; CLOSING QUOTE

    344

    345	000052	012700 	000000G		10$:	MOV	#TTYBLK,R0		; POINT TO TTY FDB

    346	000056	016701 	000000G			MOV	FREEPT,R1		; BUFFER START

    347	000062	010160 	000002G			MOV	R1,F.NRBD+2(R0)		; SAVE RECORD POINTER

    348	000066	160102 				SUB	R1,R2			; BUFFER LENGTH

    349	000070	010260 	000000G			MOV	R2,F.NRBD(R0)		; SAVE IN FDB

    350	000074					PUT$S				; OUTPUT MESSAGE

    351	000100	012602 				MOV	(SP)+,R2		; RESTORE R2

    352	000102	012767 	000000G	000000G		MOV	#EX$ERR,STATUS		; SET ERROR STATUS

    353	000110	000207 				RTS	PC			; AND EXIT

RSXIO	MACRO M1110  21-AUG-78 22:54  PAGE 40

LIBRARY OPEN FAILURE ROUTINE



    355					.SBTTL	LIBRARY OPEN FAILURE ROUTINE

    356					;++

    357					;

    358					; THIS ROUTINE IS CALLED WHEN THERE IS AN OPEN FAILURE OF A FILE SUPPLIED

    359					; IN THE ".LIBRARY" DIRECTIVE.

    360					;

    361					;--

    362	000112				LIBFAIL:				; MACRO LIBRARY OPEN FAILED

    363	000112	126027 	000000G	000000G		CMPB	F.ERR(R0),#IE.NOD	; INSUFFICIENT NODES?

    364	000120	001404 				BEQ	10$			; SKIP IF YES

    365	000122	126027 	000000G	000000G		CMPB	F.ERR(R0),#IE.UPN	; INSUFFICIENT NODES?

    366	000130	001004 				BNE	20$			; NO, MORE SERIOUS PROBLEM

    367	000132				10$:	WSIG$S				; WAIT FOR SIGNIFICANT EVENT

    368	000140	000207 				RTS	PC			; RETURN TO TRY AGAIN

    369

    370	000142				20$:					; PRINT ERROR ON USER'S TERMINAL

    371	000142					ERRPRT	LIBOPN,LIBBLK+C.FILD	; LIBRARY FILE NAME

    372	000156					ERRPRT	LIBSRC,CSIBLK+C.FILD	; SOURCE FILE NAME

    373	000172	000167 	000000G			JMP	ABORT			; TERMINATE

RSXIO	MACRO M1110  21-AUG-78 22:54  PAGE 41

BUFFER AND C.S.I. BLOCK FOR USE WITH .LIBRARY



    375					.SBTTL	BUFFER AND C.S.I. BLOCK FOR USE WITH .LIBRARY

    376

    377	000000				.PSECT	RODATA,D,GBL

    378

    379		000050 			FILLEN	= 40.				; 40 CHARACTERS MAXIMUM IN FILE NAME

    380

    381	000000				LIBBUF:	.BLKB	FILLEN			; ALLOCATE BUFFER FOR FILE NAME

    382

    383	000050					CSI$

    384						.EVEN

    385	000050				LIBBLK:	.BLKB	C.SIZE			; ALLOCATE CSI BLOCK FOR LIBRARY AND INCLUDE

    386						.EVEN

    387

    388

    389					.SBTTL	ERROR MESSAGES FOR .LIBRARY AND INTERMEDIATE FILE I/O

    390

    391	000124				LIBOPN:	 CNTSTR	<MAR -- FAILED TO OPEN LIBRARY>

    392	000164				LIBSRC:	 CNTSTR	<LIBRARY DIRECTIVE IS IN FILE>

    393	000222				WRKOUT:: CNTSTR	<MAR -- INTERMEDIATE FILE OUTPUT ERROR>

    394	000272				WRKINP:: CNTSTR	<MAR -- INTERMEDIATE FILE INPUT ERROR>

    395

RSXIO	MACRO M1110  21-AUG-78 22:54  PAGE 42

ASSEMBLY TIME STATISTICS



    397					.SBTTL	ASSEMBLY TIME STATISTICS

    398	000000				.PSECT	STATIS

    399

    400					.GLOBL	LIBDMP

    401

    402	000000	004767 	000000G		LIBDMP:	JSR	PC,LINIT	; INITIALIZE LISTING BUFFER

    403	000004					LPUSH	GETLIB,#0	; PUSH DIRECTORY BLOCKS READ

    404	000024	004767 	000000G			JSR	PC,DECLR	; CONVERT TO DECIMAL

    405	000030	012700 	000236'			MOV	#LIBHDR,R0	; POINT TO MESSAGE

    406	000034	004767 	000166 			JSR	PC,COPMSG	; COPY MESSAGE

    407	000040					LPUSH	GETMAC,#0	; PUSH MACRO LINES READ

    408	000060	004767 	000000G			JSR	PC,DECLR	; CONVERT TO DECIMAL

    409	000064	012700 	000256'			MOV	#LIBRDS,R0	;

    410	000070	004767 	000132 			JSR	PC,COPMSG	;

    411	000074					LPUSH	GETPSC,#0	; PUSH NUMBER OF MACROS

    412	000114	004767 	000000G			JSR	PC,DECLR	;

    413	000120	012700 	000277'			MOV	#MACS,R0	;

    414	000124	004767 	000076 			JSR	PC,COPMSG	; COPY ASCIZ TEXT

    415	000130					LPUSH	GETINT,#0	; PUSH INTERMEDIATE FILE WRITES

    416	000150	004767 	000000G			JSR	PC,DECLR	;

    417	000154	012700 	000311'			MOV	#INTWRT,R0	;

    418	000160	004767 	000042 			JSR	PC,COPMSG	; COPY ASCIZ TEXT

    419	000164	162703 	000000G			SUB	#LINEBF,R3	; GET LENGTH OF LINE

    420	000170	010367 	000000G			MOV	R3,LINELN	; WRITE INTO LINELENGTH

    421	000174	004767 	000000G			JSR	PC,WRTLST	; OUTPUT TO LISTING FILE

    422	000200	005067 	000000G			CLR	GETLIB		; START WITH ZERO NEXT TIME

    423	000204	005067 	000000G			CLR	GETMAC		;

    424	000210	005067 	000000G			CLR	GETINT		;

    425	000214	005067 	000000G			CLR	GETPSC		;

    426	000220	005067 	000000G			CLR	GETRES		;

    427	000224	000207 				RTS	PC		;

    428

    429	000226	112023 			COPMSG:	MOVB	(R0)+,(R3)+	; COPY ASCIZ DATA

    430	000230	001376 				BNE	COPMSG		; LOOP UNTIL ZERO

    431	000232	005303 				DEC	R3		; ONE LESS CHARACTER

    432	000234	000207 				RTS	PC		;

    433

    434	000236	   040 	   115 	   114 	LIBHDR:	.ASCIZ	@ MLB DIR RDS - @

	000241	   102 	   040 	   104

	000244	   111 	   122 	   040

	000247	   122 	   104 	   123

	000252	   040 	   055 	   040

	000255	   000

    435	000256	   040 	   107 	   105 	LIBRDS:	.ASCIZ	@ GETS TO DEFINE @

	000261	   124 	   123 	   040

	000264	   124 	   117 	   040

	000267	   104 	   105 	   106

	000272	   111 	   116 	   105

	000275	   040 	   000

    436	000277	   040 	   115 	   101 	MACS:	.ASCIZ	@ MACROS. @

	000302	   103 	   122 	   117

	000305	   123 	   056 	   040

	000310	   000

    437	000311	   040 	   111 	   116 	INTWRT:	.ASCIZ	@ INTER. FILE WRITES. @

	000314	   124 	   105 	   122

	000317	   056 	   040 	   106

	000322	   111 	   114 	   105

RSXIO	MACRO M1110  21-AUG-78 22:54  PAGE 42-1

ASSEMBLY TIME STATISTICS



	000325	   040 	   127 	   122

	000330	   111 	   124 	   105

	000333	   123 	   056 	   040

	000336	   000

    438

    439		000001 			.END

RSXIO	MACRO M1110  21-AUG-78 22:54  PAGE 42-2

SYMBOL TABLE



ABORT = ****** GX	FF    = 000014   	LIBRDS  000256R     006	OPENIX  000272R     002	S.DF  = 100000

BLNK  = 000040   	FILLEN= 000050   	LIBRY   000000RG    003	OPNFAI= ****** GX	S.EPT = 000100

CHAR  = ****** GX	FREEPT= ****** GX	LIBRYX  000230R     003	OPTN    000372RG    002	S.EXTN= 010000

CLOSET  000522RG    002	F.BDB = ****** GX	LIBSRC  000164R     005	PAR$$$= 000000   	S.GLOB= 020000

CMDFLG= ****** GX	F.DFNB= ****** GX	LINEBF= ****** GX	PRSERR= ****** GX	S.LOCL= 001000

COMMA = 000054   	F.DSPT= ****** GX	LINELN= ****** GX	PRSFLD= ****** GX	S.ODBG= 000040

COPMSG  000226R     006	F.ERR = ****** GX	LINIT = ****** GX	PSECCH= 000020   	S.REF = 000400

COPNAM  000232RG    003	F.FNB = ****** GX	LISTLV= ****** GX	PSECOP= 000016   	S.TKMS= 000377

CR    = 000015   	F.LUN = ****** GX	LOWCAS= 000140   	PSECV1= 000012   	S.WEAK= 040000

CSIBLK= ****** GX	F.NRBD= ****** GX	LPTLEN= 000074   	PSECV2= 000014   	TAB   = 000011

CS.DIF= 000002   	F.RCTL= ****** GX	LSTBLK= ****** GX	P2    = ****** GX	TTYBLK= ****** GX

CS.DVF= 000004   	GETCHR= ****** GX	LSTXST= ****** GX	RGTANG= 000076   	UNTERM= ****** GX

CS.EQU= 000040   	GETINT= ****** GX	LS.LST= ****** GX	RTNVAL=%000000   	VAXBLK= ****** GX

CS.INP= 000001   	GETLIB= ****** GX	MACS    000277R     006	R6    =%000006   	V1STAC= ****** GX

CS.MOR= 000020   	GETMAC= ****** GX	MLBBLK= ****** GX	R7    =%000007   	V2STAC= ****** GX

CS.NMF= 000001   	GETPSC= ****** GX	MLBFIL= ****** GX	SEMI  = 000073   	WRKINP  000272RG    005

CS.OUT= 000002   	GETRES= ****** GX	MLBIND= ****** GX	SKIPSP= ****** GX	WRKOUT  000222RG    005

CS.WLD= 000010   	G.LUCW= 000004   	MLIBR   001074RG    002	SPACE = 000040   	WRTLST= ****** GX

CURMLB= ****** GX	G.LUFB= 000003   	M.ARGC= 000014   	SPOOLF= ****** GX	$DIDDO= 000000

C.CMLD= 000002   	G.LUNA= 000000   	M.ARGS= 000016   	STATUS= ****** GX	$DSPAT= ****** GX

C.DEVD= 000006   	G.LUNU= 000002   	M.END = 000012   	STKLIB  001120RG    002	$E$   = 000001

C.DIRD= 000012   	IE.NOD= ****** GX	M.GETL= 000004   	SWCHTB= ****** GX	$L    = 000000

C.DSDS= 000006   	IE.UPN= ****** GX	M.IFLV= 000006   	SWM.ML= ****** GX	$LL   = 000000

C.FILD= 000016   	IIII  = 177777   	M.IFVL= 000010   	SWM.SP= ****** GX	$L$   = 000000

C.MKW1= 000024   	INTBLK= ****** GX	M.LINK= 000000   	SWSCN   000274RG    002	$R    = 177777

C.MKW2= 000026   	INTWRT  000311R     006	M.NXTL= 000002   	SYMCHR= 000012   	$T    = 000000

C.SIZE= 000054   	IO.ATT= ****** GX	NOFILE= ****** GX	SYMFLA= 000002   	$TT$  = 000272R     005

C.STAT= 000001   	IO.DET= ****** GX	NOWCRD= ****** GX	SYMLEN= 000011   	$$$ARG= 000002

C.SWAD= 000022   	LASTML= ****** GX	NXTFIL= ****** GX	SYMLIN= 000000   	$$$OST= 000014

C.TYPR= 000000   	LF    = 000012   	N.DID = ****** GX	SYMMAX= 000017   	.CLOSE= ****** G

DECLR = ****** GX	LFTANG= 000074   	N.DVNM= ****** GX	SYMSEG= 000010   	.CSI1 = ****** G

DIRERR= ****** GX	LIBBLK  000050R     005	N.FID = ****** GX	SYMVL1= 000004   	.CSI2 = ****** G

ERORPT= ****** GX	LIBBUF  000000R     005	N.FVER= ****** GX	SYMVL2= 000006   	.OPFNB= ****** G

ERRPRI  000000RG    004	LIBDMP  000000RG    006	N.UNIT= ****** GX	S.ABS = 004000   	.PARSE= ****** GX

EX$ERR= ****** GX	LIBFAI  000112R     004	OBJBLK= ****** GX	S.ASN = 000200   	.PUTSQ= ****** G

FD.OSP= ****** GX	LIBHDR  000236R     006	OPENIT  000000RG    002	S.DBG = 002000   	.SAVAL= ****** GX

FD.REC= ****** GX	LIBOPN  000124R     005



. ABS.	000000	   000

      	000000	   001

RSXIO 	001200	   002

LIBRY 	000332	   003

PRNTER	000176	   004

RODATA	000340	   005

STATIS	000337	   006

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  15225 WORDS  ( 60 PAGES)

DYNAMIC MEMORY:  16500 WORDS  ( 63 PAGES)

ELAPSED TIME:  00:00:47

OBJ$:RSXIO,LIS$:RSXIO/-SP=SRC$:MD,COMMON,RSXIO

