X86-64 Instruction Encoding: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
Partial rollback of rollback
→‎16-bit addressing: Added info on 8-bit addressing, expanded on 16-bit with REX
Line 222:
|8
|}
 
=== 8-bit addressing ===
Many instructions have a variant that allows the use of 8-bit register operands, and this requires no operand-size prefix. The x86-64 processors have no way to specify 8-bit addresses. These are the meanings of the ''Mod'' (vertically), ''R/M'' (horizontally) bits and REX prefix for 8-bit register operands:
 
{| {{wikitable}}
! !! colspan="8" | No REX prefix
|-
! Mod !! R/M=b000 !! b001 !! b010 !! b011 !! b100 !! b101 !! b110 !! b111
|-
! b00
| colspan="8" rowspan="3" style="text-align: center; vertical-align: middle" | N/A
|-
! b01
|-
! b10
|-
! b11
|AL||CL||DL||BL||AH||CH||DH||BH
|-
| colspan="9" style="background-color: white; border-bottom: solid 2px black; border-top: solid 2px black;" |
|-
! !! colspan="8" | REX.B = 0
|-
! Mod !! R/M=b000 !! b001 !! b010 !! b011 !! b100 !! b101 !! b110 !! b111
|-
! b00
| colspan="8" rowspan="3" style="text-align: center; vertical-align: middle" | N/A
|-
! b01
|-
! b10
|-
! b11
|AL||CL||DL||BL||BPL||SPL||SIL||DIL
|-
| colspan="9" style="background-color: white; border-bottom: solid 2px black; border-top: solid 2px black;" |
|-
! !! colspan="8" | REX.B = 1
|-
! Mod !! R/M=b000 !! b001 !! b010 !! b011 !! b100 !! b101 !! b110 !! b111
|-
! b00
| colspan="8" rowspan="3" style="text-align: center; vertical-align: middle" | N/A
|-
! b01
|-
! b10
|-
! b11
|R8L||R9L||R10L||R11L||R12L||R13L||R14L||R15L
|}
 
 
=== 16-bit addressing ===
In ''Long processing mode'' there is no way to specify 16-bit addresses. These are the meanings of the ''Mod'' (vertically) and, ''R/M'' (horizontally) bits and REX prefix for [[#Operand-size and address-size override prefix|16-bit addressing]]: (The SIB-byte is not used in 16-bit addressing.)
 
{| {{wikitable}}
! !! colspan="8" | REX.B = 0 or no REX prefix
|-
! Mod !! R/M=b000 !! b001 !! b010 !! b011 !! b100 !! b101 !! b110 !! b111
|-
Line 238 ⟶ 293:
|-
! b11
|AL, AX||CL, CX||DL, DX||BL, BX||AH, SP||CH, BP||DH, SI||BH, DI
|-
| colspan="9" style="background-color: white; border-bottom: solid 2px black; border-top: solid 2px black;" |
|-
! !! colspan="8" | REX.B = 1
|-
! Mod !! R/M=b000 !! b001 !! b010 !! b011 !! b100 !! b101 !! b110 !! b111
|-
! b00
| colspan="8" rowspan="3" style="text-align: center; vertical-align: middle" | N/A
|-
! b01
|-
! b10
|-
! b11
|R8W||R9W||R10W||R11W||R12W||R13W||R14W||R15W
|}