<<< x86 ADD Instruction Opcode     Index     General-Purpose Registers >>>

6. Encoding x86 Instruction Operands, MOD-REG-R/M Byte


  •   MOD-REG-R/M Byte

  • The MOD field specifies x86 addressing mode:

      MOD Meaning

  • The REG field specifies source or destination register:

      x86 register encoding

  • The R/M field, combined with MOD, specifies either

    1. the second operand in a two-operand instruction, or

    2. the only operand in a single-operand instruction like NOT or NEG.

  • The d bit in the opcode determines which operand is the source, and which is the destination:

    • d=0: MOD R/M <- REG, REG is the source

    • d=1: REG <- MOD R/M, REG is the destination

  • ___________

  • (*) Technically, registers do not have an address, but we apply the term addressing mode to registers nonetheless.


<<< x86 ADD Instruction Opcode     Index     General-Purpose Registers >>>