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
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!
Another issue with inline assembler is that (at least in the past) it completely kills optimization for the module in question.
"Another issue with inline assembler is that (at least in the past) it completely kills optimization for the module in question." Not anymore. See the last half of this thread: http://www.keil.com/forum/docs/thread1657.asp
View all questions in Keil forum