For those who are worrying about 64-bit Windows, I have tested Stony Brook Modula-2 (version 4, build 30) on a PC with an AMD Athlon 64 3200+ processor with the following Windows versions:
SBM2 installs and runs successfully on these systems (I did not test the debugger).
I have also tested some programs written in SBM2 by different developers, and all run without problems. Some ran 2 to 3 times faster than on a (more or less) comparable Intel Pentium4 (3.4 GHz) based machine, irrespective of whether the 32-bits or 64-bits version of the OS used.
On 64-bit Windows, 32-bit applications run by means of an emulator called WOW64. An application can detect whether it is running under WOW64 by calling the IsWow64Process function. This function is only implemented in Windows XP and Windows Server 2003 and therefore it should not be called directly (unless you don't want your application to be compatible with earlier Windows versions).
The following Modula-2 procedure returns TRUE when used in an application that is running under a 64-bits Windows version, and FALSE in all other cases.
<*/PUSH*>
<*/CALLS:WIN32SYSTEM*>
<*/NOHIGH*>
<*/ALIGN:8/NOPACK*>
TYPE fnIsWow64Process = PROCEDURE (WIN32.HANDLE, VAR WIN32.BOOL) : WIN32.BOOL;
<*/POP*>
PROCEDURE IsWow64Process(): BOOLEAN;
VAR proc : fnIsWow64Process;
hinstance : WIN32.HINSTANCE;
ok : WIN32.BOOL;
BEGIN
hinstance:=CAST(WIN32.HINSTANCE,WIN32.GetModuleHandle("kernel32"));
IF hinstance=NIL THEN RETURN FALSE END;
proc:=CAST(fnIsWow64Process,WIN32.GetProcAddress(hinstance,"IsWow64Process"));
IF proc=CAST(fnIsWow64Process,NIL) THEN RETURN FALSE END;
IF ~proc(WIN32.GetCurrentProcess(),ok) THEN RETURN FALSE END;
RETURN ok;
END IsWow64Process;
|