www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/08/21:40:08

Date: Mon, 9 Oct 2000 07:16:01 +0530
Message-Id: <200010090146.HAA01074@midpec.com>
From: Prashant TR <tr AT midpec DOT com>
To: jeffw AT darwin DOT sfbr DOT org
CC: djgpp AT delorie DOT com
In-reply-to: <200010081611.LAA14033@darwin.sfbr.org> (message from jt williams
on Sun, 8 Oct 2000 11:17:02 -0600)
Subject: Re: When is a DOS app a "32-bit DOS" app?
References: <200010081611 DOT LAA14033 AT darwin DOT sfbr DOT org>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

| From: jt williams <jeffw AT darwin DOT sfbr DOT org>
| Date: Sun,  8 Oct 2000 11:17:02 -0600
| 
| Strange question:  When is a DOS app a "32-bit" app?  Or does "32-bit DOS" 
| have meaning only with respect to the kernel and protected mode?
| 
| Suppose a certain application program 'foo.c' is written to compile using 
| 16-bit tools (e.g., Borland).  And suppose that by using '#ifdef __DJGPP__' 
| statements and DOS-specific DJGPP functions (e.g., _get_dos_version(), etc), 
| the code is also made to compile with DJGPP and to generate an executable that 
| works (with cwsdpmi).
| 
| Is 'foo.exe' now a 32-bit DOS app? If not, why?  Do these questions have any 
| meaning?

Several others have answered, but here's what I have to say...

A 32-bit app. is one that runs as a 32-bit prot. mode app, i.e. it has
a code segment selector in which the segment descriptor has the "G"
bit set to 1 (http://www.midpec.com/djgpp/protmode/). 16-bit programs,
OTOH, are of two types - real and protected.

386 instructions behave entirely different in 32-bit mode and
16-bit mode. For example, if the opcode for MOV AX, BX was "xx yy" in
16-bit mode, the same opcode "xx yy" would perform the operation "MOV
EAX, EBX" in 32-bit protected mode. This isn't the only
difference. Stack alignment is different....

In the case you mentioned, the DJGPP app, is a mixture of real 16-bit,
protected mode 16-bit and 32-bit, although it is mostly 32-bit. True
32-bit apps are the ones you run on Unix systems.

This is just a short answer, though ;-)

-- 
Prashant TR <tr AT midpec DOT com>
Web: http://www.midpec.com/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019