MRKPNT	MACRO M1110  22-AUG-78 02:16  PAGE 1





      1						.TITLE	MRKPNT

      2						.IDENT	/01/

      3					;

      4					; COPYRIGHT (C) 1976

      5					; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

      6					;

      7					; THIS SOFTWARE IS FURNISHED UNDER  A LICENSE FOR USE ONLY  ON  A

      8					; SINGLE COMPUTER SYSTEM AND MAY BE  COPIED ONLY WITH  THE INCLU-

      9					; SION OF  THE  ABOVE  COPYRIGHT NOTICE.  THIS SOFTWARE,  OR  ANY

     10					; OTHER COPIES THEREOF, MAY NOT BE  PROVIDED  OR  OTHERWISE  MADE

     11					; AVAILABLE TO ANY OTHER PERSON EXCEPT  FOR  USE  ON  SUCH SYSTEM

     12					; AND TO  ONE WHO AGREES  TO  THESE LICENSE  TERMS.  TITLE TO AND

     13					; OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.

     14					;

     15					; THE INFORMATION IN THIS SOFTWARE  IS  SUBJECT TO CHANGE WITHOUT

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

     17					; EQUIPMENT CORPORATION.

     18					;

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

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

     21					;

     22					; VERSION 01

     23					;

     24					; K. D. MORSE 1-AUG-76

     25					;

     26					; MACRO LIBRARY CALLS

     27					;

     28						.MCALL GCML$,GCMLB$,CSI$1,CSI$2,CSI$,CSI$SW,CSI$ND

     29						.MCALL OPEN$R,OPEN$W,FDAT$R,CLOSE$,DELET$,PRINT$,GET$,PUT$

     30						.MCALL WAIT$,READ$,WRITE$

MRKPNT	MACRO M1110  22-AUG-78 02:16  PAGE 2





     32					;+

     33					;**-MRKREC/PNTREC-MARK/POINT TO A RECORD IN A FILE

     34					;

     35					; THESE ROUTINES ARE USED TO POINT TO A CERTAIN RECORD IN A FILE.  THE

     36					; SEQUENCE FOR USING THESE ROUTINES IS:  1) CALL MARK TO SAVE POINTERS TO

     37					; THE NEXT RECORD TO BE READ, 2) CLOSE THE FILE, 3) OPEN THE FILE, AND

     38					; 4) CALL PNTREC TO POSITION THE FILE TO THE LAST RECORD MARKED.

     39					; NOTE:  THE FILE MUST BE RE-OPENED ON THE SAME LUN ON WHICH IT WAS MARKED.

     40					;

     41					; INPUTS:

     42					;

     43					;	2(R5) IS THE ADDRESS OF THE LUN ON WHICH THE FILE IS OPEN

     44					;	4(R5) IS THE ADDRESS OF THE TABLE OF POINTERS INTO THE FILE

     45					;	6(R5) IS THE ADDRESS OF THE SUCCESS/ERROR CODE

     46					;

     47					; OUTPUTS:

     48					;

     49					;	@6(R5) CONTAINS ONE OF THE FOLLOWING:

     50					;		>0 = SUCCESSFUL OPERATION

     51					;		 0 = ERROR, EOF

     52					;		-1 = ERROR, UNABLE TO POINT AS FILE NOT OPEN

     53					;		-2 = ERROR, UNABLE TO MARK FILE AS FOUR FILES ALREADY MARKED

     54					;		-3 = ERROR, UNABLE TO POINT TO FILE AS FILE NOT MARKED

     55					;		-4 = ERROR, UNABLE TO POINT AS FILE NOT OPEN

     56					;

     57					;

     58					;	MRKREC:  THE APPROPRIATE POINTERS ARE SAVED IN PNTREC.

     59					;	PNTREC:  THE FILE OPEN ON THE GIVEN LUN IS POSITIONED TO THE LAST

     60					;		 RECORD MARKED IN THE FILE.

     61					;

     62					;  MODIFICATIONS:

     63					;

     64					; NO		DATE		PROGRAMMER		PURPOSE

     65					; --		----		----------		-------

     66					;

     67					;

     68					; 01		15-NOV-76	K.D. MORSE		RETURN ERROR CODE OF

     69					;							ZERO FOR EOF.

     70					;

     71					;

     72					;

     73					;-

     74					;

     75					;

     76					; LOCAL DATA

     77					;

     78	000000				PNTBLK:	.BLKW	12.		;4 SETS OF RECORD POINTERS FOR MARKING FILES

     79					;

     80					;

     81						.ENABL	LSB

     82	000030	012775 	000001 	000006 	MRKREC:: MOV	#1,@6(R5)	;ASSUME SUCCESS

     83	000036	004767 	000000G			CALL LUNFDB		;GET ADDRESS OF FDB FOR THIS LUN

     84	000042	103430 				BCS	90$		;ERROR, FILE NOT OPEN

     85	000044	004767 	000000G			CALL	.MARK		;GET POINTERS TO THIS RECORD

     86	000050	103430 				BCS	91$		;ERROR, UNABLE TO MARK

     87	000052	016500 	000004 			MOV	4(R5),R0	;GET ADDRESS OF POINTER TABLE

     88	000056	010120 				MOV	R1,(R0)+	;SAVE HIGH-ORDER BITS OF VBN

MRKPNT	MACRO M1110  22-AUG-78 02:16  PAGE 2-1





     89	000060	010220 				MOV	R2,(R0)+	;SAVE LOW-ORDER BITS OF VBN

     90	000062	010320 				MOV	R3,(R0)+	;SAVE NUMBER OF NEXT BYTE IN VB

     91	000064	000444 				BR	100$		;RETURN

     92	000066	012775 	000001 	000006 	PNTREC:: MOV	#1,@6(R5)	;ASSUME SUCCESS

     93	000074	004767 	000000G			CALL LUNFDB		;GET FDB ADDRESS

     94	000100	103424 				BCS	93$		;ERROR, FILE NOT OPEN

     95	000102	016503 	000004 			MOV	4(R5),R3	;GET ADDRESS OF FIRST SET OF POINTERS

     96	000106	012301 			50$:	MOV	(R3)+,R1	;GET HIGH-ORDER BITS OF VBN

     97	000110	012302 				MOV	(R3)+,R2	;GET LOW-ORDER BITS OF VBN

     98	000112	011303 				MOV	(R3),R3		;GET NUMBER OF NEXT BYTE IN VB

     99	000114	004767 	000000G			CALL	.POINT		;POSITION FILE TO THAT RECORD

    100	000120	103410 				BCS	92$		;ERROR, UNABLE TO POINT

    101	000122	000425 				BR	100$		;RETURN

    102					;

    103					; ERROR CODES

    104					;

    105	000124	005475 	000006 		90$:	NEG	@6(R5)		;FILE NOT OPEN, UNABLE TO MARK

    106	000130	000422 				BR	100$		;RETURN

    107	000132	012775 	177776 	000006 	91$:	MOV	#-2,@6(R5)	;UNABLE TO MARK

    108	000140	000410 				BR	94$		;++01 CHECK FOR EOF

    109	000142	012775 	177775 	000006 	92$:	MOV	#-3,@6(R5)	;UNABLE TO POINT

    110	000150	000404 				BR	94$		;++01 CHECK FOR EOF

    111	000152	012775 	177774 	000006 	93$:	MOV	#-4,@6(R5)	;FILE NOT OPEN, UNABLE TO POINT

    112	000160	000406 				BR	100$		;++01 RETURN

    113	000162	122760 	177766 	000000G	94$:	CMPB	#-10.,F.ERR(R0)	;++01 IS IT EOF?

    114	000170	001002 				BNE	100$		;++01 NO, RETURN ERROR CODE

    115	000172	005075 	000006 			CLR	@6(R5)		;++01 YES, INDICATE EOF

    116	000176	000207 			100$:	RETURN			;RETURN

    117						.DSABL	LSB

    118		000001 				.END

MRKPNT	MACRO M1110  22-AUG-78 02:16  PAGE 2-2

SYMBOL TABLE



F.ERR = ****** GX	MRKREC  000030RG 	PNTREC  000066RG 	.MARK = ****** GX	.POINT= ****** GX

LUNFDB= ****** GX	PNTBLK  000000R



. ABS.	000000	   000

      	000200	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  3414 WORDS  ( 14 PAGES)

DYNAMIC MEMORY:  4884 WORDS  ( 18 PAGES)

ELAPSED TIME:  00:00:05

OBJ$:MRKPNT,LIS$:MRKPNT/-SP=SRC$:MRKPNT.MAC

