32位汇编指令的64位指令

发布于 2024-07-26 07:56:26 字数 404 浏览 2 评论 0原文

我开始将一个用 C 编写的程序移植到 64 位机器上,该程序有几段用汇编语言编写的代码,其中包含 32 位机器的指令(如 ljmp)。

是否有一个地方/文档包含 32 位机器及其对应的 64 位机器的汇编说明? 如果没有,我在哪里可以找到列出 32 位和 64 位机器的所有指令的文档?


很明显,我是这种情况的新手。 让我们澄清一些要点。

我正在移植一个早期的操作系统。 它是针对 x86 机器编写的。 现在,我希望它在 x86_64 上运行。

它是在 Linux 机器上编写的,考虑到了 UNIX。 我几乎可以肯定原作者是在 Intel 机器上编写的。 我也在使用 Intel,但我也想在 AMD 上运行操作系统。

使用的编译器是gcc。

I am beginning to port a program which is written in C and have several pieces of code written in assembly with instructions for a 32 bit machine - like ljmp - to a 64 bits machine.

Is there a place/document that have the instructions, in assembly, for a 32 bit machine and its counterpart for a 64 one? If not, where can I find a document that lists all the instructions for a 32 bit and a 64 bit machine?


As it's is pretty obvious, I am a newbie for the situation. Let's clarify some points.

I am porting a OS in its very early days. It was written with a x86 machine in mind. Now, I want it to run at a x86_64.

It is written in a Linux box with UNIX in mind. I am almost sure that the original author is writing it at a Intel machine. I am also on Intel but I would like to run the OS in AMD too.

The compiler used is gcc.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我做我的改变 2024-08-02 07:56:26

您没有提供任何背景信息,甚至没有提供 CPU 的类型,但我建议您也许应该以这个 64 位端口为契机,重新考虑是否使用汇编语言。 虽然它确实有其地位,但我建议用 C++ 重新编码该例程,并对编译器的优化输出进行基准测试,看看它是否真的更慢。 在很多情况下,情况并非如此。

You haven't offered any background, or even the type of CPU, but I'm going to suggest thay maybe you should take this 64-bit port as an opportunity to reconsider having used assembly language. While it certainly has its place, I would recommend recoding the routine in C++ and benchmarking the compiler's optimized output to see if it's really any slower. In many cases, it won't be.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文