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

Combining C & Assembly

Can anybody tell me how to combine both C and assembly in Uvision 3?
I know something like we have to use SRC directive,asm and endasm for assembly. Suppose i want to perform some addition operation in assembly and i want to print the result using printf statement in C.How to get the register values to C variables?

Parents Reply Children
  • //C style code
    #pragma asm
    ;
    ;assembly code
    ;
    #pragma endasm
    //c style code
    That would be Inline Assembler in a 'C' source file.

    It's almost always better to have separate 'C' and assembler source files, and do the 'C' stuff properly in 'C', and the assembler stuff properly in assembler.