www.digitalmars.com         C & C++   DMDScript  

c++.dos - Compiling DOS program

reply Hans Wennborg <hans hanshq.net> writes:
Hi!

I've worked with Borland C++ 5.02 until now but I've been looking for a 
new compiler for a long time since Borland's old compiler doesen't 
follow the standard very well..

So I found Digital Mars and it seems like it will also compile DOS 
executables wich is exactly what I need (that's why I used Borland's 
compiler in the first place).

I've downloaded and installed the Compiler (v. 8.32) and DOS 16 libraries.

This is the program I'm trying to compile:

int main () {
	unsigned char* video_buffer = (unsigned char*)0xB8000000;
	video_buffer[0] = 'x';

         return 0;
}

My question is simply, how do I tell the compiler that I wan't to make 
this a 16-bit DOS executable?

If I type "dmc" withouy any arguments I get the following:
-m[tsmclvfnrpxz][do][w][u] set memory model
     s: small code and data              m: large code, small data
     c: small code, large data           l: large code and data
     v: VCM                              r: Rational 16 bit DOS Extender
     p: Pharlap 32 bit DOS Extender      x: DOSX 32 bit DOS Extender
     z: ZPM 16 bit DOS Extender          f: OS/2 2.0 32 bit
     t: .COM file                        n: Windows 32s/95/98/NT/2000/ME/XP
     d: DOS 16 bit                       o: OS/2 16 bit
     w: SS != DS                         u: reload DS

so I figured I should just type

dmc test.cpp -md
but it doesen't work? Have I gotten anything wrong? I would be really 
glad if someone could help me with this.

And thanks for a great compiler so far!
Feb 02 2003
parent reply Hans Wennborg <hans hanshq.net> writes:
Well, apparently the answer was in the documentations so I guess I 
should apologize for my dumb question.

Everything is working perfectly now thanks to this great compiler, I'm 
thinking strongly about buying the CD-ROM so I get the IDDE and all the 
other great stuff!

Thanks for a great compiler!

Hans Wennborg wrote:
 Hi!
 
 I've worked with Borland C++ 5.02 until now but I've been looking for a 
 new compiler for a long time since Borland's old compiler doesen't 
 follow the standard very well..
 
 So I found Digital Mars and it seems like it will also compile DOS 
 executables wich is exactly what I need (that's why I used Borland's 
 compiler in the first place).
 
 I've downloaded and installed the Compiler (v. 8.32) and DOS 16 libraries.
 
 This is the program I'm trying to compile:
 
 int main () {
     unsigned char* video_buffer = (unsigned char*)0xB8000000;
     video_buffer[0] = 'x';
 
         return 0;
 }
 
 My question is simply, how do I tell the compiler that I wan't to make 
 this a 16-bit DOS executable?
 
 If I type "dmc" withouy any arguments I get the following:
 -m[tsmclvfnrpxz][do][w][u] set memory model
     s: small code and data              m: large code, small data
     c: small code, large data           l: large code and data
     v: VCM                              r: Rational 16 bit DOS Extender
     p: Pharlap 32 bit DOS Extender      x: DOSX 32 bit DOS Extender
     z: ZPM 16 bit DOS Extender          f: OS/2 2.0 32 bit
     t: .COM file                        n: Windows 32s/95/98/NT/2000/ME/XP
     d: DOS 16 bit                       o: OS/2 16 bit
     w: SS != DS                         u: reload DS
 
 so I figured I should just type
 
 dmc test.cpp -md
 but it doesen't work? Have I gotten anything wrong? I would be really 
 glad if someone could help me with this.
 
 And thanks for a great compiler so far!
 
Feb 02 2003
parent "Walter" <walter digitalmars.com> writes:
"Hans Wennborg" <hans hanshq.net> wrote in message
news:b1jjeb$13t6$1 digitaldaemon.com...
 Everything is working perfectly now thanks to this great compiler, I'm
 thinking strongly about buying the CD-ROM so I get the IDDE and all the
 other great stuff!

 Thanks for a great compiler!

 Hans Wennborg wrote:
You're welcome!
Feb 02 2003