Preview: The first 64bit PB program ever! - yes, for real ;)

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Post by IceSoft »

hardfalcon wrote:...to display the message "This program cannot be run in MS-DOS." these days) ?
Try to run the example PB64.exe and look!

A 32bit Windows OS will tell it for you:
D:\pb64.exe is not a valid Win32 application.
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Fred
Administrator
Administrator
Posts: 18153
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

hardfalcon wrote:That's great news :D

As we are talking about 64bit, another question: Is it possible (this is not a feature request, but just a simple question) to link 32bit and 64bit code to one and the same PE executable (like you can link 16bit and 32bit code together (even is the 16bit code is only used to display the message "This program cannot be run in MS-DOS." these days) ?
I don't think so, i never see such a "dual" program for x64. Keep in mind than adressing, stack etc. is no more the same, so you could endup with memory area which would be never reachable by the 32bits program part. Also the current x64 CPU have a special mode when running a 32 bits program, as the same ASM opcode doesn't do the same action in 32 bit or 64 bit mode.
hardfalcon
User
User
Posts: 89
Joined: Fri Apr 29, 2005 3:03 pm
Location: Luxembourg
Contact:

Post by hardfalcon »

Fred: The fact that you never see such programs doesn't mean they don't exist... :wink:
http://en.wikipedia.org/wiki/Portable_Executable#Brief_history wrote:The format has retained limited legacy support to bridge the gap between DOS-based and NT systems. For example, PE/COFF headers still include an MS-DOS executable program, which is by default a stub that displays the simple message "This program cannot be run in DOS mode" (or similar). PE also continues to serve the changing Windows platform. Some extensions include the .NET PE format (see below), a 64-bit version called PE32+ (sometimes PE+), and a specification for Windows CE.
Hmmm, if I get that article right, that should also be possible with 32bit/64bit...
Concerning the 16bit/32bit PEs, the German Wikipedia article gives the Windows 95 setup executable as an example...
"And God caused a deep sleep to fall upon Adam, and he slept: and he took one of his ribs, and closed up the flesh instead thereof; And the spare rib, which God had taken from man, made he a woman, and brought her unto the man"
Fred
Administrator
Administrator
Posts: 18153
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Well, it's only my opinion on the topic..
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

That's not the same. They aren't actually "linked together", they are just stuck together with a hack in the PE header. You can't run the dos part of the program in windows and vice versa.
User avatar
Frontier
User
User
Posts: 74
Joined: Thu Dec 22, 2005 2:43 pm
Location: Chios, Greece
Contact:

Post by Frontier »

hardfalcon wrote: Hmmm, if I get that article right, that should also be possible with 32bit/64bit...
Concerning the 16bit/32bit PEs, the German Wikipedia article gives the Windows 95 setup executable as an example...
This stub is evident only on x86 not x64 executables.
Microsoft x64 OSes do not have the MS-DOS executable identification stub anymore.
Post Reply