0

I am studying MASM32, and I am learning about xmm, ymm registers.

I wanna debug xmm registers with its address (like ebp, esp, eax and so on), but I can't find any debug tools and good methods in visual studio.

How can I get the address of xmm registers?
I am trying to copy pointer of xmm registers to get address, but it doesn't work well.

Of course, I can see the value with watch while debug. But I want to get the address and hex(binary) data of xmm registers. My example project is 32bit in visual studio 2022.

vmovsd xmm0, real8 ptr[ebp+8]

PS: I know xmm0 is a 16bytes register and above code moves 8 bytes.

I want to know if XMM0 is

0000 0000 0000 0000 XXXX XXXX XXXX XXXX

or

XXXX XXXX XXXX XXXX 0000 0000 0000 0000

?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • 2
    XMM registers do not have an address, you can see the value in the "register window" but it looks like you know that – harold Feb 21 '23 at 14:34
  • "register window" shows only these registers "EAX = 00EFF740 EBX = 00EFF78C ECX = 00EFF700 EDX = 00EFF620 ESI = 003C1028 EDI = 00EFF780 EIP = 003C3E20 ESP = 00EFF50C EBP = 00EFF50C EFL = 00000202" – HappyLuck99 Feb 21 '23 at 14:38
  • For the PS, the value is loaded into the low 64 bits of the register and all higher bits are cleared. How that's displayed may depend on your debugger. – Nate Eldredge Feb 21 '23 at 14:39
  • Thanks for your comments, I found hex value of the xmm registers, and I am clear above the source. – HappyLuck99 Feb 21 '23 at 14:56
  • 3
    In the register window, if you right click you can select which registers to show – harold Feb 21 '23 at 15:17
  • In addition to `real8` you can also use `xmmword ptr` for 128 bit integers. You would need to use PSHUFB to reverse the bytes in an xmm register to switch little endian in memory to big endian in xmm register or vice versa. – rcgldr Feb 21 '23 at 19:37
  • You don't need an explicit size in your asm source; `movups xmm0, [ebp+8]` Just Works, with the register xmm0 implying the 16-byte size. (Since 32-bit code isn't required to maintain 16-byte stack alignment, you typically can't use `movaps` from stack args, or from your own locals on the stack unless you first aligned ESP.) – Peter Cordes Feb 21 '23 at 20:06
  • 1
    [How can i use the register debug window in visual studio](https://stackoverflow.com/q/63071518) points out you can change which set of registers to show in the registers window. [Debugging xmm registers in Assembler](https://stackoverflow.com/q/34425422) mentions a bug in older VS versions. [Meaning of XMM register values shown in Visual Studio debugger's register window](https://stackoverflow.com/q/7792127) talks about interpreting hex and per-element contents of the display window. – Peter Cordes Feb 21 '23 at 20:51
  • Also related: [Convention for displaying vector registers](https://stackoverflow.com/q/41351087) re: notation for which order to show the bytes. – Peter Cordes Feb 21 '23 at 22:27

0 Answers0