NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: ben321 on October 09, 2022, 12:12:16 AM

Title: What is this 32-bit real mode mentioned in the official Intel x86 x64 manual?
Post by: ben321 on October 09, 2022, 12:12:16 AM
I was just reading the second page of section 8.1.10 (go to https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-1-manual.pdf#G9.57567 and then go down one page) in the official Intel CPU manual, while researching on the x87 FPU I happened to notice something interesting. It mentions a 32-bit real mode. And I'm thinking WOW, how does that work? I've always been told that real mode is 16 bits, and that there are 16bit and 32bit protected modes (and now also 64bit long mode). Is this an experimental mode that Intel was working on, but just never developed a CPU for? Or is this some kind of mode that while it does exist in Intel CPUs, the mechanism to switch to it is undocumented?

And by the way, that one mention of 32bit real mode, is the ONLY mention in the entire PDF file. And the file contains almost 500 pages.
Title: Re: What is this 32-bit real mode mentioned in the official Intel x86 x64 manual?
Post by: Frank Kotler on October 09, 2022, 12:32:11 AM
Possible reference to djgpp?

   www.delorie.com/djgpp/

Best,
Frank


Title: Re: What is this 32-bit real mode mentioned in the official Intel x86 x64 manual?
Post by: debs3759 on October 09, 2022, 04:20:07 AM
https://en.wikipedia.org/wiki/Unreal_mode
Title: Re: What is this 32-bit real mode mentioned in the official Intel x86 x64 manual?
Post by: debs3759 on October 09, 2022, 04:22:25 AM
Possible reference to djgpp?

   www.delorie.com/djgpp/

Best,
Frank

Unreal mode is fairly well documented. Best reference I can find with code examples is https://wiki.osdev.org/Unreal_Mode
Title: Re: What is this 32-bit real mode mentioned in the official Intel x86 x64 manual?
Post by: Frank Kotler on October 09, 2022, 04:37:03 AM
Yes. Sometimes referred to as "voodoo mode" or "flat real mode". Better called "relimited real mode", perhaps. Fasm used it at one time, I think. Not much used these days I suspect., unless you're in a museum... in the basement...

Best,
Frank

Title: Re: What is this 32-bit real mode mentioned in the official Intel x86 x64 manual?
Post by: ben321 on October 09, 2022, 09:04:12 AM
https://en.wikipedia.org/wiki/Unreal_mode

I'm not completely sure that's what it refers to. Unreal mode is kinda a hack, not exactly something that an Intel manual would ever make reference too. Yet that one page of that one manual indicates the existence of a 32 bit real mode. Is it possible that this is something similar to, but not the same as the "unreal" mode? Maybe an undocumented feature who's existence just happened to accidentally get leaked on that one page in that one manual? Maybe you need to use an undocumented opcode to switch to it?
Title: Re: What is this 32-bit real mode mentioned in the official Intel x86 x64 manual?
Post by: debs3759 on October 09, 2022, 09:31:41 AM
They are different names for the same operating mode. To set up segment selectors to use 32-bit addressing, you have to go into protected mode, set up the segments, then drop back into real mode with 32-bit segments. It's not strictly speaking documented (as you say, Intel barely mention it), but it is relatively easy. The second link I shared shows how to do it.