[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Implement own Pragma ?
From: |
Jan van Mastbergen |
Subject: |
Re: Implement own Pragma ? |
Date: |
Thu, 18 Nov 2004 21:14:51 +0100 |
Ehh, no direct experience here but you seem to be looking for inline
assembly using the asm keyword, not a pragma. Should look something like
this:
extern function_name(); // Your assembly routine
void caller()
{
asm {
push arg /* prepare call stack */
call function_name; /* call routine */
pop /* cleanup if your routine
doesn't */
}
}
Hth, Jan
"Che" <che@linuxmail.org> wrote in message
a6555781.0411172130.4c5c338@posting.google.com">news:a6555781.0411172130.4c5c338@posting.google.com...
> Hi,
>
> I am unsure of this message should be posted here. If not please let
> me know the appropriate group.
>
> I was wondering how i could implement my own pragma in g++/gcc.
> Say #pragma to_asm_code {function_name}
> {function_name} is an assembly routine. I believe some compilers
> provide this feature by mechanism of "FastCall". I don't want anything
> complicated. All I wish to do is the language must recognize this as a
> pragma, push the return address and transfer control to the assembly
> routine.
>
> Thanks,
> Che