Click to See Complete Forum and Search --> : Memory layout help


MasterDucky
February 2nd, 2008, 01:37 PM
After reading several books and tutorials on C++ its still not clear to me
how the memory numbered.

Is it like the addresses goes from 0x000000 until the available amount of memory and then the programs assigned somewhere between them?

Or is it every program loaded into memory starts with 0x000000 and then
the processor knows some way where to access them?

Im asking this also because if i compile the same program again only with another name, i mean that i make a copy of it, it will give the same addresses
for the same variables.

TheCPUWizard
February 2nd, 2008, 03:03 PM
You are confusing Logical and Physical addresses. A program is based on Logcal addresses (which will typically be duplicated between programs). The hardware works on Physical addresses which are usually totally invisible to the program (and are potentially different each time the program is loaded into memory.

MasterDucky
February 2nd, 2008, 03:10 PM
Ah, ok, thats why i didnt understand it, i didnt know there were two kind of addresses.
So then every program starts with 0x000000.

Thanks for clearing this up to me!