.NLIST TOC,SYM .TITLE $RDPAG .SBTTL ULBLIB 029 - Virtual Memory I/O Routines .IDENT \V01.00\ .PSECT .LIBC. .ENABL LC,GBL ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. ;+ ; $RDPAG ; $WRPAG ; These two routines do all I/O to the virtual memory work file. ; ; $RDPAG ; ; R0 = dynamic memory address of the page ; ; CALL $RDPAG ; ; C-bit = 0 => success ; ; On failure, $ERMSG is jumped to with R1 = E$R73 ; ($WRKPT)+F.ERR = the actual error ; ; $WRPAG ; ; R2 = dynamic memory address of the page ; ; CALL $RDPAG ; ; C-bit = 0 => success ; ; On failure, $ERMSG is jumped to with R1 = E$R73 ; ($WRKPT)+F.ERR = the actual error ;- .MCALL .READW, .WRITW .ENABL LSB $RDPAG:: JSR R2,$SAVVR ;Save volatile registers MOV R0,R2 ;Copy page address CALL VMIOST ;Set up for I/O .READW ;Do the read BCC 2$ ;Branch if no error CALL $IERR ;Set up F.ERR with correct error; Set C-bit BR 1$ ; $WRPAG:: JSR R2,$SAVVR ;Save volatile registers CALL VMIOST ;Set up for I/O .WRITW ;Do the write BCC 2$ ;Branch if no error CALL $OERR ;Set up F.ERR with correct error; Set C-bit 1$: MOV #E$R73,R1 ;Indicate I/O failure JMP $ERMSG ;Call the user error routine (no return) 2$: RETURN .DSABL LSB ; This routine sets up the registers for the virtual memory I/O ; ; R2 -> page header to read or write ; ; CALL VMIOST ; ; R0 -> I/O area block ; R1 -> work file FDB ; R2 -> I/O buffer VMIOST: MOV $WRKPT,R0 ;R0 -> work file FDB ADD #F.IO.,R0 ;R0 -> I/O area block CLR R1 ;Need a MOVB with no sign extend BISB P$GBLK(R2),R1 ;Get the block number to read or write MOV R1,F.IOBK-F.IO.(R0) ;Save it in the area block MOV #256.,F.IOWC-F.IO.(R0) ;Set up the word count ADD #P$GHD,R2 ;R2 -> I/O buffer MOV R2,F.IOBF-F.IO.(R0) ;Save it MOV $WRKPT,R1 ;R1 -> work file FDB RETURN .END