answersLogoWhite

0

Assembler- A computer program that takes computer instructions and converts them into a pattern of bits that the computer can understand and perform by it certain operations.

Compiler- program that processes statements written in a programming language and turns them into machine language that a computer's processor uses. this program get the syntax error in the written program

Conceptually speaking, both an assembler and a compiler do exactly the same thing: they take as input some language that is human-understandable, and translate that directly into machine code instructions that the computer can execute.

However, in common usage, an "assembler" refers specifically to a such a program that takes as its input assembly language. Assembly language is a very "low-level" programming language, where short acronyms as used to represent machine instructions. Thus, assembly language very, very closely mirrors the actual machine code being executed, and (realistically) is only very mildly "human readable". Assemblers do little more than directly translate the assembly source code into machine code - that is, they don't do optimization of their own, as assembly language is meant as a direct representation of the machine code, and thus no optimization is required (or, desired).

A "compiler" generally refers to any other instance of this concept, but usually means something that take a "higher-level language" (i.e. anything above assembly language) and translates that to machine code. Compilers generally need to be significantly "smarter" than an assembler, as the compiler does a whole lot more work, and thus, has the opportunity to make significantly optimizations when doing the source->machine code translation. That is, high-level languages allow for the expression of concepts of ideas, which make them ideal for humans to write programs in. The compiler must be sophisticated enough to take these ideas and convert them into concrete machine code instructions. In addition, better compilers notice places where shortcuts can be taken (optimizations) given the overall structure of the input source code.

User Avatar

Wiki User

13y ago

Still curious? Ask our experts.

Chat with our AI personalities

JordanJordan
Looking for a career mentor? I've seen my fair share of shake-ups.
Chat with Jordan
BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake
ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi
More answers

An Assembler converts Assembly instructions into executable machine language. A Compiler converts higher level programming language instructions into Assembly instructions, and then those are turned into executable machine language. Most Compilers allow generation of "object" code, which is the Assembly instruction set generated by the Compiler. Some older Compilers allow for the Assembly instructions to be fine tuned by the programmer. Compiled programming languages typically generate many lines of Assembly instructions for each program statement. Some programming languages, such as ANSI C, are very close to Assembly, while others such as Java, result in many Assembly instructions per program statement. Most Compilers are highly optimized and it would be difficult for a human programmer to improve the efficiency of the output. Assembly level instructions are very difficult for someone not trained on Assembly to read and comprehend.
: compiler is a system software which translates high level language into machine language all in one line of source program is treated as input and accessed on turn into machine language during which errors are encountered the entire program is error free it will be compiled and machine code will be generated. e.g.c++,java,c language. : Assembler is also a system software used to convert an assembly language program into machine language.e.g. T A S M (Turbo Assembler Software), A S M( Microsoft Assembler Software)

User Avatar

Wiki User

7y ago
User Avatar

A disassembler reverts the process of an assembler: while an assembler translates assembly language source code into machine code, a disassembler reads machine code and generates the corresponding assembly language source code.

This is possible because assembly languages, unlike higher level languages, have a one-to-one relationship between assembly language instructions and machine code instructions. However, the disassembler's process is not perfect. Details such as names of functions and procedures, comments or visible grouping of code into distinct functions are generally lost.

User Avatar

Wiki User

12y ago
User Avatar

A compiler takes a text file written in a programming language, and converts it intobinary code that a processor can understand: it makes an ".exe" file. You compile only once, then always run the "exe" file.

Borland Turbo C is a compiler: you write in C in a text file, then you compile to get and exe file.

An interpreter does the same, BUT in real time: each time you run the code, it is "compiled", line by line: Basic is an interpreter.

An assembler is similar, in the way that, instead of taking a plain text file, ie in C, it takes a code written in Assembler Mnemonics, and convert it into binaries.

All "executable" files are in binaries (just 1's and 0's) - maybe viewed in hex (0x12de...)

User Avatar

Wiki User

12y ago
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between assembler and compiler?
Write your answer...
Submit
Still have questions?
magnify glass
imp