FCSPR	MACRO M1110  22-AUG-78 01:57  PAGE 4





      1

      2						.IF NDF	W$$KST

      3

      4						.TITLE	RDPAG

      5

      6						.IFF

      7

      8						.TITLE	RDPAS

      9

     10						.ENDC

     11

     12						.IDENT	/03/

     13

     14					                                                                                ;**-1

     15					;

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

     17					;

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

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

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

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

     22					;

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

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

     25					; EQUIPMENT CORPORATION.

     26					;

     27					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY

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

     29					;

     30					; VERSION 03

     31					;                                                                               ;**-2

     32					; C. MONIA 22-FEB-74

     33					;

     34					; MODIFICATIONS:

     35					;

     36					; NO.		DATE		PROGRAMMER

     37					; ---		----		----------

     38					;

     39					; 043		24-OCT-75	C. MONIA

     40					; 060		25-APR-76	C. MONIA

     41					;

     42					; SUBROUTINES TO READ/WRITE PAGE BUFFERS TO VIRTUAL STORE

     43					;

     44					; MACRO LIBRARY CALLS

     45					;

     46

     47						.MCALL	READ$,WRITE$,WTSE$S

     48

     49					;

     50					; LOCAL DATA

     51					;

     52

     53	000000	000000 			BLK:	.WORD	0		; HIGH ORDER PART OF VIRTUAL BLOCK NUMBER

     54	000002				BLKL:	.BLKW	1		; LOW ORDER PART OF VIRTUAL BLOCK NUMBER

     55	000004				IOSTS:	.BLKW	2		; I/O DONE STATUS BLOCK

     56	000010	000000G			WKEXT:	.WORD	W$KEXT		; WORK FILE EXTEND SIZE

     57

RDPAS	MACRO M1110  22-AUG-78 01:57  PAGE 4-1





     58					;+

     59					; **-RDPAG-READ A PAGE INTO MEMORY

     60					;

     61					; INPUTS:

     62					;

     63					;	R0=PAGE ADDRESS

     64					;	PAGE HEADER (P$GBLK) MUST CONTAIN RELATIVE BLOCK

     65					;	NUMBER OF PAGE.

     66					;

     67					; OUTPUTS:

     68					;

     69					;	REQUESTED PAGE IS TRANSFERRED INTO MEMORY

     70					;-

     71

     72	000012				$RDPAG::			;

     73	000012					SAVVR			; SAVE VOLATILE REGISTERS

     74	000016					CALL	STIOR		; SETUP FOR READ

     75	000022					READ$	R0,R1,#512.,#BLK,#2,#IOSTS ; EXECUTE READ

     76	000076					CALL	CHKST		; CHECK STATUS

     77	000102	103510 				BCS	CHKST1		; IF C/S FATAL ERROR

     78

     79						.IF DF	W$$KST

     80

     81	000104	005267 	000002G			INC	$WRKRD+2	; INCREMENT LOW PART OF READ COUNT

     82	000110	001002 				BNE	10$		; IF NE HAVE CURRENT COUNT

     83	000112	005267 	000000G			INC	$WRKRD		; INCREMENT HIGH PART OF COUNT

     84	000116				10$:				;

     85

     86						.ENDC

     87

     88	000116					RETURN			; EXIT

     89

     90					;+

     91					; **-$WRPAG-WRITE A PAGE INTO VIRTUAL STORE

     92					;

     93					; INPUTS:

     94					;

     95					;	R2=ADDDRESS OF PAGE TO BE SWAPPED OUT

     96					;	PAGE HEADER (P$GBLK) MUST CONTAIN RELATIVE BLOCK NUMBER

     97					;	OF PAGE

     98					;

     99					; OUTPUTS:

    100					;

    101					;	REQUESTED PAGE IS TRANSFERRED TO VIRTUAL STORE

    102					;

    103					;-

    104

    105	000120				$WRPAG::			;

    106	000120					SAVVR			; SAVE VOLATILE REGISTERS

    107	000124					CALL	STIOW		; SET REGISTERS FOR WRITE

    108	000130				10$:				;

    109	000130					WRITE$	R0,R1,#512.,#BLK,#2,#IOSTS ; EXECUTE SWAP

    110	000204					CALL	CHKST		; WAIT FOR COMPLETION

    111	000210	016760 	177574 	000040 		MOV	WKEXT,F.ALOC(R0) ; RESET DEFAULT EXTENSION

    112	000216	103744 				BCS	10$		; IF C/S REPEAT OPERATION

    113

    114						.IF DF	W$$KST

RDPAS	MACRO M1110  22-AUG-78 01:57  PAGE 4-2





    115

    116	000220	005267 	000002G			INC	$WRKWR+2	; INCREMENT LOW PART OF WRITE COUNT

    117	000224	001002 				BNE	20$		; IF NE HAVE COUNT

    118	000226	005267 	000000G			INC	$WRKWR		; INCREMENT HIGH PART OF COUNT

    119	000232				20$:				;

    120

    121						.ENDC

    122

    123	000232					RETURN			;                                               ;**-1

    124

    125					;

    126					; SETUP REGISTERS FOR A PAGE I/O REQUEST

    127					;

    128

    129	000234				STIOR:				;

    130	000234	010001 				MOV	R0,R1		; COPY PAGE ADDRESS

    131	000236	000401 				BR	STIO		;

    132	000240				STIOW:				;

    133	000240	010201 				MOV	R2,R1		; COPY PAGE ADDRESS

    134	000242				STIO:				;

    135	000242	005067 	177534 			CLR	BLKL		; CLEAR LOW PART OF VBN

    136	000246	116167 	000000G	177526 		MOVB	P$GBLK(R1),BLKL ; SET LOW PART OF VBN

    137	000254	005267 	177522 			INC	BLKL		; CONVERT RELATIVE BLOCK TO VBN

    138	000260	062701 	000000G			ADD	#P$GHD,R1	; STEP PAST HEADER

    139	000264	016700 	000000G			MOV	$WRKPT,R0	; GET RECORD BLOCK

    140	000270					RETURN			;

    141

    142					;

    143					; CHECK STATUS OF I/O REQUEST

    144					;

    145

    146						.ENABL	LSB

    147

    148	000272				CHKST:				;

    149	000272	103410 				BCS	5$		; IF C/S NEGATE EXTEND SIZE

    150	000274					WTSE$S	#2		; WAIT FOR I/O COMPLETION

    151	000306	106167 	177472 			ROLB	IOSTS		; GET SIGN OF STATUS BYTE

    152	000312	103011 				BCC	10$		; IF C/C OK

    153	000314				5$:				;

    154	000314	005467 	177470 			NEG	WKEXT		; NEGATE WORK FILE EXTEND SIZE

    155	000320	000261 				SEC			; SET FAILURE

    156	000322	100405 				BMI	10$		; IF MI REPEAT OPERATION

    157	000324				CHKST1:				;

    158	000324	005002 				CLR	R2		; SET DUMMY PARAMETER BLOCK ADDRESS

    159	000326	012701 	000000C			MOV	#<S$V2*400!E$R73>,R1 ; GET ERROR/SEVERITY

    160	000332					CALL	$ERMSG		; FATAL-NO RETURN

    161	000336				10$:				;

    162	000336					RETURN			;

    163

    164						.DSABL	LSB

    165

    166

    167		000001 				.END

RDPAS	MACRO M1110  22-AUG-78 01:57  PAGE 4-3

SYMBOL TABLE



BLK     000000R  	FD.ISP= 002000   	F.BKP1= 000051   	F.SPDV= 000072   	R.FIX = 000001

BLKL    000002R  	FD.MNT= 100000   	F.BKST= 000024   	F.SPUN= 000074   	R.SEQ = 000003

B.BBFS= 000010   	FD.OSP= 004000   	F.BKVB= 000064   	F.STBK= 000036   	R.VAR = 000002

B.BFST= 000015   	FD.PLC= 000004   	F.CHR = 000075   	F.UNIT= 000136   	SPA   = 000040

B.NXBD= 000012   	FD.PRN= 000004   	F.CNTG= 000034   	F.URBD= 000020   	STIO    000242R

B.VBN = 000004   	FD.PSE= 010000   	F.DFNB= 000046   	F.VBN = 000064   	STIOR   000234R

CHKST   000272R  	FD.RAH= 000001   	F.DSPT= 000044   	F.VBSZ= 000060   	STIOW   000240R

CHKST1  000324R  	FD.RAN= 000002   	F.DVNM= 000134   	HT    = 000011   	S$V2  = ****** GX

CH.AND= 000001   	FD.REC= 000001   	F.EFBK= 000010   	IOSTS   000004R  	S.BFHD= 000020

CR    = 000015   	FD.RWM= 000001   	F.EFN = 000050   	LF    = 000012   	S.FATT= 000016

E$R73 = ****** GX	FD.SDI= 000020   	F.EOBB= 000032   	NB.DEV= 000200   	S.FDB = 000140

FA.APD= 000100   	FD.SQD= 000040   	F.ERR = 000052   	NB.DIR= 000100   	S.FNAM= 000006

FA.CRE= 000010   	FD.TTY= 000004   	F.FACC= 000043   	NB.NAM= 000004   	S.FNB = 000036

FA.DLK= 001000   	FD.WBH= 000002   	F.FFBY= 000014   	NB.SD1= 000400   	S.FNBW= 000017

FA.ENB= 100000   	FF    = 000014   	F.FNAM= 000110   	NB.SD2= 001000   	S.FNTY= 000004

FA.EXC= 002000   	FF.CHR= 000005   	F.FNB = 000102   	NB.SNM= 000040   	S.FTYP= 000002

FA.EXT= 000004   	FF.NV = 000003   	F.FTYP= 000116   	NB.STP= 000020   	S.NFEN= 000020

FA.NSP= 000100   	FF.POE= 000002   	F.FVER= 000120   	NB.SVR= 000010   	VT    = 000013

FA.POS= 010000   	FF.RWD= 000001   	F.HIBK= 000004   	NB.TYP= 000002   	WKEXT   000010R

FA.RD = 000001   	FF.RWF= 000006   	F.LUN = 000042   	NB.VER= 000001   	W$KEXT= ****** GX

FA.RWD= 004000   	FF.SPC= 000004   	F.MBCT= 000054   	N.DID = 000024   	W$$KST= 000000

FA.SEQ= 040000   	FO.APD= 000106   	F.MBC1= 000055   	N.DVNM= 000032   	$ERMSG= ****** GX

FA.SHR= 000040   	FO.MFY= 000002   	F.MBFG= 000056   	N.FID = 000000   	$RDPAG  000012RG

FA.TMP= 000020   	FO.RD = 000001   	F.NRBD= 000024   	N.FNAM= 000006   	$SAVVR= ****** GX

FA.WCK= 020000   	FO.UPD= 000006   	F.NREC= 000030   	N.FTYP= 000014   	$WRKPT= ****** GX

FA.WRT= 000002   	FO.WRT= 000016   	F.OVBS= 000030   	N.FVER= 000016   	$WRKRD= ****** GX

FD.BLK= 000010   	F.ACTL= 000076   	F.RACC= 000016   	N.NEXT= 000022   	$WRKWR= ****** GX

FD.CCL= 000002   	F.ALOC= 000040   	F.RATT= 000001   	N.STAT= 000020   	$WRPAG  000120RG

FD.COM= 020000   	F.BBFS= 000062   	F.RCNM= 000034   	N.UNIT= 000034   	$$    = 000001

FD.CR = 000002   	F.BDB = 000070   	F.RCTL= 000017   	PAR$$$= 000000   	.READ = ****** G

FD.DIR= 000010   	F.BGBC= 000057   	F.RSIZ= 000002   	P$GBLK= ****** GX	.WRITE= ****** G

FD.FTN= 000001   	F.BKDN= 000026   	F.RTYP= 000000   	P$GHD = ****** GX	...GBL= 000000

FD.F11= 040000   	F.BKDS= 000020   	F.SEQN= 000100   	R$$11M= 000000   	...TPC= 000140

FD.INS= 000010   	F.BKEF= 000050



. ABS.	000000	   000

      	000340	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  2445 WORDS  ( 10 PAGES)

DYNAMIC MEMORY:  3828 WORDS  ( 14 PAGES)

ELAPSED TIME:  00:00:18

OBJ$:RDPAS,LIS$:RDPAS/-SP=SRC$:MACFLM,FCSPR,WRKST,RDPAG

