home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 14 / CDACTUAL.iso / cdactual / demobin / share / program / asm / SCSIDRV.ZIP / BINMODE.C next >
Encoding:
C/C++ Source or Header  |  1991-11-06  |  497 b   |  28 lines

  1. #ifdef MSDOS
  2. #include <dos.h>
  3.  
  4. binmode(fd)
  5. int fd;
  6. {
  7.     union REGS inregs, outregs;
  8.  
  9.     /*
  10.     ** get the current mode
  11.     */
  12.     inregs.h.ah = 0x44;            /* ioctl */
  13.     inregs.h.al = 0x00;            /* get */
  14.     inregs.x.bx = fd;            /* unit */
  15.     intdos(&inregs, &outregs);
  16.  
  17.     /*
  18.     ** set to BINARY mode (this works for char devices)
  19.     */
  20.     inregs.h.ah = 0x44;            /* ioctl */
  21.     inregs.h.al = 0x01;            /* set */
  22.     inregs.x.bx = fd;            /* unit */
  23.     inregs.h.dh = 0;
  24.     inregs.h.dl = outregs.h.dl | 0x20;
  25.     intdos(&inregs, &outregs);
  26. }
  27. #endif
  28.