In a mock exam there is the following question:
Which of the following addresses is a proper memory address for a pointer variable on an x86_64 processor?
- 0x7ffffff3328
- 0x0
- 0x8043844
- 0x555555ab3b
When searching I found that x86_64 virtual memory adresses are 48 bits long. But this is what confuses me, none of the possible answers shows a 48 bit adress. Can I assume that the end of the adress will be filled with zeros?
If I assume that all addresses were valid 48 bit addresses I could eliminate 0x0 and 0x8043844 as 0x0 would be a null pointer and 0x8043844 should be an adress in the kernel space. So now only 0x7ffffff3328 and 0x555555ab3b are left. If check kernel.org it says 0x0000000000000000 to 0x00007fffffffffff are valid user space adresses ( https://www.kernel.org/doc/Documentation/x86/x86_64/mm.txt ).
I'm really not sure what I am missing. Is my assumption with the padding of the adresses with zeros correct? Which of the adresses would be the right answer and why?
I would really appreciate any help :)
0x7ffffff3328is the same as0x000007ffffff3328. I'm not sure if I'm counting the digits correctly, but those all look like they'd fit the low 48 bits.