This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I have a problem. How to extrn asm in C inline asm.

I want to extrn a function in asm in C.
example:
_asm
{
extrn test:near
call test
}
like the example:
but I have a exception like that:

inline syntax error in 'opcode'; found 'test'

Parents
  • Hi,

    I don't see why you want to do this.
    You can do it in C:

    extern void test(void);  // before your main function
    ...
    test();   // in the middle of some code.
    
    And they are not supposed to be located at the same place. It never happens in ASM as well.

    BTW, you didn't mention your toolset, If you are using C51, you need #pragma asm / endasm.

    Frank

Reply
  • Hi,

    I don't see why you want to do this.
    You can do it in C:

    extern void test(void);  // before your main function
    ...
    test();   // in the middle of some code.
    
    And they are not supposed to be located at the same place. It never happens in ASM as well.

    BTW, you didn't mention your toolset, If you are using C51, you need #pragma asm / endasm.

    Frank

Children