What is difference between compiler and cross-compiler?


Compiler vs. Cross Compiler

The main difference between a compiler and a cross compiler is that a compiler transforms a computer program written in a high-level programming language into machine language, while a cross compiler can create executable code for a platform different from the one on which it is running.

What is a Cross Compiler?

A cross compiler is a compiler capable of creating executable code for a platform other than the one on which it is running. For example, a compiler running on a PC but generating code for an Android smartphone is a cross compiler.

Types of Compilers

Broadly, there are three types of compilers:

  1. Single Pass Compilers
  2. Two Pass Compilers
  3. Multi-Pass Compilers

Three Address Code

Three address code is a type of intermediate code that uses at most three addresses and one operator to represent an expression. It is easy to generate and can be easily converted to machine code. Each instruction computes a value stored in a temporary variable generated by the compiler.

Lascia un commento