Need C compiler for Windows 7 64-bit, to compile to DOS target

If you can find an old Microsoft Compiler, like 16 bit C / C++ 1.52 (which is included on the 32 bit C / C++ 4.1 cd-rom), or C 8.00 or earlier, it runs using a dos extender or in a 32 bit dos console window.

Why can't you run the Borland compiler using FreeDOS?

You could try to create a virtual machine with MSDOS on it, but you'd have to find a way to install MSDOS 6.22 on the virtual machine. At Microsoft's support site, they have links to a bootable ISO file for MSDOS 6.22. I still have the original floppies and started with those on an old system that has a floppy drive. It's a bit awkward to import / export files to / from the virtual machine.

This is the config.sys that I use that seems to work with Win 7 virtual machine. I had to increase buffers, stacks, and files to avoid a stack overflow problem with this setup.

dos=high,umb
buffers=40,0
files=60
lastdrive=e
shell=c:\command.com c:\ /e:1024 /p
stacks=64,512
switches=/f
device=c:\dos\himem.sys /numhandles:64 /testmem:off
device:c:\dos\emm683.exe ram i=b100-b7ff i=c600-c7ff i=cc00-cfff i=e600-efff frame=d000 a=32 d=128 notr
devicehigh=c:vmadd\cdrom.sys /d:mscd001

This is the autoexec.bat that I use (smartdrv is a bit pointless in this case so I commented it out with "rem" prefix) .

c:\dos\emm386 auto
lh c:\dos\mscdex.exe /d:mscd001 /m:7
rem lh c:\dos\smartdrv.exe
lh c:\vmadd\mouse.com
set path=c:\dos
set blaster=a220 i5 d1 h5 p330 t6
prompt $p$g

Run Virtual XP or VirtualBox and install Borland C++ inside. BTW, there is version 5.02 with some fixes (in case your version is exactly 5.0).


As for a compiler, Open Watcom seems to me to be the best choice in your situation. FrameworkPascal (written in the old version of Watcom) provides a 32 bit extender. Regarding the creation of a FreeDOS virtual machines, pickup the tools from Microsoft SysInteral. They include a tool that create a VHD. Once you get a FreeDOS running in a VM you can simply SYS the VHD and start it anywhere. There are plenty ready to run ISO images for FreeDOS, one worth mentioning is Seagate Seatools for DOS which is being distributed with the FreeDOS kernel.

Your best (but not only) solution for running all that is probably XPMode on Windows 7 Pro. It runs Windows XP 32 which of course provide 100 percent transparent compatibility via its NTVDM with DOS 16 bit real mode, 16 bits protected (Windows 3.1), and DOS 32 bit extenders. NTVDM by the way is a feature that can be activated on Windows 10 Pro but it yet to be seen what exactly can be done with it there.

XPMode is a free downnload from Microsoft that installs a free version of Windows XP 32 bit in a virtual machine on Windows 7 Pro with full sharing of the cutpaste/copy buffer, USB, drives, screen and network card (web access). It can be toggled between a Window and full screen. The installation of XPMode is automated (after activation of the Windows 7 Pro VM). Microsoft provide various downloadable hot fixes that update the registry to activate the VM. There is an MS support downloadable hot fix that has to be run to allow the installation on the AMD Bulldozer architecture. XPMode hibernate its desktop and virtual hard drives making it a much more productive environment than a hardware based system.

With a little extra work Windows XP 32 bits can be installed on any virtual machine including Microsoft Virtual Machine on Windows XP 64 bits as well as Oracle Box and VMWare. XPMode however is probably the smoothest solution since some installations such as MS Virtual Machine for Windows XP 64 bits do not utilized the full physical display in full screen (only about 90 percent of it). If you install your browser and email in XPMode you can live in the full screen and forget about new versions of Windows.