Code Comments
Programming Forum and web based access to our favorite programming groups.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.
Post Follow-up to this messageOn 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.
Post Follow-up to this messageElcaro 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
Post Follow-up to this messageOn 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
Post Follow-up to this message"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
Post Follow-up to this messageNoob <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.
Post Follow-up to this messageOn 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.
Post Follow-up to this messageElcaro 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
Post Follow-up to this messageAh! You spoilt youngsters! I remember when we thought having 4k bytes was wonderful, after using 50 word drums...
Post Follow-up to this messageOn 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.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.