??? 01/08/07 18:18 Modified: 01/08/07 18:20 Read: times |
#130447 - there is NO WAY you can do that. C does not, in a Responding to: ???'s previous message |
The reason why am I doing such a craziness is because I want that the source code can be compiled by both Keil and SDCC.
why on earth? If it works with tools you have (whatever they may be) why do you worry about using other tools? Yes, C does supposedly make portable code, but there is no place in the C specification that states that 'portable' means "run in the same time with different compilers" The mentioned code piece is time critical (that's why It was written in assembler) so I have to be SURE that the C compiled code has the same efficienty as the assembler one. there is NO WAY you can do that. C does not, in any way, state that the generated code has to run in the same time, just with the same result. There has even been posts that a compiler generate different code when 'unrelated' changes were made. Another issue is that "both Keil and SDCC" even if you succeed, may not be true when nest revision of either coems out. Keil uses it special function called ?C?LLDPTR to transform the return values. But I have no access to this function source code. step through it in the debugger. My question is: How can I be sure that the function ?C?LLDPTR does not take more time as the MOV's R7-R4 in my assembler version? You can't. even if it does, it may be different in the next version. Erik |