mov ax, 3306h ;Get MS-DOS Version
int 21h
mov MajorV, bl ;major version number (05h for version 5.0)
mov MinorV, bh ;minor version number (00h for version 5.0)
mov RevisionNum, dl ;revision number in bits 0 through 2
mov VersionFlags, dh ;version flags
Get MS-DOS Version (Function 3306h) returns the MS-DOS version number, the MS-DOS revision number, and version flags specifying whether MS-DOS is in the high memory area (HMA) or in read-only memory (ROM).
This function has no parameters.
The BX and DX registers contain the following information:
Register | Contents |
BL | The major version number—for example, 05h for version 5.0. |
BH | The minor version number—for example, 00h for version 5.0. |
DL | In the low three bits, the revision number. All other bits are reserved and set to zero. |
DH | The MS-DOS version flags. The contents may be a combination of the following values: |
Value | Meaning |
DOSINROM (08h) | If set, MS-DOS runs in ROM; otherwise, MS-DOS runs in RAM. |
DOSINHMA (10h) | If set, MS-DOS is in the high memory area; otherwise, MS-DOS is in conventional memory. |
All other bits are reserved and set to zero. |
This function returns the actual MS-DOS version number rather than the version number set by the setver command for the program.
Function 30h Get Version Number