Hi, I have a problem. I want to insert assembler code into C rutine in IAR compiler. I prove with #asm and #noasm but no function. How do I do? Help me Ariel

Assembler code into C rutine in IAR software
Started by ●January 27, 2004
Reply by ●January 27, 20042004-01-27
"vazquez_ari" <avazquez@avaz...> writes:
> Hi,
> I have a problem.
>
> I want to insert assembler code into C rutine in IAR compiler.
> I prove with #asm and #noasm but no function.
>
> How do I do?
>
> Help me
You can do one of two things:
1) Use inline assembler, for example:
void test()
{
asm("nop");
asm("nop");
asm("nop");
}
Or, even better, write your routine in assembler and call it from C.
There is an entire chapter in the manual that covers this.
-- Anders Lindgren, IAR Systems
--
Disclaimer: Opinions expressed in this posting are strictly my own and
not necessarily those of my employer.
Reply by ●January 27, 20042004-01-27
You can use the _OPC() instruction to insert op codes directly to memory. Search for this instruction in the help of IAR. To quickly know the instruction opcodes use the debug mode and watch the program listing in assembler wich will put line in C and assembler the next and so on. Good luck! --- vazquez_ari <avazquez@avaz...> escribi --------------------------------- Hi, I have a problem. I want to insert assembler code into C rutine in IAR compiler. I prove with #asm and #noasm but no function. How do I do? Help me Ariel . --------------------------------- . ------------ Los mejores usados y las m tentadoras ofertas de 0km est en Yahoo! Autos. Compro vendtu auto en http://autos.yahoo.com.ar
