为什么 MSVC 不支持 AMD64 和 Itanium 目标的内联汇编?
昨天我了解到,在针对 AMD64 和 Itanium 目标进行编译时,Microsoft Visual C++ 不支持内联汇编(使用 __asm 关键字)。
这是正确的吗?如果是这样,有谁知道为什么他们不支持这些目标的内联汇编?这似乎是一个相当大的功能,只是删除......
Yesterday I learned that inline assembly (with the __asm keyword) is not supported under Microsoft Visual C++ when compiling for AMD64 and Itanium targets.
Is that correct? And if so, does anyone know why they would not support inline assembly for those targets? It seems like a rather big feature to just drop...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正确,VS 2010 Beta 1< 中仍然不支持它/a>.我的猜测是内联汇编太难实现:微软实现它的方式是与周围的 C 代码集成,以便数据可以流入和流出 C 代码,并自动注入适当的粘合代码。为此,C 编译器实际上需要理解汇编代码;他们只是还没有为 AMD64 和 Itanium 实现这一点。
Correct, it still isn't supported in VS 2010 Beta 1. My guess is that inline assembly is just too difficult to implement: the way Microsoft implemented it, it integrates with the surrounding C code so that data can flow in and out of the C code, and appropriate glue code is automatically injected. For that, the C compiler actually needs to understand the assembler code; they just haven't implemented that for AMD64 and Itanium.
只要遵循 C 约定,调用用汇编程序编写的函数非常容易。 本教程解释了如何操作。
It's quite easy to call a function written with an assembler, as long as you follow C conventions. This tutorial explains how.