VOGONS

Common searches


First post, by keen

User metadata
Rank Newbie
Rank
Newbie

There are two DOS compilers that I'm currently aware of. DJGPP and OpenWatcom. Which of these two are the currently recommended compiler to use for C89/99? let me know if there's a different one I should use because I want whatever I program to work in both native DOS be it MS-DOS or FreeDOS and Dosbox as well. What C compiler will work the best on both native and emulated DOS, which one will be the least amount of headaches? Should I even bother with the older proprietary compilers like borland turbo C/turbo C++?

Reply 1 of 7, by mr.cat

User metadata
Rank Member
Rank
Member

As they say..."it depends"
Maybe you could provide some info on what kind of coding you are planning to do? Any specific hardware target perhaps? Any memory constrictions? DOS extender needed? Libraries you care about? And so on...

If you care about portability to gcc, I guess DJGPP would then be a good bet.
Turbo C was great for the 80's and 90's, but I think today you can do much better in terms of IDE. Unless you want that authentic coding experience as it was "back in the day" of course 😁

Emulators are a varied bunch and can cause problems if your code relies on cycle-accuracy. I don't know if you can even rely on the math stuff being 100% correct in emus.

That's just my 0.02eurocents.

Reply 2 of 7, by keen

User metadata
Rank Newbie
Rank
Newbie
mr.cat wrote on 2020-12-15, 21:43:
As they say..."it depends" Maybe you could provide some info on what kind of coding you are planning to do? Any specific hardwar […]
Show full quote

As they say..."it depends"
Maybe you could provide some info on what kind of coding you are planning to do? Any specific hardware target perhaps? Any memory constrictions? DOS extender needed? Libraries you care about? And so on...

If you care about portability to gcc, I guess DJGPP would then be a good bet.
Turbo C was great for the 80's and 90's, but I think today you can do much better in terms of IDE. Unless you want that authentic coding experience as it was "back in the day" of course 😁

Emulators are a varied bunch and can cause problems if your code relies on cycle-accuracy. I don't know if you can even rely on the math stuff being 100% correct in emus.

That's just my 0.02eurocents.

I said a month ago I was wanting to make a video game for DOS. I'm not sure how powerful it's going to require or things like DOS extenders will be needed. For convenience sake, I was thinking about making it DOSbox and I'm unsure which compiler would be the best to use.

Reply 3 of 7, by OzzFan

User metadata
Rank Newbie
Rank
Newbie

I'm currently trying to rewrite my compiled .BAT files into C/C++ code and applications. I'm mostly using Symantec C++ 7.21 but I also have a copy of Microsoft Visual C++ 1.52. Both have options to create MS-DOS applications. Any emulator worth its weight should be emulating the real thing, so just write for DOS and let the emulator do it's job. Depending on the size and scope of your game, you may need a DOS extender to put the CPU into 32bit mode (like DOOM and some other titles).

The company that made Symantec C++ continued selling it under the Digital Mars name, and has provided the compiler and tools for free here: https://digitalmars.com/download/freecompiler.html if you want to check them out.

A (mostly accurate) listing of my computer systems: http://www.shelteringoak.com/OzzNet/

Reply 4 of 7, by vvbee

User metadata
Rank Oldbie
Rank
Oldbie

I made a comparison of some DOS-based C compilers: https://github.com/leikareipa/dccb. The code can be compiled using a bunch of compilers, and some sample performance results are included.

I'd use the Digital Mars C/C++ compiler, but the Microsoft C/C++ one is pretty good too. As far as I know, DJGPP requires an extender no matter what, so... Also, don't bother with older pre-standards compilers unless you're masochistic.

Reply 5 of 7, by Jo22

User metadata
Rank l33t++
Rank
l33t++

I used to use MIX Power C, since that's what my dad had on 5,25" floppies..
Anyway, I programmed in K&R C style mainly.
Newer felt comfortable with the extra complexity that comes with ANSI C..

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 6 of 7, by gerry

User metadata
Rank Oldbie
Rank
Oldbie
keen wrote on 2020-12-15, 22:22:

I said a month ago I was wanting to make a video game for DOS. I'm not sure how powerful it's going to require or things like DOS extenders will be needed. For convenience sake, I was thinking about making it DOSbox and I'm unsure which compiler would be the best to use.

assuming you are targeting MSDOS in 32 bits you will need a 32 bit dos extender like and i think your choice of compiler realistically comes down to OpenWatcom or DJGPP. To test with DOSBOX you could download an existing project for each and compile it while in DOSBOX, I'd expect both to be ok unless perhaps there is use of rare, undocumented interrupts or hardware features in the code that are not yet emulated in DOSBOX

If you're not intent on 32 bits, but want a 16 bit exe then either check the above two to see if they can compile to 16 bits or check out some very old but nice compiler, like Turbo C

best wishes for your project! Hope it turns out as you want it 😀

Reply 7 of 7, by mr.cat

User metadata
Rank Member
Rank
Member
vvbee wrote on 2020-12-16, 06:55:

I made a comparison of some DOS-based C compilers: https://github.com/leikareipa/dccb. The code can be compiled using a bunch of compilers, and some sample performance results are included.

I'd use the Digital Mars C/C++ compiler, but the Microsoft C/C++ one is pretty good too. As far as I know, DJGPP requires an extender no matter what, so... Also, don't bother with older pre-standards compilers unless you're masochistic.

Plain DJGPP does, but there are custom things such as gcc-ia16 or this one (not DJGPP, but gcc so close enough):

GCC for 8088/8086