x86 指令集路线图
经过长时间的高级编程,我才接触到 x86 指令集的表面。大约 20 年前,我第一次阅读 x86 汇编编程,通过谷歌搜索,我迷失在无数的指令集参考中;从混合新一代处理器(286、386、486...)到添加更新的 x86 指令的其他处理器。更不用说 AMD 的变种了。
由于我计划构建一个引导加载程序,我的第一个想法是完全符合“标准 x86”,但我无法弄清楚它在哪里,或者即使它存在于任何地方。
甚至英特尔文档似乎也遵循相同的路径,就像另一位文档所说的那样,“我们需要 x86 指令集标准化,操作码的演变是混乱的”。
高举标准化大旗不是我的想法。我只想看看路,了解哪里是安全的步行地点。如果有人可以帮助我,我将非常感激!
I'm just touching the surface of the x86 instruction set after a long period of high level programming. It's been about 20 years I had my first read on x86 assembly programming and from my googlings I get just lost with the myriad of instruction set references; from ones that mix new generations of processors (286, 386, 486...) to others that add newer x86 instructions. Not to mention the AMD variations.
Since I'm planning on building a boot loader, my first thought was to be fully compliant with 'standard x86' but I can't figure out where in time it is or even if it exists anywhere.
Even Intel documentation seems follow the same path and like another one said, 'we need a x86 instruction set standardisation, the evolution of opcodes is chaotic'.
It's not my idea to hold the standardization banner. I just want to see the road and understand where is the safe place to walk. If anyone could help I'd appreciate a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从历史上看,x86 一直非常向后兼容。 x86-64 已经抛弃了一些非常旧的指令(例如 BCD 指令),但此类更改不太可能再次发生(至少在 64 位地址空间转换等重大事件发生之前不会发生)。
如果您想确保您的代码几乎可以在所有 x86 处理器上运行,请坚持使用 386 指令集(如果您的代码是 32 位)或早期的 x86-64 指令集(如果它是 64 位)。
Historically, x86 has been very backward compatible. x86-64 has thrown away some very old instructions (like BCD instructions) but it's unlikely that these kind of changes are going to happen again (at least not until something huge as 64 bit address space transition happens).
If you want to ensure your code works on virtually all x86 processors out there, stick to the 386 instruction set (if your code is 32-bit) or early x86-64 instruction set (if it's 64-bit).
引导加载程序以 16 位实模式执行(尽管您可以通过操作数大小前缀访问 32 位寄存器)。获取 386 指令参考,您就安全了。
Boot loader executes in 16-bit real mode (although you do have access to 32-bit registers via the operand size prefix). Get a 386 instruction reference, and you'll be safe.