; TITLE "SRREAD - Syslib 4.0" NAME ('RREAD') ;================================================================= ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;----------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from SRREAD.MAC Ver 1.1 by Richard Conn ; Date : 11 Jun 89 ; Version : 1.3 ; Module : SRREAD ; Abstract: This module contains the routine R$READ which reads ; the specified random record of the selected file to the ; current DMA address. The file must have been previously ; opened by a routine such as F$OPEN. ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC R$READ, @RRW ; From SYSLIB Get.. EXT @BDOSA ; Definitions READRAN EQU 33 ; Random Read Dos function RANREC EQU 33 ; Offset to Random Rec in FCB .Z80 CSEG ;=============================================================== ; NAME - R$READ ; Entry: DE - Addresses the FCB for the desired file ; HL - Contains desired Random Record Number ; Exit : A = 0, Zero Flag Set (Z) if Ok ; A = Error Code, Zero Flag Reset (NZ) if Error ; Uses : AF ; Special Requirements: File Must have been previously opened ;=============================================================== R$READ: LD A,READRAN ; Set Read @RRW: PUSH DE ; Save FCB pointer PUSH HL ; ..and record number LD HL,RANREC ; Offset to R0, R1 and R2 ADD HL,DE ; HL now points to Random Rec Number POP DE ; Restore Record Number to DE LD (HL),E ; store low-order value INC HL LD (HL),D ; store high-order value INC HL LD (HL),0 ; store 0 EX DE,HL ; Put Random Rec # back in HL POP DE ; .restore FCB ptr JP @BDOSA ; ..and perform function elsewhere END