C++ DOS???

Pages: 12
May 21, 2011 at 10:43pm
I need to know if C++ is for ms dos?
If not then what language is for dos?

Do you have eny ideas?
May 21, 2011 at 10:45pm
I know assembler's for DOS... if that's eny help.
May 21, 2011 at 10:50pm
MS DOS is an operating system. C++ is a programming language.

No programming language is "for" MS DOS. You can programme in C++ using MS DOS as your operating system to run the programmes you need in order to write and build your code. You can write programmes using C++ that will run on MS DOS.

You can do the same with lots of other languages.
May 21, 2011 at 11:00pm
then what program do you use?
b'cus i tryde to use a console program in ms dos but it did not werk.
It just sase that this program can not be run is dos mode?
May 21, 2011 at 11:05pm
ok so i tryde to google it but i got

http://www.gamereclaim.com/2008/10/128/
May 21, 2011 at 11:07pm
Today I write code in emacs, and compile/link with gcc. I cannot remember the last time I wrote something to run on MS-DOS.

What exactly are you trying to do?
May 22, 2011 at 5:50am
i've seen c++ writen in DOS for animation program, but how to make an animation program using c++?
May 22, 2011 at 6:54am
You don't. DOS is dead.
May 22, 2011 at 7:10am
i've seen it's included like this:

#include <dos.h>
Last edited on May 22, 2011 at 7:10am
May 22, 2011 at 7:11am
@Athar, there will always be enthusiasts who want to do something someone considers dead just for the sake of doing it or better understanding how things work.
May 22, 2011 at 7:45am
yup, coz i'm actually curious
Last edited on May 22, 2011 at 7:46am
May 22, 2011 at 8:06am
If you want to run it on DOS, you could transfer the code to your DOS environment and compile it there with a DOS compiler.

I am aware of this one - http://www.delorie.com/djgpp/
Be aware that it appears to be 8 years old. Perhaps there are some more up to date DOS compilers, but I don't know.

[edit] Assuming the code you have written only uses the standard library, since I imagine many third party libraries are not DOS compatible.
Last edited on May 22, 2011 at 8:07am
May 22, 2011 at 11:46am
Back when we were using DOS C++ was pretty unpopular among DOS systems, so there won't be many options especially now that C++ is popular DOS is dead.

You'd have more luck with C but pretty much every commercial DOS program I ever used was written in Assembly code with the DOS Assembler API. I don't know much about it (never sat there one day thinking about writing for a dead OS with a notoriously difficult assembler API) but I hear that programming for DOS defined a lot of the older programmers.

I reckon any C++ code written for DOS will run pretty poorly, since the DOS was not written to have heavy OS dependant memory grabbing OOP languages like C++ running on it. This sounds strange because these days C++ seems the opposite, but household DOS systems couldn't run shit.

Still though, this is just what I know from discussions with friends, since I've never wanted to touch DOS with a bargepole.

Anyway, have fun with that.
May 22, 2011 at 12:42pm
Don't be ridiculous. DOS was more than it has been given credit here. C++ was widely used in that platform, along with a host of other languages such as Pascal. Borland's compilers rocked back then!

DOS runs in real mode where any program can directly access video memory, system ports, etc.. That presented a lot of fun opportunities graphically.

Today, operating systems are usually multiuser and multitasking. In order to keep one thread of execution from interfering with others, the OS has to put boundaries in place. The result is called protected mode.

I, too, expected every old OS that has come and gone over the years to disappear until virtualization came about. Take VMware Player, for example. You can setup a VM and run DOS on your machine right now. You could use it for educational purposes, to run software that was written specifically on that platform, or even just take a trip back in time.

Ever heard of a BBS, ANSI art groups, or demo groups like the Future Crew? I used to spend hours writing software influenced by these things.
May 22, 2011 at 12:46pm
I didn't say DOS was at fault, I'd prefer a more open OS anyway, it's just that most household DOS systems could barely run games written in Assembler and maybe C, yet alone C++.

Anyway, I'm going to trust what you say even so, because, as I said before, this isn't from my own experience, just what friends have said.

And I happen to run DOSBox, which runs fine for me. Daggerfall FTW!
May 22, 2011 at 1:25pm
Hey guys I feel like I need to mention that "protected mode" is a feature that is physically built into the Intel family of processors and was so even back then. I don't care if you wrote a text editor or an Operating System, if you can't take advantage of a security feature that is handed to you then you need to GTFO of the game. TL;DR: There is a reason MS\PC-DOS are dead and it has little to do with users getting lazy and prefering a GUI.

@ moorecm: Perhaps a little nostalgia?: http://www.textfiles.com/
Some of the stuff here is just halarious to look back on.
May 22, 2011 at 1:51pm
I love all the different file extensions people were just making up for their ASCII art. That was a good thing about DOS, it didn't screw about with extensions.

I'm aware protected mode was an x86 thing as well, but I thought that moorecm realised that, it sounded like he did.

Am I right in believing C++ is designed to run on an OS? Nobody's said much about that but from the way it works I'm guessing that it relies on being compiled for an OS.
May 22, 2011 at 1:54pm
Also, I think DOS may have been made for the 8086 or 80186 originally because they don't have a protected mode. That way DOS could have just run in real mode from the 80286+.
May 22, 2011 at 1:58pm
Most of the stuff we write requires an OS to run, this is only because human beings are lazy creatures and we don't like to enumerate every DLL like resource and it's dependencies just to say "Hello World". If you care to take the time to export the functions from the drivers for your Hardware though you could write a stand alone OS in C++.

Also, DOS was written in a lot of languages including but not limited to C.
EDIT: Source: http://en.wikipedia.org/wiki/MS-DOS
Last edited on May 22, 2011 at 1:59pm
May 22, 2011 at 3:21pm
The reason I say this is because a lot of C++ is designed (particularly the standard library streams and memory allocations) to run on a Unix-style OS. However, I've heard that things like Windows 7 run on C++, completely counter-intuitive to what I know about the language.

So apparently you can write an OS in C++, along with other languages. Although I hardly doubt it will ever be suitable for a good kernel.
Pages: 12