Topic created on: December 14, 2010 00:39 CST by
midget 
.
I have an application that a friend of mine bought a long time ago (95) that deals with recording comics into a database. It works fine in Windows 7 when ran in compatibility mode with 95. It will list items in the database but when you try to open an entry it returns an error. I don't have the error message right now as it's on another computer. All the APIs that are called load correctly from the DLLs. I think it has to do with it being 16-bit.
I want to make it 32-bit but I don't have any source that I could recompile. I was wondering if anyone knows a way of doing this or if it's not worth the trouble.
As a personal reference to how much I know. I am at 39 in the lena151 series. These however seem to be cracking oriented which is not what I'm looking for. I want interoperability. Any help would be appreciated. Let me know if I am not providing enough information.
-midget
Hey,
Porting from 16-bit to 32-bit is possible, but it take a lot of work, time, energy, etc.
Basically you have to write a disassembler that's output will be recompilable by a 32-bit assembler of your choice. This sounds easy, but since there are quite a few architectural changes between 16-bit and 32-bit (e.g. segments vs flat mode (well, you can use segments to emulate this I guess), 16-bit pointers including stack pointers vs 32-bit pointers in pmode).
In addition to that, you'll have to replace all legacy API/ABI calls with calls to same functions in new libraries. This normally requires you to create a layer of wrappers to convert the calling convention / stored registers / etc. Additionally some APIs/ABIs might not exist or would not have a proper replacement in new libraries, and in such case you would have to implement your own replacements.
Summarizing: it's a project for a year (if it's a small-medium sized app) of constant work, and it required you to have (gain) knowledge of the DOS architecture / ABI, compiling process, pmode and Windows 7 API, and also a good programming skill to write lots and lots of tools.
Another method would be to reverse engineer the old app and reimplement it in C/C++/other language (i.e. reimplement the database parser, GUI, and whatever else would need reimplementing, basically the whole app).
This is easier than the recompilation option, but takes probably the same amount of time (since you have to analyze every function and figure out how to properly reimplement it).
I think personally I would go for the second option :)
|