First time here? Checkout the FAQ!
0 votes
asked in Compiler Design by (21 points) 1 | 55 views

Here is a concise and explanatory definition of what is a compiler.

1 Answer

+3 votes
Best answer
You write a C program to add two input numbers. Compile it and run - get the sum.

Now compiler comes in between here. What it does?

We are writing C code as per C syntax in English language. But the computer has a processor inside it where it takes instructions in machine language and the instructions should be of the form prescribed by the processor maker (Intel for example). These will be like

"MOV A, B;

So, the compiler does this job. It converts the source program written by a programmer in a high level language like C to the language the processor can understand- often called object file.

In the above example I used A and B which can be registers- which are memory locations fixed inside CPU. But these registers are limited and when we need more memory (say finding the sum of 100 elements) we use main memory (RAM) and then the address is used in then instruction - like 0x40000321  (of course converted to binary) instead of A. Then the CPU will call its address handler - in a VM system this will be converted to a physical address, and that returns/stores the content from/to that address. For this reason we study CO&A.
answered by Veteran (319k points) 577 1442 2960
selected by

Related questions

+1 vote
0 answers
0 votes
1 answer
+1 vote
1 answer

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Top Users Oct 2017
  1. Arjun

    23242 Points

  2. Bikram

    17048 Points

  3. Habibkhan

    7096 Points

  4. srestha

    6012 Points

  5. Debashish Deka

    5430 Points

  6. jothee

    4928 Points

  7. Sachin Mittal 1

    4762 Points

  8. joshi_nitish

    4278 Points

  9. sushmita

    3954 Points

  10. Rishi yadav

    3744 Points

Recent Badges

Popular Question Rahul Jain25
Popular Question Ml_Nlp
Notable Question set2018
Notable Question rahul sharma 5
Notable Question Sanjay Sharma
Notable Question Lakshman Patel RJIT
Popular Question makhdoom ghaya
Popular Question Çșȇ ʛấẗẻ
Reader kenzou
Popular Question mystylecse
27,262 questions
35,076 answers
33,185 users