Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i've recently gotten the urge to install dos recently, and see what it might have been like in the text only days of operating systems. I was having just jolly good time piddling around with the text interfaces and text programs and whatnot, until i decided to run one of my silly text games that i'd made awhile back for the cmd in windows, and now i've come to find out that anything i'd written in msvc++ was suddenly useless :\ . so, driven to figure out a way to program for ms-dos, i stumbled upon a compiler named djgpp, but for the life of me, i can't get it to work correctly in dos. so, because i'm apparenlty a miserable fail, does anyone here know of a way to possibly write a program and compile it from a more modern operating system, but have it still be able to run in ms-dos? it doesn't have to be able to run in windows, just compile in windows and then run in dos :\ . i'm using ms-dos 7.1 and intend to program in c++ for it.
Posted

MS-DOS is a 16-bit OS.
So you need a compiler capable of creating 16-bit binaries.
It doesn't matter in which OS you're writing the programs as long as you can run a 16-bit compiler to convert your programs into binaries.
Borland C++, Turbo C++, Visual C++ v. 1.5 etc. use 16-bit compilers.
Modern compilers like Visual Studio 2010 uses 32-bit and 64-bit compilers, which you cannot use to create 16-bit binaries.
 
Share this answer
 
Comments
Mehdi Gholam 16-Oct-11 3:25am    
my 5!
FatalCatharsis 16-Oct-11 13:31pm    
yeh, but if i'm not mistaken, it's impossible to run a 16 bit compiler on a 32 or 64 bit system right? so i pretty much have to find a way to install one of these in dos. i got a copy of turbo c++, but i can't install it on win7x64 because it says it needs a win32 system for installation. and, fun-ily enough, it won't install on dos either :P . so now i guess the question is, is there a way to run a 64 bit program that compiles and links 16 bit executables?
«_Superman_» 16-Oct-11 22:40pm    
Although you can run 16-bit programs on 64-bit Intel x64 and AMD64 machines, 64-bit Windows does not support 16-bit programs. So you will not be able to directly run a 16-bit compiler on 64-bit Windows. However, as Mehdi Gholam stated in his answer, there is a program called DOSBox (http://www.dosbox.com/download.php?main=1) that you can use to run 16-bit programs. I have used DOSBox to run some 16-bit game programs on my 64-bit Windows machine.
Your taking a backward turn!

The short answer is yes you can create your programs in a modern operating system in the DOS box and run it in DOS.

You can't use Visual Studio to compile to DOS, although you can use the editor.

See if you can find old versions of Borland C++, Turbo C++ for pure DOS only IDE's.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900