News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Instruction Set detection for 32 bit Operating Systems

Started by Gunther, February 03, 2013, 08:24:36 AM

Previous topic - Next topic

Antariy

I understand that the command to change the subsystem version was mistyped ::) Instead of /SUBSYSTEM:CONSOLE,3.1 it is proper to use 3.10
So the need not to test exes from the archive above because some of them linked with mistyped version.

FORTRANS

Hi Alex,

   The error message from Win32s is a popup that says (sort of)
"Win32s", "CPU.EXE:  Invalid format".  Clicking on that brings closes
it and brings up "Cannot Run Program", "Unexpected error 21".

   Looking for information I found http://stephan.win31.de/w32slist.htm.
Where it says:

Quote[Someone had encountered an Error 21/"Invalid Format" message from Win32s]
Unfortunately the VC++ 5 and 6 compilers default to not generate a .reloc section
in applications so the .EXE can be loaded only at its fixed base address (default
0x400000) that is not available in Win32s.

   Is adding a .reloc section difficult with MASM?

Regards,

Steve N.

P.S.  Interesting when a search for new information turns up your
own posting.  Grr.

Gunther

Hi Steve,

Quote from: FORTRANS on May 07, 2014, 01:19:29 AM
   Is adding a .reloc section difficult with MASM?

not sure, but would help this thread? May be that Erol (aka Vortex) knows how to fix that.

Gunther
You have to know the facts before you can distort them.

FORTRANS

Hi Gunther,

   Thank you.  I will try that later.

Regards,

Steve N.

Gunther

You have to know the facts before you can distort them.

FORTRANS

Hi,

   I tried the linker switch /FIXED:NO as mentioned by Vortex.
And assembled a small program that is using;

include \masm32\include\masm32rt.inc

And it then wants MSVCRT.DLL, so copy that over.  Then
it trys to load, and fails with "Win32s - error", "The procedure
entrypoint "HeapCompact" could not be located in [...]".  So
I would guess I need a simpler set of includes to replace
masm32ft.inc.  And so I will look in the examples subdirectory to
see what I can find.

Regards,

Steve N.

Antariy

Hi Steve, thank you very much for the information, did not know that :t
Yes, I removed (as usually) the relocations from the EXE - the MSVC10 produces .reloc section by default but I turned it off with /FIXED switch. Now recompiled the EXE with relocs :t
Can you try it out? Two exes, one is 4.0 subsystem version, the other is 3.10

FORTRANS

Hi Alex,

   Tried both on two systems.  With both I used File Manager,
selected the EXE, went to File, run, and the run dialog comes up.
Clicking on that and the dialog goes away.  No messages or
anything else as far as I can tell.  I also tried just double clicking
it, and except for an instant of disk activity, nothing happens.

HTH,

Steve N.


Gunther

Steve,

Quote from: FORTRANS on May 07, 2014, 09:23:59 AM
   Tried both on two systems.  With both I used File Manager,
selected the EXE, went to File, run, and the run dialog comes up.
Clicking on that and the dialog goes away.  No messages or
anything else as far as I can tell.  I also tried just double clicking
it, and except for an instant of disk activity, nothing happens.

seems to be a good sign.

Gunther
You have to know the facts before you can distort them.

FORTRANS

Hi,

   I looked in the "masm32\examples" directory for console examples
that did not use masm32rt.inc, and selected a few.  Here are the first
results for running with Win32s in a VDM.

dosstyle.asm : requires MSVCRT.DLL, does not work.
hello.asm : disappears,  does not work.
MemInfoMicro.asm : works, but it is a dialog and not a console application.
MemFree.asm : did not assemble due to errors.

   Comments?  Suggestions?

Regards,

Steve N.

Gunther

Hi Steve,

Quote from: FORTRANS on May 08, 2014, 02:31:21 AM
dosstyle.asm : requires MSVCRT.DLL, does not work.
hello.asm : disappears,  does not work.
MemInfoMicro.asm : works, but it is a dialog and not a console application.
MemFree.asm : did not assemble due to errors.

that doesn't sound great. But look Win32s was designed between Windows 3.1 and Win95 and the "s" stands for "subset". I think that explains some things.

Gunther
You have to know the facts before you can distort them.

Antariy

Hi Steve,

Quote from: FORTRANS on May 08, 2014, 02:31:21 AM
   I looked in the "masm32\examples" directory for console examples
that did not use masm32rt.inc, and selected a few.  Here are the first
results for running with Win32s in a VDM.

dosstyle.asm : requires MSVCRT.DLL, does not work.
hello.asm : disappears,  does not work.
MemInfoMicro.asm : works, but it is a dialog and not a console application.
MemFree.asm : did not assemble due to errors.

   Comments?  Suggestions?

I thought about that it maybe something with console type programs, but did not spoke that "aloud" because though that I already got much of your patience with the question, and did not want to be boring :biggrin:

MSVCRT.DLL was first shipped with Win98/late Win95 as a system DLL, so instead of linking with MSVCRT.lib you may link the program with CRTDLL.LIB - I described in previous page how to do the import library for CRTDLL.DLL. But probably that has nothing to do with our question, i.e. if we put MSVCRT.dll on the system or relink with CRTDLL.dll the program won't run because of other reason.
MemInfoMicro - this name is familar :biggrin: Yes, it's not a console program but uses a MessageBox which brings up the dialog. Maybe the reason is really in the console programs?

Antariy

Hi Gunther,

Quote from: Gunther on May 08, 2014, 02:54:41 AM
that doesn't sound great. But look Win32s was designed between Windows 3.1 and Win95 and the "s" stands for "subset". I think that explains some things.

Yes, you're right, the Win32s is not a widely spread system, so your program covers the most of the OSes, but it is just a curious technical problem - why a programs didn't work on it :biggrin:

hutch--

Just vaguely I remember that you needed a specialised linker to build a win32S application. It is hybrid crap technology bridging win16 to a test format of 32 bit written underneath in 16 bit. They ran on win16 (3.11) but nothing fancy.