Encoding the x86_64 instruction mov rcx,rdx
(using https://defuse.ca/online-x86-assembler.htm) outputs 48 89 D1
.
Checking the op-code with this reference shows how that byte sequence encodes the instruction.
However two rows down in that table (op-code 8B
) is a very similar mov
instruction, but with the order of the operands flipped.
In fact I'm able to encode the same instruction using 48 8b ca
(verified by decompiling).
Why do both op-codes exist? Do they differ by more than I was able to work out? When would one be picked over the other?
.s
suffix for gas). – Jester