Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Is it possible to address more than 1MB in real-mode
Would it be possible to use a 32-bit addressing-mode in real-mode via
address-size prefix and thereby to have segments which are 4GB long?
Someone in a different NG claimed that he can address more than 1MB
in real-mode with the large addressing-modes. The time I dealt with
such things is 15 years ago and the only way to have segments which
are 4GB long is to switch into 32 bit protected-mode, load the seg-
ment registers from appropriate selectors and to get back into real
-mode with interrupts disabled to prevent the cached selectors to
be overwritten.


Report this thread to moderator Post Follow-up to this message
Old Post
Elcaro Nosille
02-18-08 11:59 PM


Re: Is it possible to address more than 1MB in real-mode
On Mon, 18 Feb 2008 21:08:52 +0100, I waved a wand and this message
magically appears in front of Elcaro Nosille:

> Would it be possible to use a 32-bit addressing-mode in real-mode via
> address-size prefix and thereby to have segments which are 4GB long?
> Someone in a different NG claimed that he can address more than 1MB
> in real-mode with the large addressing-modes. The time I dealt with
> such things is 15 years ago and the only way to have segments which
> are 4GB long is to switch into 32 bit protected-mode, load the seg-
> ment registers from appropriate selectors and to get back into real
> -mode with interrupts disabled to prevent the cached selectors to
> be overwritten.

IIRC, that was due to a bug in segmented addressing on the 8086/8088
processors. You could address the first 64K above the 1MB address range
due to this; but that was many, many years ago and I probably
misremember but I think it's actually something like that.
--
http://www.munted.org.uk

Fearsome grindings.


Report this thread to moderator Post Follow-up to this message
Old Post
Alex Buell
02-18-08 11:59 PM


Re: Is it possible to address more than 1MB in real-mode
Elcaro Nosille wrote:

> Would it be possible to use a 32-bit addressing-mode in real-mode via
> address-size prefix and thereby to have segments which are 4GB long?
> Someone in a different NG claimed that he can address more than 1MB
> in real-mode with the large addressing-modes. The time I dealt with
> such things is 15 years ago and the only way to have segments which
> are 4GB long is to switch into 32 bit protected-mode, load the seg-
> ment registers from appropriate selectors and to get back into real
> -mode with interrupts disabled to prevent the cached selectors to
> be overwritten.

Isn't this what some call unreal mode?
http://en.wikipedia.org/wiki/Unreal_mode


Report this thread to moderator Post Follow-up to this message
Old Post
Noob
02-18-08 11:59 PM


Re: Is it possible to address more than 1MB in real-mode
On Mon, 18 Feb 2008 21:09:17 +0000, Alex Buell  <spamtrap@crayne.org>
wrote in comp.lang.asm.x86:

> On Mon, 18 Feb 2008 21:08:52 +0100, I waved a wand and this message
> magically appears in front of Elcaro Nosille:
> 
>
> IIRC, that was due to a bug in segmented addressing on the 8086/8088
> processors. You could address the first 64K above the 1MB address range
> due to this; but that was many, many years ago and I probably
> misremember but I think it's actually something like that.

I think your memory is a little bit hazy.  The 8086 and 8088 only had
20 address lines, A0 through A19, and so could only generate one MB
different physical addresses.  If an instruction with a high enough
starting address (segment above F000 hex) used a large enough offset,
it would wrap around and address RAM in the first 64K.

Some software, and some BIOSes, in particular, took advantage of that
wrap around, which is why early processors with more address lines
(286, 386, 486) had a hardware circuit on the board (the A20 gate),
that could pass their address line A20 through, allowing access to all
memory, or always force A20 as seen by memory to 0, causing the warp
around for 8088 DOS compatibility with poorly designed software.

In the days of DOS 5 and 6, himem.sys sometimes had problems enabling
the A20 gate on some motherboards, because different makers
implemented it in different ways.

When the A20 gate was enabled, processors 286 and above could load a
real mode segment register with FFF0 hex and access 64K - 16 bytes
above one meg.  That was what was called the HMA, High Memory Area.

But that is very different from having full 32-bit addressing in real
mode like the OP asked for.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html


Report this thread to moderator Post Follow-up to this message
Old Post
Jack Klein
02-19-08 03:00 AM


Re: Is it possible to address more than 1MB in real-mode
"Noob" <root@localhost.news.free.fr> wrote in message
news:47b9ff18$0$12492$426a74cc@news.free.fr...

> Isn't this what some call unreal mode?
> http://en.wikipedia.org/wiki/Unreal_mode

Yes, and it's very similar to how 386+(?) supervisor mode works as well I
believe.

--
Jay

Jason Burgon - author of Graphic Vision
http://homepage.ntlworld.com/gvision


Report this thread to moderator Post Follow-up to this message
Old Post
Jason Burgon
02-19-08 08:59 AM


Re: Is it possible to address more than 1MB in real-mode
Noob <root@localhost.news.free.fr> wrote:

>Elcaro Nosille wrote:
> 
>
>Isn't this what some call unreal mode?
>http://en.wikipedia.org/wiki/Unreal_mode

Exactly right.  That's the only way to do it.  Without that magic, the
real-mode selectors have a limit of 64k bytes, regardless of the address
size prefix.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.


Report this thread to moderator Post Follow-up to this message
Old Post
Tim Roberts
02-19-08 08:59 AM


Re: Is it possible to address more than 1MB in real-mode
On Mon, 18 Feb 2008 21:27:06 -0600, I waved a wand and this message
magically appears in front of Jack Klein:

> I think your memory is a little bit hazy.  The 8086 and 8088 only had
> 20 address lines, A0 through A19, and so could only generate one MB
> different physical addresses.  If an instruction with a high enough
> starting address (segment above F000 hex) used a large enough offset,
> it would wrap around and address RAM in the first 64K.
>
> Some software, and some BIOSes, in particular, took advantage of that
> wrap around, which is why early processors with more address lines
> (286, 386, 486) had a hardware circuit on the board (the A20 gate),
> that could pass their address line A20 through, allowing access to all
> memory, or always force A20 as seen by memory to 0, causing the warp
> around for 8088 DOS compatibility with poorly designed software.
>
> In the days of DOS 5 and 6, himem.sys sometimes had problems enabling
> the A20 gate on some motherboards, because different makers
> implemented it in different ways.
>
> When the A20 gate was enabled, processors 286 and above could load a
> real mode segment register with FFF0 hex and access 64K - 16 bytes
> above one meg.  That was what was called the HMA, High Memory Area.
>
> But that is very different from having full 32-bit addressing in real
> mode like the OP asked for.

Haha, you're absolutely correct, thank you for refreshing my memory
indeed yes that was what I was thinking of!
--
http://www.munted.org.uk

Fearsome grindings.


Report this thread to moderator Post Follow-up to this message
Old Post
Alex Buell
02-20-08 12:06 AM


Re: Is it possible to address more than 1MB in real-mode
Elcaro Nosille asked:

> Would it be possible to use a 32-bit addressing-mode in real-mode via
> address-size prefix and thereby to have segments which are 4GB long?

No, except beside UnReal/BigReal you can only access the first 64 KB
(-16 bytes, aka HMA) above the first MB with A20 enabled and with
the segment at FFFF.

> Someone in a different NG claimed that he can address more than 1MB
> in real-mode with the large addressing-modes.

I dont think that this will work very well, Unreal/Bigreal will crash
on any IRQ if the handlers weren't written explicite for it.
And if one think to create them, he may be better advised to create
PM32-handlers and use fully working PM<->RM or VM switches instead.

>    The time I dealt with
> such things is 15 years ago and the only way to have segments which
> are 4GB long is to switch into 32 bit protected-mode, load the seg-
> ment registers from appropriate selectors and to get back into real
> -mode with interrupts disabled to prevent the cached selectors to
> be overwritten.

Yeah, that was the old XMS/EMM way during DOS times where
IRQ handling during PM weren't available while in plain DOS.
Mode swapping OSes should cover IRQ-handling in both real and protected
mode to keep sequence-sensible HW (mouse,keybd,net,...) in synch.

btw: I once encountered a CPU-bug (may be still in some 'modern' chips)
with an operand size extended instruction...

:RM16
db 66h |BT(c/r/s) [mem],reg32  ;this can range within +/-256 MB

...where it could in fact access another segment (even not above 1 MB)
without raising an exception.
__
wolfgang



Report this thread to moderator Post Follow-up to this message
Old Post
Wolfgang Kern
02-20-08 12:06 AM


Re: Is it possible to address more than 1MB in real-mode
Ah! You spoilt youngsters!
I remember when we thought having 4k bytes was wonderful, after using
50 word drums...


Report this thread to moderator Post Follow-up to this message
Old Post
Terence
02-20-08 12:06 AM


Re: Is it possible to address more than 1MB in real-mode
On Tue, 19 Feb 2008 07:30:38 -0800 (PST), Jim Leonard
<spamtrap@crayne.org> wrote:

>On Feb 18, 3:09 pm, Alex Buell  <spamt...@crayne.org> wrote: 
>
>Replace 808x with 80286+ and you're correct.  The 808x didn't have
>enough address lines for this trick to work; the 286 and later did.
>(80186 *might* have, but I don't have the sheets in front of me atm to
>confirm)

My 80186 book seems to think that it took the same memory size as the
8086.
--
ArarghMail802 at [drop the 'http://www.' from ->] http://www.arargh.com
BCET Basic Compiler Page: http://www.arargh.com/basic/index.html

To reply by email, remove the extra stuff from the reply address.


Report this thread to moderator Post Follow-up to this message
Old Post
ArarghMail802NOSPAM
02-20-08 12:06 AM


Sponsored Links




Last Thread Next Thread Next
Pages (5): [1] 2 3 4 5 »
Search this forum -> 
Post New Thread

A86 Assembler archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:34 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.