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

inserting assembly code in c language code

Hi
is there any way that i could insert some lines of assembly code in my code which was written in keil( C language).
please tell

Parents
  • Mudassir,

    When you tell uVision to have the compiler generate ASM and then assemble them, some of the things it would automatically do for you don't happen. The upshot of it is this: You must manually copy and add the file INIT.A51 that is included with Keil's package to your project. Then things will compile correctly for you.

Reply
  • Mudassir,

    When you tell uVision to have the compiler generate ASM and then assemble them, some of the things it would automatically do for you don't happen. The upshot of it is this: You must manually copy and add the file INIT.A51 that is included with Keil's package to your project. Then things will compile correctly for you.

Children
  • thanks for replying

    but it could not resolve my problem that warning still occurs, i have added init.a51 to my project and copied it to the project folder.
    please tell me some other way to tackle with this problem.

  • Mudassir,

    Did you add STARTUP.A51 as well? I'm unable to reproduce the problem you're having. I can create a new project with only a main() function, set the options mentioned above, and then use pragma asm/endasm to insert some assembly statements. Mine gave the same warning, but when I added INIT.A51 (in addition to the already included STARTUP.A51), everything compiled fine.