What is the purpose of intermediate code generation in a compiler?

What is the purpose of intermediate code generation in a compiler?

کمپائلر میں انٹرمیڈیٹ کوڈ جنریشن کا مقصد کیا ہے؟
Explanation
  • Intermediate code allows portability across different hardware platforms.
  • It serves as a bridge between high-level language and machine code generation.