Reputation: 497
In 64-bit mode, the default address size is 64 bits. If the address-size override prefix (67h) is present, the address size is 32-bits.
I'm aware of the fact that canonical 64-bit addresses have bits 63 through the most significant implemented bit either all 0s or all 1s. Is the 32-bit address (obtained by prefixing 67h to an instruction in 64-bit mode) required to be in canonical form? If yes, how is this canonical form defined?
Upvotes: 2
Views: 1081
Reputation: 18217
Canonical addresses are formed by sign-extending the significant part (the lower 48 bits) of a virtual address; the most significant bit is treated as the sign.
Speculating on this now (not willing to look it up - but that's also not necessary to answer your question) - there's two conceivable behaviours for 32bit addresses in 64bit mode:
0x00000000xxxxxxxx
is canonical.0xffffffff80000000
... 0x000000007fffffff
- again, all of which are canonical.Since the result (32bit addresses always implicitly being of canonical form) is the same, it doesn't matter what the CPU actually does - 32bit addresses are canonical, period.
Upvotes: 4