Inline asm with gnu

Hi all,

I am recompiling QNX4.x sources for QNX RTP. So I must use the gnu gcc
compiler,
but in some c-files we use the Watcom Inline assambler via #pragma aux. What
must we change?
Where are the documentaion?

f.e.

unsigned char _rotrb(unsigned long, unsigned long);
#pragma aux _rotrb =
“ror al, cl”
parm [ EAX ] [ECX ]
modify [ ];


Can somebody help me with this example?

Thanks,

Hermann Leenings

Scheidt & Bachmann GmbH

Hermann Leenings <Leenings.Hermann@scheidt-bachmann.de> wrote:

Hi all,

I am recompiling QNX4.x sources for QNX RTP. So I must use the gnu gcc
compiler,
but in some c-files we use the Watcom Inline assambler via #pragma aux. What
must we change?
Where are the documentaion?

f.e.

unsigned char _rotrb(unsigned long, unsigned long);
#pragma aux _rotrb =
“ror al, cl”
parm [ EAX ] [ECX ]
modify [ ];

Checkout the section on inline assembly in the GCC docs,
especially

http://gcc.gnu.org/onlinedocs/gcc_4.html#SEC98

Also check out some of the x86/*.h headers, which have quite
a bit of inline assembly.


cburgess@qnx.com

Previously, Hermann Leenings wrote in comp.os.qnx:

Hi all,

I am recompiling QNX4.x sources for QNX RTP. So I must use the gnu gcc
compiler,
but in some c-files we use the Watcom Inline assambler via #pragma aux. What
must we change?
Where are the documentaion?

Look in /usr/local/info, I think you have all the docs, but no way to
read them, you’d need the utility “info” to read them. Oh well.

Search on the net for the gcc manual, it describes in detail the gcc
syntax for inline assembler, www.gnu.org would be a good start.

One example I know of is in the source for the random number generator
I ported to QNX4 and Nto, it may help if you have a good idea of what
you’re doing, because the same thing is done with gcc under Nto and
Watcom under QNX4. See www.emyr.net/Sam/mail.html, and download the
devrand driver.

Sam

f.e.

unsigned char _rotrb(unsigned long, unsigned long);
#pragma aux _rotrb =
“ror al, cl”
parm [ EAX ] [ECX ]
modify [ ];


Can somebody help me with this example?

Thanks,

Hermann Leenings

Scheidt & Bachmann GmbH

\


Sam Roberts (sam@cogent.ca), Cogent Real-Time Systems (www.cogent.ca)