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?

Variadicism
  • 624
  • 1
  • 7
  • 17
  • I think you are doomed :( I assume that the original source code is lost? – Martin James Sep 02 '13 at 16:17
  • @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? – Variadicism Sep 02 '13 at 23:12
  • 1
    A qualified maybe.. wots it written in? – Martin James Sep 03 '13 at 11:00
  • @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? – Variadicism Sep 03 '13 at 16:38
  • Realistically, it would be more practical to reimplement the program based on observations of its behaviour rather than by decompiling it. – Harry Johnston Sep 11 '13 at 22:37
  • 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. – Martin Vahi Feb 10 '17 at 04:05

2 Answers2

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.

Fabel
  • 1,711
  • 14
  • 36
  • 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) – Edw590 Sep 26 '20 at 22:00
  • 1
    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. – Fabel Sep 27 '20 at 06:50
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!

Hosam N
  • 75
  • 8