使用 HP CC 编译器的 PA-RISC 内联汇编
我需要将一些用 GCC 编译器和内联汇编编写的代码移植到其 HP Unix 等效项。情况是HP CC编译器不支持_asm关键字,当然语法完全不同。我已经在互联网上查找了好几天,但没有找到太多信息。我得到的最多的是有关头文件 inline.h 的一些信息,其中包含一些宏的所有定义,据我所知,这些宏相当于某种汇编函数。
我还没有找到任何可以指导我的例子。我找到的所有 HP 文档都是关于 Itanium 汇编语言的,它是与 PA-RISC 完全不同的体系结构。
有人可以向我指出一些有关使用 HP CC 编译器进行 PA-RISC 内联汇编的在线资源吗?或者至少举一些例子。
I need to port some code written with a GCC compiler and inline assembly to its HP Unix equivalent. The situation is that HP CC compiler does not support the _asm keyword and of course the syntax is completely different. I have been looking on the internet for days but I have not found much information. The most I got is some information about the header file inline.h which has all the definitions of some macros that, as I understand, are equivalent to some kind of assembly functions.
I have not found any example that can guide me. All the HP documentation I have found is about Itanium assembly language, which is a completely different architecture from PA-RISC.
Can someone please point me to some online resources about PA-RISC inline assembly with the HP CC compiler? Or at least some examples.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的计算机讲西班牙语(RISC 汇编)。
有人为中文计算机编写了中文指令。
您需要将中文翻译成西班牙语。
尽管有例子,但不懂两种语言使它成为一项不可能的工作。
建议:请原程序员用纯 C 语言重写代码。
Your computer speaks Spanish (RISC Assembly).
Somebody wrote instructions in Chinese for a Chinese speaking computer.
You need to translate from Chinese to Spanish.
Not knowing both languages makes it an impossible job, examples notwithstanding.
Suggestion: ask the original programmer to rewrite the code in plain C.
作为以不同汇编器格式重写程序集的替代方法,您可以使用 gcc 在你的hpux上。
当然,如果程序集是为不同的处理器编写的,那么您必须遵循@pmg 的建议并要求通用的 C 版本。 (这就是 C 如此流行的原因之一!一旦为目标平台编写了编译器代码生成器,它就可以在多种体系结构上工作!哇。)
As an alternative to rewriting the assembly in a different assembler format, you could use gcc on your hpux.
Of course, if the assembly was written for a different processor, then you'll have to follow @pmg's advice and ask for a generic C version. (Which is one of the reasons why C became so popular! It worked on multiple architectures once a compiler code generator was written for the target platform! Woot.)