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 ?
Keil C51 cannot generate a .obj from a source file containing inline assembler; instead, C51 generate a .src which you must then pass to the assembler (A51) to generate the .obj. That's the way Keil does it (they're not alone in choosing that method). In uVision, you need to check both the 'Generate Assembler SRC file' and the 'Assemble SRC File' options for the .c file in question (on the 'C51' tab). Is there c code to implement ADDC command? why would you want to do that!? Surely the whole point of using a HLL like 'C' is that you don't need to worry about that sort of thing? Can't you just use an int instead of a char?
Is there c code to implement ADDC command? why would you want to do that!? Surely the whole point of using a HLL like 'C' is that you don't need to worry about that sort of thing? Can't you just use an int instead of a char? Because I need to reduce code size, and some data type is 3 bytes. "using a HLL like 'C' ...." What's that mean?
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