0 like 0 dislike
18 views
in Computer Science by (1.0m points)
What is the difference between compiler and assembler?

1 Answer

0 like 0 dislike
by (1.0m points)
Assembler vs Compiler

In general, compiler is a computer program that reads a program written in one language, which is called the source language, and translates it in to another language, which is called the target language. Traditionally, source language was a high level language such as C++ and target language was a low level language such as Assembly language. However, there are compilers that can convert a source program written in Assembly language and convert it to machine code or object code. Assemblers are such tools. So, both assemblers and compilers ultimately produce code that can be directly executed on a machine.

Compiler is a computer program that reads a program written in one language, which is called the source language, and translates it in to another language, which is called the target language. Most often, the source language is a high level language and the target language is a low level language. So, in general compilers can be seen as translators that translate from one language to another. In addition, compilers perform some optimizations to the code. A typical compiler is made up of several main components. The first component is the scanner (also known as the lexical analyzer). Scanner reads the program and converts it to a string of tokens. The second component is the parser. It converts the string of tokens in to a parse tree (or an abstract syntax tree), which captures the syntactic structure of the program. Next component is the semantic routines that interpret the semantics of the syntactic structure. The code optimizations and final code generation follow this.

Related questions

0 like 0 dislike
1 answer 62 views
0 like 0 dislike
1 answer 23 views
0 like 0 dislike
0 answers 39 views
asked Feb 9, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 41 views
0 like 0 dislike
1 answer 56 views
0 like 0 dislike
1 answer 30 views
0 like 0 dislike
1 answer 20 views
0 like 0 dislike
0 answers 32 views
0 like 0 dislike
1 answer 24 views
0 like 0 dislike
1 answer 49 views
Welcome to Free Homework Help, where you can ask questions and receive answers from other members of the community. Anybody can ask a question. Anybody can answer. The best answers are voted up and rise to the top. Join them; it only takes a minute: School, College, University, Academy Free Homework Help

19.4k questions

18.3k answers

8.7k comments

3.3k users

Free Hit Counters
...