home *** CD-ROM | disk | FTP | other *** search
- page 58,132
-
- ; dosabs.asm
- ; contains: dosabsread(), dosabswrite()
- ;
- ;
-
- include model.h
- include prologue.h
- name dosabs
- pseg dosabs
-
- ;==>-- int dosabsread(drive,sectors,startlsector,buffer)
- ;
- ;; ARGUMENTS:
- ; (int) drive - Drive Number, 0=A: 1=B: etc
- ; (unsigned) sectors - Number of sectors to read
- ; (unsigned) startlector - Beginning logical sector number
- ; (char *) buffer - Pointer to buffer
- ;
- ;; DESCRIPTION:
- ; This function calls interrupt 0x25
- ;
- ;; RETURNS:
- ;
- ; 0x00 Successful
- ; 0x80 Attachment failed to respond
- ; 0x40 Seek operation failed
- ; 0x20 Controller failed
- ; 0x10 Data Error (bad CRC)
- ; 0x08 Direct memory access (DMA) failure
- ; 0x04 Requested sector not found.
- ; 0x03 Write protect fault.
- ; 0x02 Bad address mark
- ; 0x01 Bad Command
- ;
- ;; AUTHOR:
- ; "" 25-MAR-1987 10:47:25.06
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ; MODIFICATIONS:
- ; "" Tue 08-Nov-1988 12:36:17
- ; Modified RETURNS: section of comment to be correct, also added
- ; code to pop ds before leaving function in the large data models.
- ; (SAR #86 & #95)
- ;;;
- cproc dosabsread,,dosabsre
- mov al,parm1_ ;al=drive
- mov cx,parm2_ ;cx=number of sectors to read
- mov dx,parm3_ ;dx=beginning logical sector #
- if _LDATA
- push ds
- lds bx,parm4_
- else
- mov bx,parm4_
- endif
- int 25h ;do abs disk read
- pop cx
- mov ah,0 ;clear ah
- jc drex ;if error return code in AX
- xor al,al ;else clear al (return 0 in ax)
- drex:
- if _LDATA
- pop ds
- endif
- cproce
-
- ;==>-- int dosabswrite(drive,sectors,startlsector,buffer)
- ;
- ;; ARGUMENTS:
- ; (int) drive - Drive Number, 0=A: 1=B: etc
- ; (unsigned) sectors - Number of sectors to write
- ; (unsigned) startlector - Beginning logical sector number
- ; (char *) buffer - Pointer to buffer
- ;
- ;; DESCRIPTION:
- ; This function calls interrupt 0x26
- ;
- ;; RETURNS:
- ;
- ; 0x00 Successful
- ; 0x80 Attachment failed to respond
- ; 0x40 Seek operation failed
- ; 0x20 Controller failed
- ; 0x10 Data Error (bad CRC)
- ; 0x08 Direct memory access (DMA) failure
- ; 0x04 Requested sector not found.
- ; 0x03 Write protect fault.
- ; 0x02 Bad address mark
- ; 0x01 Bad Command
- ;
- ;; AUTHOR:
- ; "" 25-MAR-1987 11:01:09.20
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ; MODIFICATIONS:
- ; "" Tue 08-Nov-1988 12:36:17
- ; Modified RETURNS: section of comment to be correct, also added
- ; code to pop ds before leaving function in large data model.
- ; (SAR #86 & #95)
- ;;;
- cproc dosabswrite,,dosabswr
- mov al,parm1_ ;al=drive
- mov cx,parm2_ ;cx=number of sectors to read
- mov dx,parm3_ ;dx=beginning logical sector #
- if _LDATA
- push ds
- lds bx,parm4_
- else
- mov bx,parm4_
- endif
- int 26h ;do abs disk write
- pop cx
- mov ah,0 ;clear ah
- jc dwex ;if error return code in AX
- xor al,al ;else clear al (return 0 in ax)
- dwex:
- if _LDATA
- pop ds
- endif
- cproce
- endps
- end
-