X86-64 Instruction Encoding: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
→‎VEX/XOP opcodes: Better layout
→‎ModR/M: Better layout
Line 382: Line 382:
+---+---+---+---+---+---+---+---+
+---+---+---+---+---+---+---+---+
</pre>
</pre>
{| {{wikitable}}
{| {{wikitable|background-color: white}}
!style="background-color:#f9f9f9;"| Field
! Field
!style="background-color:#f9f9f9;"| Length
! Length
! Description
!style="background-color:#f9f9f9;"| Description
|-
|-
!style="background-color:#f9f9f9; text-align: left; vertical-align: top;"| MODRM.mod
| MODRM.mod||2 bits||In general, when this field is b11, then register-direct addressing mode is used; otherwise register-indirect addressing mode is used.
|style="vertical-align: top;"|2 bits||In general, when this field is b11, then register-direct addressing mode is used; otherwise register-indirect addressing mode is used.
|-
|-
!style="background-color:#f9f9f9; text-align: left; vertical-align: top;"| MODRM.reg
| MODRM.reg||3 bits||This field can have one of two values:
|style="vertical-align: top;"|3 bits||This field can have one of two values:
* A 3-bit opcode extension, which is used by some instructions but has no further meaning other than distinguishing the instruction from other instructions.
* A 3-bit opcode extension, which is used by some instructions but has no further meaning other than distinguishing the instruction from other instructions.
* A 3-bit register reference, which can be used as the source or the destination of an instruction (depending on the instruction). The referenced register depends on the [[#Operand-size and address-size override prefix|operand-size]] of the instruction and the instruction itself. See [[#Registers|Registers]] for the values to use for each of the registers. The REX.R, VEX.~R or XOP.~R field can extend this field with 1 most-significant bit to 4 bits total.
* A 3-bit register reference, which can be used as the source or the destination of an instruction (depending on the instruction). The referenced register depends on the [[#Operand-size and address-size override prefix|operand-size]] of the instruction and the instruction itself. See [[#Registers|Registers]] for the values to use for each of the registers. The REX.R, VEX.~R or XOP.~R field can extend this field with 1 most-significant bit to 4 bits total.
|-
|-
!style="background-color:#f9f9f9; text-align: left; vertical-align: top;"| MODRM.rm
| MODRM.rm||3 bits||Specifies a direct or indirect register operand, optionally with a displacement. The REX.B, VEX.~B or XOP.~B field can extend this field with 1 most-significant bit to 4 bits total.
|style="vertical-align: top;"|3 bits||Specifies a direct or indirect register operand, optionally with a displacement. The REX.B, VEX.~B or XOP.~B field can extend this field with 1 most-significant bit to 4 bits total.
|}
|}