Can I convert a 16-bit .exe program to a 64-bit .exe?
Asked Answered
T

2

7

I realize that there will likely be no special converter programs or anything easy like that for such a task, but it imperative that I find some way to get a 16-bit program to run in 64-bit Windows. Due to the large amount of resources that must be dedicated to them, emulators will not be a good solution.

The idea I had for this project was to decompile all the code from a 16-bit program, copy it, and re-compile it into 64-bit code. Is this at all possible using Eclipse or another programming environment?

Basically, I want to make a 16-bit program run in 64-bit Windows without emulators. I realize that it's a tall order, but is it conceivable?

Tabshey answered 2/9, 2013 at 16:5 Comment(6)
I think you are doomed :( I assume that the original source code is lost?Danonorwegian
@Martin James I believe the original source code to be lost, but I did find one set of information on GitHub. Unfortunately, I'm not sure if the code is the code for the same program that I'm looking for because there is no good description of the project. If it turns out that this source code is what I'm looking for, would it be possible to compile it into 64-bit binary even if the code was originally written for 16-bit systems?Tabshey
A qualified maybe.. wots it written in?Danonorwegian
@Martin James To be honest, I'm not sure what it's written in. Many of the files have a ".js" extension; does that mean JavaScript? Either way, though, I think it would be better -- if possible -- to open up the .exe and decompile the exact code. If I were to do that and the language were JavaScript or some form of C, do you think copying and recompiling in 64-bit would work?Tabshey
Realistically, it would be more practical to reimplement the program based on observations of its behaviour rather than by decompiling it.Didynamous
One of the issues with any kind of translation of any language is the set of tricks that depend on the fixed number of bits at an integer of the given CPU. For example, a shift of bits by one position might actually be used as a fast way to multiply or divide by 2. At some cases it is theoretically impossible for a translator to determine, what the author of the original program meant, when he ordered the computer to do the shift. It is possible to guess with some probability, but not infer.Soak
H
5

The problem goes beyond translating 16-bit instructions with 64-bit instructions. There is also the ABI (Application Binary Interface) used by the program to communicate with the rest of the system. A 16-bit program likely uses a lot of DOS calls and it's not unlikely it tries to access hardware directly too. There is no way this can be translated automatically. Even if such a solution existed, I highly doubt the result would be more efficient than running in a virtual machine (which actually is very efficient). Further more, programs written for 16-bit environment are often not very scalable, and completely unable to handle amounts of data beyond the capacities of the original target platform.

So I'd say there are really just two realistic solutions: Run it in a virtual machine. Or if that doesn't cut it, write a new application from scratch that does the same thing.

Hyacinthhyacintha answered 19/10, 2013 at 22:24 Comment(2)
What if the program (game, in my case) was designed to work under Windows and refuses to work on DOS ("This program requires Microsoft Windows")? May it still use DOS calls? Or there's no such thing if we're talking about Windows, whatever the version is? Is it now only the instructions that need to be translated? (and headers too, I guess, but maybe more things too? - I'm just learning about this one, so that's why I said headers)Adviser
Yes, programs designed specifically for Windows may use DOS calls, BIOS calls as well as access hardware directly. 16-bit Windows and the non-NT branch of 32-bit Windows (95 and 98) are more or less just an extensions to DOS and not so much complete operating systems of their own.Hyacinthhyacintha
S
2

Even if this is a very old question, but I thought I'd write this solution for anyone still looking out there:

Using something like winevdm -which is a very light windows program- you can run 16-bit Windows (Windows 1.x, 2.x, 3.0, 3.1, etc.) on 64-bit Windows apps very easily!

Subantarctic answered 5/5, 2021 at 23:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.