ModRM
ModRM is a byte used in x86 instruction encoding to specify operand locations and addressing modes. It is part of many instructions that operate on memory or on registers, and is often followed by displacement bytes and, when present, a scale-index-base (SIB) byte. The ModRM byte encodes three fields: mod, reg/opcode, and r/m.
The reg/opcode field can designate a register operand. In some instructions it also serves as an opcode
The mod field selects the addressing mode and displacement size. In general, mod=11 means both operands are
The r/m field selects the memory address or a register operand. When r/m=100, a SIB byte follows
ModRM is a core element of many instructions across 16, 32, and 64-bit modes, functioning as both