Service Function 0000h Get Version

mov ax, 0000h ;Get Version

call [Service] ;service-function handler

jc error_handler

mov WORD PTR [Version], bx

mov ax, es

mov WORD PTR [Version+2], ax ;es:bx points to SWVERSION structure

Get Version (Service Function 0000h) returns the address of an SWVERSION structure that identifies the current task switcher, its version number, and the protocol it supports.

Client programs and task switchers can call this function.

Parameters

This function has no parameters.

Return Value

If the function is successful, the carry flag is clear, the AX register contains 0000h, and the ES:BX registers contain the address of the SWVERSION structure for the current task switcher. If the task switcher does not support this function, the carry flag is set.

Comments

The SWVERSION structure has the following form:

SWVERSION STRUC

svsAPIMajor dw ? ;protocol supported major version

svsAPIMinor dw ? ;protocol supported minor version

svsProductMajor dw ? ;task switcher's major version

svsProductMinor dw ? ;task switcher's minor version

svsSwitcherID dw ? ;task-switcher identifier

svsFlags dw ? ;operation flags

svsName dd ? ;points to task-switcher name (ASCIIZ)

svsPrevSwitcher dd ? ;previous task switcher's entry address

SWVERSION ENDS

For a full description of the SWVERSION structure, see Section 7.11, “Structures.”

A task switcher processing Get Version can enable interrupts and call any MS-DOS system function. Although the task switcher modifies the AX, ES, and DI registers, it must preserve all other registers.

See Also

Interrupt 2Fh Function 4B02h Detect Switcher