home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / dskutl / dsktst.arc / ABSREAD.C next >
Text File  |  1985-08-06  |  896b  |  26 lines

  1. #include <dos.h>
  2. /******************************************************************************
  3. *                                          *
  4. *  absolute disk read (calls disk bios) 0x80 = 1st hard disk              *
  5. *                                          *
  6. ******************************************************************************/
  7. absread(drive,cyl,head,record,count,buffer)
  8. int drive, cyl, head, record, count;
  9. char *buffer;
  10. {
  11.   union  REGS  reg;
  12.   struct SREGS seg;
  13.   int err = 0;
  14.   segread(&seg);
  15.   reg.h.ch = (cyl & 0x00ff);         /* lo order cylinder */
  16.   reg.h.cl = (((cyl & 0xff00) << 6) | record);
  17.   reg.h.dh = head;
  18.   reg.h.dl = drive;
  19.   reg.h.al = count;
  20.   reg.h.ah = 2;
  21.   reg.x.bx = (unsigned int) buffer;            /* point to buffer */
  22.   err = int86x(0x13,®,®,&seg); /* read the disk */
  23.   err = (err >> 8);
  24.   return(err);
  25. }
  26.