Author Topic: Instruction Set detection for 32 bit Operating Systems  (Read 45987 times)

Antariy

  • Member
  • ****
  • Posts: 551
Re: Instruction Set detection for 32 bit Operating Systems
« Reply #75 on: May 03, 2014, 06:02:10 AM »
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

  • Member
  • *****
  • Posts: 1084
Re: Instruction Set detection for 32 bit Operating Systems
« Reply #76 on: May 07, 2014, 01:19:29 AM »
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

  • Member
  • *****
  • Posts: 3697
  • Forgive your enemies, but never forget their names
Re: Instruction Set detection for 32 bit Operating Systems
« Reply #77 on: May 07, 2014, 01:59:14 AM »
Hi Steve,

   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
Get your facts first, and then you can distort them.

FORTRANS

  • Member
  • *****
  • Posts: 1084
Re: Instruction Set detection for 32 bit Operating Systems
« Reply #78 on: May 07, 2014, 04:32:27 AM »
Hi Gunther,

   Thank you.  I will try that later.

Regards,

Steve N.

Gunther

  • Member
  • *****
  • Posts: 3697
  • Forgive your enemies, but never forget their names
Re: Instruction Set detection for 32 bit Operating Systems
« Reply #79 on: May 07, 2014, 04:43:20 AM »
Hi Steve,

   Thank you.  I will try that later.

okay. Don't rush.

Gunther
Get your facts first, and then you can distort them.

FORTRANS

  • Member
  • *****
  • Posts: 1084
Re: Instruction Set detection for 32 bit Operating Systems
« Reply #80 on: May 07, 2014, 07:28:45 AM »
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

  • Member
  • ****
  • Posts: 551
Re: Instruction Set detection for 32 bit Operating Systems
« Reply #81 on: May 07, 2014, 08:05:36 AM »
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

  • Member
  • *****
  • Posts: 1084
Re: Instruction Set detection for 32 bit Operating Systems
« Reply #82 on: May 07, 2014, 09:23:59 AM »
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.

Antariy

  • Member
  • ****
  • Posts: 551
Re: Instruction Set detection for 32 bit Operating Systems
« Reply #83 on: May 07, 2014, 09:32:50 AM »
Steve, thank you! :biggrin:

Gunther

  • Member
  • *****
  • Posts: 3697
  • Forgive your enemies, but never forget their names
Re: Instruction Set detection for 32 bit Operating Systems
« Reply #84 on: May 07, 2014, 09:58:12 PM »
Steve,

   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
Get your facts first, and then you can distort them.

FORTRANS

  • Member
  • *****
  • Posts: 1084
Re: Instruction Set detection for 32 bit Operating Systems
« Reply #85 on: May 08, 2014, 02:31:21 AM »
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

  • Member
  • *****
  • Posts: 3697
  • Forgive your enemies, but never forget their names
Re: Instruction Set detection for 32 bit Operating Systems
« Reply #86 on: May 08, 2014, 02:54:41 AM »
Hi Steve,

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
Get your facts first, and then you can distort them.

Antariy

  • Member
  • ****
  • Posts: 551
Re: Instruction Set detection for 32 bit Operating Systems
« Reply #87 on: May 08, 2014, 03:36:34 AM »
Hi Steve,

   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

  • Member
  • ****
  • Posts: 551
Re: Instruction Set detection for 32 bit Operating Systems
« Reply #88 on: May 08, 2014, 03:40:36 AM »
Hi Gunther,

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--

  • Administrator
  • Member
  • ******
  • Posts: 8126
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Instruction Set detection for 32 bit Operating Systems
« Reply #89 on: May 08, 2014, 03:45:28 AM »
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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy: