También puedes hacer todo sin ensamblador, ejemplo:
Código Delphi
[-]unit Unit4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
const
PROCESSOR_ARCHITECTURE_AMD64 = 9;
{$EXTERNALSYM PROCESSOR_ARCHITECTURE_AMD64}
PROCESSOR_ARCHITECTURE_IA64 = 6;
{$EXTERNALSYM PROCESSOR_ARCHITECTURE_IA64}
type
TForm4 = class(TForm)
bt1: TButton;
procedure bt1Click(Sender: TObject);
private
public
end;
var
Form4: TForm4;
implementation
{$R *.dfm}
function GetNativeSystemInfo(var SystemInfo: TSystemInfo): Boolean;
type
TGetNativeSystemInfo = procedure (var SystemInfo: TSystemInfo); stdcall;
var
LibraryHandle: HMODULE;
_GetNativeSystemInfo: TGetNativeSystemInfo;
begin
Result := False;
LibraryHandle := GetModuleHandle(kernel32);
if LibraryHandle <> 0 then
begin
_GetNativeSystemInfo := GetProcAddress(LibraryHandle, 'GetNativeSystemInfo');
if Assigned(_GetNativeSystemInfo) then
begin
_GetNativeSystemInfo(SystemInfo);
Result := True;
end
else
GetSystemInfo(SystemInfo);
end
else
GetSystemInfo(SystemInfo);
end;
function IsWindows64: Boolean;
var
ASystemInfo: TSystemInfo;
begin
GetNativeSystemInfo(ASystemInfo);
Result := ASystemInfo.wProcessorArchitecture in
[PROCESSOR_ARCHITECTURE_IA64, PROCESSOR_ARCHITECTURE_AMD64];
end;
procedure TForm4.bt1Click(Sender: TObject);
begin
if IsWindows64 then
ShowMessage('Es 64 bits')
else
ShowMessage('Es 32 bits');
end;
end.