Is there a way to 'mov'e a specific immediate byte-size number into a direct memory location? I.e.
MOV 10h,ffffh
to write the value 16
into the memory address 65535
? If so, which opcode is that, orwould I have to store a memory address into a register first?
Intel Manual Volume 2 Instruction Set Reference - 325383-056US September 2015 Section 3.2 "MOV—Move " has a table which contains:
Then you must know that:
r/m
means register or memory locationimm
means immediateSo those are the encodings you are looking for.
More empirically you could also have just tried it out and decompiled:
Then:
Gives:
So we conclude that
c6
is the opcode, with ModR/M05
, and immediates following.Yes. The opcode is
C6
. You should download a copy of the Intel ISA documents, which are freely available.To your follow-up question: the full encoding of your example is: