0

A basic question: Why is it possible to xor two 64 bit registers with eachother (two qwords) and not xor a 64bit register with a qword.

So this works:

mov rax, 0x1234567812345678
mov rbx, 0x8765432187654321
xor rax, rbx

But this doesn't:

mov rax, 0x1234567812345678
xor rax, 0x8765432187654321

Why is this?

JFMR
  • 23,265
  • 4
  • 52
  • 76
Wealot
  • 201
  • 2
  • 9
  • 4
    Because the 64-bit ISA has not been extended to have 64-bit immediates (since this make the instructions very long). However, the (still) 32-bit immediates are sign extended, but in general you need to `xor` two registers. – Margaret Bloom Mar 01 '18 at 16:58
  • http://www.felixcloutier.com/x86/XOR.html - find the "imm64" one... yep, none. – Ped7g Mar 01 '18 at 17:32
  • Thanks for the reactions! Margaret, please make yours an answer :P. Let me add that I am an absolute newbie in assembly so I did not know that the duplicate question would be the same as my question, so sorry for that. – Wealot Mar 02 '18 at 13:26

0 Answers0