I am checking some terrible C source code; I haven't got any idea about how to maintain it or cooperate with it. But I found a very fundamental problem. It does NOT have a startup.asm; it has a startup.c using the powerful C extension "#pragma". So, the C runtime environment is setup by "#pragma section", "#pragma intvect", "#pragma asm". I quite worry about such a startup.c; so I contacted the FAE of our local distributor. The FAE is an experienced good engineer, but he told me that, this is not their standard way to setup C runtime environment; they definitely provided the startup.s from Day 1.
What will be the side-effect, when the C runtime environment is setup by the C extension "#pragma"?
"What will be the side-effect, when the C runtime environment is setup by the C extension "#pragma"?"
probably none.
as far as the mcu is concerned, it simply executes a series of commands sent to it. what generated those commands is irrelevant.
as to the wisdom of using .c start-up files, check the cmsis document and you will see that they plan to use .c start-up files later.
no, I wouldn't lose too much sleep over that.
CMSIS applies specifically to ARM Cortex-Mx, and one of the key goals of that architecture's design was to allow "all C" coding - in particular, witout requiring assembler startup code.
The 8051 is very different!
That's why I said early on that this can't be treated (just) as a generic topic - it does depend very much on the particular toolset!
the cmsis example is to show that there is nothing wrong with using .c start-up code.
and I am not sure why that wouldn't / couldn't be extended to cover the 8051.
View all questions in Keil forum