Is there any special C standard for microcontrollers?
No, there is an ISO C standard. Since many small devices have special architecture features that need to be supported, many compilers support language extensions. For example, since the 8051 has an address RAM bit, the _bit data type may be provided. It also has a Harvard architecture , so keywords are provided to indicate different memory address spaces that a single address does not allow, since addressing requires different instructions for these spaces. Such extensions will be clearly indicated in the compiler documentation. Moreover, extensions in the corresponding compiler must have an underscore prefix. However, many of them provide unvarnished aliases for backward compatibility, and their use should be deprecated.
... when I programmed something under Windows, it doesn't matter which compiler I used.
Since the Windows API standard is standardized (Microsoft), and it only works on x86, so there are no architectural changes. However, you can still see the FAR and NEAR macros in the API, and this is a return to the 16-bit x86 with its segmented addressing, which also required processing compiler extensions.
... that even he is still C in his fundamentals, for example, in loops, creating variables, etc.,
I'm not sure what that means. A typical microcontroller application does not have an OS or a simple core, you should expect much more bare metal or a system level because there are no extensive OS interfaces and device driver interfaces to do a lot of work under the hood for you. All of these library calls are just that; they are not part of the language; it is the same C language; jut is put on a different job.
... there is some type of syntax that I have never seen in C for desktops.
For example...?
And besides, the syntax changes from version to version.
I doubt. Again; eg...?
I use the AVR-GCC compiler, and in previous versions you used the function for input-output ports, now you can treat the port as a variable in the new version.
It does not depend on changes in the language or the compiler, but rather, simple "preprocessing magic." In AVR, all I / O operations are mapped to memory, so if, for example, you include the device support header, it may have an announcement, for example:
#define PORTA (*((volatile char*)0x0100))
Then you can write:
PORTA = 0xFF;
To write 0xFF to memory, a register is displayed at address 0x100. You can just take a look at the header file and see how it does it.
The GCC documentation describes specific concrete options; AVR is specifically addressed here in section 6.36.8, and in 3.17. 3 . If you compare this to other goals supported by GCC, it has very few extensions, perhaps because the architecture and AVR suite were specifically designed for a clean and efficient implementation of the C compiler without extensions.
What determines what functions and how to implement them in the compiler, and yet call it C?
It is important to understand that the C programming language is a separate object from its libraries, and the functions provided by the libraries are no different from those that you can write yourself - they are not part of the language - so it can be C without any library . Ultimately, library functions are written using the same basic language elements. You cannot expect that the level of abstraction is present, say, in the Win32 API, which exists in the library intended for the microcontroller. In most cases, you can expect at least a subset of the C standard library , as it was designed as a system-level library with a small dependency target equipment.
I have written C and C ++ for embedded and desktop systems for many years and do not recognize the huge differences that you seem to perceive, so you can only assume that they are the result of a misunderstanding of what the C language is. The following books may help.