| re: Implement a Pragma.
Che wrote:
[color=blue]
> 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.
> 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[/color]
in this specific case you can just declare the function and call it, e.g.:
extern "C" void function_name() ;
then
function_name() to call it.
And that should do exactly what you need although you may have to add an
'_' character to the name in your assembly code.
the 'fastcall' pragma is I think a watcom C/C++ thing, what it means is
pass the arguments in registers instead of pushing them on the stack. It
doesn't do anything if you don't have arguments.
David |