retagged by
535 views

1 Answer

Best answer
3 votes
3 votes
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;
ADD 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.
selected by

Related questions

0 votes
0 votes
1 answer
1
goluabhinan asked Sep 16, 2018
1,518 views
Any transcription error can be repaired by(a) insertion alone (b) deletion alone(c) insertion and deletion alone (d) replacement alone
0 votes
0 votes
1 answer
4
stblue asked Aug 26, 2017
844 views
a) (i) and (ii) onlyb) (ii) and (iii) onlyc) (i) and (iv) onlyd) All are correct