home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
xbase
/
library
/
clipper
/
rettig
/
source
/
curdrive.asm
< prev
next >
Wrap
Assembly Source File
|
1990-10-21
|
1KB
|
40 lines
; Function: CURDRIVE.ASM
;
; By Leonard Zerman
;
; Placed in the public domain by Tom Rettig Associates, 10/22/1990.
;
;-------------------------------------------------------------
; SYNTAX: memvar = CURDRIVE()
;
; RETURNS: Current disk directory letter.
;---------------------------------------------------------------
INCLUDE EXTENDA.INC
DATASEG
CLpublic <CURDRIVE>
CLstatic <byte DRIVEBUFF << 2 DUP (0) >>>
CLfunc char CURDRIVE
CLcode
DOSREQ 19H ; Get current drive
ADD AL,'A' ; Convert to ASCII
PUSH BX
PUSH DS
MOV BX,SEG DRIVEBUFF
MOV DS,BX
MOV BX,OFFSET DRIVEBUFF
MOV [BX],AL
MOV AX,BX
MOV DX,DS
POP DS
POP BX
CLret DX,AX
;********************************************************
END