I am decoding X86 hex code representation to back to assembly. Section A.2.1 of ISA manual 2C provides the abbreviation Codes for Addressing Method (Page A-2 Vol. 2C). Can anyone explain me the what is the difference between abbr E and abbr M ?
E – A ModR/M byte follows the opcode and specifies the operand. The
operand is either a general-purpose register or a memory address. If
it is a memory address, the address is computed from a segment
register and any of the following values: a base register, an index
register, a scaling factor, a displacement.M – The ModR/M byte may refer only to memory (for example, BOUND, LES,
LDS, LSS, LFS, LGS, CMPXCHG8B).
E can allows any source or destination residing in memory or a register (such as
MOV EAX, DWORD PTR DS:[ESI]orMOV EAX, ESI), where as M only allows memory addresses, which means it cannot address a register, but it can address the memory pointed to by the value in the register (CMPXCHG8b ESIis invalid, where asCMPXCHG8b QWORD PTR DS:[ESI]is valid).