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.
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 :
- Cross-assembler is used to convert assembly language into binary machine code.
- Cross-assemblers are also used to develop program which will run on game console and other small electronic system which are not able to run development environment on their own.
- Cross-assembler can be used to give speed development on low powered system.
- C 64 is the best example 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.
Features of Compiler :
- After executing program, the first task of compiler is to create .obj file and then .exe file.
- Compiler manages the storage of code and variable.
- Compiler is responsible for correctness of code and highlights the errors.
- Compiler is more intelligent then cross-assembler.
- MinGW, javac are the examples of compiler.
Difference between Cross-Assembler and 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.|
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Difference between Native compiler and Cross compiler
- Difference between Compiler and Interpreter
- Difference between Compiler and Assembler
- Compiler Theory | Set 1
- Compiler Theory | Set 2
- Phases of a Compiler
- Why FIRST and FOLLOW in Compiler Design?
- Symbol Table in Compiler
- Three address code in Compiler
- Compiler construction tools
- Bootstrapping in Compiler Design
- Introduction of Compiler Design
- Input Buffering in Compiler Design
- Peephole Optimization in Compiler Design
- Error Handling in Compiler Design
- Shift Reduce Parser in Compiler
- Loop Optimization in Compiler Design
- Data flow analysis in Compiler
- Code Optimization in Compiler Design
- Types of Parsers in Compiler Design
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.