Int 21H [1.0] Function 19H (25) Get current disk

Returns the drive code of the current, or default, disk drive.

Call with:

AH = 19H

Returns:

AL = drive code (0 = A, 1 = B, etc.)

Notes:

To set the default drive, use Int 21H Function 0EH.

Some other Int 21H functions use drive codes beginning at 1 (that is, 1 = A, 2 = B, etc.) and reserve drive code zero for the default drive.

Example:

Get the current disk drive and save the code in the variable cdrive.

cdrive db 0 ; current drive code

.

.

.

mov ah,19h ; function number

int 21h ; transfer to MS-DOS

mov cdrive,al ; save drive code

.

.

.