473,883 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best C++ compiler for DOS programs

I have to develop several large and complex C++ hardware test programs that
should work under DOS, most likely with 32-bit DOS extender. Development
workstation OS would be Microsoft XP. Quite some time ago I worked in DOS,
with Borland BC++ 4.1. I do not have it any more. Which compiler would you
recommend me now? Which ones support serious DOS program development?
Criterion should be number of available free library modules (graphic menu
system, mouse driver, I/O), ease of development, price (maybe free?),
current and future support. If compiled program can work in DOS window under
XP, at least for some early testing, that would be fine also.

So far I have found free Watcom, Digital Mars and DJGPP compilers

http://www.digitalmars.com/
http://www.openwatcom.org/index.php/Main_Page
http://www.delorie.com/djgpp/

Which one of these, or other free compilers, is best? What about commercial
compilers? Are they worth the money for DOS development? What would you
recommend me?

Steve.

Apr 22 '06
55 12876

"Steve" <St**@nospam.co m> wrote in message
news:e2******** **@news.eunet.y u...
Thank you all for your answers.

. Now I
need to find some good graphical (not textual) windowing menu system library that would, hopefully, work with Watcom. If you have some suggestion about
it, please, I would like to hear it.

The DJGPP crowd prefers Allegro, but I've had many problems getting Allegro
applications to work with the video cards I've used. The one I've been
looking at using is DEPUI 3.0. It works well, but it needs a small amount
of simple DJGPP DPMI code ported to OpenWatcom. I'm able to and was
planning on porting it, but just haven't gotten to it and am not sure when I
will... DEPUI seems to work well with all the video cards of mine that have
problems with Allegro.

http://www.deleveld.dds.nl/depui30/index.htm
Still, it was frustrating. I don't understand almost complete abandonment of DOS program development in commercial compiler world.


No 32-bit DOS.

Are you sure that you _really_ need DOS to do your hardware testing? I
would think that there are well established mechanisms for Windows and Linux
to do everything that DOS can. If the DPMI host is doing alot of switching
from PM to RM and back, results can be incorrect under DOS too... Memory
testing using physically addressed memory is about the thing that comes to
mind which should be difficult outside of DOS.
Rod Pemberton
Apr 23 '06 #11
Steve wrote:
I have to develop several large and complex C++ hardware test programs that
should work under DOS, most likely with 32-bit DOS extender. Development
workstation OS would be Microsoft XP. Quite some time ago I worked in DOS,
with Borland BC++ 4.1. I do not have it any more. Which compiler would you
recommend me now? Which ones support serious DOS program development?
Criterion should be number of available free library modules (graphic menu
system, mouse driver, I/O), ease of development, price (maybe free?),
current and future support. If compiled program can work in DOS window under
XP, at least for some early testing, that would be fine also.

So far I have found free Watcom, Digital Mars and DJGPP compilers

http://www.digitalmars.com/
http://www.openwatcom.org/index.php/Main_Page
http://www.delorie.com/djgpp/

Which one of these, or other free compilers, is best? What about commercial
compilers? Are they worth the money for DOS development? What would you
recommend me?
Steve wrote: I don't understand almost complete abandonment of
DOS program development in commercial compiler world.


The answer is pretty simple. Commercial product developers develop for
customers who are willing to pay for products, and that dried up for DOS
long ago. I remember the same lament around 1985 or so when people were
complaining that commercial compiler companies had abandoned CP/M, which
they abandoned for the exact same reason.

-Walter Bright
Digital Mars
Apr 23 '06 #12
Steve wrote:
Thank you all for your answers.

It seems I should take a look at Watcom compiler first. They have many
target platforms and still seem very active. I assume that no latest
Microsoft or Borland C++ compilers support DOS program development. Now I
need to find some good graphical (not textual) windowing menu system
library
that would, hopefully, work with Watcom. If you have some suggestion about
it, please, I would like to hear it.

Library I am using:
ZSVGA by Zephyr Software. ... ZSVGA v1.01 (ZSVGA101.ZIP) is a 32 bit
protected mode SVGA graphics library for the Watcom & Symantec C/C++
compilers. ...
Apr 23 '06 #13
> ZSVGA by Zephyr Software. ... ZSVGA v1.01 (ZSVGA101.ZIP) is a 32 bit
protected mode SVGA graphics library for the Watcom & Symantec C/C++
compilers. ...


It seems to be a commercial product - it is under development anymore?

Bye
Flo
Apr 23 '06 #14
> Are you sure that you _really_ need DOS to do your hardware testing? I
would think that there are well established mechanisms for Windows and Linux
to do everything that DOS can. If the DPMI host is doing alot of switching
from PM to RM and back, results can be incorrect under DOS too... Memory
testing using physically addressed memory is about the thing that comes to
mind which should be difficult outside of DOS.


Please, don't post this words on this list - it is a DOS list... ;-)

Bye
Flo
Apr 23 '06 #15
Walter Bright wrote:
Steve wrote:

I don't understand almost complete abandonment of
DOS program development in commercial compiler world.


The answer is pretty simple. Commercial product developers develop for
customers who are willing to pay for products, and that dried up for DOS
long ago. I remember the same lament around 1985 or so when people were
complaining that commercial compiler companies had abandoned CP/M, which
they abandoned for the exact same reason.


OK, but they abandoned CP/M for another OS of the same kind (actually worse
one). Approximately same functionality could be found on replacemet OS. With
DOS, now, we have platform that is close to hardware. There will always be
need for that, and that is the reason why it must be kept alive. Trying to
pass though several layers of code to reach hardware, and disable parts of
OS in the process, does not seem like a good approach for
test/diagnostic/repair/low level benchmark utilities.

Steve

Apr 23 '06 #16
Rod Pemberton wrote:
The DJGPP crowd prefers Allegro, but I've had many problems getting
Allegro applications to work with the video cards I've used. The one
I've been looking at using is DEPUI 3.0. It works well, but it needs a
small amount of simple DJGPP DPMI code ported to OpenWatcom. I'm able to
and was planning on porting it, but just haven't gotten to it and am not
sure when I will... DEPUI seems to work well with all the video cards of
mine that have problems with Allegro.
http://www.deleveld.dds.nl/depui30/index.htm


It looks very good. Could you give me some info, which part DEPUI needs
fixing? If it's not too complex, maybe I will be able to do it.
Still, it was frustrating. I don't understand almost complete
abandonment of DOS program development in commercial compiler world.


No 32-bit DOS.

Are you sure that you _really_ need DOS to do your hardware testing? I
would think that there are well established mechanisms for Windows and
Linux to do everything that DOS can. If the DPMI host is doing alot of
switching from PM to RM and back, results can be incorrect under DOS
too... Memory testing using physically addressed memory is about the
thing that comes to mind which should be difficult outside of DOS.


At least context switching is predictable. In preemptive multitasking you
can never be sure when you will be interrupted, by which task, what it will
do, and for how long. One another example is corrupted hard disk. Some power
glitch or bad sector can alter or damage file system system area, or
important OS system files. OS usually can't be loaded. Or, if it can, you
will further corrupt hard disk data. First rule is that you must not write
anything to that disk. But no modern OS can be loaded without hard disk
writing. Again, we need bootable medium with some rudimentary OS, like DOS,
for various repair and backup utilities. In fact, when PC becomes unstable
for whatever unknown reason, it is better to avoid diagnostic hardware
experiments (replacing components) with booting real OS. It is quite
possible that you will have to reinstall it again.

I would rather avoid DOS extenders and protected mode but I don't think it
will be possible. Just the amount of data can be enough reason (for example
scrollable graphic diagrams), and I would like to avoid the need for
temporary hard disk storage. And in protected mode DOS I usually have
something like 128MB of memory just waiting for me :)

Steve

Apr 23 '06 #17
Steve wrote:
OK, but they abandoned CP/M for another OS of the same kind (actually worse
one). Approximately same functionality could be found on replacemet OS.
With
DOS, now, we have platform that is close to hardware. There will always be
need for that, and that is the reason why it must be kept alive. Trying to
pass though several layers of code to reach hardware, and disable parts of
OS in the process, does not seem like a good approach for
test/diagnostic/repair/low level benchmark utilities.


You mentioned "free" four times in your request for DOS development
tools. While there are a number of free DOS development tools, many of
them very good, I can tell you for a fact that there is little interest
out there in paying for DOS development tools, and that means there
isn't going to be interest from commercial tool developers in supporting it.
Apr 23 '06 #18

"Steve" <St**@nospam.co m> wrote in message
news:e2******** **@news.eunet.y u...
Rod Pemberton wrote:
The DJGPP crowd prefers Allegro, but I've had many problems getting
Allegro applications to work with the video cards I've used. The one
I've been looking at using is DEPUI 3.0. It works well, but it needs a
small amount of simple DJGPP DPMI code ported to OpenWatcom. I'm able to and was planning on porting it, but just haven't gotten to it and am not
sure when I will... DEPUI seems to work well with all the video cards of mine that have problems with Allegro.
http://www.deleveld.dds.nl/depui30/index.htm


It looks very good. Could you give me some info, which part DEPUI needs
fixing? If it's not too complex, maybe I will be able to do it.


If you use DEGFX instead of Allegro, under the DEGFX directories there is a
DJGPP directory. There are four files. Three are small. I think, but am
not sure, that these are the only files that need ported. It appears to me
that these are mostly DPMI calls or below 1Mb memory accesses (farpeek's
etc..). It's fairly straightforward but time consuming to port these. I
also see some packed structs and use of DJGPP transfer buffer.
DJGPP packed structs would need to be rewritten:

typedef struct VESA_INFO {
unsigned char VESASignature[4] __attribute__ ((packed));
/* snipped middle of struct */
unsigned char OemData[256] __attribute__ ((packed));
} VESA_INFO;

Rewritten like so (you probably don't need the __DJGPP__ section):

#ifdef __DJGPP__
#define HANDLE_PRAGMA_P ACK_PUSH_POP 1
#endif

#pragma pack(push,1)
typedef struct VESA_INFO {
unsigned char VESASignature[4];
/* snipped middle of struct */
unsigned char OemData[256];
} VESA_INFO;
#pragma pack(pop)
The DJGPP transfer buffer can be setup for PM Watcom, get_dos_mem() is
called to setup __tb, and free_dos_mem() when done:

#ifdef __WATCOMC__
#ifdef __386__
void *tb;
unsigned short sel; /* sel needed to free allocated memory, don't use */

/* setup tb - transfer buffer for dos calls in memory below 1Mb */
void free_dos_mem(vo id)
{
r.w.ax=0x0101; /* free dos memory */
r.w.dx=sel;
int386(0x31,&r, &r);
}

void get_dos_mem(voi d)
{
r.w.ax=0x0100; /* allocate dos memory, no __tb in Watcom */
r.w.bx=0x400; /* 04000h (16384 bytes) in paragraphs (16 bytes) */
int386(0x31,&r, &r);
sel = r.w.dx;
tb = (void *)(r.w.ax<<4);
}
#endif
#endif

Rod Pemberton
Apr 23 '06 #19
On Sun, 23 Apr 2006 15:07:22 -0700 Walter Bright
<wa****@digital mars-nospamm.com> waved a wand and this message
magically appeared:
You mentioned "free" four times in your request for DOS development
tools. While there are a number of free DOS development tools, many
of them very good, I can tell you for a fact that there is little
interest out there in paying for DOS development tools, and that
means there isn't going to be interest from commercial tool
developers in supporting it.


I've just been testing your Digital Mars C++ compiler and
OpenWatcom 1.4 under Windows 98, targetting MSDOS 6.22 platforms. Very,
very, nice. But I'd really like to be able to write STL code that can
run under DOS under the large memory model. Is that even do-able? One
of my STL projects only takes up 300k when compiled as a 32 bit windows
console application. OpenWatcom 1.4 barfs on most of my STL code, but I
suppose 1.5 will be much better in that respect.

Oh, and by the way, I've managed to compile 16 bit Windows programs
using just the *downloaded* Digital Mars compiler toolchain plus the
16bit DOS development package. All I did was to copy over Win16.h from
OpenWatcom 1.4 into the \h\win16 include directory and renamed it
windows.h. Mind you, I can't link at all!

--
http://www.munted.org.uk

Take a nap, it saves lives.
Apr 24 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
6712
by: Chris Mantoulidis | last post by:
Out of curiosity, I wanted to test executable file sizes of the same program from different compilers... The 2 compilers I tested (both old, on purpose) were Borland C++ 3.1 and DJGPP 2.03... The program was nothing but a simple hello world program using the iostream header file... I compiled and linked (both copies) with those 2 different
24
2076
by: wm2004 | last post by:
Which is the best C++ Compiler? Get An Online Business and Make Money! Learn the secrets of many ordinary people who quit their day jobs to pursue an online business. There are many affiliate programs to choose from, but choose an interest you are passionate about and sell it online! Please subscribe to the newsletter below for updates and news:
9
2555
by: Jacek Dziedzic | last post by:
Hi! I often find that my programs need to store information on "current mode of something" with two or at most several mutually exclusive "modes" to choose from, e.g. - datafile: is it in a) read-only mode or b) write-only mode, - a function picking points a) above, b) below or c) contained on a plane in 3D, etc.
19
1775
by: David W | last post by:
float nanometers(long pm) { return pm / 1000.0f; } void f() { if(nanometers(309311L) == nanometers(309311L)) { // do something }
71
33272
by: David T. Ashley | last post by:
Where is the best place to define TRUE and FALSE? Are they in any of the standard include files, ever? Do any standards apply? What I've traditionally done is something like: #ifndef (TRUE) #define TRUE (1)
31
2821
by: Mark Dufour | last post by:
Hi all, I have recently released version 0.0.20 and 0.0.21 of Shed Skin, an optimizing Python-to-C++ compiler. Shed Skin allows for translation of pure (unmodified), implicitly statically typed Python programs into optimized C++, and hence, highly optimized machine language. Besides many bug fixes and optimizations, these releases add the following changes: -support for 'bisect', 'collections.deque' and 'string.maketrans'
10
2230
by: rsteph | last post by:
I've been working to immerse myself in C++ lately. I've programmed with Java, VB, and VB.NET in the past. I'm curious what compiler(s) people use and/or would suggest to me to use with C++ programming. I used a free version of NetBeans to program in Java, then Visual Studios 6.0 and Visual Studio.NET for each type of VB. I tried using Visual Studio.NET to write C++ programs but found that it kept wanting to add extra code, and that trying to...
41
18267
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
159
7168
by: bernard | last post by:
howdy! please recommend a good c compiler. - should be small - should be fast - should come with a good ide - should be inexpensive i am using windows os.
0
9944
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9797
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10863
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7136
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5807
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6005
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3241
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.