跳进指令的中间 - 在IA-32 [英] Jump into the middle of instruction - in IA-32

查看:137
本文介绍了跳进指令的中间 - 在IA-32的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么IA-32让我们跳进指令的中间?

Why IA-32 enable us to jump into the middle of instruction?

我怎么可以使用这个优化建筑学的特点,当我在汇编正在写? (明显的情况下,我们身边要保存命令的寄存器里面的编码和随后激活此命令)?

how can I use this architectonic characteristic for optimization when I'm writing in Assembler? (beside the obvious of cases we like to save command's encoding inside register and afterward activate this command) ?

推荐答案

IA-32能够跳跃到一个指令的中间由于历史的原因。 x86指令集是在由8080的predecessor到第一个86使用的指令集连续层的结果 - 这把我们带回到70年代末。在那个时候,RAM是非常昂贵的,这是值得的具有尽可能短的说明,即使这意味着所有的指令不具有相同的长度。现在,在IA-32指令长度可以是1个字节和12个以上的字节之间的任何地方。这意味着,任何地址可以潜在地是一个指令(没有对齐要求),但是许多地址指向某些字节在指令中间的开始。跳进一个指令的中间命令CPU reinter $ P $角开始的跳转目标字节机器code字节,产生相当不同的指示。

IA-32 enable jumping into the middle of an instruction due to historical reasons. The x86 instruction set is the result of successive layers over the instruction set used by the 8080, the predecessor to the first "x86" -- which brings us back to the late 70s'. At that time, RAM was very expensive, and it was worthwhile to have instructions as short as possible, even if this implied that all instructions do not have the same length. Right now, an IA-32 instruction length can be anywhere between 1 byte and more than 12 bytes. This implies that any address can potentially be the start of an instruction (no alignment requirement) but many addresses point to some byte in the middle of an instruction. Jumping into the middle of an instruction instructs the CPU to reinterpret the machine code bytes starting with the jump target byte, resulting in quite different instructions.

有关优化,使用正确的方式跳进中间的特点是的不可以使用它。该CPU去codeS通过内部转换它变成一个更正规结构的微指令序列的指令流,并且可以工作在该加快速度(并行执行,推测转移跟随,等等)。中间跳跃可以肆虐到这些优化。

For optimization, the proper way to use the "jump into the middle" feature is to not use it. The CPU decodes the instruction stream by converting it internally into a sequence of micro-instructions with a much more regular structure, and works over that to speed things up (parallel execution, speculative branch follow, and so on). Middle-jumping can wreak havoc into these optimizations.

这篇关于跳进指令的中间 - 在IA-32的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆