home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l440 / 2.ddi / CHAP2 / LASTDRV3.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-09-25  |  374 b   |  21 lines

  1. /* LASTDRV3.C -- uses only documented DOS */
  2.  
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. #include <dos.h>
  6.  
  7. main()
  8. {
  9.     unsigned lastdrv;
  10.     _AH = 0x19;
  11.     geninterrupt(0x21);
  12.     _DL = _AL;
  13.     _AH = 0x0E;
  14.     geninterrupt(0x21);
  15.     lastdrv = _AL;
  16.     fputs("LASTDRIVE=", stdout);
  17.     putchar('A' - 1 + lastdrv);
  18.     putchar('\n');
  19.     return lastdrv;
  20. }
  21.