Home >Backend Development >C#.Net Tutorial >Can C language directly operate hardware?
# Can C language directly operate the hardware?
cannot.
First of all, C language cannot directly operate the hardware. Essentially, not even assembly language. Only machine language can directly operate hardware.
Secondly, C language must go through a series of compilation and conversion to operate the hardware. Eventually it will become the mechanical code of 0101. At this time, it is not a C language that we can understand at all.
Taking the GCC compiler as an example, this can be divided into four steps.
The first step is preprocessing, including grammar checking and other work. gcc -P abc.c The second step is to generate assembly language code from the source program. gcc -S abc.c will generate the abc.s file, which contains the assembly code. In the third step, the compiler generates object code, and one source file generates one object code. gcc -c abc.c will generate abc.o. The fourth step is that the connector generates an executable file from the target code. gcc abc.o
Finally, relatively speaking, C language is the language closest to the physical level among high-level languages. It is also called a low-level language within a high-level language. Because it is very close to the hardware in many aspects. A typical example is a pointer, which is a variable that directly operates memory through a physical address.
The above is the detailed content of Can C language directly operate hardware?. For more information, please follow other related articles on the PHP Chinese website!