This sounds like exactly what I'd want to do, but maybe I'm missing something. One can iterate BL for the drive letters 1-26, but how is this actually useful? If you just subtract "A" from the drive letter to get 0 for A and 1 for B, would that mean that the third floppy drive (2) HAS to be C: ?
Here is what I make out.
I have a system with three floppy drives, and a hard drive containing one DOS partition.
If I boot to DOS 3.3, I discover that the drive letters (logical drives) assigned by DOS are:
A: = First floppy drive
B: = Second floppy drive
C: = Third floppy drive
D: = DOS partition on hard drive
If I then boot to DOS 5, I discover that the drive letters (logical drives) assigned by DOS are:
A: = First floppy drive
B: = Second floppy drive
C: = DOS partition on hard drive
D: = Third floppy drive
Let's look at the latter DOS situation, where the hard drive partition is C:
I have not used the subject function 44H before, but from what I read in the 'The MS-DOS Encyclopedia' book:
* Logical drive A: - Programmer passes 01h to the function. On return, the carry flag is clear. Returned in the device type field is a value ranging from 0 to 4, or 7, i.e. A: is a floppy drive.
* Logical drive B: - Programmer passes 02h to the function. On return, the carry flag is clear. Returned in the device type field is a value ranging from 0 to 4, or 7, i.e. B: is a floppy drive.
* Logical drive C: - Programmer passes 03h to the function. On return, the carry flag is clear. Returned in the device type field is the value of 5, i.e. C: is a partition on a hard drive.
* Logical drive D: - Programmer passes 04h to the function. On return, the carry flag is clear. Returned in the device type field is a value ranging from 0 to 4, or 7, i.e. D: is a floppy drive.
* Logical drive E: - Programmer passes 05h to the function. On return, the carry flag is set, and in AX is 2, indicating 'invalid drive'.
* Logical drive F: - Programmer passes 06h to the function. On return, the carry flag is set, and in AX is 2, indicating 'invalid drive'.
And so on.
What drive number to use in INT13H functions ?
According to the pointed-to Microsoft Q62571 article:
- The bit about subtracting "A" (or 1) only applies if function 44H indicates that the logical drive is a floppy/diskette type.
- Therefore, for A:, a floppy drive, the drive number to use in INT13H functions is 0 ("A" - "A" = 0).
- Therefore, for B:, a floppy drive, the drive number to use in INT13H functions is 1 ("B" - "A" = 1).
- Therefore, for C:, a partition on a hard drive, step 3 in Q62571 needs to be followed.
- Therefore, for D:, a floppy drive, the drive number to use in INT13H functions is 3 ("D" - "A" = 3).
If that is correct, then presumably, if the drive number of 2 was passed to INT13H, INT13H would indicate an invalid drive.