How can I inline asm codes into C or C++ codes under QNX4.25

Hi, everybody!

How can I inline asm codes into C or C++ codes under QNX4.25 ?

Can someone help me? Thanks a lot!

I presume you are not talking about arm assembly language since there is no support for anything but x86 in QNX4. Can you explain what you mean by “inline arm codes”?


Maybe its a typo and cqjwl meant "asminstead of arm.

For some tibits of asm; look into /usr/include/sys/inline.h for some example. Watcom documentation includes all the info you need. Inline assembly under Watcom 10.6 is primitive compare to today’s compiler.

If the asm code is rather large, you’d better write a .asm module and let the watcom assembler deal with it.

So sorry, I spell mistake.What I mean is asm.

Yes, I want to inline x86 assembly language.

So thanks to all of you!

Ha ha, after 10 years, I dig this thread :smiley:

I have a problem with my code, need inline assembly on a C program, build with Watcom 10.6 on QNX4.
After a long time have been searching on WWW, I found this work fine. I post them here for someone else (or for me later :smiley:)

OS: QNX4.25 with Watcom C Compiler 10.6
Filename: test.c
Make: cc test.c -o test
Code: Cong Ca Chon

#include <stdio.h>
void int10(void);
int Cong(int a, int b);

#pragma aux int10 =
" mov ax, 13h "
" int 10h "
modify [ax];

#pragma aux Cong parm [eax] [ebx] =
" add eax, ebx "
value [eax]
modify [eax ebx];

int main()
printf(“Inline assembly demo\n”);
printf("%d+%d=%d", 5,10,Cong(5,10));
return 0;