-1

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.

j0k
  • 22,600
  • 28
  • 79
  • 90
EMBT
  • 37
  • 1
  • 2
  • RISC is not an architecture, but a broad term to describe one. Please be more specific about the Chip you are targeting. – Axel Gneiting Mar 14 '11 at 01:04
  • Please STOP SHOUTING. Your Caps Lock key must have stuck while typing the subject line. – Ken White Mar 14 '11 at 01:15
  • @Axel He's talking about HP's [PA-RISC](http://en.wikipedia.org/wiki/PA-RISC) architecture, the predecessor of Itanium. – zwol Mar 14 '11 at 22:27

2 Answers2

2

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.

pmg
  • 106,608
  • 13
  • 126
  • 198
2

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.)

sarnold
  • 102,305
  • 22
  • 181
  • 238