Open In App

Difference between Cross-Assembler and Compiler

1. Cross-Assembler :
A cross-assembler is an assembler that runs on a computer with one type of processor but generates machine code for a different type of processor. For example, if we use a PC with the 8086 compatible machine language to generate a machine code for the 8085 processor, we need a cross-assembler program that runs on the PC compatible machine but generates the machine code for 8085 mnemonics. It takes assembly language as input and give machine language as output.


Figure – Cross-Assembler



In the above block diagram, we can see that there is an assembler which is running on Machine B but converting assembly code of Machine A to machine code, this assembler is Cross-assembler.

Features of Cross-Assembler :



2. Compiler :
A compiler is a software (program) that translate source code from a high-level programming language to a machine level language. It is not as simple as assembler’s translation. It has to perform several steps to produce an object file in machine code form. The main job of the compiler is that it checks all kinds of limits, ranges, errors, etc. The process of converting high level language to machine language is known Compilation. If something is wrong in code, then it will give errors.


Figure – Compiler

Features of Compiler :

Difference between Cross-Assembler and Compiler :

S.No. CROSS-ASSEMBLER COMPILER
1 A cross-assembler is an assembler that runs on a computer with one type of processor but generates machine for different type of processor. Compiler is used to convert source code from High level language to machine level language.
2 Cross-assembler inputs assembly language code. Compiler input source code.
3 Cross-assembler can’t do this at once. Compiler can converts the whole code into machine language at a time.
4 Cross-assembler is less intelligent. It is more intelligent than cross-assemblers.
5 The output of cross-assembler is in binary code. The output of compiler is in machine code.
6 Cross-assembler can cooperate with two processor at a time. Whereas compiler works on one processor at a time.
7 The example of Cross-assembler is C 64. compiler examples are GCC, javac, MinGW etc.

Article Tags :