X86数据转移指令简介

普通转移指令

助记符 英文 功能
MOV Move 从存储器地址或寄存器或立即数拷贝字节、字、双字、四字到存储器地址或寄存器。源和目标不能同为存储器地址。源和目标的字节长度必须相同
MOVBE Move with Big-Endian 类MOV。操作数必须大于一个字节,源和目标都必须是存储器地址
MOVSX Move with Sign-Extend 类MOV。源的字节长度小于目标长度,缺少的bit高位用符号位补齐
MOVZX Move with Zero-Extend 类MOV。源的字节长度小于目标长度,缺少的bit高位用0补齐
MOVD Move Doubleworld or Quadword 类MOV。拷贝双字、四字到存储器地址或寄存器或XMM/MMX寄存器
MOVNTI Move Non-temporal Doubleword or Quadword 类MOVD。但不经过cache(但具体经不经过cache,是硬件实现决定的)

 

 

 

 

 

 

 

 

 

 

**虽然可以用MOV将某个寄存器设置成0,但建议使用XOR指令,因为效率更高。

条件数据转移指令

条件数据转移指令,是只有当条件满足时才起作用(条件指标记寄存器的标记位),否则直接跳过。CPU是否支持条件数据转移指令需要用CPUID指令确认。

助记符 英文 作用
CMOVO Conditional move if overflow 溢出时转移数据(OF=1)
CMOVNO Conditional move if not overflow 不溢出是转移数据(OF=0)
CMOVB
CMOVC
CMOVNAE
Conditional move if below
Conditional move if carry
Conditional move if not above or equal
小于时转移数据(CF=1),针对无符号数
CMOVAE
CMOVNB
CMOVNC
Conditional move if above or equal
Conditional move if not below
Conditional move if not carry
大于等与时转移数据(CF=0 或 ZF = 0),针对无符号数
CMOVE
CMOVZ 
Conditional move if equal
Conditional move if zero
等于时转移数据(ZF=1),针对无符号数
CMOVNE
CMOVNZ 
Conditional move if not equal
Conditional move if not zero
不等于时转移数据(ZF=0),针对无符号数
CMOVBE
CMOVNA
Conditional move if below or equal
Conditional move if not above
小于等于时转移数据(ZF=0 或 CF=1),针对无符号数
CMOVA
CMOVNBE
Conditional move if above
Conditional move if not below or equal
大于时转移数据(CF=0),针对无符号数
CMOVS  Conditional move if sign 负数时转移(SF=1),针对无符号数
CMOVNS  Conditional move if not sign 非负时转移(SF=0),针对无符号数
CMOVP
CMOVPE 
Conditional move if parity
Conditional move if parity even
奇偶校验 最低字节偶数个1时转移数据(PF=1)
CMOVNP
CMOVPO 
Conditional move if not parity
Conditional move if parity odd
奇偶校验 最低字节奇数个1时转移数据(PF=0)
CMOVL
CMOVNGE 
Conditional move if less
Conditional move if not greater or equal
小于时转移数据(SF <> OF),针对有符号数
CMOVGE
CMOVNL 
Conditional move if greater or equal
Conditional move if not less
大于等于或等于时转移数据(SF == OF),针对有符号数
CMOVLE
CMOVNG 
Conditional move if less or equal
Conditional move if not greater
小于或等于时转移数据(ZF = 1 or SF <> OF),针对有符号数
CMOVG
CMOVNLE
Conditional move if greater
Conditional move if not less or equal
大于时转移数据(ZF = 0 and SF = OF),针对有符号数

你可能感兴趣的:(X86数据转移指令简介)