cotter wrote:I have a question regarding how much memory an x86 can really address in real-address mode
1 Megabytes+64K. Moreover, the whole accessable memory is not available for use, given that about half of that memory is reserved for VRAM, Bios Data Area,IVT etc.
cotter wrote:The 8086 knows nothing about %eax, only %ax. However, I have found that when I write assembly code for the x86 executing in real mode, I am able to use the register %eax.
Did you run that code under 8086? Do not make mistake in assuming that 'Real Mode' is same as '8086 16 bit mode'.
Real mode means 'Real Addressing Mode'.You can use some 32 bit registers in real mode as long as you are supposed to run that code for 386+. You can't rely that to run on 8086 because 8086 uses 16 bit registers. Remember, Real mode does not necessarily mean '8086 16-bit mode'. In fact, this behaviour changes with the the newer processors in the sense that you can use 32 bit registers for general instructions(your assembler might truncate the higher bits of 32 bit registers, in some case).And as such if you employ any of those 32 bit registers, it runs on 386+ even under Real Mode.
cotter wrote:This behavior appears to be un-defined in the Intel software developer's manual. That is, the manual never states explicitly what happens if I use the 32-bit registers and write values to memory that is clearly outside the supposed limits of an 8086 executing in real mode.
You might be wrong in this case.Did you mean you accessed more than 1 Megabytes (+64K) of memory in 'Real Mode'? If this is the case, you might be employing 'Unreal Mode'.
cotter wrote:Certainly, my own hardware is (my CPU, that is) is a core2duo that clearly can address 2^32 and beyond. Can anyone explain why I am apparently allowed to address memory that is way outside the range of real-address memory mode.
You cannot address memory outside the range of real-address mode.That's impossible[AFAIK].
cotter wrote:More over, the following code appears to work:
Code:
Code: Select all
.code16
movl $0x9999999, %eax
movl $0x12345678, (%eax)
Afterwards, the memory at location 0x9999999 has the value 0x12345678.
Do you realize what your code is supposed to do? How can you say that it is accessing memory beyond 1 Megabytes?
Thank You.