0

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 :)

4
  • The answer to this question depends on the context. On a x86_64 CPU the address 0 is a valid memory location. If this is in reference to an operating system like any gnu/linux system or Windows, then address 0 is usually forbidden. Commented Jan 26, 2023 at 19:26
  • usually it's adding zeroes to the left that keeps the number the same, e.g. 123 is the same as 000123, and 0x7ffffff3328 is the same as 0x000007ffffff3328. I'm not sure if I'm counting the digits correctly, but those all look like they'd fit the low 48 bits. Commented Jan 26, 2023 at 19:26
  • @tkausl yes, the question is in reference to gnu/linux. So 0x0 and 0x8043844 would make sense that they are not "valid" addresses. Commented Jan 26, 2023 at 20:39
  • @ilkkachu thanks, padding before the given address makes more sense. Commented Jan 26, 2023 at 20:42

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.