home *** CD-ROM | disk | FTP | other *** search
- page 58,132
-
- ;/*
- ;** dosxabs.asm
- ;** contains: dosrdabs(), doswrabs()
- ;*/
- ifndef _LCODE
- include model.h
- endif
- include prologue.h
- name pntspool
-
-
- DOSABSREAD equ 025h ;DOS Absolute read software Int
- DOSABSWRITE equ 026h ;DOS Absolute write software Int
-
-
-
- DOSXABSPACKET struc
- FirstSector dd ? ;32 bit first sector number
- Count dw ? ;Number of sectors to I/O
- Buffer dd ? ;32 bit pointer to buffer
- DOSXABSPACKET ends
-
-
- dseg ddosxabs
- packet DOSXABSPACKET <0,0,0>
- endds
-
-
- pseg cdosxabs
-
- ;/*
- ;** int
- ;** dosrdabs(int drive,int count,long firstsector,void *buffer)
- ;**
- ;** ARGUMENT(s)
- ;** drive - Drive # (0==A:, 1==B: etc.)
- ;** count - number of sectors to read
- ;** firstsector - starting sector of read (0 based)
- ;** buffer - pointer to buffer to receive data read from
- ;** disk.
- ;**
- ;** DESCRIPTION
- ;** Performs extended dos absolute read. This function requires DOS 4.0 or
- ;** higher. This function is not supported by versions prior to version 4.
- ;**
- ;** WARNING: Before calling this function to removable media, the media in
- ;** the drive must be established correctly. This can be done by calling
- ;** the Greenleaf function dosgetdir() for the drive.
- ;**
- ;**
- ;** RETURNS
- ;** 0 if successful else one of the following error codes:
- ;**
- ;** 0x80 - Attachment failed to respond
- ;** 0x40 - SEEK operation failed
- ;** 0x08 - Bad CRC on diskette read
- ;** 0x04 - Requested sector not found
- ;** 0x02 - Error other than types listed above
- ;**
- ;** AUTHOR
- ;** "" Thu 01-Dec-1988 15:37:09
- ;** Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
- ;**
- ;** MODIFICATIONS
- ;**
- ;*/
- cproc dosrdabs
- if _LDATA
- push es
- les bx,parm5_ ;ES:BX point to buffer
- mov word ptr packet.Buffer,bx
- mov word ptr packet.Buffer+2,es
- pop es
- else
- mov bx,parm5_ ;BX points to buffer
- mov word ptr packet.Buffer,bx
- mov word ptr packet.Buffer+2,ds
- endif
- mov ax,parm2_ ;AX = count of sectors to read
- mov packet.Count,ax ;and save in packet
- mov ax,parm3_ ;AX = low order part of long
- mov word ptr packet.FirstSector,ax
- mov ax,parm4_ ;AX = high order part of long
- mov word ptr packet.FirstSector+2,ax
- mov al,parm1_ ;AL = drive #
- mov cx,-1 ;Indicate extended
- lea bx,packet
- int DOSABSREAD ;make request
- pop cx ;clean stack
- mov bx,0
- xchg bx,ax
- jnc dosxrex
- mov al,bh ;put error in AL
- dosxrex:
- cproce
-
-
- ;/*
- ;** int
- ;** doswrabs(int drive,int count,long firstsector,void *buffer)
- ;**
- ;** ARGUMENT(s)
- ;** drive - Drive # (0==A:, 1==B: etc.)
- ;** count - number of sectors to write
- ;** firstsector - starting sector of write (0 based)
- ;** buffer - pointer to buffer containing data to be
- ;** written to disk.
- ;**
- ;** DESCRIPTION
- ;** Performs extended dos absolute write. This function requires DOS 4.0 or
- ;** higher. This function is not supported by versions prior to version 4.
- ;**
- ;**
- ;** WARNING: Before calling this function to removable media, the media in
- ;** the drive must be established correctly. This can be done by calling
- ;** the Greenleaf function dosgetdir() for the drive.
- ;**
- ;**
- ;** RETURNS
- ;** 0 if successful else one of the following error codes:
- ;**
- ;** 0x80 - Attachment failed to respond
- ;** 0x40 - SEEK operation failed
- ;** 0x08 - Bad CRC on diskette read
- ;** 0x04 - Requested sector not found
- ;** 0x03 - Write attempt on write-protected media
- ;** 0x02 - Error other than types listed above
- ;**
- ;** AUTHOR
- ;** "" Thu 01-Dec-1988 16:06:25
- ;** Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
- ;**
- ;** MODIFICATIONS
- ;**
- ;*/
- cproc doswrabs
- if _LDATA
- push es
- les bx,parm5_ ;ES:BX point to buffer
- mov word ptr packet.Buffer,bx
- mov word ptr packet.Buffer+2,es
- pop es
- else
- mov bx,parm5_ ;BX points to buffer
- mov word ptr packet.Buffer,bx
- mov word ptr packet.Buffer+2,ds
- endif
- mov ax,parm2_ ;AX = count of sectors to write
- mov packet.Count,ax ;and save in packet
- mov ax,parm3_ ;AX = low order part of long
- mov word ptr packet.FirstSector,ax
- mov ax,parm4_ ;AX = high order part of long
- mov word ptr packet.FirstSector+2,ax
- mov al,parm1_ ;AL = drive #
- mov cx,-1 ;Indicate extended
- lea bx,packet
- int DOSABSWRITE ;make request
- pop cx ;clean stack
- mov bx,0
- xchg bx,ax
- jnc dosxwex
- mov al,bh ;put error in AL
- dosxwex:
- cproce
-
-
-
-
- endps
- end
-