x86 汇编中是否有仅存在于 64 位模式下的指令?
一些旧的 x86 指令在 64 位模式下未定义。例如,LDS
、LES
和 LSS
,或 INC r16
的短操作码 (40 + < em>rw
)和 INC r32
(40 + rd
)指令。
是否有任何指令仅在 64 位模式下定义,而不在 32 位保护模式下定义?
编辑:上下文是 x86 处理器的开发。我想确保我符合规范。
Some old x86 instructions are undefined in 64-bit mode. For instance LDS
, LES
and LSS
, or short opcodes of the INC r16
(40 + rw
) and INC r32
(40 + rd
) instructions.
Are there any instructions that are defined only in 64-bit mode, and not in 32-bit protected mode?
Edit: The context is development of an x86 processor. I want to make sure I'm compatible to the spec.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
有一种寻址方式,在32位中没有对应的:指令指针相对寻址。在 32 位模式下,这仅适用于分支(也称为分支偏移量),在 64 位模式下,您可以为相对于 (r)ip 的任何内存操作数形成有效地址。
所以,该指令
在x86-64中确实存在,而
在x86中则不存在。
There is an addressing mode, which has no counterpart in 32 bit: Instruction pointer relative addressing. In 32 bit mode, this is only available with branches (aka branch offset), in 64 bit mode you can form effective addresses for any memory operand relative to the (r)ip.
So, the instruction
does exist in x86-64, while
does not in x86.
摘自英特尔架构软件开发人员手册,第 2C 卷附录 A(操作码映射):
表 A-1。操作码表中使用的上标
...
o64 指令仅在 64 位模式下可用
...
搜索表,以下指令与该上标一起出现:
第 5.16 节(64 位模式指令)列出了一些附加指令,它们是现有指令的变体:
From Intel's Architectures Software Developer's Manual, Volume 2C Appendix A (Opcode Map):
Table A-1. Superscripts Utilized in Opcode Tables
...
o64 Instruction is only available when in 64-bit mode
...
Searching the tables, the following instructions appear with that superscript:
A few additional instructions which are variants of existing ones are listed in section 5.16 (64-BIT MODE INSTRUCTIONS):
抛开现在在 64 位寄存器上运行的旧指令(它们确实是新指令,因为它们使用不同的二进制表示形式),我可以想到至少有两条仅 64 位的指令:
syscall
和sysret
指令。Setting aside old instructions that now operate on 64 bit registers (they are really new instructions as they use a distinct binary representation), I can think of at least two instructions that are 64-bit only:
syscall
andsysret
instructions.您可以随时查看不同的手册: http ://www.intel.com/products/processor/index.htm?iid=dev_center+tech_hw_design+prods+processors 查找此类说明。将会有很多艰苦的工作;)
You can always look into the different manuals at http://www.intel.com/products/processor/index.htm?iid=dev_center+tech_hw_design+prods+processors to find such instructions. Will be a lot of work tough ;)
相反的更容易想出;)比如 cmpxchg8b ....你永远不会在 64 位模式下使用它。
the opposite is much easier to come up with;) like cmpxchg8b .... you'd never use that one in 64-bit mode.
PUSHA 仅存在于 32 位模式下。 64位模式下不存在
PUSHA exists only in 32 bit mode. It doesnot exist in 64 bit mode