1 year ago
#368003
VortixDev
How are segment selectors related to the address?
Let's say I run the following C code and get 0x7ffd385c9588
:
#include <stdio.h>
int main() {
int test = 5;
printf("%p", &test);
return 0;
}
I've heard that the logical address contains the segment selector, so does the value provided by printf
contain it?
I thought it was embedded within the segment register part of the instruction, e.g. ds:[0x7ffd385c9588]
, but it's said that x64 uses 48-bit addresses, which would only fit the offset and not the selector.
assembly
x86-64
memory-address
memory-segmentation
0 Answers
Your Answer