The process of converting program code into machine language is called "compiling" or "assembling" (depending on the context).
- Compiling: usually refers to the process of converting source code written in a high-level programming language (such as C, C++, Java, etc.) into machine language (i.e., target code).
This conversion process is completed by the compiler, which performs steps such as lexical analysis, syntax analysis, semantic analysis, intermediate code generation, code optimization, and final target code generation.
- Assembly: refers to the process of converting code written in assembly language into machine language.
Assembly language is a low-level language whose code is very close to machine language, but easier for humans to read and write than machine language.
The assembler is responsible for converting assembly language code into machine language code.
In most cases, when people refer to converting program code into machine language, they are more likely to refer to the "compiling" process, because relatively few codes are written directly in assembly language in modern programming.
However, assembly language still has important application value in some specific fields (such as embedded systems, operating system development, etc.) or scenarios that require highly optimized performance.