Image Map Image Map
Results 1 to 3 of 3

Thread: How to make Borland C++ 5.02 compile 16-bit programs on an x64 system...

  1. #1

    Default How to make Borland C++ 5.02 compile 16-bit programs on an x64 system...

    Hi Everyone,

    I've developed with Borland C++ 5.02 for years, but one thing that is annoying is that the DOS linker (TLINK.EXE) was never updated to 32-bit. The result is that it compiles DOS applications with a 32-bit tool, and then links them with a 16-bit tool. This wasn't a problem at the time, but when 64-bit operating systems dropped support for running 16-bit code, it means that you can compile a DOS application on x64, but you can't link it.

    Obviously the best solution would be a 32-bit version of TLINK.EXE, but after some searching for tools or something that might be able to convert a DOS application to a Win32 console application, I didn't find anything that could do something like this. If you could disassemble it and port it to win32 and recompile it that would be a great solution, but I would imagine a huge undertaking if possible at all.

    I also read about someone who was trying to bring 16-bit NTVDM support to x64 systems, but it sounds like quite a bit of work to accomplish and talked about making OS changes that didn't sound comforting.

    I was wondering about DOSBox or something similar, but in this case the BC5 IDE calls TLINK.EXE and expects an errorlevel returned. I found a tool called VDOS that is a single executable that starts up and autoruns an AUTOEXEC.TXT file. With this in mind I made a "stub" or placeholder for TLINK.EXE which is a 32-bit console application. It can be launched from the BC5 IDE and its job is to be the "go between". It will setup the AUTOEXEC.TXT file and launch VDOS.EXE to which calls TLINKDOS.EXE to carry out the link, and then finally it will return the errorlevel to the BC5 IDE.

    The linking problem probably isn't the only problem - you also can't install BC5 on x64 because it uses a 16-bit installer, but Borland has the whole BC5 directory on the CD-ROM and you can just copy it. You could also install it on x86 and then copy the directory from that to your x64 machine. You also can't debug or run 16-bit code unless you launch VDOS and run it or debug it there.

    It might work with older Borland windows based compilers as well, I'm not sure because I haven't tested it.

    To make this work:

    Rename the real TLINK.EXE file in the BC5\BIN directory to TLINKDOS.EXE.

    Copy the TLINK.EXE file from the attached ZIP file into the BC5\BIN directory.

    Obtain the VDOS.EXE from this location and also put it in the BC5\BIN directory:
    http://www.vdos.info

    I've include my TLINK.CPP so you can tweak it if necessary. It will automatically detect the BC5 installation path. It goes without saying that the BC5 installation path and project path should be short file name compatible.
    Attached Files Attached Files

  2. #2

    Default

    You can still boot a 64 bit processor with a dos disk, no? Why not just create another partition for real mode development?

  3. #3

    Default

    I've got plenty of machines I can run it on...it was an exercise to see if I could make it work!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •