From: "Alexei A. Frounze" Newsgroups: comp.os.msdos.djgpp Subject: [Fwd: Re: Help with Inline ASM...] Date: Sun, 16 Apr 2000 13:32:19 +0400 Organization: MTU-Intel ISP Lines: 67 Message-ID: <38F988A3.9521D14A@mtu-net.ru> NNTP-Posting-Host: ppp97-187.dialup.mtu-net.ru Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-Trace: gavrilo.mtu.ru 955887118 21507 212.188.97.187 (16 Apr 2000 12:11:58 GMT) X-Complaints-To: usenet-abuse AT mtu DOT ru NNTP-Posting-Date: 16 Apr 2000 12:11:58 GMT X-Mailer: Mozilla 4.72 [en] (Win95; I) X-Accept-Language: en,ru To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com -------- Original Message -------- Subject: Re: Help with Inline ASM... Date: Sun, 16 Apr 2000 11:40:57 +0200 (IST) From: Eli Zaretskii To: "Alexei A. Frounze" On Sun, 16 Apr 2000, Alexei A. Frounze wrote: > Eli Zaretskii wrote: > > > > On Fri, 14 Apr 2000, Alexei A. Frounze wrote: > > > > > Please read all the following text until its end. Then reply. > > > > I thought I always did that, no need to remind me. > > I tell this because it seems to me that people start replying immediately. You need to realize that by telling that, you offend people. Most of those who reply to messages about advanced stuff like this always read the message first, so in many cases, you offend people for no good reason. So, even if you suspect that your correspondent didn't read your message in its entirety, it's usually a good idea to avoid saying that explicitly. Instead, simply point that person to something you already wrote. Please remember that you are talking to people in a language tyhat is foreign for you and for many of those who reply. When this happens, misunderstandings are common. It's not nice to offend people because they didn't understand something you wrote. > > According to my definition, the flat model is when any linear address > > can be accessed without reloading the segment registers. DJGPP > > doesn't allow this (for example, you need _dos_ds to access the > > conventional memory), so its memory model is not flat. > > :))) > Not really. GCC was not developed for *DOS* and *DPMI*. It's just a free 32-bit > GNU C/C++ compiler for i386+. And it may be compiled for Windows as well as for > DOS/DPMI. Btw, it's available for Linux... Originally it doesn't support any > segment reloads at all. Just 32-bit offsets. The code produced by GCC from ``normal'' C sources is only part of the issue. The run-time environment set up by the library startup code is the other, no less important part. The library startup is where the segment registers get loaded with specific values, and that's where you should look for the details. In addition, the low-level library functions is another important part of the run-time environment. These additional parts clearly demonstrate that DJGPP's environment doesn't use the flat memory model, because the segmentation clearly shows. The same compiler--GCC--can be used for both flat memory model, like on Linux, and for segmented model, like in DJGPP. The above doesn't mean that data in code seghment cannot be modified: it can, because the data and code segments are set up to allow this. But flat memory model is something else. That is all I wanted to point out.