home *** CD-ROM | disk | FTP | other *** search
- ;************************************************************;
- ; ;
- ; Function 21H: Random File Read, FCB-based ;
- ; ;
- ; int FCB_rread(oXFCB,recnum) ;
- ; char *oXFCB; ;
- ; long recnum; ;
- ; ;
- ; Returns 0 if record read OK, otherwise ;
- ; returns error code 1, 2, or 3. ;
- ; ;
- ;************************************************************;
-
- cProc FCB_rread,PUBLIC,ds
- parmDP poXFCB
- parmD recnum
- cBegin
- loadDP ds,dx,poXFCB ; Pointer to opened extended FCB.
- mov bx,dx ; BX points at FCB, too.
- mov ax,word ptr (recnum) ; Get low 16 bits of record
- mov [bx+28h],ax ; number and store in FCB.
- mov ax,word ptr (recnum+2) ; Get high 16 bits of record
- mov [bx+2ah],ax ; number and store in FCB.
- mov ah,21h ; Ask MS-DOS to read recnum'th
- ; record, placing it at DTA.
- int 21h
- cbw ; Clear high byte of return value.
- cEnd
-