Intermediate code is used to translate the source code into the machine code. Intermediate code lies between the high-level language and the machine language.
Fig: Position of intermediate code generator
Intermediate code can be represented in two ways:
1. High Level intermediate code:
High level intermediate code can be represented as source code. To enhance performance of source code, we can easily apply code modification. But to optimize the target machine, it is less preferred.
2. Low Level intermediate code
Low level intermediate code is close to the target machine, which makes it suitable for register and memory allocation etc. it is used for machine-dependent optimizations.