Intel 64/x86_64/IA-32/x86处理器 - 指令格式(8) - 80386/32位指令前缀

版权声明:转载必须保留原出处,没有书面许可不可用于商用目的, https://blog.csdn.net/qq_43401808/article/details/86594038

下面详细讲解一下指令前缀。Pentium Pro处理器支持的前缀可以分成如下四组:

  • 组1: 封锁和重复执行前缀

指令前缀

(十六进制)

描述

F0 H

Lock前缀,封锁总线

The LOCK prefix can be prepended only to the following instructions and only to those forms of the instructions where the destination operand is a memory operand: ADD, ADC, AND, BTC, BTR, BTS, CMPXCHG, CMPXCH8B, CMPXCHG16B, DEC, INC, NEG, NOT, OR, SBB, SUB, XOR, XADD, and XCHG.

 

If the LOCK prefix is used with one of these instructions and the source operand is a memory operand, an undefined opcode exception (#UD) may be generated.

 

An undefined opcode exception will also be generated if the LOCK prefix is used with any instruction not in the above list.

 

The XCHG instruction always asserts the LOCK# signal regardless of the presence or absence of the LOCK prefix.

F2 H

REPNE/REPNZ前缀(只位于字符串指令前)

F3 H

REP前缀(只位于字符串指令前)

F3 H (与REP前缀同码)

REPE/REPZ前缀(只位于字符串指令前)

 

  • 组2: 段跨越前缀

指令前缀(十六机制)

描述

2E H

CS段跨越前缀,即指定CS段,下同理

36 H

SS段跨越前缀

3E H

DS段跨越前缀

26 H

ES段跨越前缀

64 H

FS段跨越前缀

65 H

GS段跨越前缀

 

  • 组3:操作数宽度前缀

66H,用来“反转”默认的16位或32位操作数宽度。例如,当默认的操作数宽度是16位时,可以用这个前缀选择32位宽度的操作数,或者反之。(todo:给个例子)

  • 组4:地址宽度前缀

67H,用来“反转”默认的16位或32位地址宽度。例如,当默认的地址宽度是32位时,可以用这个前缀选择16位宽度的地址,或者反之。(todo:给个例子)

指令前缀小结

 

分组

前缀编码

16位模式(8086)

32位模式(80386)

 

组2

2E H

CS段跨越前缀

CS段跨越前缀

 

36 H

SS段跨越前缀

SS段跨越前缀

 

3E H

DS段跨越前缀

DS段跨越前缀

 

26 H

ES段跨越前缀

ES段跨越前缀

 

64 H

Not used

FS段跨越前缀

 

65 H

Not used

GS段跨越前缀

 

组3

66 H

Not used

操作数宽度前缀

 

组4

67 H

Not used

地址宽度前缀

 

组1

F0 H

Lock前缀

Lock前缀

 

F2 H

REPNE/REPNZ

REPNE/REPNZ

 

F3 H

REP; REPE/REPZ

REP; REPE/REPZ

 

 

猜你喜欢

转载自blog.csdn.net/qq_43401808/article/details/86594038