3

I'm debugging my x64 c++ program to learn how it look in x64dbg. I see some register for r8-r15 on the right window, but I don't see r8d. There were others like r15d too. So what is it?

Here is a screenshot of my x64dbg. Here is a screenshot of my x64dbg.

binary_assemble
  • 394
  • 3
  • 17
  • 2
    Note that `xor r8d, r8d` actually has the effect of zeroing the entire 64-bit `r8` register, see https://stackoverflow.com/questions/11177137/why-do-x86-64-instructions-on-32-bit-registers-zero-the-upper-part-of-the-full-6, just like `xor r8, r8` would. For the "low" general-purpose registers rax-rdx, rsi, rdi, rsp, rbp this trick yields a savings in code space: `xor edx, edx` does the same thing as `xor rdx, rdx` but the former is one byte shorter due to not needing a REX prefix. For the "high" registers r8-r15, it actually makes no difference because the REX prefix is needed in both cases. – Nate Eldredge Nov 21 '21 at 04:02

1 Answers1

4

The d suffix means its (the 64-bit register's) lower double-word. For example, r8d is accessing r8's lower 32-bit as if it is a 32-bit register.

You can find more info here.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
hata
  • 11,633
  • 6
  • 46
  • 69