Function 30h Get Version Number

mov al, VerOrOEMFlag ;01h = version flag, 00h = OEM number

mov ah, 30h ;Get Version Number

int 21h

mov MajorV, al ;major version number (05h for version 5.0)

mov MinorV, ah ;minor version number (00h for version 5.0)

mov VerOrOEM, bh ;version flag or OEM number

mov byte ptr [UserNum+2], bl ;bl:cx is 24-bit user serial number

mov word ptr [UserNum], cx

Get Version Number (Function 30h) returns the MS-DOS version number set by the setver command for the program. The function also returns either the MS-DOS version flag or the original-equipment-manufacturer (OEM) number.

Parameter

VerOrOEMFlag

Specifies whether the function returns the version flag or the OEM number in the BH register. It can be one of the following values:

Value Number

00h The OEM number
01h The version flag

Return Values

The AX, BX, and CX registers contain the following information:

Register Contents

AL The major version number for the program—for example, 03h for version 3.31, 05h for version 5.0.
AH The minor version number for the program—for example, 1Fh for version 3.31, 00h for version 5.0.
BH Either the OEM number or the version flag. In the latter case, if the version flag is set to DOSINROM (08h), MS-DOS runs in ROM; otherwise, MS-DOS runs in RAM. All other bits are reserved and set to zero.
BL:CX The 24-bit user serial number. The user serial number is OEM-dependent. If not used, the number is set to zero.

Comments

This function returns the MS-DOS version number set by the setver command. This version number can differ from the actual MS-DOS version number returned by Get MS-DOS Version (Function 3306h).

For more information about the setver command, see the Microsoft MS-DOS User's Guide and Reference.

See Also

Function 3306h Get MS-DOS Version