Newsgroup: alt.msdos.programmer


Path: icdoc!tsun6.doc.ic.ac.uk!zmact61
From: zmact61@tsun6.doc.ic.ac.uk.doc.ic.ac.uk (D Spinellis)
Newsgroups: alt.msdos.programmer
Subject: Re: 386 instructions
Summary: In the real the segment limit is 64K
Message-ID: <1451@gould.doc.ic.ac.uk>
Date: 16 Jan 90 11:42:42 GMT
References: <13346@garnet.BBN.COM> <580@watserv1.waterloo.edu> <6142@internal.Apple.COM> <8166@portia.Stanford.EDU>
Sender: news@doc.ic.ac.uk
Reply-To: dds@cc.ic.ac.uk (Diomidis Spinellis)
Organization: Imperial College Department of Computing
Lines: 29
Content-Length: 1437
In article <8166@portia.Stanford.EDU> dhinds@portia.Stanford.EDU (David Hinds) writes:

>    On a tangent to the previous articles in the series, why are these DOS
>extenders and things needed anyway???  Almost all of the 386-specific
>instructions can be executed by the processor in real mode (i.e., under DOS)
>without any contortions.  
[...]
>Any DOS program can simply use 32-bit addresses to access
>extended memory.

Sorry, but the above is not exactly correct.  It is true that most of the
386 instructions can be used in the real mode, but the segment limit is
still limited to 64K.  That is the base address (the one that is added
to the segment) even when using 32 bit operands must be less than 65535.
If it is more an exception will occur.  Because of this you miss the linear 
addressing feature of the 386.  In order to increase the segment limit
you have to go to protected mode.  

Try the following program to convince yourself:
	mov	ebx,010000h		; This is more than the segment limit
	mov	al, [ebx]		; You should get an exception in real
					; mode at this point.

Diomidis
--
Diomidis Spinellis                  Internet:                 dds@cc.ic.ac.uk
Department of Computing             BITNET:                   dds@cc.ic.ac.uk
Imperial College                    UUCP:   ...!cernvax!cc.imperial.ac.uk!dds
London SW7 2BZ                      JANET:                    dds@uk.ac.ic.cc



Newsgroup alt.msdos.programmer contents
Newsgroup list
Diomidis Spinellis home page

Creative Commons License Unless otherwise expressly stated, all original material on this page created by Diomidis Spinellis is licensed under a Creative Commons Attribution-Share Alike 3.0 Greece License.