Scanning

Parsing

Semantic Analysis

Optimization

Code Generation

Tradeoffs

Other System Software

Portability

Benchmarks

Validations

12.2.8 Portability

Compilers are such large programs that the ability to move a compiler from one machine to another is a definite asset. Some software companies build compilers for one or two languages and then stay in business by "porting" them to and marketing them for other machines.

In addition to other machines, sometimes a compiler is to be ported from one environment or operating system to another. As UNIX became more widely used, much software was "retargeted" for this environment.

The issues in retargeting are often code generation issues: different addressing modes, different operations, a different number of registers and run-time library all need to be addressed. Memory layout may be quite different. Object code formats are different for different machines.