kernel′), ′getversion′);
{GETVERSION 函数在模块 KERNEL中}
{lpGetVersion 存放GETVERSION 的地址}
if lpgetVersion=nil then exit;
label1.caption:=intTostr(selectorof(lpgetversion))
+'':'' +intTostr(offsetof(lpgetversion));{取32位地址的高16位用selectorof}
{取32位地址的低16位用offsetof }
asm {嵌入式汇编语言标记}
call lpgetversion
mov versionLowWord,ax
{ax寄存器放Windows版本号}
mov versionHighWord,dx
{dx寄存器放DOS版本号}
end;
label2.caption:=′Windows Version ′+
intTostr(lobyte(versionLowWord))
+′.′+intTostr(hibyte(versionLowWord)); {取16位 2进制数 的低8位用lowbyte}
{取16位 2进制数 的高8位用hibyte}
label3.caption:=′MS-DOS Version ′+
intTostr(hibyte(versionHighWord))
+′.′+intTostr(lobyte(versionHighWord));
end;
end