Is compiler C compiling into a general assembly?

I participate in the Computer Organization class, and we program the material in the assembly. However, since this is a class, I do not understand the wider meaning or use in the real world. We use the assembly language Altera Nios II. The professor did not tell us anything about which assembly languages ​​are used in the current production, and what semantics are, or how C code is compiled for ALL assembler languages.

Following this short introduction, can I proceed from the assumption that there are several assembler languages ​​with which C code is compiled? If so, what does he do to reach all of these assembly languages ​​- parse it into a common assembly language and then translate it from there? Or is there a separate process for each assembler language?

+5
source share
2 answers

There is no need to compile C for any specific assemblies or any assembly in general, they are left to the compiler developer, and are not part of the language specification. Typically, each CPU manufacturer will develop a C compiler to target its specific architecture.

There are more general compilers, such as GCC and Clang, although they can target many different sets of instructions.

Clang , , " " , LLVM IR. , LLVM LLVM IR , , , LLVM IR, , LLVM.

, , , . back-end, (, , , ).

GCC, , , . , GCC-, LLVM.

+6

C , (). .

, C- (, C, ), . C ( ) x86 () MIPS PPC.

+2

All Articles