movq and 64 bit numbers

前端 未结 1 1252
遥遥无期
遥遥无期 2021-01-17 01:15

When I write to a register, everything is fine,

movq  $0xffffffffffffffff, %rax

But I get Error: operand size mismatch when I write to a me

1条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-17 01:58

    Why is that?

    Because MOV r64, imm64 is a valid x86 instruction, but MOV r/m64, imm64 is not (there's no encoding for it).


    I see in compiled C code that in asm these numbers are split in two and two movl instructions show up.

    MOV r/m64, imm32 is a valid x86 instruction, which is why you see two of them being used to store a 64-bit immediate to memory.


    Maybe you can tell me where the mowq and other instructions are documented

    In Intel's Software Developer Manuals.

    0 讨论(0)
提交回复
热议问题