The Full Wiki

Unreal mode: Wikis


Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.


From Wikipedia, the free encyclopedia

x86 processor modes
Mode First supported
Intel 8086
Intel 80286
Intel 80386
  • Unreal mode
Intel 80386
Intel 386SL
AMD Opteron

In x86 computing, unreal mode, also big real mode, huge real mode, or flat real mode, is a variant of real mode (PE=0), in which one or more data segment registers have been loaded with 32-bit addresses and limits. Contrary to its name, it is not a separate addressing mode that the x86 and x86-64 processors can operate in. It is used in the 80386 and later x86 processors.



For efficiency reasons, the 80386 and later x86 processors use the base address stored in their internal "descriptor" cache whenever accessing memory, regardless if they are operating in real or protected mode. The "selector", i.e. the 16-bit "segment number" visible to the programmer is used once, while reloading a segment register, to update the various fields of the respective "descriptor", and then is simply disregarded.

Some DOS extenders use this feature to address the high memory. It was used by many computer games in the 1990 to 1995 time frame, since it allowed programmers to use more memory than in real mode, which is restricted to 1 MB (640 KB usable), but still access the DOS operating system, which doesn't work in protected mode. After the introduction of Windows 95 unreal mode quickly fell out of favour as programs using it cannot be run in the DOS prompt of Microsoft Windows; they require a "Restart in MS-DOS mode" in Windows 95 and 98, and cannot be run at all on NT and later Windows systems. For those operating systems, an emulator such as DOSBox is the only way to run programs designed for unreal mode. Unreal mode is still extensively used by BIOS code. In particular the SMM mode in Intel 386SL and later processors places the processor in unreal mode.

Enabling Unreal Mode

To enable unreal mode without using any undocumented features of the CPU, the program has to enter protected mode, locate a flat descriptor in the GDT or LDT or create such, load some of the data segment registers with the respective protected mode "selector", then switch back to real mode. When jumping back to real mode, the processor will continue using the cached descriptors as established in protected mode, thus allowing access to 4 GB of "extended" memory from inside real mode.

Huge versus Big real mode

As described above, unreal mode usually involves using one or more data selectors to more efficiently address data in memory. This has been common practice and often referred to as "big" real mode. "Huge" real mode is attained by, in addition, loading the code selector (CS) from a descriptor allowing access to the whole memory and having the 32-bit attribute ("D" bit) set to one. This rarely used "mode" presents some advantages but it is more difficult to set up, since real mode interrupts do not automatically preserve the high sixteen bits of the extended instruction pointer, EIP.

See also

Got something to say? Make a comment.
Your name
Your email address