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

How to write few asembly lines, during C programming for 89C52

I want to write few assembly instructions during I'm writting a C code for my 89C52 microcontroller. Do you know How? I don't want write another asm file and link it to my C file.
thanx

Parents
  • It's all described in the Manual:
    look-up the SRC, ASM, and ENDASM directives.

    Note that this will cause your entire 'C' file to be converted to assembler, and you must then pass this to the assembler to generate the object. This means that
    1. You lose the 'C'-level source debugging & browsing;
    2. 'C' files with the SRC option are re-translated every time you build the project - whether the source has changed or not!

    Therefore it's usually best to isolate your inline assembler into a very small file - or actually have a separate assembler module!

Reply
  • It's all described in the Manual:
    look-up the SRC, ASM, and ENDASM directives.

    Note that this will cause your entire 'C' file to be converted to assembler, and you must then pass this to the assembler to generate the object. This means that
    1. You lose the 'C'-level source debugging & browsing;
    2. 'C' files with the SRC option are re-translated every time you build the project - whether the source has changed or not!

    Therefore it's usually best to isolate your inline assembler into a very small file - or actually have a separate assembler module!

Children