NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: nobody on October 24, 2005, 05:19:45 AM

Title: Is there a 32-bit real mode and why?
Post by: nobody on October 24, 2005, 05:19:45 AM
Is there a 32-bit real mode and why?
Title: Re: Is there a 32-bit real mode and why?
Post by: Frank Kotler on October 24, 2005, 06:37:05 AM
No, and you'll have to ask Intel :)

An (over)simplified explanation would be: if we're in protected mode, a bit in the descriptor to which cs points determines if the CPU is running in 16- or 32-bit mode. In real mode, there's no such bit.

You can use 32-bit instructions with the CPU in 16-bit mode. You can even use 32-bit addressing modes - but ordinarily, offsets are limited to 64k-1 (there's a workaround for this - "Flat Real Mode").

What is it you're trying to do?

Best,
Frank
Title: Re: Is there a 32-bit real mode and why?
Post by: nobody on October 25, 2005, 05:54:53 AM
Actually, 32-bit real mode has been supported
ever since the 80386 -- it is perfectly valid
to enter 32-bit protected mode, clear CR0.PE,
and not reload the segment registers: the CPU
will continue to honour various sreg.ar bits,
including CS.ar.D=1.
Title: Re: Is there a 32-bit real mode and why?
Post by: Frank Kotler on October 25, 2005, 09:08:36 AM
Got an example?

Best,
Frank