3
$\begingroup$

when I write a program, in a Von Neumann architecture, how the ram will be divided to receive data and instructions? For example if I have 1 MB of ram, the addresses from 0 to 499.999 for data and from 500.000 to 999.999 for instructions? Or I could find instructions mixed with data? Is divided the entire memory for example a side for all data of all programs and the other from all the instructions of all programs or when I load the memory with a single program, is reserved a small space (just for that program) and then that space is divided? Is the compiler to decide or the OS? Thanks in advance

$\endgroup$
  • 1
    $\begingroup$ For hints, you should look for linker memory segments in your favourite search engine : CODE, DATA, BSS, stack... ex : blmrgnn.blogspot.fr/2014/06/… $\endgroup$ – TEMLIB Nov 29 '15 at 17:43
2
$\begingroup$

Is the compiler to decide or the OS?

The architecture put some constraints, then the OS is built to work within these and adds its own constraints, then the compiler does the same thing.

how the ram will be divided to receive data and instructions?

It depends.

Or I could find instructions mixed with data?

You could very well. It's more or less a defining property of Von Neumann architectures.

Is divided the entire memory for example a side for all data of all programs and the other from all the instructions of all programs

That would be rare.

or when I load the memory with a single program, is reserved a small space (just for that program) and then that space is divided?

That's more the case. But you seem to forget segmentation and paging which make it so that the addresses that a program see are not the physical one and what a program see as continuous may be physically interleaved with the memory of other programs.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.