Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
GetCurDrive
 Map                                       Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
;* GetCurDrive - Gets designation of current drive.
;*
;* Shows:   DOS Function - 19h (Get Current Disk)
;*          Instruction - cbw
;*
;* Params:  None
;*
;* Return:  Short integer with drive designation
;*          0 = A, 1 = B, 2 = C, etc.
 
GetCurDrive PROC
 
        mov     ah, 19h                 ; DOS Function 19h
        int     21h                     ; Get Current Disk
        cbw                             ; AX = drive designation
        ret
 
GetCurDrive ENDP
                                    -♦-