home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / xbase / library / clipper / rettig / source / curdrive.asm < prev    next >
Assembly Source File  |  1990-10-21  |  1KB  |  40 lines

  1. ; Function: CURDRIVE.ASM
  2. ;
  3. ; By Leonard Zerman
  4. ;
  5. ; Placed in the public domain by Tom Rettig Associates, 10/22/1990.
  6. ;
  7. ;-------------------------------------------------------------
  8. ;     SYNTAX:  memvar = CURDRIVE()
  9. ;
  10. ;    RETURNS:  Current disk directory letter.
  11. ;---------------------------------------------------------------
  12.  
  13.          INCLUDE EXTENDA.INC
  14.          DATASEG
  15.  
  16.          CLpublic <CURDRIVE>
  17.  
  18.          CLstatic <byte DRIVEBUFF << 2 DUP (0) >>>
  19.  
  20.          CLfunc char CURDRIVE
  21.  
  22.          CLcode
  23.  
  24.           DOSREQ     19H                  ; Get current drive
  25.           ADD        AL,'A'               ; Convert to ASCII
  26.           PUSH       BX
  27.           PUSH       DS
  28.           MOV        BX,SEG DRIVEBUFF
  29.           MOV        DS,BX
  30.           MOV        BX,OFFSET DRIVEBUFF
  31.           MOV        [BX],AL
  32.           MOV        AX,BX
  33.           MOV        DX,DS
  34.           POP        DS
  35.           POP        BX
  36.           CLret      DX,AX    
  37. ;********************************************************
  38.           END
  39.  
  40.