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 insert asm code in c file?

How to insert asm code in c file.
I don't want to generate asm file
and not to call asm function.

example :

void f1(void)
{
...
...
nop <----- put asm code here
...
}

how to write in Keil C compile ?

Parents
  • If code size is really that tight, maybe you should just do the lot in assembler?

    But have you tried doing it all in 'C', with maximum compiler optimisations for Code Size?

    Rather than just try to implement ADDC in 'C', I think you'd be better to implement a 3-byte Add; you could implement it in assembler & call it from 'C'.

    "HLL" = High-Level Language - C, Pascal, etc;
    "LLL" = Low-Level Language - assembler
    "nGL" = nth-Generation Language

Reply
  • If code size is really that tight, maybe you should just do the lot in assembler?

    But have you tried doing it all in 'C', with maximum compiler optimisations for Code Size?

    Rather than just try to implement ADDC in 'C', I think you'd be better to implement a 3-byte Add; you could implement it in assembler & call it from 'C'.

    "HLL" = High-Level Language - C, Pascal, etc;
    "LLL" = Low-Level Language - assembler
    "nGL" = nth-Generation Language

Children
No data