<<< Encoding ADD ECX, [ EBX + EDI*4 ] Instruction     Index     Encoding Eight, Sixteen, and Thirty-Two Bit Operands >>>

21. Encoding ADD Immediate Instruction


  • MOD-REG-R/M and SIB bytes have no bit combinations to specify an immediate operand.

  • Instead, x86 uses a entirely different instruction format to specify instruction with an immediate operand.

  • There are three rules that apply:

  • Encoding x86 immediate operands:

      Encoding Immediate Operands

  1. If opcode high-order bit set to 1, then instruction has an immediate constant.

  2. There is no direction bit in the opcode:

  3. The third difference between the ADD-immediate and the standard ADD instruction is the meaning of the REG field in the MOD-REG-R/M byte:


<<< Encoding ADD ECX, [ EBX + EDI*4 ] Instruction     Index     Encoding Eight, Sixteen, and Thirty-Two Bit Operands >>>