I've been studying C++ for a while now and I'm curious about two things:
1.) When exactly are the virtual addresses generated for the program? Are most or all done at compile time or runtime? or does it depend?
2.) Once virtual addresses are generated, either by the compiler or computer, what is the exact process of program execution? The way I would guess would be:
Program code loaded into RAM first.
Then one instruction at a time gets loaded into the cpu for execution.
If instruction involves a load intruction then cpu calls back to RAM, via page translation table, for data which is then sent back to the cpu to finish execution.
Or something along those lines. Can someone confirm or deny this? or fill in any gaps? Thanks for any help.
Edit: From some of the responses so far it seems this question is more platform specific so I would ask what the process is for say a windows 7 computer.